2008 Aug 29 6:23 AM
Hi Experts,
I want to Download a file from Application Server to Internal Table.
In selection screen i have provided 2 radiobuttons. One for Presentation server and other for Application server. When i click on F4 for Presentation server it was working fine, But when i do the same for Application server it was not showing any F4 help for that.
So can any one help me how to solve this problem.
Thanks & Regards,
Ramana
2008 Aug 29 6:27 AM
Hi,
We dont need to use any radio buttons.
Use the FM F4_DXFILENAME_TOPRECURSION.
In this Fm, there is a parameter O_FLAG_LOCATIOn.
If this Paramter's Value is ' P' then the File is taken from Presentation server else taken from Application server.
O_PATH gives the Path of the file. This internally provides the F4 functionality.
Example Code :
parameters:
p_file type dxfields-longpath obligatory.
data:
w_server type dxfields-location, " Server Location
at selection-screen on value-request for p_file.
call function 'F4_DXFILENAME_TOPRECURSION'
importing
o_path = p_file
o_location_flag = w_server
exceptions
rfc_error = 1
error_with_gui = 2.
if sy-subrc ne 0.
message text-002 type 'E'.
endif.
Regards
Lekha
Hi Experts,
I want to Download a file from Application Server to Internal Table.
In selection screen i have provided 2 radiobuttons. One for Presentation server and other for Application server. When i click on F4 for Presentation server it was working fine, But when i do the same for Application server it was not showing any F4 help for that.
So can any one help me how to solve this problem.
Thanks & Regards,
Ramana
2008 Aug 29 6:27 AM
Hi,
We dont need to use any radio buttons.
Use the FM F4_DXFILENAME_TOPRECURSION.
In this Fm, there is a parameter O_FLAG_LOCATIOn.
If this Paramter's Value is ' P' then the File is taken from Presentation server else taken from Application server.
O_PATH gives the Path of the file. This internally provides the F4 functionality.
Example Code :
parameters:
p_file type dxfields-longpath obligatory.
data:
w_server type dxfields-location, " Server Location
at selection-screen on value-request for p_file.
call function 'F4_DXFILENAME_TOPRECURSION'
importing
o_path = p_file
o_location_flag = w_server
exceptions
rfc_error = 1
error_with_gui = 2.
if sy-subrc ne 0.
message text-002 type 'E'.
endif.
Regards
Lekha
2008 Aug 29 6:29 AM
hi Ramana
use FM
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.
MESSAGE 'Successful' type 'I'.
ENDIF.
Regards
Deva
2008 Aug 29 6:30 AM
2008 Aug 29 6:37 AM
Check this example. when you have multiple options and Radiobutton values will not be updated at the event on value request . just follow the sample code.
REPORT ztest_see.
DATA: BEGIN OF lt_dynpfields OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF lt_dynpfields.
DATA : i_mdate TYPE sy-datum.
DATA: w_filename TYPE string.
SELECT-OPTIONS: s_date FOR i_mdate.
PARAMETERS: p_file TYPE filename-fileintern,
p_lofile LIKE filename-fileintern.
PARAMETERS: p_rad1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND aaa,
p_rad2 RADIOBUTTON GROUP g1 .
AT SELECTION-SCREEN .
SELECT SINGLE fldate
INTO i_mdate
FROM sflight
WHERE carrid LIKE 'A%' AND
fldate IN s_date.
IF sy-subrc NE 0.
MESSAGE ' Enter the date in the format YYYY/MM/DD' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
MOVE 'P_RAD1' TO lt_dynpfields-fieldname.
APPEND lt_dynpfields.
MOVE 'P_RAD2' TO lt_dynpfields-fieldname.
APPEND lt_dynpfields.
MOVE 'P_FILE' TO lt_dynpfields-fieldname.
APPEND lt_dynpfields.
MOVE 'P_LOFILE' TO lt_dynpfields-fieldname.
APPEND lt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10.
LOOP AT lt_dynpfields.
CASE lt_dynpfields-fieldname.
WHEN 'P_RAD1'.
p_rad1 = lt_dynpfields-fieldvalue.
WHEN 'P_RAD2'.
p_rad2 = lt_dynpfields-fieldvalue.
WHEN 'P_FILE'.
p_file = lt_dynpfields-fieldvalue.
WHEN 'P_LOFILE'.
p_file = lt_dynpfields-fieldvalue.
ENDCASE.
ENDLOOP.
IF p_rad1 EQ 'X'.
PERFORM get_local_file USING p_file.
ELSEIF p_rad2 EQ 'X'.
PERFORM get_appl_file USING p_lofile.
ENDIF.
*&---------------------------------------------------------------------*
*& Form get_local_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_P_FILE text
*----------------------------------------------------------------------*
FORM get_local_file USING p_p_file.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
client = sy-mandt
logical_filename = p_file
IMPORTING
file_name = w_filename
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
ENDFORM. " get_local_file
*&---------------------------------------------------------------------*
*& Form get_appl_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_P_LOFILE text
*----------------------------------------------------------------------*
FORM get_appl_file USING p_p_lofile.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
client = sy-mandt
logical_filename = p_lofile
IMPORTING
file_name = w_filename
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
ENDFORM. " get_appl_file
2008 Aug 29 6:38 AM
HI ,
Hi ur problem using f4 help for the application server input path
Use the function module '/SAPDMC/LSM_F4_SERVER_FILE' for F4 help for
Application server files. you need to write this in the
AT SELECTION_SCREEN on FIELD REQUEST.
Thanks.
Ashok
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |