02-21-2005 5:18 AM
Hai,
I have created batch input program posting documents in Batch input mode, it works fine.
But now i want to use the same in call transaction mode.
if error occurs in Call transaction mode,client wants to display this error in batch input session.(similar to Batch input mode).
Because its easy for them to trace the screen while error making.
could you pls guide me how to do this in case of Call transaction mode.
ambichan.
02-21-2005 5:50 AM
Hi,
Sample Code:
CALL TRANSACTION C_TCODE USING BDC_TAB MODE 'N' UPDATE 'S'.
RETURN_CODE = SY-SUBRC.
*--- Here we check the return code, if there was an error, we put the transaction in a bdc session for the user to review and correct.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'GRPNAME'
USER = 'USRNAME'
KEEP = 'X'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = C_TCODE
TABLES
DYNPROTAB = BDC_TAB.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
Regards
02-21-2005 5:31 AM
Hello,
I understand from your query that you want the messages to be logged in 'CALL TRANSACTION' mode. Please check the on-line documentation for the 'CALL TRANSACTION' where the messages get into an Internal table of type 'BDCMSGCOLL' which is a structure.
Hope this helps you.
Regards, Murugesh AS
02-21-2005 5:50 AM
Hi,
Sample Code:
CALL TRANSACTION C_TCODE USING BDC_TAB MODE 'N' UPDATE 'S'.
RETURN_CODE = SY-SUBRC.
*--- Here we check the return code, if there was an error, we put the transaction in a bdc session for the user to review and correct.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'GRPNAME'
USER = 'USRNAME'
KEEP = 'X'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = C_TCODE
TABLES
DYNPROTAB = BDC_TAB.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
Regards