10-17-2008 9:48 AM
hi guys,
I need to create a function module that will get the file or folder name by f4 help for the file in the presentation server or application server based on the location selected.
For this function module what are the minimum impot parametrs and export parameters required.
i have tried with 'f4_filename' for presentation server
and '/SAPDMC/LSM_F4_SERVER_FILE' for application server.
but i am not able to get this.
can any one help me in this regard ?
cheers,
kumar.
10-17-2008 9:55 AM
Hi,
Try this out:
call function 'F4_FILENAME'
exporting
field_name = 'P_FILE'
importing
file_name = p_file.
p_file is the name of the parameter on selection screen.
The same name is given in field_name parameter of 'F4_FILENAME'.
10-17-2008 9:59 AM
10-17-2008 10:03 AM
Hi,
You can use for persentation server..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
PERFORM GET_PC_FILE.
form get_pc_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FNAME.
endform.
Rgds,
Paras
10-17-2008 10:13 AM
10-17-2008 10:18 AM
>
> use full answers will get awarded properly.
>
> kumar.
All useless posts will be reported appropriately
pk
10-17-2008 10:27 AM
hey pk .
try to concentrate on giving the answer not on the useless comments. ok.
10-17-2008 10:42 AM
Hi Kumar
For example you have created a function module Z_F4 . Put only Export parameter as
"FILE_NAME TYPE IBIPPARMS-PATH" under EXPORT tab.
Then the code inside the function module will be like
FUNCTION Z_F4.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" REFERENCE(FILE_NAME) TYPE IBIPPARMS-PATH
*"----------------------------------------------------------------------
CALL FUNCTION 'F4_FILENAME'
* EXPORTING
* PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = FILE_NAME
.
MESSAGE FILE_NAME TYPE 'I'.
ENDFUNCTION.
And the code in the report pgm will be
DATA FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'Z_F4'
IMPORTING
FILE_NAME = FILE
.
WRITE FILE.
Regards
10-17-2008 10:06 AM
hi use like this ..
if p_presvr = 'X'.
*-- if the file is to be downloaded to presentation server
call function '/SAPDMC/LSM_F4_FRONTEND_FILE'
changing
pathfile = p_file
exceptions
canceled_by_user = 1
system_error = 2
others = 3.
if sy-subrc <> 0.
if sy-batch = 'X'.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 into v_msg.
write / v_msg.
clear v_msg.
stop.
else.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
else.
*-- if the file is to be downloaded to application server
call function '/SAPDMC/LSM_F4_SERVER_FILE'
exporting
directory = '/'
filemask = '*'
importing
serverfile = p_file
exceptions
canceled_by_user = 1
others = 2.
if sy-subrc <> 0.
if sy-batch = 'X'.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 into v_msg.
write / v_msg.
clear v_msg.
stop.
else.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
endif.
10-17-2008 10:06 AM
Hi,
You can use the function Module "F4_DXFILENAME_TOPRECURSION"
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A' " application server
I_SERVER = ' ' " server name
I_PATH =
FILEMASK = '.'
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
O_PATH = W_PATH
" Path name ex: W_PATH TYPE DXFIELDS-LONGPATH.
ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
do it like this , definetly your problem will be solved.
Regards,
Chiru.
10-17-2008 10:08 AM
Hi,
use this.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = w_directory
mask = ',*.CSV,*.*.'
mode = 'O'
title = text-m01
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
Thanks & Regards,
Krishna..
11-26-2008 5:28 AM
Thanks to all for the support.
solved myself.
Thanks & Regards,
kumar.