06-26-2008 6:27 AM
06-26-2008 6:31 AM
hi,
welcome to SDN.
check this fm.
BM_ERROR_CH.
generally every function module consists of a structure to handle errors.
ex: RETURN STRUCTURE BAPIRET2 OPTIONAL.
06-26-2008 6:31 AM
hi,
welcome to SDN.
check this fm.
BM_ERROR_CH.
generally every function module consists of a structure to handle errors.
ex: RETURN STRUCTURE BAPIRET2 OPTIONAL.
06-26-2008 6:32 AM
06-26-2008 6:34 AM
Hi ,
There is no fixed format for error handling in bapi. We have to fill all the error messages in the internal table of type BAPIRET2 and pass it back to the user.
You can check the error handling logic in any existing BAPI in SE37.
Regards,
Naveen Veshala
06-26-2008 6:34 AM
Hi,
Plz take help of this example.
Generally the error messages for BAPI are stored in return importing parameter ie gt_bapiret2 .
LOOP AT gt_bapiret2 INTO gs_bapiret2.
gs_report-rhkont = gs_accounts-zshkont.
gs_report-posid = gs_prps-posid.
gs_report-post1 = gs_prps-post1.
gs_report-abgsl = gs_prps-abgsl.
gs_report-pbukr = gs_prps-pbukr.
gs_report-rtype = gs_bapiret2-type.
gs_report-rmessage = gs_bapiret2-message.
IF gs_report-rtype EQ 'E'.
gs_report-ricon = icon_led_red.
ELSEIF gs_report-rtype EQ 'S'.
gs_report-ricon = icon_led_green.
ELSEIF gs_report-rtype EQ 'W'.
gs_report-ricon = icon_led_yellow.
ENDIF.
gs_report2-rhkont = gs_accounts-zrhkont.
gs_report2-shkont = gs_accounts-zshkont.
gs_report2-posid = gs_prps-posid.
gs_report2-post1 = gs_prps-post1.
gs_report2-abgsl = gs_prps-abgsl.
gs_report2-pbukr = gs_prps-pbukr.
IF gs_report-rtype = 'S' .
PERFORM commit_work.
ENDIF.
Hope this helps you.
plz reward if useful.
thanks,
dhanashri.
Edited by: Dhanashri Pawar on Jun 26, 2008 7:35 AM
06-26-2008 6:35 AM
Hi,
Plz take help of this example.
LOOP AT gt_bapiret2 INTO gs_bapiret2.
gs_report-rhkont = gs_accounts-zshkont.
gs_report-posid = gs_prps-posid.
gs_report-post1 = gs_prps-post1.
gs_report-abgsl = gs_prps-abgsl.
gs_report-pbukr = gs_prps-pbukr.
gs_report-rtype = gs_bapiret2-type.
gs_report-rmessage = gs_bapiret2-message.
IF gs_report-rtype EQ 'E'.
gs_report-ricon = icon_led_red.
ELSEIF gs_report-rtype EQ 'S'.
gs_report-ricon = icon_led_green.
ELSEIF gs_report-rtype EQ 'W'.
gs_report-ricon = icon_led_yellow.
ENDIF.
gs_report2-rhkont = gs_accounts-zrhkont.
gs_report2-shkont = gs_accounts-zshkont.
gs_report2-posid = gs_prps-posid.
gs_report2-post1 = gs_prps-post1.
gs_report2-abgsl = gs_prps-abgsl.
gs_report2-pbukr = gs_prps-pbukr.
IF gs_report-rtype = 'S' .
PERFORM commit_work.
ENDIF.
Hope this helps you.
plz reward if useful.
thanks,
dhanashri.
06-26-2008 10:47 AM