‎2014 Aug 25 12:17 PM
Hi Experts,
I want show the F4 help on the presentation server.
If the file is selected REquirement is that , on clicking the F4, the dialog box should open.
If we choose the file , then file should be selected , but if we select the folder then folder should be selected.
Normal function modules or methods present in SAP opens the folder containt in the folder.
Kindly provide anyFM name or class method name o achieve the functiknality .
Thanks in advance.
‎2014 Aug 25 12:22 PM
HI,
Please paste this code,You will get F4 help.
DATA: lt_filetable TYPE filetable,
lwa_filetable TYPE file_table,
l_rc TYPE i.
REFRESH lt_filetable[].
CLEAR:lwa_filetable.
* Open file
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_filetable
rc = l_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
READ TABLE lt_filetable INTO lwa_filetable INDEX 1.
IF sy-subrc = 0.
p_sap1 = lwa_filetable-filename.
ENDIF.
ENDIF.
‎2014 Aug 25 12:45 PM
Thanks Shakeer,
But this is not the requirement
This functionality goes upto the file level of the folder.My requirement is that , If i want to choose the folder , then that folder should be selected, but if want to choose file , then file should be selected.
I want both the functionality in the at the same time .
Regards,
Vaibhav
‎2014 Aug 25 1:39 PM
PARAMETERS:pa TYPE localfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = ' '
filemask = ' '
IMPORTING
serverfile = pa
EXCEPTIONS
canceled_by_user = 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.
else.
concatenate pa '/' into pa.
ENDIF.