‎2009 Jan 30 1:06 PM
hi guys,
how to handle the EXCEPTIONS from the standard bapi and write a custom message.
Regards,
selvamuthukumar.N
‎2009 Jan 30 1:10 PM
Hi,
I think you require to give your message for the sy-subrc (Exception) value of FM.
After FM call
If sy-subrc <> 0.
case sy-subrc.
when '1'.
custom message.
when '2'.
custom message.
.
.
.
endcase.
else.
endif.
Hope this is ur requirement to be handled.
Regards,
Dwaraka.S
‎2009 Jan 30 1:35 PM
hii..
you can try like this.
CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
PURCHASEORDER = l_ebeln
ITEMS = 'X'
SERVICES = 'X'
IMPORTING
PO_HEADER = wa_po_header
TABLES
PO_ITEMS = po_items
PO_ITEM_SERVICES = po_services
RETURN = bapi_return_po.
LOOP AT BAPI_RETURN_PO WHERE TYPE = 'E'.
MESSAGE ID BAPI_RETURN_PO-ID(2)
TYPE BAPI_RETURN_PO-TYPE
NUMBER BAPI_RETURN_PO-NUMBER
WITH BAPI_RETURN_PO-MESSAGE_V1
BAPI_RETURN_PO-MESSAGE_V2
BAPI_RETURN_PO-MESSAGE_V3
BAPI_RETURN_PO-MESSAGE_V4.
LEAVE.
ENDLOOP.like this, u can wite for SUCCESS also.
regards,
Padma.
‎2009 Jan 30 2:40 PM
Most BAPIs don't have exceptions. Problems are dealt with by looking at the RETURN table. What BAPI are you looking at?
Rob