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

Hi problem in down load the data while the value is blank

Former Member
0 Likes
419

hi ,

while i am down loading the internal table data into application server .

for the last field in the internal table the value is blank .

after downloading the data into flat file .the blank value for the last field is igoring.

i want the row ending with the blank data(spaces) in each line in file.

2 REPLIES 2
Read only

Former Member
0 Likes
381

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD

EXPORTING

FILENAME = 'C:\Documents and Settings\999999\Desktop\demo.xls'

FILETYPE = 'DBF'

WRITE_FIELD_SEPARATOR = 'X'

  • HEADER = '00'

<b>TRUNC_TRAILING_BLANKS = SPACE</b>

  • WRITE_LF = 'X'

CHANGING

DATA_TAB = lt_datatab.

Read only

varma_narayana
Active Contributor
0 Likes
381

Hi..

This is the Simple way you can download the ITAB with Tab delimiter: Check the Last field now...

DATA : V_REC(200).

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB INTO WA.

Concatenate WA-FIELD1 WA-FIELD2

INTO V_REC

SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

TRANSFER V_REC TO P_FILE.

ENDLOOP.

CLOSE DATASET P_FILE.

Note: if there are any Numeric fields ( Type I, P, F) In your ITAB then before CONCATENATE you have to Move them to Char fields ..

<b>Reward if Helpful.</b>