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 file to presentation server with header

Former Member
0 Kudos

Hello,

I have a scenario where i have download the file into presentation server with field header like' purchase order number' and so on in the header level and then next below item should be po number.. is there any function module can you for this or how to aceive this scenario as well please your input for same format put in the application server?

thanks,

john.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

HI John,

This is one method of doing it.

Populate the descriptions of the header in an internal table of the same structure as the data internal table.

Download that internal table using GUI_DOWNLOAD functionmodule.

Then download the actual data to the same file, but in APPEND mode.(Pass APPEND = 'X' in the FM parameters).

Regards,

Ravi Kanth

0 Kudos

hello friends,

this soluction is not help me out please help me to give some different soluction..

my question is that store CVS format into the application server with header label.

how can i aceive this one..

thanks,

john.

0 Kudos

Hi..

For Application Server this is the code:

DATA : BEGIN OF IT_HEADER OCCURS 0,

EBELN TYPE EKKO-EBELN,

LIFNR TYPE EKKO-LIFNR,

END OF IT_HEADER.

DATA : BEGIN OF IT_ITEM OCCURS 0,

EBELN TYPE EKKO-EBELN,

MATNR TYPE EKKO-MATNR,

END OF IT_ITEM.

PARAMETERS : P_DSN(40) . "file name

data : v_rec(120) .

START-OF-SELECTION.

SELECT ebeln lifnr FROM EKKO INTO TABLE IT_HEADER.

IF IT_HEADER[] IS NOT INITIAL.

SELECT ebeln matnr FROM EKPO INTO TABLE IT_ITEM FOR ALL ENTRIES IN IT_HEADER WHERE EBELN = IT_HEADER-EBELN.

ENDIF.

OPEN DATASET P_DSN

FOR OUTPUT

IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC NE 0.

Message 'File not opened' type 'E'.

ENDIF.

LOOP AT IT_HEADER .

CONCATENEATE IT_HEADER-EBELN IT_HEADER-LIFNR

INTO V_REC SEPERATED BY ';'.

TRANSFER V_REC TO P_DSN.

LOOP AT IT_ITEM WHERE EBELN = IT_HEADER-EBELN.

CONCATENEATE IT_ITEM-EBELN IT_ITEM-MATNR

INTO V_REC SEPERATED BY ';'.

TRANSFER V_REC TO P_DSN.

ENDLOOP.

ENDLOOP.

CLOSE DATASET P_DSN.

<b>Reward points if helpful</b>

uwe_schieferstein
Active Contributor
0 Kudos

Hello John

Perhaps the function module <b>SAP_CONVERT_TO_CSV_FORMAT</b> may be helpful.

In addition, have a look at my sample report <b>ZUS_SDN_CSV_FILE_DOWNLOAD</b> in thread:

Regards

Uwe