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

Please Help...

Former Member
0 Likes
845

Hi All,

Is there any function module in ABAP to convert the Directory Parameter name in the TCODE AL11 into the corresponding path? If not how can we convert that dir parameter name to corresponding path?

Thanks in advance,

Points will be rewarded for sure...

Regards,

Bijesh

1 ACCEPTED SOLUTION
Read only

Pawan_Kesari
Active Contributor
0 Likes
765

use syntax

 CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_BINARY'
                    ID 'VALUE' FIELD path.

Just change the value 'DIR_BINARY' for different path and you will get unix parth in variable 'path'

7 REPLIES 7
Read only

Former Member
0 Likes
765

Hi,

can you explan it a little bit more?

Perhaps concatenate helps?

Regards, Dieter

Read only

Former Member
0 Likes
765

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

client = sy-mandt

logical_filename = p_filout

operating_system = sy-opsys

IMPORTING

file_name = w_phy_fname

EXCEPTIONS

file_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

In the obove example I use the function module 'FILE_GET_NAME'

It gives the file path.

INPUT-

logical_filename.

OUTPUT-

Physical_filename.

Note: If you want logical path and physical file name.

We can get by using the following function module.

‘FILE_GET_NAME_USING_PATH’.

INPUT-

Logical path & Physical file name.

OUTPUT-

Physical path & Physical file name.

Regards,

Vishal

Read only

0 Likes
765

Hi Vishal,

I think you have given me the right solution. But am not able to test it.

I went to the AL11 screen and took one logical file name. and passed the same to the function. But i am getting the File Not Found Error (SY-SUBRC - 1).

Can you plz tell me why it could be?

Read only

Former Member
0 Likes
765

do you mean something like

CONCATENATE 'tmp'

sy-sysid

'data'

into filename

separated by '\'.

Read only

Pawan_Kesari
Active Contributor
0 Likes
766

use syntax

 CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_BINARY'
                    ID 'VALUE' FIELD path.

Just change the value 'DIR_BINARY' for different path and you will get unix parth in variable 'path'

Read only

0 Likes
765

Thank You Pawan,

That solved it. But is this

'C_SAPGPARAM'

a program? I am not able to see it using the SE38 txn!

If you can, could you plz tell me what is it exactly?

Read only

0 Likes
765

'C_SAPGPARAM' is system function. Normally external programs written in C