Ansicht
Dokumentation

05689 - Transaction Lock Automatic !!

05689 - Transaction Lock Automatic !!

Vendor Master (General Section)   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

Transaction Lock Automatic !!

ZBCP0030 will create a BDC session which can be run to either "lock" or
"un-lock" transactions.
The variant will contain the "transaction & trigger for lock/or/unlock"

We wrote this back when when transaction codes where short; so you may want to
correct where appropriate


REPORT ZBCP0030 .

TABLES: TSTC.


* for bdc transaction
DATA: BEGIN OF BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.

* BDC_MSG captures messages returned from call transaction 46C
DATA: BEGIN OF BDC_MSG OCCURS 10. "46C
INCLUDE STRUCTURE BDCMSGCOLL. "46C
DATA: END OF BDC_MSG. "46C

SELECT-OPTIONS: TRAN FOR TSTC-TCODE obligatory.
******************Radiobuttons added for 46C****************************
Parameters: Unlock radiobutton group 01 default 'X',
lock radiobutton group 01.
******************Radiobuttons added for 46C****************************

CLEAR: BDC_MSG, bdcdata. "46C
REFRESH: BDC_MSG, bdcdata. "46C

START-OF-SELECTION.


clear: tstc. "46C
SELECT * FROM TSTC WHERE TCODE IN TRAN.

if sy-subrc = 0. "46C
PERFORM BDC_DATA USING:
'X' 'SAPMTSTC' '1010', "46C
' ' '*TSTC-TCODE' TSTC-TCODE, "transaction name
' ' 'BDC_OKCODE' '/00'. "46C

if lock = 'X'. "46C
PERFORM BDC_DATA USING: "46C
'X' 'SAPMTSTC' '1010', "46C
' ' 'TSTCF-FLAGS(01)' 'X', "46C lock
' ' 'BDC_OKCODE' '=SEL'. "46C
else. "46C
PERFORM BDC_DATA USING: "46C
'X' 'SAPMTSTC' '1010', "46C
' ' 'TSTCF-FLAGS(01)' ' ', "46C unlock
' ' 'BDC_OKCODE' '=SEL'. "46C
endif.
endif.
ENDSELECT.

if sy-subrc = 0.
PERFORM BDC_DATA USING:
'X' 'SAPMTSTC' '1010', "46C
' ' 'BDC_OKCODE' '=SEL', "46C lock/unlock
' ' 'BDC_OKCODE' '/03'. "Exit from program


CALL TRANSACTION 'SM01' "46C
USING BDCDATA "46C
MODE 'N' "46C
UPDATE 'A' "46C
MESSAGES INTO BDC_MSG. "46C
else. "46C
Write:/ 'The transaction', tran, 'does not exist'. "46C
endif. "46c

END-OF-SELECTION.

*---------------------------------------------------------------------*
* FORM BDC_OPEN *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM BDC_OPEN.

CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'SM01'
KEEP = 'X'
USER = SY-UNAME
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.

ENDFORM.

*---------------------------------------------------------------------*
* FORM BDC_DATA *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> BEGIN *
* --> NAME *
* --> VALUE *
*---------------------------------------------------------------------*
FORM BDC_DATA USING BEGIN NAME VALUE.
CLEAR BDCDATA.
IF BEGIN = 'X'.
BDCDATA-PROGRAM = NAME.
BDCDATA-DYNPRO = VALUE.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
CLEAR BDCDATA.
ELSE.
BDCDATA-FNAM = NAME.
BDCDATA-FVAL = VALUE.
APPEND BDCDATA.
CLEAR BDCDATA.
ENDIF.

ENDFORM.

*---------------------------------------------------------------------*
* FORM BDC_INSERT *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM BDC_INSERT.


CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SM01'
TABLES
DYNPROTAB = BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.

REFRESH BDCDATA.
CLEAR BDCDATA.

ENDFORM.

*---------------------------------------------------------------------*
* FORM BDC_CLOSE_SESSION *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM BDC_CLOSE_SESSION.


CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.

ENDFORM.










Doreen Anderson
Ball Horticultural Company
dandersoZb...
(630) 231-3600 x3214


-----Original Message-----
From: Lindner, Thomas [mailto:Thomas.LindnerZe...]
Sent: Friday, April 12, 2002 5:02 AM
To: DoNotReply@consolut.eu
Subject: Transaction Lock Automatic !!
Importance: High

Hi Sapling's,

is it possible to lock some Transactions automatic ??

like an ABAP in Batch or create an Transportrequest ??

Thanks in advance



> Best Regards/mit freundlichem Gruss
>
> Thomas Lindner
AS/400 & SAP R/3-Basis Support

> EGG IT-Services Gmbh
> Systemtechnik
> Industriestraße 21-39
> 65760 Eschborn
>
T +49 (0) 6196 477381
F +49 (0) 6196 477776

> mailto:Thomas.LindnerZe...
>
>
>


Have a look to our homepage at: http://www.consolut.net
DoNotReply@consolut.eu

Your use of consolut is subject to http://www.consolut.net


Durban Tours - Südafrika Safari

CPI1466 during Backup   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 6663 Date: 20240305 Time: 080224     sap01-206 ( 3 ms )