Hello Anshika,
Putting your requirement clearly is very important,
1. Your first requirement,
1001 24
1001 27
1001 30
1001 40.
output
1001 24
27
30
40
Solution:
sort it_tab by field1 field2.
LOOP AT it_tab INTO wa_tab.
AT NEW field1.
WRITE wa_tab-field1.
ENDAT.
WRITE 20 wa_tab-field2.
skip.
ENDLOOP.
2. Second Requirement
Sales Org | Dist.Channel | Division
1000 |10 |00 |
|1000 |10 |00 |
|1000 |10 |00 |
|1020 |22 |00 |
|1020 |22 |00 |
expected output
|Sales Org | Dist.Channel | Division
|1000 |10 |00
|1020 |22 |00
Solution:
Data : lv_sal_org type lgort,
wa_tab type ty_struc,
it_tab type table of ty_struc.
loop at it_tab into wa_tab.
if lv_sal_org <> wa_tab-sale.Org
skip.
write wa_tab-sales.org , wa_tab-dist.chnl, wa_tab-division.
lv_sal_org = wa_tab-sales.org.
endif.
endloop.
Hope this fixes your issue ..
Regards,
Arun.