- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Aggregating rows in SAP ABAP with the same name
You can use the COLLECT keyword or some aggregate functions to achieve the result. You should define some datatype to match the scenario.
TYPES: BEGIN OFt_my_type, key_aTYPE foo, key_bTYPE foo, nokey_cTYPE foo, nokey_dTYPE foo, END OFt_my_type, tt_my_type_list TYPE STANDARD TABLE OF t_my_type WITH DEFAULT KEY, tt_my_type_hash TYPE HASHED TABLE OF t_my_type WITH KEY key_a key_b. DATA: lt_resultTYPE tt_my_type_list, lt_sums TYPE tt_my_type_hash. FIELD-SYMBOLS:<ls_result> TYPE t_my_type. LOOP AT lt_result ASSIGNING <ls_result>. COLLECT<ls_result> INTO lt_sums. ENDLOOP.
Advertisements