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

Internal Table with variable field lengths

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
674

Hi Guys,

I have a requirement to populate an internal table whose structure is as follows.

Internal Table will have 5 lines.

Line1: 050 char

Line2: 100 char

Line3: 100 char

Line4: 100 char

Line5: 050 char.

I have all the required data with me. I just need to populate the table.

Reward points up for grabs

Regards,

Suhas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
653

what is your real problem, write everything in the Char100 field and you are done.

5 REPLIES 5
Read only

Former Member
0 Likes
654

what is your real problem, write everything in the Char100 field and you are done.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
653

Hello Boes,

I have done exactly this way. But i have some reservations regarding this approach.

Actually this internal table is a payment file which will be sent to the bank. Will there be any problem?

Regards,

Suhas

Read only

Former Member
0 Likes
653

Hi,

for eg you have it in one itab.

declare the internal table with maximum length field

data: begin of itab occurs 0,

field(100) type c,

end of itab.

condense: line1, line2, line3, line4, line5.

itab-field = line1.

append itab.

clear: itab.

itab-field = line2.

append itab.

clear: itab.

itab-field = line3.

append itab.

clear: itab.

itab-field = line4.

append itab.

clear: itab.

itab-field = line5.

append itab.

clear: itab.

now you will have all the records,

thanks & regards,

Venkatesh

Read only

Former Member
0 Likes
653

Hi Suhas,

You have mentioned that you have all the required data with you, does this mean that the data is available in a text file in the presentation server?

If yes, then you can use the function module "gui_upload" using which you can transfer the data from the file in to an internal table....

else, If you have all data in a different internal table, Loop into that table and APPEND the entires in to the required internal table.

Best Regards,

Ram.

Read only

Former Member
0 Likes
653

Hi,

Wher do you have the data?

You can define a work area and internal table of two rows..

wa-row1 = 'yourdata'

wa-row2 = 'your data'

append wa to itab.

wa-row1 = 'yourdata'

wa-row2 = 'your data'

append wa to itab.

wa-row1 = 'yourdata'

wa-row2 = 'your data'

append wa to itab.

wa-row1 = 'yourdata'

wa-row2 = 'your data'

append wa to itab.

wa-row1 = 'yourdata'

wa-row2 = 'your data'

append wa to itab.

If you have your data in Db table then you need to write a select query..

select <fields,,,> from DBtable into tableITAb.

Be clear with your question we can help you...

rewads if useful,

regards,

nazeer