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

Report display format problem

Former Member
0 Likes
734

Dear Friends,

I am getting the record like this: 1111 2222 3333 4444 5555 6666 7777 8888 9999 .

and I want to display on my report like this:

1111 2222

3333 4444

5555 6666

7777 8888

This is my report and the records my long ....

how to display on this format?

Thanks,

Sridhar

7 REPLIES 7
Read only

Former Member
0 Likes
713

Hello,

If the data are stored in the internal table with the same field then do like this.


data: lines type i.
loop at itab.
lines = sy-tabix  mod 2.
if lines = 0.
write: itab-field1.
else.
new-line.
write: itab-field1.
endloop.

Cheers,

Vasanth

Read only

0 Likes
713

Thanks for the replay...

its a string..I mean The value is in String and I want to split and display like the above format.

Read only

0 Likes
713

so , u have to split at each blank space

Read only

Former Member
0 Likes
713

hi

good

check this link on new-line statement on abap.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/new_line.htm

thanks

mrutyun^

Read only

Former Member
0 Likes
713

U need to print 2 record in one row.

loop the ITAB

if (sy-tabix % 2) = 0 i.e remainder value

skip

endif.

write itab-data

endloop

<REMOVED BY MODERATOR>

Narendra

Edited by: Alvaro Tejada Galindo on Feb 5, 2008 5:21 PM

Read only

Former Member
0 Likes
713

Hi,

use new-page line-size 9

Regards

Read only

Former Member
0 Likes
713

Hi sridher,

1. this is one logic

2. just copy paste

3.

REPORT ABC.

*----


DATA : MYSTR(100) TYPE C.

DATA : BEGIN OF ITAB OCCURS 0,

F(15) TYPE C,

END OF ITAB.

DATA : NUM TYPE I.

DATA : S(20) TYPE C.

MYSTR = '1111 2222 3333 4444 5555 6666 7777 8888 9999'.

*----


SPLIT MYSTR AT ' ' INTO TABLE ITAB.

LOOP AT ITAB.

NUM = SY-TABIX MOD 2.

CONCATENATE S ITAB-F INTO S SEPARATED BY SPACE.

IF NUM = 0.

WRITE 😕 S.

CLEAR S.

ENDIF.

ENDLOOP.

regards,

amit m.