Application Development 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: 

how can we put F4 help for a given filepath

Former Member
0 Kudos

hi all,

my requirement is if i select one check box and give the file path using GUI_DOWNLOAD F.M. file should be download to specific file. to achieve this i declared like this.

parameters: p_chk1 as checkbox,

p_file like rlgrap-filename.

can anybody help me how to write logic for this using F4_help F.M..

in output screen checkbox and filepath is dispalying but when i check that checkbox and i hv to give filepath in that file parameter using f4 help.

reply me ASAP.

thanks in advance

swathi.

6 REPLIES 6

Former Member
0 Kudos

Hi,

Just use FM F4_FILENAME.

AT SELECTION_SCREEN ON VALUE REQUEST FOR p_file.

..here use F4_filename.

Regards,

Atish

former_member387317
Active Contributor
0 Kudos

if you want to develope the File browser for F4 help then use below code...

PARAMETERS: dataset(132) LOWER CASE OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR dataset.

PERFORM call_filedialog CHANGING dataset.

FORM call_filedialog CHANGING fname.

DATA: li_filetable TYPE STANDARD TABLE OF file_table,

lv_return TYPE i,

lw_filetable TYPE file_table.

CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'

TABLES

file_table = li_filetable

EXCEPTIONS

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

ENDIF.

READ TABLE li_filetable INDEX 1 INTO lw_filetable.

fname = lw_filetable-filename.

ENDFORM.

or else use F4_FILENAME Function module to solve ur prob..

Thanks & Regards

ilesh 24x7

former_member195698
Active Contributor
0 Kudos

Hi Swati,

You can try the FM KD_GET_FILENAME_ON_F4 also.

Reward if useful

Regards,

Abhishek

Former Member
0 Kudos

Hi

Do like this it will work

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

Reward if useful

Anji

harimanjesh_an
Active Participant
0 Kudos

hi swathi,

For these use '<b>F4_FILENAME</b>' Function Module .

check this code.

PARAMETERS: p_file LIKE rlgrap-filename. "File Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME' "F4 help for file browsing

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = ' '

IMPORTING

file_name = p_file

.

Reward me if useful...........

Harimanjesh AN

Former Member
0 Kudos

Hi , swathi.

I read your question, and this is my answer.

REPORT ztest

MESSAGE-ID Zxxxxx.

*SELECTION-SCREEN DEFINITION

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: P_CHK1 AS CHECKBOX DEFAULT 'X',

P_FILE LIKE RLGRAP-FILENAME.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN.

IF P_CHK1 = 'X' AND P_FILE IS INITIAL.

  • MESSAGE Exxx WITH 'xxxx'.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

mask = ',.,.'

static = 'X'

CHANGING

file_name = P_FILE.

IF SY-SUBRC <> 0.

  • HANDLE ERROR

ENDIF.

Regards,

feng.