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

formatting internal table

0 Likes
581

Hi ABAP gurus,

I have a question

I have an internal table with entries like

LINE ROW COLUMN VALUE

1 1 1 R3 ID

2 1 2 Program Fee Paid

3 2 1 41213

4 2 2 No serr

5 3 1 32412

6 3 2 No

From this i want an internal table as below

R3 ID PROGRAM Fee PAID

41213 No serr

32412 No

Can you please help me regarding this

4 REPLIES 4
Read only

Former Member
0 Likes
562

Hi,

data :

begin of fs,

f1(20) type c,

f2(20) type c,

end of fs.

data itab2 like standard table of fs.

data w_i type i value 1.

loop at itab1 into fs1 where row = w_i.

if fs1-column = w_i.

fs-f1 = fs1-value.

add 1 to w_i.

else.

fs-f2 = fs1-value.

w_i = 1.

endif.

append fs to itab.

clear fs.

endloop.

Read only

Former Member
0 Likes
562

hi

data: BEGIN OF itab OCCURS 0,

f1 type string,

f2 type string,

f3 type string,

f4 type string,

flag type string,

END OF itab.

data string TYPE string.

itab-f1 = 25.

itab-f2 = 10.

itab-f3 = 'R3'.

itab-f4 = 'ID'.

APPEND itab.

itab-f1 = 25.

itab-f2 = 10.

itab-f3 = 'PROGRAM'.

itab-f4 = 'FEE PAID'.

APPEND itab.

loop at itab.

CONCATENATE itab-f3 itab-f4 into string SEPARATED BY space.

write string.

endloop.

OUTPUT IS

R3ID PROGRAMFEE PAID

Edited by: abap on Feb 13, 2009 2:17 PM

Read only

Former Member
0 Likes
562

LINE ROW COLUMN VALUE

1 1 1 R3 ID

2 1 2 Program Fee Paid

3 2 1 41213

4 2 2 No serr

5 3 1 32412

6 3 2 No

have a new itab where line is not there.

then...

sort itab by row column.

data: val(50) type c.

Loop at itab.

concatenate val itab-value into va separated by space.

condense val.

at end of column.

write:/ val.

clear: val.

endat.

endloop.

Regards,

Venkatesh

Read only

Former Member
0 Likes
562

Hello Manish,

This seems to be a assignment for you :-).

Please know how to utilize and why SCN is !!!

Thanks,

Jayant Sahu