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: 

File creation on server

Former Member
0 Kudos
112

Hi all,

Using the "OPEN DATASET", I am trying to create a file in a directory having spaces embedded in the name, e.g.
INTRANET.BARCAPINT.COM\DFS-EMEA\GROUP\GLB\FMCSGLB\WEALTH MANAGEMENT\WM REGION\SHARED\MANAGEMENT\SAP HR TEST\FSTEST.TXT where there is space between "Wealth" and "Management".

The problem I have is that only part of the directory up to "WEALTH" gets picked up(
INTRANET.BARCAPINT.COM\DFS-EMEA\GROUP\GLB\FMCSGLB\WEALTH) and the rest gets discarded. I want to use the full directory name, which in this case has spaces in between, to create files in.

How can I do this? Any ideas?

Regards,

Shabbar

4 REPLIES 4

Former Member
0 Kudos
60

Hi Ali,

Please do check again, if the directory avaliable in the server is with same name (WEALTH MANAGEMENT) as you have mentioned in the post..

Thanks and Regards,

Ram.

Former Member
0 Kudos
60

hi syntax is

reward if useful

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

*--- Display error messages if any.

IF sy-subrc NE 0.

MESSAGE e001(zsd_mes).

EXIT.

ELSE.

*---Data is downloaded to the application server file path

LOOP AT it_tab2 INTO wa_tab2.

TRANSFER wa_tab2 TO p_file.

ENDLOOP.

ENDIF.

*--Close the Application server file (Mandatory).

CLOSE DATASET p_file.

Pawan_Kesari
Active Contributor
0 Kudos
60

Is your variable (directory_name) used in statement

OPEN DATASET directory_name

is long enough to hold the path.

Try creating logical path from FILE transaction if path is too long to specify in

OPEN DATASET

statement

Former Member
0 Kudos
60

If you are running on a UNIX / LINUX based server, spaces are simply not permitted in file / dir names.

Spaces are a Windows / Mac "thing."

You will need to replace the blanks with underscores or something simliar if your OS does not permit spaces... and that appears to be the case here.