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

Open dataset -. doesn't work

Former Member
0 Likes
1,452

Hi experts,

I have:

OPEN DATASET path FOR OUTPUT

IN TEXT MODE ENCODING DEFAULT .

IF sy-subrc <> 0.

MESSAGE e415(oa) WITH path space.

ENDIF.

LOOP AT itab2.

TRANSFER itab2 TO path.

ENDLOOP.

CLOSE DATASET path.

where path :

PARAMETER : path LIKE sapb-sappfad DEFAULT 'C:\Transport.txt'.

the problem is that the file is not being generated. Any idea? thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,147

Yot cannot create files on your PC if your report is running in background.

When a program is running in background it is not connected to presentation server.

You can create application server files only in background

6 REPLIES 6
Read only

Former Member
0 Likes
1,147

Hi Marc,

do you get any error message after starting the report? Also check if you have the permission on the application server to create a file "C:\Transport.txt" -- note that it's not created on your client.

Kind regards, Matthias

Read only

0 Likes
1,147

I want to save the file in my PC.

I used GUI_DOWNLOAD but it doesnt work if i execute in the background, but the file is created in my PC.

I have permisions.

Read only

Former Member
0 Likes
1,148

Yot cannot create files on your PC if your report is running in background.

When a program is running in background it is not connected to presentation server.

You can create application server files only in background

Read only

Former Member
0 Likes
1,147

Hi,

Check the below link provided.....it will help you.

Read only

matt
Active Contributor
0 Likes
1,147
OPEN DATASET path FOR OUTPUT
PARAMETER : path LIKE sapb-sappfad DEFAULT 'C:\Transport.txt'.

This will attempt to open the file transport.txt on the APPLICATION server, not your PC, which is the PRESENTATION server.

If your app server is running unix, then the path isn't even valid.

So, create your dataset on a valid path for your app server, then use FTP, or NFS or such like to get the file onto your PC.

matt

Read only

Clemenss
Active Contributor
0 Likes
1,147

Hi Marc,

DATASETS are files accessed by the application server of your SAP system. This is not your desktop. The desktop (also konown as client) can be accessed from SAP only by means of SAPGUI.

A path like 'C:\' will exist on your desktop. The SAP server may have a path 'C:\' only if SAP is running on WINDOWS server. And then your user must be autorized to use path 'C:\'.

You'd rather use function 'GUI_DOWLOAD' for you purposes.

search here for 'GUI_DOWLOAD' and find ample solutions for use.

Regards,

Clemens