on 11-11-2008 6:10 AM
hi ,
I am working on a code and it is giving problem that where the Work center field is empty it is making the last field repeated having the Work Center . here 's d code :-
CODE :-
LOOP AT T_MAPL INTO W_MAPL.
LOOP AT T_PLAS INTO W_PLAS WHERE PLNAL = W_MAPL-PLNAL AND PLNNR = W_MAPL-PLNNR.
W_FTAB6-PLNKN = W_PLAS-PLNKN.
LOOP AT T_PLPO INTO W_PLPO WHERE PLNNR = W_PLAS-PLNNR AND PLNKN = W_PLAS-PLNKN.
W_FTAB6-MATNR = W_MAPL-MATNR.
W_FTAB6-PLNTY = W_MAPL-PLNTY.
W_FTAB6-PLNAL = W_MAPL-PLNAL.
W_FTAB6-WERKS = W_MAPL-WERKS.
READ TABLE T_PLKO INTO W_PLKO WITH KEY PLNAL = W_MAPL-PLNAL PLNNR = W_MAPL-PLNNR.
W_FTAB6-KTEXT = W_PLKO-KTEXT.
W_FTAB6-PLNNR = W_PLPO-PLNNR.
W_FTAB6-VORNR = W_PLPO-VORNR.
W_FTAB6-LTXA1 = W_PLPO-LTXA1.
W_FTAB6-KTSCH = W_PLPO-KTSCH.
W_FTAB6-ARBID = W_PLPO-ARBID.
W_FTAB6-BMSCH = W_PLPO-BMSCH.
W_FTAB6-MEINH = W_PLPO-MEINH.
W_FTAB6-VGW04 = W_PLPO-VGW04.
W_FTAB6-VGE04 = W_PLPO-VGE04.
READ TABLE T_CRHD INTO W_CRHD WITH KEY OBJID = W_PLPO-ARBID.
W_FTAB6-ARBPL = W_CRHD-ARBPL.
W_FTAB6-VERWE = W_CRHD-VERWE.
W_FTAB6-OBJTY = W_CRHD-OBJTY.
W_FTAB6-OBJID = W_CRHD-OBJID.
READ TABLE T_CRTX INTO W_CRTX WITH KEY OBJID = W_CRHD-OBJID.
W_FTAB6-KTEXT_UP = W_CRTX-KTEXT_UP.
READ TABLE T_MARC INTO W_MARC WITH KEY MATNR = W_MAPL-MATNR.
W_FTAB6-LGPRO = W_MARC-LGPRO.
APPEND W_FTAB6 TO T_FTAB6.
ENDLOOP.
ENDLOOP.
ENDLOOP.
OUTPUT:-
OprID W.C. Item description
0010 1422 SHEARING MACHINE-01
0011 1920 LATHE MACHINE N55
0015 1920 LATHE MACHINE N55
0020 1461 KNUCKLE JOINT PRASS -01
0021 1920 LATHE MACHINE N55
0025 1920 LATHE MACHINE N55
0030 1464 PEDESTAL GRINDER-01
0040 1461 KNUCKLE JOINT PRASS -01
0041 1920 LATHE MACHINE N55
0045 1920 LATHE MACHINE N55
0050 1920 LATHE MACHINE N55
This is the piece of output i am getting right now . There is Work center Id '1920' which is getting repeated for the values where no work center is defined and i want to display the as it is shown in the tcode CA03(Display Routing). I had checked in the debug mode that it is picking up the records where the Work Center is defined,and then it is picking the records where no work center is defined.
due to append statement it is picking the last record having work center value 1920 and it is making repetition of it for the records having no work center.
the output which i want to display is:-
OprID W.C. Item description
0010 1422 SHEARING MACHINE-01
0011
0015
0020 1461 KNUCKLE JOINT PRASS -01
0021
0025
0030 1464 PEDESTAL GRINDER-01
0040 1461 KNUCKLE JOINT PRASS -01
0041
0045
0050 1920 LATHE MACHINE N55
Plz provide me guidelines how to display this type of output.
Hi,
In the Piece of code u have written i can see that no condition is kept while appending the records in the final internal table...check that if the work center is not empty then only the second field is to be appended to the final table....
Regards,
Rohan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.