Application Development and Automation 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: 
Read only

CS12

Former Member
0 Likes
764

Hi friends,

I am creating an exploded bom disply report. the problem is User want to to see the expanded list in orde rlike

1 Bom element of main material

1.1 bom element of 1

1.1.2 bom element od 1.1

1.1.......

1.2 bom element of 1

2 bom element of ain material

2.1 and so on...

I had made this order manually just thinking if there is any functional module available in Sap to have List order like above.

thanks in advance for suggestions.

Lakhbir

5 REPLIES 5
Read only

ferry_lianto
Active Contributor
0 Likes
687

Hi,

Have you looked this FM <b>CS_BOM_EXPL_MAT_V2 or CS_WHERE_USED_MAT</b>?

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
687

Hi Lakhbir,

i did it with an abap.

Here a short example:

PROGRAM Z_TEST1 MESSAGE-ID ZZ.

*

TABLES: MAST,

STAS,

STPO.

*

PARAMETERS: P_MATNR LIKE MAST-MATNR.

*

  • interne Tabelle der Stücklistenpositionen

DATA: BEGIN OF ITAB OCCURS 100,

STUFE(10) TYPE C,

POSNR LIKE STPO-POSNR,

IDNRK LIKE STPO-IDNRK,

END OF ITAB.

*

DATA: STUFE TYPE I.

************************************************************************

*

START-OF-SELECTION.

*

SELECT SINGLE * FROM MAST WHERE MATNR = P_MATNR

AND WERKS = '2000'

AND STLAN = '1'

AND STLAL = '01'.

*

IF SY-SUBRC = 0.

PERFORM LESEN_STAS_STPO USING MAST-STLNR.

ENDIF.

*

LOOP AT ITAB.

WRITE: / ITAB-STUFE, ITAB-POSNR, ITAB-IDNRK.

ENDLOOP.

*

************************************************************************

FORM LESEN_STAS_STPO USING MAST-STLNR.

*

STUFE = STUFE + 1.

*

SELECT * FROM STAS WHERE STLNR = MAST-STLNR

AND STLAL = '01'.

*

CLEAR: ITAB.

*

SELECT SINGLE * FROM STPO WHERE STLNR = STAS-STLNR

AND STLKN = STAS-STLKN.

*

*

ITAB-STUFE+STUFE = STUFE.

ITAB-IDNRK = STPO-IDNRK.

ITAB-POSNR = STPO-POSNR.

*

*

APPEND ITAB.

*

SELECT SINGLE * FROM MAST WHERE MATNR = STPO-IDNRK

AND WERKS = '2000'

AND STLAN = '1'

AND STLAL = '01'.

  • rekursiver Stüklistenpositionsaufruf

IF SY-SUBRC = 0.

PERFORM LESEN_STAS_STPO USING MAST-STLNR.

ENDIF.

*

ENDSELECT.

*

STUFE = STUFE - 1.

*

ENDFORM.

************************************************************************

Hope i can help you

Regards, Dieter

Read only

0 Likes
687

Hi Dieter,

i used same fields to get that seqeunce generated, I was thinking if we have some readliy available instead of manully making the logic,anyway thanks alot.

Read only

0 Likes
687

In above program I am not able to understand the followeing statement. What it is doing.

ITAB-STUFE+STUFE = STUFE.

Can any one please clarify.

Thank you.

Read only

0 Likes
687

In above program I am not able to understand the followeing statement. What it is doing.

ITAB-STUFE+STUFE = STUFE.

Can any one please clarify.

Thank you.