Tuesday, December 28, 2010
REPORT ztest_notepad.

DATA: BEGIN OF it_file OCCURS 0,
data TYPE c LENGTH 255,
END OF it_file.
DATA str     TYPE string.
DATA g_len   TYPE i.
DATA g_off   TYPE i.
DATA g_loops TYPE i.
CONCATENATE
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890x'
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890y'
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890z'
'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789m'
INTO str SEPARATED BY space.

g_len   = STRLEN( str ).
g_loops = g_len / 255.

g_off = 1.
DO g_loops TIMES.
IF g_loops NE sy-index.
IF sy-index EQ 1.
it_file-data = str+0(255).
ELSE.
it_file-data = str+g_off(255).
ENDIF.
APPEND it_file.
CLEAR  it_file.
g_off = sy-index * 255.
ELSE.
g_len = g_len - g_off.
it_file-data = str+g_off(g_len).
APPEND it_file.
CLEAR  it_file.
ENDIF.
ENDDO.
LOOP AT it_file.
WRITE:/ it_file-data.
ENDLOOP. 

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.