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

Dumping files to Applicaton Server.

Former Member
0 Likes
591

Hi All,

I have to extract data from SAP and to dump them in Application Server.The dumped files then will be extracted by middleware.

Can someone tell me what is the convenient way to dumping data in Application server.

Thx. in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
526

Hi Subrato,

You have the OPEN DATASET, TRANSFER, and CLOSE DATASET commands for this.

Normally, you would build up an internal table with the exact structure of your file, and then loop through it, TRANSFERing each record to the file.

Hope that helps.

Brad

4 REPLIES 4
Read only

andreas_mann3
Active Contributor
0 Likes
526

*

Read only

Former Member
0 Likes
527

Hi Subrato,

You have the OPEN DATASET, TRANSFER, and CLOSE DATASET commands for this.

Normally, you would build up an internal table with the exact structure of your file, and then loop through it, TRANSFERing each record to the file.

Hope that helps.

Brad

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
526

Hi Subrato

Just as an example to Brad's recommendation.

DATA gv_dsn(30) TYPE c .

gv_dsn = '/usr/test.txt',
OPEN DATASET gv_dsn FOR OUTPUT .
LOOP AT gt_data . 
 TRANSFER gt_data TO gv_dsn .
ENDLOOP .
CLOSE DATASET gv_dsn .

You can use this to upload a file from frontend:


DATA gt_data TYPE TABLE OF text1000 WITH HEADER LINE .
DATA gv_dsn(30) TYPE c .

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename = p_fname "Path for the frontend file" 
    filetype = 'BIN'
  TABLES
    data_tab = gt_data
  EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    OTHERS = 6 .


gv_dsn = '/usr/test.doc',
OPEN DATASET gv_dsn FOR OUTPUT .
LOOP AT gt_data .
  TRANSFER gt_data TO gv_dsn .
ENDLOOP .
CLOSE DATASET gv_dsn .

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Read only

0 Likes
526

Hi Brad and Serdar,

Thx for your kind advice.

Regards.

SK.