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
1,556

Hi Folks,

I have to provide F4 help to a selection screen parameter, so that I may get file path of application server.

Is there is any Function Module for this.

Thanks in Advance

Punit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,501

Hi

Use this Function Module and code to open application server file

PARAMETERS : app_fp TYPE localfile.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR app_fp.

  • Open Dialog Box for Application Server files

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

IMPORTING

serverfile = app_fp

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • Check error

ENDIF.

Mark helpfull.

Regards

Manoj B Gupta

11 REPLIES 11
Read only

Former Member
0 Likes
1,501

hi punit,

check this fm..

F4IF_FIELD_VALUE_REQUEST

(or)

check this program..

PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/EC5'.

data: begin of it_filedir occurs 10.

include structure salfldir.

data: end of it_filedir.

START-OF-SELECTION.

  • Get Current Directory Listing for OUT Dir

call function 'RZL_READ_DIR_LOCAL'

exporting

name = p_fdir

tables

file_tbl = it_filedir.

  • List of files are contained within table it_filedir

loop at it_filedir.

write: / it_filedir-NAME.

endloop.

<b>reward if useful...</b>

Read only

Former Member
0 Likes
1,501

Punit,

Take a look at this thread, you will get the info.

regards,

Ravi

note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,501

Hi Punit

you can assign F4 help to any parameter on selection-screen using

PROCESS ON HELP REQUEST FOR <field> event for that particular parameter

Thanks

Read only

Former Member
0 Likes
1,501

Hi Punit,

This question has been asked a number of times. Just check this code.

REPORT ZJAYRA_FILEPROG .

data: it_tab type filetable with header line,

gd_subrc type i.

tables: rlgrap.

parameters file_nam type rlgrap-filename .

data: user_act type i.

at selection-screen on value-request for file_nam.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

WINDOW_TITLE = 'select a file'

  • DEFAULT_EXTENSION = '*.txt

DEFAULT_FILENAME = ''

FILE_FILTER = '*.txt'

INITIAL_DIRECTORY = ''

MULTISELECTION = abap_false

  • WITH_ENCODING =

CHANGING

file_table = it_tab[]

rc = gd_subrc

USER_ACTION = user_act

  • FILE_ENCODING =

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.

ENDIF.

if user_act = '0'.

loop at it_tab.

file_nam = it_tab-filename.

endloop.

endif.

This will work.

Regards,

SP.

Read only

Former Member
0 Likes
1,501

Hi Punit,

you can use MATCHCODE OBJECT in select options.

eg.

SELECT-OPTIONS: S_MATNR FOR MARC-MATNR MATCHCODE OBJECT S_MAT1,

or,

You can use this function module

F4IF_INT_TABLE_VALUE_REQUEST

In this function module you pass internal table values.

Regards,

Suresh

Read only

Former Member
0 Likes
1,501

Hi Ashok,

I am writing a BDC. I am searching for a FM which will open a window so that user may select a file and return the path of the selected file.

The path returned by the FM will be provided to FM 'GUI_UPLOAD'.

Is this is possible with this FM 'F4IF_FIELD_VALUE_REQUEST'

Read only

0 Likes
1,501

Hi Punit,

You can try the method file_open_dialog

of the class cl_gui_frontend_services.

This will satisfy your requirement.

The path you selected will be stored in the parameter.

This can then be sent to other Function Modules.

This will work.

Regards,

SP.

Read only

0 Likes
1,501

Hi,

You can also try F4_FILENAME.

Thanks,

Rashmi.

Read only

0 Likes
1,501

Punit,

GUI_UPLOAD, I don't think it will work for app servers. Please go through the thread I have referred in my earlier posts.

More over, CL_GUI_FRONTEND_SERVICES will NOT work for app servers as well as in the background.

Please choose the right funciton.

regards,

Ravi

Read only

Former Member
0 Likes
1,501

hai punit,

F4 help to get file path of application server

function group name -


DX_FILE

Function MODULE----


F4_DXFILENAME_TOPRECURSION

Popup to select one file from the given application server directory.

hope this will be helpful.

regards,

praba.

Read only

Former Member
0 Likes
1,502

Hi

Use this Function Module and code to open application server file

PARAMETERS : app_fp TYPE localfile.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR app_fp.

  • Open Dialog Box for Application Server files

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

IMPORTING

serverfile = app_fp

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • Check error

ENDIF.

Mark helpfull.

Regards

Manoj B Gupta