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

BDC CALL TRANSACTION PROCESS.

Former Member
0 Likes
1,498

hi

how to get the success message after BDC CALL TRANSACTION PROCESS.

PLEASE TELL ME.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,410

Hi Mahesh,

Use CALL TRANSACTION USING.... MESSAGES INTO.... statement.

Regards,

John.

9 REPLIES 9
Read only

Former Member
0 Likes
1,411

Hi Mahesh,

Use CALL TRANSACTION USING.... MESSAGES INTO.... statement.

Regards,

John.

Read only

Former Member
0 Likes
1,410

Hi,

Based on Message type u capture the messages.

Chech that message type 'S'.

Passsed into internal table.

LOOP AT IT_BDC_MESSAGES.

IF IT_BDC_MESSAGES-msgtyp = 'E'.

SELECT single * FROM t100 WHERE

sprsl = it_BDC_MESSAGES-msgspra

AND arbgb = IT_BDC_MESSAGES-msgid

AND msgnr = IT_BDC_MESSAGES-msgnr.

IF sy-subrc = 0.

l_mstring = t100-text.

.

Reward if useful.

Regards,

Narasimha

Edited by: narasimha marella on May 14, 2008 11:56 AM

Read only

Former Member
0 Likes
1,410

hi,

In the call transaction command, use the addtion

" Messages into (internal table)".

Example:

CALL TRANSACTION wf_tcode

USING tb_bdcdata

MODE wf_mode

UPDATE co_s

MESSAGES INTO tb_messtab.

Then read the internal table tb_messtab to check if any of the entries have the value 'E" for the field msgtyp.

If there are no entries with msgtyp=E, it means that CALL TRNSACTION is successful.

Read only

Former Member
0 Likes
1,410

Hi,

Download all the messages into BDCMSGCOLL table.

if there is no error messages in this table you can give a success message.

Check the syntax below,

*****

call transaction t-code using bdcdata messages into bdcmsgcoll.

read bdcmsgcoll where msgtyp = 'E'.

if sy-subrc <> 0.

message s001(zmsg).

endif.

********

Regards,

Read only

Former Member
0 Likes
1,410

Hi Mahesh,

once the call transaction is successfull, all the messages comes in to the internal table I_MESSAGES,

for success full entry u will find a messaged id ( MSGID) and message number (MSGNR) and message type ( MSGTYP )as 'S'.

Read the internal table I_MESSAGES with message id , type and number,

Ex:

read table i_messages into l_messages

with key MSGTYP = 'S'

MSGID = 'IW'

MSGNR = 123

BINARY SEARCH

if sy-subrc = 0.

CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'

EXPORTING

id = msgid

number = msgnr

language = sy-langu

textformat = 'ASC'

IMPORTING

message = message.

endif.

Read only

Former Member
0 Likes
1,410

Hi,

DATA: MESSTAB TYPE TABLE OF BDCMSGCOLL.

DATA : BEGIN OF ERROR_ITAB OCCURS 0,

ERROR(50),

MSGTYP,

END OF ERROR_ITAB.

CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'

MESSAGES INTO MESSTAB

LOOP AT MESSTAB.

if messtab-msgtyp eq 'S'.

SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA

AND ARBGB = MESSTAB-MSGID

AND MSGNR = MESSTAB-MSGNR.

IF SY-SUBRC = 0.

L_MSTRING = T100-TEXT.

IF L_MSTRING CS '&1'.

REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ELSE.

REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ENDIF.

CONDENSE L_MSTRING.

MOVE L_MSTRING TO ERROR_ITAB-ERROR.

MOVE MESSTAB-MSGTYP TO ERROR_ITAB-MSGTYP.

APPEND ERROR_ITAB.

delete error_itab where msgtyp = 'E'.

ELSE.

MOVE MESSTAB TO ERROR_ITAB-ERROR.

APPEND ERROR_ITAB.

ENDIF.

Regards,

Raj.

Read only

Former Member
0 Likes
1,410

thanks

Read only

0 Likes
1,410

Untill you dont want to share, which solution is helpfull to your query than please don't close by updating them by saying just Thanks.it will create JUNK.

Read only

0 Likes
1,410

Hi..,

Yes I agree with Amit.

It very good practice to close thread with solution of that problem, It will take maximum 2 to 5 minutes time.

You can do this in your free time. Because it very helpful for your future refrence and also for others..

Thanks,

Naveen.I