08-04-2008 2:54 PM
Can some body help me with sample error processing code for an Inbound IDOC? I will have to process an incoming DEBMAS IDOC using a custom function module which inturn calls the function module IDOC_INPUT_DEBITOR and a few other BAPIs that doesn't have the IDOC_STATUS Internal table passed any where.
I also want to know the places where I have to incorporate this error processing code within the custom function module. While I do know what is the processing that I have to do and also that statuses 60, 56 and 51 are to be checked. But I am trying to understand how can we code checking the status of IDOC.
How about this, do you think, this works?
data: l_idoc_status like line of IDOC_STATUS.
read table IDOC_STATUS into l_idoc_status with key status = 51.
if sy-subrc = 0.
perform send_email_notification.
endif.
Thanks much in advance.
08-05-2008 3:27 PM
LOOP AT idoc_status WHERE status = '56' OR status = '60' OR status = '63'
OR status = '65' OR status = '67' OR status = '68' OR status = '59'
OR status = '72' OR status = '51'.
PERFORM send_email_notification.
RETURN.
ENDLOOP.
Is there a better way of writing this code?