Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Exception in FM CS_BOM_EXPLOSION

Hi all ,

I am getting exception after calling FM CS_BOM_EXPLOSION .Sy-subrc is 2 every time . So as per FM , it is printing CALL_INVALID . Please let me know y the error is comig .

This FM is basically to Know the sub components .

Note : i am not sending any data thru TABLES statement , they are empty . I dont know which fields are neccessary . Please let me know the parameters of TABLES which i need to pass thru.

Here is my code ....

&----


*& Report ZHARKAR_BOM_EXPLOSION

*&

&----


*&

*&

&----


REPORT ZHARKAR_BOM_EXPLOSION.

DATA : IT_TOPMAT TYPE CSTMAT OCCURS 0 WITH HEADER LINE,

IT_TOPEQUI TYPE CSTEQUI OCCURS 0 WITH HEADER LINE,

IT_TOPTPL TYPE CSTTPL OCCURS 0 WITH HEADER LINE,

IT_DSTST TYPE CSDATA-XFELD OCCURS 0 WITH HEADER LINE.

DATA : IT_STBD TYPE CSXDOC OCCURS 0 WITH HEADER LINE,

IT_STBE TYPE CSXEQUI OCCURS 0 WITH HEADER LINE,

IT_STBK TYPE CSXKLA OCCURS 0 WITH HEADER LINE,

IT_STBM TYPE CSXMAT OCCURS 0 WITH HEADER LINE,

IT_STBP TYPE CSXGEN OCCURS 0 WITH HEADER LINE,

IT_STBT TYPE CSXTPL OCCURS 0 WITH HEADER LINE.

*******EXPORTING PARAMETERS ************************

PARAMETERS : P_CAPID TYPE TC04-CAPID , " APLLICATION

  • P_MEHRS TYPE CSDATA-XFELD , " MATERIAL EXPLOSION

P_MTNRV TYPE MARA-MATNR, " MATERIAL

P_STLAL TYPE STKO-STLAL, " ALTERNATIVE BOM

P_WERKS TYPE MARC-WERKS, " PLANT

P_VERID TYPE MKAL-VERID. " Production version (global)_

INITIALIZATION .

AT SELECTION-SCREEN .

*******

START-OF-SELECTION .

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = P_MTNRV

IMPORTING

OUTPUT = P_MTNRV.

.

CALL FUNCTION 'CS_BOM_EXPLOSION'

EXPORTING

CAPID = 'PP01'

MEHRS = 'X'

MTNRV = P_MTNRV

STLAL = P_STLAL

WERKS = P_WERKS

  • MDNOT = ' '

  • PANOT = ' '

  • QVERW = ' '

  • VBELN = ' '

  • VBPOS = 0

VERID = P_VERID

  • VRSVO = 'X'

IMPORTING

TOPEQUI = IT_TOPEQUI

TOPMAT = IT_TOPMAT

TOPTPL = IT_TOPTPL

DSTST = IT_DSTST

TABLES

stbd = IT_STBD

stbe = IT_STBE

stbk = IT_STBK

stbm = IT_STBM

stbp = IT_STBP

stbt = IT_STBT

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

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.

CASE SY-SUBRC.

WHEN '1'.

WRITE 'ALT_NOT_FOUND'.

WHEN '2'.

WRITE 'CALL_INVALID'.

WHEN '3'.

WRITE 'MISSING_AUTHORIZATION'.

WHEN '4'.

WRITE ' NO_BOM_FOUND '.

WHEN '5'.

WRITE 'NO_PLANT_DATA '.

WHEN '6'.

WRITE 'NO_SUITABLE_BOM_FOUND'.

WHEN '7'.

WRITE ' OBJECT_NOT_FOUND'.

WHEN '8'.

WRITE 'CONVERSION_ERROR'.

WHEN '9'.

WRITE 'OTHERS '.

ENDCASE.

LOOP AT IT_TOPMAT.

WRITE IT_TOPMAT-MATNR.

ENDLOOP.

Tags:
Not what you were looking for? View more on this topic or Ask a question