Skip to Content
0
Former Member
Aug 02, 2005 at 01:41 PM

BOM

18 Views

Friends,

My requirement is to display all components related to a top level material. To acheive the same I have written the below code. Although the material i have given in the parameter option has components associated with it in the plant 'HP', nothing is displayed for me.

Please review the code below & help me identify the problem.

data : i_stb type standard table of STPOX,

wa_stb like line of i_stb.

parameters p_MTNRV type mara-matnr.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

  • MEHRS = 'X'

  • mmory = '1'

MTNRV = p_mtnrv

  • auskz = ' '

  • capid = 'PP01'

  • datuv = sy-datum

  • emeng = '1.000'

  • stlan = '1'

  • stpst = '0'

werks = 'HP'

TABLES

stb = i_stb

EXCEPTIONS

ALT_NOT_FOUND = 1

CALL_INVALID = 2

MATERIAL_NOT_FOUND = 3

MISSING_AUTHORIZATION = 4

NO_BOM_FOUND = 5

NO_PLANT_DATA = 6

NO_SUITABLE_BOM_FOUND = 7

CONVERSION_ERROR = 8

OTHERS = 9

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at i_stb into wa_stb.

write :/ wa_stb-IDNRK.

endloop.