Skip to Content

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

include space between two variables from internal table

Hi Experts,

I have an internal table with 4 fields with values for a b c d , i have to arrange them in the specific order so that i can download all the data in a text file.

the first 3 variables are already arranged , the format is a bc, but the var d should be put in a specific positon after predefined spaces from var c.

Please refer below for the sample of of the output text file. In this example:

a = A20N

b = 7227802

c = 0300207

d = 010109

Space between c & d is determined by a POS variable in internal table

a b c d

A20N 72278020300207 010109

A20A 72278020300207 21

A20N 72278020300207 2511100

A21F 72278020300207 Van Capellen

A21G 72278020300207 Tim

A20E 72278020300207 1

A20T 72278020300207 2

A20T 72278020300207 1

A20E 72278020300207 01

A20E 72278020300207 Vilvoorde

plz help me out as i have to resolve this as soon as possible.



Check this code..

DATA l_string TYPE char100.
DATA : l_data1 TYPE char4 VALUE 'Test'.
DATA : l_data2 TYPE char10 VALUE '10000'.
DATA l_pos TYPE i VALUE 10.

l_string = l_data1.
l_string+l_pos =  l_data2.  " l_pos is the position value from where l_date2 is started.
WRITE l_string.

Test      10000

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question