‎2007 Jul 27 12:23 PM
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
‎2007 Jul 27 1:12 PM
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'
‎2007 Jul 27 12:31 PM
Hi,
can you explan it a little bit more?
Perhaps concatenate helps?
Regards, Dieter
‎2007 Jul 27 12:41 PM
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
‎2007 Jul 27 12:55 PM
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?
‎2007 Jul 27 12:41 PM
do you mean something like
CONCATENATE 'tmp'
sy-sysid
'data'
into filename
separated by '\'.
‎2007 Jul 27 1:12 PM
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'
‎2007 Jul 27 1:19 PM
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?
‎2007 Jul 27 1:22 PM
'C_SAPGPARAM' is system function. Normally external programs written in C