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

f4 help

Former Member
0 Likes
865

experts,

i have to upload the data to a file on the application server.

i have passed the total path of the file name in the transfer line........ statement.

can we have any option to dynamically select the application server files or directory's.

thanks and regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
846

Check the sample code..

REPORT  ZTEST_SDN.

PARAMETERS: P_S1(10) TYPE C MODIF ID S1.
PARAMETERS: P_S2(10) TYPE C MODIF ID S2.

parameter: p_date type sy-datum.
data: i_mara like mara occurs 0 .
data: fs_mara like mara.
parameters:
 p_file type dxfields-longpath.

 at selection-screen on value-request for  p_file.
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.

IF sy-subrc EQ 0.
p_file = file_path.
ENDIF.

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
846

hi,

u can use CG3Y and CG3Z transactions to upload and download data from application server.

Read only

Former Member
0 Likes
846

use the tcode CG3Y for the file path for the appication server

Read only

Former Member
0 Likes
845

Yes we can give the filepath dynamically.

You can use the function module

F4_DXFILENAME_TOPRECURSION

Read only

Former Member
0 Likes
847

Check the sample code..

REPORT  ZTEST_SDN.

PARAMETERS: P_S1(10) TYPE C MODIF ID S1.
PARAMETERS: P_S2(10) TYPE C MODIF ID S2.

parameter: p_date type sy-datum.
data: i_mara like mara occurs 0 .
data: fs_mara like mara.
parameters:
 p_file type dxfields-longpath.

 at selection-screen on value-request for  p_file.
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.

IF sy-subrc EQ 0.
p_file = file_path.
ENDIF.

Read only

Former Member
0 Likes
845

Use the Function module '/SAPDMC/LSM_F4_SERVER_FILE'

Regards,

Rajasekhar Reddy.

Read only

Former Member
0 Likes
845

hiiii

use following FM

CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
    EXPORTING
      object_type                     = 'PROG'
     object_name                     = wa_prog
*   ENCLOSING_OBJECT                = ENCLOSING_OBJECT
*   SUPPRESS_SELECTION              = 'X'
*   VARIANT                         = ' '
*   LIST_VARIANT                    = ' '
*   DISPLAY_FIELD                   = DISPLAY_FIELD
*   MULTIPLE_SELECTION              = MULTIPLE_SELECTION
*   SELECT_ALL_FIELDS               = ' '
*   WITHOUT_PERSONAL_LIST           = ' '
*   PACKAGE                         = ' '
*   USE_ALV_GRID                    = ' '
   IMPORTING
     object_name_selected            = wa_prog
*   ENCLOSING_OBJECT_SELECTED       = ENCLOSING_OBJECT_SELECTED
*   STRUCINF                        = STRUCINF
* TABLES
*   OBJECTS_SELECTED                = OBJECTS_SELECTED
*   RECORD_TAB                      = RECORD_TAB
* EXCEPTIONS
*   CANCEL                          = 1
*   WRONG_TYPE                      = 2

.

regards

twinkal