Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to insert one column of data into an existing internal table?

hello.

I already have an internal table with data inside it.

But now i want to insert one column of data into a field inside the internal table just now.

What should i do??

Thanks in advance.

Tags:
Former Member
Former Member replied

Hi,

I wish this example clarifies your doubt.

First we create an internal table type with a field called 'unfilled' .

This field will be filled separately after all the other fields get the data from a standard SAP table t001k.

TYPES: BEGIN OF t_tabletype,

bukrs TYPE bukrs,

butxt TYPE butxt,

unfilled(10) TYPE c,

END OF t_tabletype.

Creating an internal table of above table type.

DATA: i_tabletype TYPE TABLE OF t_tabletype.

Creating a workarea of the above internal table.

DATA: wa_tabletype LIKE LINE OF i_tabletype.

Populating the internal table i_tabletype from t001k.

SELECT bukrs

butxt

INTO CORRESPONDING FIELDS OF TABLE i_tabletype

FROM t001k.

suppose you want to fill the field unfilled with your name.

Then proceed as follows:

LOOP AT i_tabletype INTO wa_tabletype.

wa_tabletype-unfilled = 'Lim'.

MODIFY i_tabletype FROm wa_tabletype INDEX sy-tabix TRANSPORTING unfilled.

ENDLOOP.

CLEAR wa_tabletype.

Regards,

Prosenjit.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question