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

Unable to capture error message while doing call transaction

Former Member
0 Likes
1,847

Hi Every one,

I am doing BDC Call transaction method for FB01.

I am posting accounting document for Asset. When I am posting for Asset i am passing Internal order. Here Call transaction is not capturing any kind of message.

When i posted manually with the same data i am getting messgae that Budget exceeds for order.

Please help me in this how to capture.

Thanks in advance,

Deepak.

10 REPLIES 10
Read only

Former Member
0 Likes
1,518

Are you pulling your messages abck from the call transactions? ie.

      Call transaction 'FB01' using bdcdata
                              mode p_mode
                              update 'S'
                              messages into messtab.

Read only

0 Likes
1,518

Hi,

Thanks for your reply.

here is my code....

refresh li_errtab. clear: li_errtab.

call transaction 'FB01' using bdcdata

mode w_mode

update 'S'

messages into li_errtab.

  • if sy-subrc = 0.

read table li_errtab into l_errtab with key msgtyp = 'S'

msgid = 'F5'

msgnr = '312'.

if sy-subrc = 0.

move: l_errtab-msgv1 to jv_po-belnr,

v_date+6(4) to jv_po-gjahr,

text-t05 to jv_po-msg.

Thanks,

Deepak.

Read only

former_member404244
Active Contributor
0 Likes
1,518

hI,

as u r getting the error message so instead of using msgtyp as 'S' use 'E' while reading.

Put a break point and check what are the messages u r getting in li_errtab.

refresh li_errtab. clear: li_errtab.

call transaction 'FB01' using bdcdata

mode w_mode

update 'S'

messages into li_errtab.

  • if sy-subrc = 0.

read table li_errtab into l_errtab with key msgtyp = 'E'

msgid = 'F5'

msgnr = '312'.

if sy-subrc = 0.

move: l_errtab-msgv1 to jv_po-belnr,

v_date+6(4) to jv_po-gjahr,

text-t05 to jv_po-msg.

Regards,

Nagaraj

Read only

0 Likes
1,518

Hi,

I am checking by putting a break point on read statement.

when i check the structure li_errtab nothing was there in my case which i mentioned above.

Is there any alternative method to capture message???

Thanking you,

Deepak.

Read only

0 Likes
1,518

Hi,

I am checking by putting a break point on read statement.

when i check the structure li_errtab nothing was there in my case which i mentioned above.

Is there any alternative method to capture message???

Thanking you,

Deepak.

Read only

0 Likes
1,518

Hi,

I am checking by putting a break point on read statement.

when i check the structure li_errtab nothing was there in my case which i mentioned above.

Is there any alternative method to capture message???

Thanking you,

Deepak.

Read only

0 Likes
1,518

Hi deepak,

1. try doing the bdc in A = show all screens mode,

as well as E = show only errors

2. in that way we can come to know whether the bdc is running,

in the desired way or not.

regards,

amit m.

Read only

0 Likes
1,518

Hi Amith,

I tried that option also with mode 'A'. There also I am not getting the error message.

After simulation when I am trying to save it it is comming out of the session and nothing was comming in error structure.

With same data if i tried to post manually in FB01 then i am getting the error message.

Not only thins I found one message which is not captured by BDC.

Any alternative.

Thanking you,

Deepak.

Read only

0 Likes
1,518

Is your messtab defined correctly as BDCMSGCOLL?

Read only

Former Member
0 Likes
1,518

Come to think of it I have seen some transactions that when ran in BDC mode do not output the success messages, so you need to rely on Error messages. Run the BDC and deliberatley fail is and check if your messtabe is then populated. If so you can just search for type E messages, and if none found assume successfull:

loop at messtab into wa_mess.

IF wa_mess-msgtyp = 'E'. "UnSucessfull Msg

fail = 1.

endif.

Endloop.