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

Former Member
0 Likes
302

Hi Experts,

I have a itablike this.

data: begin of itab occurs 0,

finaltext(3000),

end of itab.

when i exicute my pgm ith itab has the data like:

2006-07-28 13:55:00.0

Content/Products/Product Detail/Test1.html

Test1.html

2006-06-02 13:55:00.0

7

9

admin

1075

/Content/Products/Product Detail/Test1.html

text/vnd.merant.contribution+xml

Test1 description

Product Detail

0

0

/WebSite/Content/Products/Product Detail/Test1.html

Test1

9

Financial Intelligence,IRA

Banks,Finance Companies

Electronic Documents

Menu-driven paper - Request Consultation

asdfsa

23412

test, akjsd

This is a search descriptions

<IMG class="" alt="Soap Bubbles" src="../../../Assets/Images/Soap%20Bubble

<A class="" title="" href="../../../Assets/Documents/Catalog_Hub_UXP_v1_4.

This is a &lt;b&gt;Short Description&lt;/b&gt;.

<FONT color=#ffffff cmid="Product Detail:longDescription"><FONT color=#ff0

So i have nearly 29 fields....in one more jtab like this:

data: begin of it_product occurs 0,

p1(20),

p2(70),

p3(20),

p4(20),

p5(2),

p6(2),

p7(15),

p8(10),

p9(70),

p10(60),

p11(50),

P12(30),

P13(2),

P14(2),

P15(70),

P16(10),

P17(2),

P18(30),

P19(30),

P20(30),

P21(40),

P22(20),

P23(10),

P24(7),

P25(15),

P26(40),

P27(50),

P28(100),

P29(80),

P30(100),

end of it_product.

so i want to move data from itab to jatb.

So after exicuting my pgm jtab shold give output like this:

p1 p2 p3 p4 p5 ......etc...p30.

Note:p1 means data in itab...

Can any body tell me how to do that?

Regards

2 REPLIES 2
Read only

Former Member
0 Likes
268

loop at itab.

move itab to itab1.

append itab1.

endloop.

This will work provided your contents are occupying the full length of the field declcared, meaning the data for P1 should occupy the full 20 characters, else wrong data will go into wrong fields.

Another way of doing it is to have a delimiter that separates the data of each field. Then you can use SPLIT command to seprate the data and append.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
268

You can do it like this.



report zrich_0001 .

data: itab type table of string with header line.

data: begin of itab2 occurs 0,
      fld1(10) type c,
      fld2(10) type c,
      fld3(10) type c,
      fld4(10) type c,
      end of itab2.

field-symbols: <fs>.

loop at itab.

  assign component sy-tabix of structure itab2 to <fs>.
  if sy-subrc <> 0.
    exit.
  endif.

  <fs> = itab.

endloop.

append itab2.

Regards,

Rich Heilman