Warning: include_once(http://erpgenie.com/_borders/topabap.htm) [function.include-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Warning: include_once() [function.include]: Failed opening 'http://erpgenie.com/_borders/topabap.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Tips and Tricks arrow ABAP Reports arrow How to Get Error Message from BDC?
How to Get Error Message from BDC? PDF Print E-mail
User Rating: / 2
PoorBest 
Written by Amit khari   
Monday, 17 September 2007

While doing call transaction, if an error occurs in updation, we declare bdcmsgcoll and store our messages in it, but how to retreive error message from it.

 

Using function module 'FORMAT_MESSAGE' you can capture the messages.

Here is a sample of the program code for that:

LOOP AT it_messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_messtab-msgid
lang = it_messtab-msgspra
no = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
msg = g_msg
EXCEPTIONS
OTHERS = 0.
IF it_messtab-msgtyp = 'S'.
it_sucess-sucess_rec = g_msg.
it_sucess-lifnr = it_header-lifnr." Based on your field
it_sucess-tabix = v_lines.
APPEND it_sucess.
ELSEIF it_messtab-msgtyp = 'E'.
it_error-error_rec = g_msg.
it_error-lifnr = it_header-lifnr.
it_error-tabix = v_lines.
APPEND it_error.
ELSE.
it_info-info_rec = g_msg.
it_info-lifnr = it_header-lifnr.
it_info-tabix = v_lines.
APPEND it_info.
ENDIF.
ENDLOOP.

Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 333
Sample Code: 164
Total Contributions: 550

Member Activity
Members: 6249 since 2/1/2007!
New: 2 since yesterday!
Visitors: 1087953

Newest Members

Welcome our newest members:

Google Ads


Warning: include(http://erpgenie.com/_borders/bottom.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22

Warning: include() [function.include]: Failed opening 'http://erpgenie.com/_borders/bottom.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22