2009 Feb 26 9:54 AM
lifnr-matnr-menge-idnrk-excess
r11-subfert-100-subscrap-25
r11-subfert-100-scrap-20
r11-neera1-125-scrap2-15
(please dont tell delete adjacent duplicates).In my case that is not needed.Because I need this in final stage.output i have shown is partial one.
i need to clear second row 100.because matnr is same.instead of 100 i need to insert zero.
i am declaring variable in my IT.
for example v_matnr type mseg-matnr.
count type i value 1.
loop at it_final.
if sy-index = 1.
v_matnr = it_final-matnr.
move it_final-menge to it_final-menge.
endif.
i am getting logic.i couldnt able to do.
lifnr-matnr-menge-idnrk-excess
r11-subfert-100-subscrap-25
r11-subfert-100-scrap-20
r11-neera1-125-scrap2-15
(please dont tell delete adjacent duplicates).In my case that is not needed.Because I need this in final stage.output i have shown is partial one.
i need to clear second row 100.because matnr is same.instead of 100 i need to insert zero.
i am declaring variable in my IT.
for example v_matnr type mseg-matnr.
count type i value 1.
loop at it_final.
if sy-index = 1.
v_matnr = it_final-matnr.
move it_final-menge to it_final-menge.
endif.
i am getting logic.i couldnt able to do.
2009 Feb 26 9:57 AM
Hi,
1.
data: count type i.
loop at it_final.
add 1 to count.
if sy-index = 1.
v_matnr = it_final-matnr.
move it_final-menge to it_final-menge.
endif.
if count eq 100.
.....
clear count.
endif.
endloop.
or 2. Define an new field in your internal table from type i and worte it if you fill the internal table
2009 Feb 26 9:57 AM
you can move data to another internal table like
it_final2[] = it_final[]
and delete dupilicates from it_final. and finally you can use it_final2.
2009 Feb 26 9:58 AM
Take two variables for lifnr and matnr. Inside the loop pass the first record Lifnr and matnr to those variables. for the second record in the loop check the itab values with the variable values for both lfinr and matnr, if both are same then make the menge zero.
2009 Feb 26 10:04 AM
2009 Feb 26 10:16 AM
hi,
sort it_final by lifnr matnr.
loop at it_final.
at new matnr.
l_flg = 'X'.
endat.
if l_flg ne 'X'.
delete it_final.
*or...
clear it_final-matnr.
modify it_final.
else.
clear l_flg.
endif.
endloop.
regards,
Edgar
2009 Feb 26 10:10 AM
Hi,
in your internal table have an extra field called
mark type c.
sort itab by lifnr matnr.
field-symbols : <fS_itab> like itab.
loop at itab assigning <fs_tab>.
at new matnr.
<fs_tab>-mark = 'X'.
endat.
endloop.
Now the the records where mark is 'X' will tell u the unique material number.
Now
loop at itab.
if itab-mark ne 'X'.
you can make the material number as zeros or what ever you want you cando .
endif.
endloop.
Please come back to us for more queries.
Regards,
Venkatesh
2009 Feb 26 10:20 AM
Thank you my dear friend.
I am so kind of you.
its working well.
thanks.
2009 Feb 26 10:21 AM
2009 Feb 26 10:23 AM
Hi,
Please close the thread if you got the proper results.
Regards,
Venkatesh
2009 Feb 26 10:17 AM
Dear Bathrinath,
do like this
t_final1[] = t_final[].
data: count type i,
count1 type i.
count = 1.
loop at t_final into w_final.
count1 = count + sy-tabix.
read table t_final1 into w_final1 index count1.
if w_final-lifnr = w_final1-lifnr and
w_final-matnr = w_final1-matnr and
w_final-menge = w_final1-menge.
w_final-menge = 0.
endif.
modify t_final from w_final.
clear: count1,w_final,w_final1.
endloop.
hope your problem will be solved.
regards
vijay
2009 Feb 26 10:21 AM
Hi,
Try below logic.
DATA : it_final TYPE TABLE OF ty_final,
wa_final TYPE ty_final,
wa_final1 TYPE ty_final,
w_indx TYPE i,
w_tybix TYPE i.
w_indx = 1.
LOOP AT it_final INTO wa_final.
w_indx = w_indx + 1.
w_tabix = sy-tabix.
IF wa_final-matnr = wa_final1-matnr.
wa_final-menge = '0'.
MODIFY it_final INDEX w_tabix FROM wa_final TRANSPORTING menge.
ENDIF.
CLEAR wa_final1.
READ TABLE it_final INDEX w_indx INTO wa_final1. " Reads next record of the table.
ENDLOOP.Regards
Bala Krishna
2009 Feb 26 12:13 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |