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

problem while displaying inspect6ion plan for recipe

Former Member
0 Likes
880

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

4 REPLIES 4
Read only

0 Likes
847

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.

Read only

0 Likes
847

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

Read only

0 Likes
847

Hi Smitha,

Table PLMW contains fields PLNAL and PLNKN. It may be used as a link between MAPL and PLMK.

Regards

Radhika

Read only

0 Likes
847

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