Skip to Content
author's profile photo Former Member
Former Member

BOM

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 exception is comig .

This FM is basically to Know the sub components of a given material .

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 11:01 PM
    CAPID,DATUV,MTNRV,WERKS

    are required.

    i think u have missed out

    DATUV

    .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.