2009 Nov 23 9:53 AM
hi
below is my code....
i will input material number , plant and task list type
then i wil get all the recipes and inspection plan for recipe...
now my problem is for group counter 1 is there then i wil get correct output but if same group is having group counter 2 than im getting wrong out put...it displays wtvr data is there in group counter one ....
if there is no Inspection plan for group counter 2 than i dont want it to display...
can any one tel me this....
or is there any Function module to get Inspection plan for respective recipe details ?
SELECT matnr
werks
plnnr
plnty
plnal
FROM mapl
INTO TABLE it_mapl
WHERE matnr in s_matnr
AND werks in s_werks
AND plnty = '2'.
SELECT VORNR
STEUS
LTXA1
plnnr
plnty
plnkn
FROM plpo
INTO TABLE it_recipe
FOR ALL ENTRIES IN it_mapl
WHERE plnnr = it_mapl-plnnr
AND plnty = it_mapl-plnty
AND steus = 'PI02'.
SELECT plnnr
plnkn
plnty
VERWMERKM
KURZTEXT
MERKNR
FROM plmk
INTO TABLE it_plmk
FOR ALL ENTRIES IN it_recipe
WHERE plnnr = it_recipe-plnnr
AND plnty = it_recipe-plnty
AND plnkn = it_recipe-plnkn.
CLEAR : wa_mapl,wa_final.
LOOP AT it_mapl INTO wa_mapl.
WA_FINAL-MATNR = WA_mapl-MATNR. "MATERIAL NUMBER
WA_FINAL-WERKS = WA_mapl-WERKS.
WA_FINAL-PLNNR = WA_mapl-PLNNR. "GROUP
WA_FINAL-PLNTY = WA_mapl-PLNTY. "TASK LIST TYPE
WA_FINAL-PLNAL = WA_mapl-PLNAL. "GROUP COUNTER
CLEAR : wa_recipe.
LOOP AT it_recipe INTO wa_recipe WHERE plnnr = wa_final-plnnr.
WA_FINAL-VORNR = WA_recipe-VORNR. "OPERATION / ACTIVITY NUMBER
WA_FINAL-STEUS = WA_recipe-STEUS. "CONTROL KEY
WA_FINAL-LTXA1 = WA_recipe-LTXA1. "OPERATION SHORT TEXT
CLEAR : wa_plmk.
LOOP AT it_plmk INTO wa_plmk WHERE plnnr = wa_final-plnnr and plnkn = wa_recipe-plnkn.
WA_FINAL-VERWMERKM = WA_plmk-VERWMERKM. "Master Inspection Char
WA_FINAL-KURZTEXT = WA_plmk-KURZTEXT. "Short Text for Inspection Characteristic
wa_final-MERKNR = wa_plmk-MERKNR.
Hi Smitha,
Table PLMW contains fields PLNAL and PLNKN. It may be used as a link between MAPL and PLMK.
Regards
Radhika
2009 Nov 23 10:14 PM
Hi Smitha,
PLNAL is a key field. Try to use them in your loop where condition statements along with other conditions inorder to avoid the repeatation of data.
Hope this will resolve your issues.
Regards,
Devendran Krishnan.
2009 Nov 24 6:24 AM
hi
thanks for the reply..
yes if i use PLNAL as a key my problm will solve but there is no PLNAL field in PLMK and PLPO....
is there any others tables u know wr i get inspection plan detail with respect to group and group counter
Regards
Smitha
2009 Nov 24 6:38 AM
Hi Smitha,
Table PLMW contains fields PLNAL and PLNKN. It may be used as a link between MAPL and PLMK.
Regards
Radhika
2009 Nov 24 8:32 AM
Thanks to every one
i got the answer
i used this FM QPAX_PLMKB_READ_FROM_PLKO
then there i wil get Plnkn i compared Plnkn with plpo
i got the out put
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |