include space between two variables from internal table
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.
Avinash Kodarapu replied
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. Output: Test 10000