Application Development and Automation 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: 
Read only

call transaction

Former Member
0 Likes
810

Hi,

While using CALL TRANSACTION, if first record is not updated the screen fields or got some error, what will be the case? how to handle this?

Do i can handle sy-subrc for this?

thnx

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
783

Hi,

You can use FM WRITE_MESSAGES and FORMAT_MESSAGES to read the error messages in addition to BDCMSGCOLL.

Regards,

Ferry Lianto

Hi,

While using CALL TRANSACTION, if first record is not updated the screen fields or got some error, what will be the case? how to handle this?

Do i can handle sy-subrc for this?

thnx

4 REPLIES 4
Read only

Former Member
0 Likes
783

Declare an internal table of TYPE BDCMSGCOLL structure. This would trap all the errors while using CALL TRANSACTION.

Thanks,

SKJ

Read only

Former Member
0 Likes
784

Hi,

You can use FM WRITE_MESSAGES and FORMAT_MESSAGES to read the error messages in addition to BDCMSGCOLL.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
783

Besides capturing the error message, you should also save the error out record to a BDC session so user has an option to fix the error records. This can be done by calling FM: <b>BDC_OPEN_GROUP</b>, <b>BCD_INSERT</b> and <b>BDC_CLOSE_GROUP.</b>

Hope this helps. Reward points if helpful.

Minami

Read only

Former Member
0 Likes
783

1. Use the MESSAGES INTO <bdcmsgcoll type internal table> option of CALL TRANSACTION.

2. READ TABLE <bdcmsgcol type itab> WITH KEY msgtyp = 'E'. If sy-subrc = 0, then error occured in the transaction call.

3. If error occured, use CONVERT_BDCMSGCOLL_TO_BAPIRET2 to convert the BDCMSGCOL message into a BAPIRET2 type structure and MESSAGE field of this structure contains the error message.

4. If error occured, use the same BDC internal table and put it into a batch input session for someone to look at it and process. Use BDC_OPEN_GROUP, BDC_INSERT, and BDC_CLOSE_GROUP.