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: 

Re: Conversion of internal table to String Table

Former Member
0 Kudos

Hi Experts ,

i have one doubt  ,

suppose i have one  internal table data  retrieved  from mara table . so my table contain 10 lines with some fields in table .

now  want to convert this table into string type table

Example

lt_mara table contains 10 lines .

fields in table matnr, maktl ,so ext

matnr  maktl

10       x1

11       x2

12       x3

so on ..

now my string table should contain 10 lines  and data no heading , it should come line string format with space .

10 x1

11 x2

12 x3

is there any best way to do in  performance wise .

Thankts ...

4 REPLIES 4

arindam_m
Active Contributor
0 Kudos

Hi,

Please check the FM SOTR_SERV_TABLE_TO_STRING. Hope this helps.

Cheers,

Arindam

m4abrams
Participant
0 Kudos

Hi Suvarna,

1. Make all the fields of your work area lines into a single string.

2. Append each of these string lines into a final itab.

Thanks.

jayan_abap
Associate
Associate
0 Kudos

Hi Suvarna,

You can use the FM SAP_CONVERT_TO_TXT_FORMAT to convert an internal table to string.

Jay

bastinvinoth
Contributor
0 Kudos

Hi  Former Member

there are two options i think so,


one is you can use "concatenate"statement inside the loop.

another one is  FM 'SOTR_SERV_TABLE_TO_STRING' which already mentioned by Arindam Mondal

Check the below thread for your reference.

https://scn.sap.com/thread/574871

Regards,

Bastin.G