2009 Sep 03 12:04 PM
Hi experts!!
i am getting a structure as export parameter when i process a FM and this structure consists of some fields. After this i want to group these fields grouped by LIFNR and display out put. Please let me know how to group the content of the internal table fields grouped by lifnr.
Please help me with the code.
2009 Sep 03 12:10 PM
Hi,
I suppose that you are getting the data as a internal table from the tables parameter, why dont you simply sort the table by vendor (lifnr) and then display, sorting would group your lines based on lifnr.
Regards,
Himanshu
Hi experts!!
i am getting a structure as export parameter when i process a FM and this structure consists of some fields. After this i want to group these fields grouped by LIFNR and display out put. Please let me know how to group the content of the internal table fields grouped by lifnr.
Please help me with the code.
2009 Sep 03 12:10 PM
Hi,
I suppose that you are getting the data as a internal table from the tables parameter, why dont you simply sort the table by vendor (lifnr) and then display, sorting would group your lines based on lifnr.
Regards,
Himanshu
2009 Sep 03 12:11 PM
2009 Sep 03 12:31 PM
Hello,
Group by functionality is only avaliable for ABAP SQL's and not for internal table but you can use AT..ENDAT statement in
LOOP AT ITAB...ENDLOOP to simulate the group by functionality.
Following are the various options available:
LOOP AT <itab>.
AT FIRST. ... ENDAT.
AT NEW <f1>. ...... ENDAT.
AT NEW <f2 >. ...... ENDAT.
.......
<single line processing>
.......
AT END OF <f2>. ... ENDAT.
AT END OF <f1>. ... ENDAT.
AT LAST. .... ENDAT.
ENDLOOP.
For more information youn can refer to following link:
http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb381a358411d1829f0000e829fbfe/content.htm
Also, for other aggregate function like min, max, sum you need to do processing using LOOP AT <ITAB>...ENDLOOP
No standard commands are avaliable in SAP ABAP for above functions.
Thanks,
Prashant
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |