Application Development and Automation 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: 
Read only

Regarding internal table ??

samiullah_qureshi
Active Contributor
0 Likes
771

Is it possible to have a internal table with lines of different length??

My task is to append data from different internal table into a single internal table such that the length specified for smaller internal tables is maintained into the bigger internal table

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
739

Hi,

Define an internal table with a field having more length and populate every field value into that internal table field by specifying the length.

ex:

Types: begin of ty_data,

field(1000) type c,

end of ty_data.

Data: itab type table of ty_data,

wa type ty_data.

Suppose if you have an internal table with fields field1 field2 with values 10 and 20 respectively move 2 fields values to itab as below.

move new_itab-field1 to itab-field+0(10).

move new_itab-field2 to itab-field+11(10).

Regards,

Satish

5 REPLIES 5
Read only

Former Member
0 Likes
739

Hi Sami,

It is not possible. but if your requirement is like then what you need to do is to declare the internal table with max lenth and append any data of any length.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 6:06 PM

Read only

Former Member
0 Likes
740

Hi,

Define an internal table with a field having more length and populate every field value into that internal table field by specifying the length.

ex:

Types: begin of ty_data,

field(1000) type c,

end of ty_data.

Data: itab type table of ty_data,

wa type ty_data.

Suppose if you have an internal table with fields field1 field2 with values 10 and 20 respectively move 2 fields values to itab as below.

move new_itab-field1 to itab-field+0(10).

move new_itab-field2 to itab-field+11(10).

Regards,

Satish

Read only

0 Likes
739

Hi satish the solution you gave even not worked out.

Do you have any other solution to this problem ??

Read only

Former Member
0 Likes
739

Hello Sami,

1.Better consider a Itab with huge string

2. Populate all of your internal tables into this table by considering the offset.So you will finally get a single table with singe field (all tables data is concatenated into a single row

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 6:07 PM

Read only

0 Likes
739

Hi Satish,

The requirement is such that the data needs to be in the given format.

The data for ITAB1,ITAB2 and ITAB5 are single lines but for ITAB3 and ITAB4 i can have n number of lines.

The data in various internal table :

ITAB1 : HABBL0903.012ABBL

ITAB2 : P31/03/2008 R0000600000000006287308.77

ITAB3 : ID1100001868 D-24 &25 Industrial Area-II Haridwar 249401 test 3924002100004964 I SAT NETWORK ENGINEERS PVT LTD 31/03/200831/03/2008180 00000000000006838.26 INR 8460006276

ITAB4 :A8460006276 31/03/2008D00001----


ITAB5 :T0000600000000006287308.77

The format in which it should come :

ITAB1( when arrow key is used to navigate through this line the line should stop at 33 and if moved further then it should go to next line).

ITAB2( when arrow key is used to navigate through this line the line should stop at 77 and if moved further then it should go to next line).

ITAB3( when arrow key is used to navigate through this line the line should stop at 822 and if moved further then it should go to next line).

ITAB4( when arrow key is used to navigate through this line the line should stop at 217 and if moved further then it should go to next line).

ITAB5( when arrow key is used to navigate through this line the line should stop at 26 and if moved further then it should go to next line).