Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

when export itab data to *.txt,how to keep the data format?

i want to export the data to .txt file, now i have do the things ,but the data format have some questions.

you konw ,the itab data format is :

a b c;

a1 b1 c1;

a2 b2 c2;

but now the data format of export file is like this:

a b c; a1 b1

c1;a2 b2 c2;

code:

××××××××××××××××××××××××××××××××××××××××××××××

data: l_rbetr type string.

loop at LT_ZREUGH_D into LS_ZREUGH.

if ls_zreugh-zfkzt ne 'X'.

l_rbetr = LS_ZREUGH-rbetr.

concatenate TEXT LS_ZREUGH-zbukr into TEXT.

concatenate TEXT

LS_ZREUGH-prctr

LS_ZREUGH-laufi

LS_ZREUGH-laufd

LS_ZREUGH-lifnr

LS_ZREUGH-name1

LS_ZREUGH-zbnkn

LS_ZREUGH-zbnkl

l_rbetr

LS_ZREUGH-rzawe

LS_ZREUGH-hktid

LS_ZREUGH-hbkid

LS_ZREUGH-bankn

LS_ZREUGH-text1

LS_ZREUGH-zfkzt

CL_ABAP_CHAR_UTILITIES=>NEWLINE

into TEXT separated by

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

endif.

endloop.

call function 'SCMS_STRING_TO_XSTRING'

EXPORTING

TEXT = TEXT

ENCODING = '8400'"8400

IMPORTING

BUFFER = XTEXT.

WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(

**path to the word file

I_FILENAME = 'FuKuan.TXT'

  • String Variable

I_CONTENT = XTEXT

  • File Type

I_MIME_TYPE = 'NOTEPAD' )."

××××××××××××××××××××××××××××××××××××××××××××××××

what i can do to solve the question,?i will wait for answer on line.

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question