Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
mkhan2126
Explorer
781

This blog is to provide new ABAP programming syntax along with some use case to ease and save development time of beginners and experienced professional who is looking for Advanced ABAP programming.

Many times, we come across a scenario where we have to bring data from different internal tables. As per traditional ABAP we use to loop the main internal table and then use READ TABLE statement for processing each field value. 

Scenario: An internal table contains data passed from an API, we need to validate the data like check if Material, plant & storage location is valid or invalid from different value tables like T001W, T001L MARA etc

Old syntax

mkhan2126_0-1765358366494.png

New Syntax:

mkhan2126_2-1765358832230.png

mkhan2126_3-1765358944737.png

FOR keyword is used for main LOOP--ENDLOOP and LET---VALUE keyword allows you to declare work area for different Internal table like READ STATEMENTS and COND.. WHEN..THEN keyword will allow you to set the conditions.

Scenario: Many times, we need to append values to the internal table already holding some records then we have to use the BASE keyword.

mkhan2126_4-1765359503063.png

Scenario: To create Range table from entries of different internal table

mkhan2126_5-1765360022005.png

Scenario: To pass entries from one internal table to another based on filtering using FILTER keyword. Note: Internal table should be of SORTED or HASHED table type with KEY.

mkhan2126_6-1765360244322.png

To calculate sum in internal table we use REDUCE statement

mkhan2126_7-1765360703664.png

Output: Total Salary: 39000

Scenario: GROUP BY statement is used to group the data like for example Order containing multiple item details and we want to pass each order detail to some BAPI for data update.

mkhan2126_8-1765362214700.png

Hope it helps the members looking for quick info on Advanced ABAP programming.

Next time will try to cover the CDS entities and RAP ABAP blogs. Till then happy coding 🙂

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\

 

 

 

 

 

 

 

 

 

 

1 Comment
suresh_datti
Active Contributor
0 Likes

>>>Next time will try to cover the CDS entities and RAP ABAP blogs. Till then happy coding

👍