Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP problem in BW

Former Member
0 Likes
373

Hi Gurus,

I am facing this ABAP problem in enhancing a standard Datasource.

Please go thru this:

Present standard Internal table ITAB :

PO number | PO item |G/L account | PO quan | PO quan1(new)

-


123 | 10 | blank | 100 | blank

I need to enhance this standard internal table for fields (G/L account & (New field) (PO quantity)

) in user exit from othe table EKKN.

I need to make use of PO number & PO item as the keys and select the data from EKKN and append into the same standard Internal table ITAB.

I know that I cannot append in the LOOP as it goes for infinite loop.

But how to take the key and select the data and append .

I want my result to be something like this

After change

PO number | PO item | G/L account |PO quan | PO quan1(new)

-


123 | 10 | blank | 100 | blank

123 | 10 | G1 | 0 | 60

123 | 10 | G2 | 0 | 40

Please help me out with the ABAP code for this

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
347

You've got an internal table with your original records. Create another table of the same type to hold your generated records, then append them to your original table.

LOOP AT itab_original.
  ... generate record into itab_new
  APPEND itab_new.
ENDLOOP

APPEND LINES OF itab_new TO itab_original.

matt

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
348

You've got an internal table with your original records. Create another table of the same type to hold your generated records, then append them to your original table.

LOOP AT itab_original.
  ... generate record into itab_new
  APPEND itab_new.
ENDLOOP

APPEND LINES OF itab_new TO itab_original.

matt

Read only

Former Member
0 Likes
347

thanks