‎2008 Feb 05 12:51 PM
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
‎2008 Feb 05 12:55 PM
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
‎2008 Feb 05 12:59 PM
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.
‎2008 Feb 05 1:00 PM
‎2008 Feb 05 12:57 PM
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^
‎2008 Feb 05 12:59 PM
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
‎2008 Feb 05 12:59 PM
‎2008 Feb 05 12:59 PM
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.