07-25-2014 7:03 AM
Hi All
I have one PO no suppose 1812006400 which have 2 movement type(BWART) suppose 101 & 351 i want to show the both movement
type in one row.now in my case its showing two different row.i made 1 seperate column in final internal table i.e. movement type2.Plz help us.
Kindly see attachment..
07-25-2014 7:09 AM
Hi Shinde,
Instead of showing both the movement types in same row, sort the fields PO Number, PO Date and PO Type in ALV Grid.
This functionality should be added to the grid before displaying it.
If you have built with function modules, you have add this feature in Field Catalog or else if you have used Classes you have to call method ADD_SORT of class CL_SALV_SORTS.
Regards,
Vijay
07-25-2014 7:13 AM
Hi Samadhan,
Try the following code for merging the Movement type into single row using Control Break statements(AT END OF...AT END).
"Sort the internal table based on PO Number and movement type
SORT IT_TABLE BY PO_NUMBER BWART.
"Process the LOOP.
LOOP AT IT_TABLE INTO WA_FINAL.
WA_FINAL-PO_NUMBER = WA_TABLE-PO_NUMBER.
"Merge Movement type
IF WA_FINAL-BWART IS INITIAL.
WA_FINAL-BWART = WA_TABLE-BWART.
ELSE.
CONCATENATE WA_FINAL-BWART '/' WA_TABLE-BWART INTO WA_FINAL-BWART.
ENDIF.
AT END OF PO_NUMBER
FLAT_END = 1.
ENDAT.
IF FLAG_END = 1.
APPEND WA_FINAL TO IT_FINAL.
CLEAR: WA_FINAL,
FLAG_END.
ENDIF.
ENDLOOP.
Regards
Rajkumar Narasimman
07-25-2014 7:20 AM
07-25-2014 7:33 AM
If you cannot get more than 2 movement types (repair in DIMP ?) define a final table with duplicated (and renamed/suffix) columns, and sort the first itab and fill the new easily in a loop with {AT NEW init final/count/map/AT END} append logic. (I suppose sort/group with EKPO-EBELN/EBLP + MSEG-MBLNR/MJAHR)
Else read once the extracted table to identify max number of movements, build a dynamic table with PO fields and n x Movement fields suffixed and fill it the same way (add some ASSIGN statement)
Regards,
Raymond