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: 

Field1 = field2 + field3

rodrigo_paisante3
Active Contributor
0 Kudos

Hello friends,

i have 3 internal tables (A,B,C) that generate 3 txt files, but now i need to create only 1 txt file with the 3 internal tables.

I tried to create a new internal table with only one field, and concatenate the fields into it. But concatenating lost the unused spaces.

The txt file that i created:

APM01Vazamento no sistema de corteBO01010CT59210D00269FF02060000050186

B000000100004

C0000000000001255540000000000001000

C0000000000001325100000000000001000

B000000100003

C0000000000001255540000000000001000

and i the layout i need (with the total lenght of field):

APM01Vazamento no sistema de corte BO01010CT59210D00269FF02060000050186

B000000100004

C00000000000012555400 00000000001000

C00000000000013251000 00000000001000

B000000100003

C00000000000012555400 00000000001000

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

Create a internal table with 1500 character length and a work area of the same.


Ex.
  data : begin of i_tab1500 occurs 0.
            text(1500) type c.
  data : end of i_tab1500.

     write : i_tabA to i_tab1500.
     append i_tab1500..
     write : i_tabB to i_tab1500.
     append i_tab1500
     write : i_tabC to i_tab1500.
     append i_tab1500


         

.

aRs

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Have you tried using the extenstion, SEPARATED BY SPACE in the CONCENTATE statement.

concatenate field1 field2 into field3 separated by space.

Regards,

RIch Heilman

former_member194669
Active Contributor
0 Kudos

Hi,

Create a internal table with 1500 character length and a work area of the same.


Ex.
  data : begin of i_tab1500 occurs 0.
            text(1500) type c.
  data : end of i_tab1500.

     write : i_tabA to i_tab1500.
     append i_tab1500..
     write : i_tabB to i_tab1500.
     append i_tab1500
     write : i_tabC to i_tab1500.
     append i_tab1500


         

.

aRs

rodrigo_paisante3
Active Contributor
0 Kudos

Thanks to all!

When I saw the help about condense, i saw the solution to my problem:

tab-field = tab2-a.

tab-field+1 = tab2-b.

tab-field+11 = tab2-c.

tab-field+26 = tab2-d.

.

.

.

tab-field+n = tab2-n.

where lenght of a = 1, b = 10 and c = 15.

Regards