Skip to Content
0
Former Member
Jan 29, 2007 at 09:49 AM

bom explosion how to restrict the item level posnr

70 Views

Hi friends

TABLES : MAST.

DATA: BEGIN OF ISTPO OCCURS 1000.

INCLUDE STRUCTURE STPOX.

DATA: END OF ISTPO.

DATA: W_TOPMAT LIKE CSTMAT.

SELECT-OPTIONS : P_MATNR FOR MAST-MATNR.

PARAMETERS : P_WERKS TYPE MAST-WERKS.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MAST-MATNR,

WERKS LIKE MAST-WERKS,

END OF ITAB.

DATA: IT_STB LIKE ISTPO OCCURS 0 WITH HEADER LINE.

*DATA : ITAB_STB LIKE ISTPO1 OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

CLEAR ISTPO. REFRESH ISTPO.

SELECT MATNR WERKS FROM MAST INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE MATNR IN

P_MATNR AND WERKS = P_WERKS.

LOOP AT ITAB.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

CAPID = 'PP01'

MEHRS = 'X'

MMAPS = 'X'

  • BREMS = 'X'

DATUV = SY-DATUM

MTNRV = ITAB-MATNR

WERKS = P_WERKS

EMENG = '1'

FBSTP = ' '

FTREL = ' '

IMPORTING

TOPMAT = W_TOPMAT

TABLES

STB = ISTPO

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

OTHERS = 8.

IF SY-SUBRC = 0.

WRITE:/ 'MaterialNumber' ,21 'Description'.

SKIP 1.

WRITE: / W_TOPMAT-MATNR UNDER TEXT-H00 COLOR COL_HEADING,

W_TOPMAT-MAKTX UNDER TEXT-H01 COLOR COL_HEADING.

*

LOOP AT ISTPO .

WRITE :/ ISTPO-POSNR,

ISTPO-IDNRK,

ISTPO-OJTXP,

ISTPO-MENGE,

ISTPO-MEINS.

ENDLOOP.

ENDIF.

*ENDLOOP.

SKIP 5.

ENDLOOP.

here i gave the material no , it gave the bom of that materials.

i restricted posnr itemnumber.

postnr component number complonentdesct u

010 sfg

010

020

020 sfg

030 sfg

010

020

i want to get only sfg component how to use this logic in above coding.

very urgent. give me a solutions

Regards

ds