Tuesday, December 21, 2010
REPORT ztest_program.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
ort01 TYPE t001-ort01,
land1 TYPE t001-land1,
END OF it_t001.
DATA: it_data TYPE TABLE OF lvc_s_1022,
wa_data LIKE LINE OF it_data.
DATA:spoolid TYPE rspoid.
DATA:file_length TYPE  int4.

START-OF-SELECTION.
SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001.
LOOP AT it_t001.
CONCATENATE it_t001-bukrs
it_t001-butxt
it_t001-ort01
it_t001-land1
INTO wa_data SEPARATED BY space.
APPEND wa_data TO it_data.
CLEAR  wa_data.
ENDLOOP.
DESCRIBE TABLE it_data.
file_length = sy-tfill * 1022.
CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
EXPORTING
i_file_length = file_length
IMPORTING
e_spoolid     = spoolid
TABLES
it_textdata   = it_data.
IF sy-subrc EQ 0.
WRITE spoolid.
ENDIF.

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.