Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Call transaction

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

former_member214131
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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