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

.CSV File should be left-aligned

Former Member
0 Likes
1,202

Hello All,

I have a program which automatically downloads the output to a .csv file. I have already successfully downloaded the output to a .csv file, however, some of my fields, like Shipping Instructions Text from the Header of a Sales Order is not left-justified when i check the file. I want all the fields to be left-justified so i don't have to check the fields one by one to see if it has a value or not. I have already tried the CONDENSE syntax and SHIFT LEFT syntax, but my downloaded file is still not left justified.

Any suggestions to make all the fields of the csv file left justified?

Thanks!

Jim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
965

Hi Jim,

Please specify the file type in GUI_DOWNLOAD FM.

CALL FUNCTION 'GUI_DOWNLOAD' "#EC *

EXPORTING

filename = v_detail_name

<b>Filetype = 'ASC'</b>

TABLES

data_tab = i_scsvtab_header

EXCEPTIONS

OTHERS = 1.

Best regards,

Prashant

PS : Please reward all helpful answers

Hello All,

I have a program which automatically downloads the output to a .csv file. I have already successfully downloaded the output to a .csv file, however, some of my fields, like Shipping Instructions Text from the Header of a Sales Order is not left-justified when i check the file. I want all the fields to be left-justified so i don't have to check the fields one by one to see if it has a value or not. I have already tried the CONDENSE syntax and SHIFT LEFT syntax, but my downloaded file is still not left justified.

Any suggestions to make all the fields of the csv file left justified?

Thanks!

Jim

3 REPLIES 3
Read only

Former Member
0 Likes
965

Hi Jim,

Could you please paste the code. Need to check the data type of the internal table which is passed to GUI_DOWNLOAD.

Best regards,

Prashant

Read only

0 Likes
965

CALL FUNCTION 'GUI_DOWNLOAD' "#EC *

EXPORTING

filename = v_detail_name

TABLES

data_tab = i_scsvtab_header

EXCEPTIONS

OTHERS = 1.

IF sy-subrc = 0.

CALL FUNCTION 'GUI_DOWNLOAD' "#EC *

EXPORTING

filename = v_detail_name

append = c_a

TABLES

data_tab = i_scsvtab

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

ENDIF.

ELSE.

  • do nothing

ENDIF.

Here's the declaration of the internal table:

DATA: BEGIN OF i_scsvtab OCCURS 0,

auart(4), "order type

vkorg(5), "sales org

vtweg(3), "distribution channel

spart(3), "division

kunnr(11), "sold to

kunwe(11), "ship to

bstkd(21), "customer PO

bstdk(11), "customer PO date

vdatu(11), "RDD

augru(41), "reason code

tbnth(41), "Billing Notes

tsins(41), "Shipping Instructions

matnr(19), "material

kwmeng(16), "quantity

vrkme(4), "UoM

werks(5), "plant

charg(11), "batch

netpr(12), "net price

kpein(6), "pricing unit

tbnti(41), "Billing Notes

zmess(46),

zflag(2),

END OF i_scsvtab.

Do i need to change the declaration??

Thanks!

Read only

Former Member
0 Likes
966

Hi Jim,

Please specify the file type in GUI_DOWNLOAD FM.

CALL FUNCTION 'GUI_DOWNLOAD' "#EC *

EXPORTING

filename = v_detail_name

<b>Filetype = 'ASC'</b>

TABLES

data_tab = i_scsvtab_header

EXCEPTIONS

OTHERS = 1.

Best regards,

Prashant

PS : Please reward all helpful answers