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:
New Syntax:
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.
Scenario: To create Range table from entries of different internal table
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.
To calculate sum in internal table we use REDUCE statement
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.
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 🙂
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 etcOld syntax: New Syntax: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.Scenario: To create Range table from entries of different internal tableScenario: 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.To calculate sum in internal table we use REDUCE statementOutput: Total Salary: 39000Scenario: 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.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 🙂 Read More Technology Blog Posts by Members articles
#SAP
#SAPTechnologyblog