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: 

How to capture dialog message in back ground.

Former Member
0 Kudos

Hi Experts ,

My program is executing in background...i'm not able to capture the error message when it is running in background.

But in foreground it is displaying the error message as in dialog box ..because my coding is triggering in PBO Module.

But in background i didnt get that error message.

My Code is as follows..

if subrc eq 0

sum condition.

else.

Message e066(Z01)

endif.

Message class Z01 is defined.

Please advice. Its very urgent becoz ,,my object is in quality testing phase.

Thanx & Regds

Venky.

6 REPLIES 6

Former Member
0 Kudos

hello peravalli-

The message parameter indicates there all system messages issued during a CALL TRANSACTION are written into the internal table <itab>. The internal table must have the structure of BDCMSGCOLL.

0 Kudos

Hi,

In Baground mode system will not issue error message.

It will store the error messages in error structure.

you need to capture error and should display on the list screen.

Create internal table referenceing structure 'BDCMSGCOLL'.

capture the error message.

call transaction .....

If sy-subrc is not initial.

Move bdcmsgcoll to itab.

append itab.

Endif.

Loop the itab.

If itab-msgtyp eq 'E'.

write: / itab-MSGV1, itab-msgv2, itab-msgv3, itab-msgv4.

Endif.

Regards,

Kishore

Former Member
0 Kudos

use call transaction <x> using itab1 MESSAGES INTO itab 2.

itab2 should have structure of BDCMSGCOLL

plz reward if useful

vivek

Former Member
0 Kudos

Hi,

If you are doing a BDC program then you must define one internal table type BDCMSGCALL, which returns all kinds of messages in the internal table after CALL TRANSACTION stmt.

If you are working with normal report then Check the below code.

if subrc eq 0

sum condition.

else.

IF SY-BATCH is initial. "Fore Ground Execution

Message e066(Z01).

Else.

v_mess = 'Your message'.

endif.

endif.

At last if you want you can display the variable v_mess.

Rgds,

Bujji

0 Kudos

For your kind information to all of you ...

I am not doing bdc program ..i'm working on normal report ( Not even ALV report also ) which includes Call screen '1100' .in this event in one form i need to display that message.

Bujji..

will your code works .?

Any guidence Yes please.

Thnx

Venky.

0 Kudos

Bujji's code will work. Check SY-BATCH, and if it's 'X' (Background execution), then don't use dialog box, use some other form of message log display, viz., displaying it on screen or creating a log table of the stated type.

Sorry I know it's been a long time this thread was created and by now you probably already know the answer, but your question if still in 'not answered' state, that's why I'm posting it

Kind regards

-Sudhu