Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM CS_BOM_EXPLOSION generates an exception NO_SUITABLE_BOM_FOUND

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Manohar2u
Active Contributor
0 Kudos

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.

6 REPLIES 6

Manohar2u
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

thanks

My question is how to proceed to execution of code2

The execution of FM stops once reach the exception.

Manohar2u
Active Contributor
0 Kudos

Even after you add a new ERROR_MESSAGE exception to this function module

0 Kudos

Did u uncomment the exceptions in you function module call in your code?

Former Member
0 Kudos

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

Former Member
0 Kudos

comment the mesage or change message type