Application Development 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: 

Additional column for output table

Former Member
0 Kudos

Hi,

I have created an ABAP function wherein I am reading table to output in a table. Code as follows

SELECT * FROM <source_table>

INTO CORRESPONDING FIELDS OF TABLE <t_output_table>

WHERE <conditions>

Import tab has two import parameters.

Export tab has none.

Changing has none.

Table tab has

PARAMETER NAME as t_output_table,

TYPING as LIKE,

ASSOCIATED TYPE as source table

What I want to do next is to add another field to the output which will be substring of one of the field of source table. For example if FieldA of source table has value "abcdefgh", I want to return "defgh" as additional column of the output table.

Appreciate any help !!

IMS

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You would need to create a structure that includes your extra column. Use this structure as the reference in your tables tab.

Now when you have selected the data in the table.

loop at the table.

populate the new column according to your logic.

Modify the new column.

endloop.

Hope this solves the problem.

Regards,

Anju

2 REPLIES 2

former_member377111
Participant
0 Kudos

Hi,

Add one more required field to your input table.Once the value has been retrieved to ur Output table,modify the table with your requiremnt and pass this value to the field required.

Former Member
0 Kudos

Hi,

You would need to create a structure that includes your extra column. Use this structure as the reference in your tables tab.

Now when you have selected the data in the table.

loop at the table.

populate the new column according to your logic.

Modify the new column.

endloop.

Hope this solves the problem.

Regards,

Anju