Application Development 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: 

download information from KNA1 as csv file on any server as background task

Former Member
0 Kudos

Dear experts.

I have to provide an csv file with information from table KNA1 in a background task.

I have several questions:

1.) I don't want to create a structure like:

TYPES: BEGIN OF itab_formate_def,

bukrs(4),

tren1(1),

kunnr(10),

tren2(1),

madat(10),

tren3(1),

mahns(1),

tren4(1),

umsaj(14),

tren5(1),

umsvj(14),

tren6(1),

offen(14),

tren7(1),

faell(14),

tren8(1),

land1(3),

tren9(1),

wechs(14),

trena(1),

isocd(5),

END OF itab_formate_def.

Is there a way to insert a delimiter dynamically?

2.) Can 'GUI_DOWNLOAD' be used in a background task? Existing files can be overwritten without request.

Many thanks for your help.

Kind regards.

Andreas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

1) you can concatenate your fields into a string separated by comma.

2) no, GUI = Graphical User Interface.. In background, there is no GUI

2 REPLIES 2

Former Member
0 Kudos

1) you can concatenate your fields into a string separated by comma.

2) no, GUI = Graphical User Interface.. In background, there is no GUI

Former Member
0 Kudos

Hello Andreas,

In addition to Robert's solution 1, you have to use the additional clause RESPECTING BLANKS. Otherwise you lose all spaces and your defined structure is completely destroyed.

DATA: v_STRING TYPE STRING. 
CONCATENATE bukrs kunnr madat ...... into v_string separated by ',' RESPECTING BLANKS

.

Have success,

Heinz