02-08-2008 5:55 AM
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.
02-08-2008 6:10 AM
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.
02-08-2008 6:18 AM
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
02-08-2008 6:15 AM
use call transaction <x> using itab1 MESSAGES INTO itab 2.
itab2 should have structure of BDCMSGCOLL
plz reward if useful
vivek
02-08-2008 6:22 AM
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
02-08-2008 6:41 AM
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.
09-06-2010 1:55 PM
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