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
668

Hi All,

My requirement is define one parameter to select the file name from presentation server

For this filed I have to provide the f4 help

Can any body pls suggest me which type of filed can I declare in selection screen

Ex : p_fnam like rlgrap-filename or any other

Because In Gui_upload it is giving dump

Reason is type mismatch of the file types

Thanks in advance

Jaya.G

7 REPLIES 7
Read only

former_member386202
Active Contributor
0 Likes
646

Hi,

Refer below code

SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS : p_pifile TYPE rlgrap-filename MODIF ID md1, "Input filename for presentation server

p_pefile TYPE rlgrap-filename MODIF ID md2. "Error filename for presentation server

SELECTION-SCREEN : END OF BLOCK b2.

*--Call function module for F4 help to input filename on presentatrion server

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

  • FIELD_NAME = ' '

IMPORTING

file_name = p_pifile.

Regards,

PRashant

Read only

Former Member
0 Likes
646

Hi,

Selection screen, declare the fields as

PARAMETERS p_file TYPE rlgrap-filename

in the AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file event, write the below code.

REFRESH i_file.

ws_c_defpath = 'c:\'.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

initial_directory = ws_c_defpath

CHANGING

file_table = i_file

rc = ws_i_rc.

IF sy-subrc = 0.

IF ws_i_rc = 1.

READ TABLE i_file INTO wa_file INDEX 1.

IF sy-subrc = 0.

p_file = wa_file-filename.

ENDIF.

ENDIF.

ELSE.

MESSAGE e005.

ENDIF.

Reward if useful.

Thanks,

Muthu

Read only

former_member156446
Active Contributor
0 Likes
646

parameter: pa_pex1 TYPE rlgrap-filename

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_pex1.
PERFORM fr_f4_file USING pa_pex1.


*---------------------------------------------------------------------*
FORM fr_f4_file USING p_pcfile .

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',*.txt,*.txt'
static = 'X'
CHANGING
file_name = p_pcfile.

ENDFORM. " fr_f4_file
*&---------------------------------------------------------------------*

Read only

Former Member
0 Likes
646

hi,

define the parameters as ibipparms-path.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_file TYPE ibipparms-path.

SELECTION-SCREEN END OF BLOCK b1.

thnks,

raji

Read only

Former Member
0 Likes
646

Hi jaya,

1. The declaration for parameter is perfectly OK.

2. But, for passing to gui_upload we have to pass as string.

3. so declare another variable and pass like this.

data : myfile type string.

myfile = p_fnam.

Now pass this myfile to gui_upload.

regards,

amit m.

Read only

Former Member
0 Likes
646

Hi,

Try using the below code.

PARAMETER:

path TYPE ibipparms-path OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.

CALL FUNCTION 'WS_FILENAME_GET'

  • EXPORTING

  • DEF_FILENAME = ' '

  • DEF_PATH = ' '

  • MASK = ' '

  • MODE = ' '

  • TITLE = ' '

IMPORTING

filename = path

  • RC =

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 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.

ENDIF.

Regards,

Aravind JM.

Read only

Former Member
0 Likes
646

hi,

try this

just before passing the file to GUI_UPLOAD.

PASS the file to a variable file_str of type string.

because gui_upload will accept string format only. try it . it wil work.

feel free to ask doubts

reward points if helpfil

regards

mano