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

create Directory via ABAP on Application Server

0 Likes
5,656

Hej folks,

does anybody know how to create a directory on the ApplServer via ABAP?

Thanks in advance!

boris

Hej folks,

does anybody know how to create a directory on the ApplServer via ABAP?

Thanks in advance!

boris

8 REPLIES 8
Read only

Former Member
0 Likes
2,421

OPEN DATASET DS1 FOR OUTPUT.

if datset is no there ii will create file with the path

you have mentioned in DS1.

If you have any file on presentation server just use CG3Y transaction and upload the data to application server,check that in AL11 transaction.

Regards,

Santosh

Read only

Former Member
2,421

check this link.

regds,

kiran

Read only

Former Member
2,421

Hi Boris,

i don't know the real UNIS-Command (MK??).

here an example for command LS:

DATA: BEGIN OF ITAB_LS OCCURS 0,

LINE(200),

END OF ITAB_LS.

*

CONSTANTS: CMD_LS(50) VALUE 'ls -al /tmp'.

*

CALL 'SYSTEM'

ID 'COMMAND' FIELD CMD_LS

ID 'TAB' FIELD ITAB_LS-SYS.

*

Hope it helps.

regards, Dieter

Read only

Former Member
0 Likes
2,421

Hi Got to AL11 transaction and click the configure button.

THen follow the GUI there to create the required directories.

THis will help u.

Read only

RaymondGiuseppi
Active Contributor
2,421

You have to use system command. So the answer depend on your Application Server system : Oracle, Windows, iSeries, etc.

Ex:

CALL 'SYSTEM' ID 'COMMAND'

FIELD CMD

So, take a look at transaction code SM49.

Regards

Read only

0 Likes
2,421

Also take a look at those FM

• SXPG_CALL_SYSTEM

• SXPG_COMMAND_EXECUTE

• SXPG_COMMAND_CHECK

• SXPG_COMMAND_LIST_GET

• SXPG_COMMAND_DEFINITION_GET

• SXPG_DUMMY_COMMAND_CHECK

Read only

Pyc
Participant
2,421

You can create an external command via SM69 which you can then invoke through function module SXPG_COMMAND_EXECUTE

For NT you'd need something like the following:

Operating system command

cmd

Parameters for operating system command

/c mkdir
$/SAPGLOBALHOST/\?

Have fun,

Mark

Kudos to Pete Devereux and Pete White

Read only

Former Member
0 Likes
2,421

here is the sample code for creating the directory .

parameters: p_path like rlgrap-filename.

at selection-screen on value-request for p_path.

    CALL METHOD cl_gui_frontend_services=>DIRECTORY_CREATE
        EXPORTING DIRECTORY = p_path .

reward points if it is usefull. ....

Girish