2006 May 16 11:06 AM
Hi,
I have a product which has child Products .These Child Product inturn are parent to some Products.I need a logic to find out all the levels.
supose a product is 1001565 has childs 1000565
1000566
Inturn these have child products which in turn are parent to other products.I want to go to the nth level.How can i go about it.
thanks and regards
Ahasan
Hi,
I have a product which has child Products .These Child Product inturn are parent to some Products.I need a logic to find out all the levels.
supose a product is 1001565 has childs 1000565
1000566
Inturn these have child products which in turn are parent to other products.I want to go to the nth level.How can i go about it.
thanks and regards
Ahasan
2006 May 16 11:11 AM
2006 May 16 11:15 AM
Hi,
I am working in APO-4.0.Do u know any function module at pegging level(In R/3 its BOM level)
Thanks and regards
Ahasan
2006 May 16 11:14 AM
Hi Ahasan,
can you explane it a little more in detail.
I had the same Problem in Tables STKO and STPO.
I solve it by using a Form and call it rekursiv.
When i get more detail, perhaps i can give
you a Code-Example.
Regards, Dieter
2006 May 16 11:22 AM
hi Dieter,
i have the same problem.I want to have a recursive call.Can u give me the example of the perform You used .
thanks and regards
Ahasan
2006 May 16 11:17 AM
sorry. ignore this
Regards
Raja
Message was edited by: Durairaj Athavan Raja
2006 May 16 11:27 AM
HI
GOOD
HOW DO YOU WANT TO DEVELOP THIS REQUIREMENT ,USING ALV OR SIMPLE REPORT.
THANKS
MRUTYUN
2006 May 16 11:29 AM
2006 May 16 11:39 AM
Hi Ahasan,
here my 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 it can help you.
Regards, Dieter
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |