02-07-2011 9:44 AM
Hello
I execute FM CS_BOM_EXPLOSION (get components of material BOM) within my FM. For one of the materials this FM generates an exception NO_SUITABLE_BOM_FOUND (BOM has marked for deletion).
Execution of FM (code2) stops.
How to enable to execution of the FM?
code1
CALL CS_BOM_EXPLOSION
code2
Thanks
02-07-2011 1:57 PM
Try this..
exceptions
alt_not_found = 1
call_invalid = 2
missing_authorization = 3
no_bom_found = 4
no_plant_data = 5
no_suitable_bom_found = 6
object_not_found = 7
conversion_error = 8
error_message = 99 "<<< this helps to capture such exceptions
OTHERS = 9
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
02-07-2011 1:57 PM
Try this..
exceptions
alt_not_found = 1
call_invalid = 2
missing_authorization = 3
no_bom_found = 4
no_plant_data = 5
no_suitable_bom_found = 6
object_not_found = 7
conversion_error = 8
error_message = 99 "<<< this helps to capture such exceptions
OTHERS = 9
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
02-07-2011 2:20 PM
thanks
My question is how to proceed to execution of code2
The execution of FM stops once reach the exception.
02-07-2011 3:15 PM
Even after you add a new ERROR_MESSAGE exception to this function module
02-07-2011 4:18 PM
Did u uncomment the exceptions in you function module call in your code?
02-08-2011 6:43 PM
I commented the message (below the FM ) and everything works fine. Is it a right approach?
Commenting the exceptions or adding new exception does help. I actually cant add new exception
Edited by: Comandante Che Guevara on Mar 15, 2011 1:24 PM
03-15-2011 12:25 PM