You can achieve this in SAP ABAP by iterating through your original internal table and populating the new internal table with the desired data. Here’s a basic example of how you can do this:“`abapDATA:

lt_original TYPE TABLE OF your_structure,      lt_new TYPE TABLE OF your_new_structure,      ls_new TYPE your_new_structure.LOOP AT lt_original INTO ls_original.  CLEAR ls_new.  ls_new-item_no = ls_original-item_no.  ls_new-batch = ls_original-batch.  ls_new-stock_type = ls_original-stock_type.  CONCATENATE ls_original-material ls_original-material_description INTO ls_new-material_data SEPARATED BY ‘ ‘.  APPEND ls_new TO lt_new.ENDLOOP.“

`In this example:- `lt_original` is your original internal table with 5 fields.- `lt_new` is your new internal table with 4 fields.- `ls_original` is a work area structure to hold the data from `lt_original`.- `ls_new` is a work area structure to hold the data for `lt_new`.Inside the loop, you copy the values of item_no, batch, and stock_type directly from the original structure to the new structure. For the `material_data` field, you use the `CONCATENATE` statement to combine the `material` and `material_description` fields with a space in between.After the loop, `lt_new` will contain your new internal table with the desired structure.

……..

DATA: lt_original TYPE TABLE OF your_structure,      lt_new TYPE TABLE OF your_new_structure,      ls_new TYPE your_new_structure.LOOP AT lt_original INTO ls_original.  CLEAR ls_new.  ls_new-item_no = ls_original-item_no.  ls_new-batch = ls_original-batch.  ls_new-stock_type = ls_original-stock_type.  CONCATENATE ls_original-material ls_original-material_description INTO ls_new-material_data SEPARATED BY ‘ ‘.  APPEND ls_new TO lt_new.ENDLOOP.

Be the first to comment

Leave a Reply

Your email address will not be published.


*