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,477

Hi,

I have one push button in my selection screen. My requirement is like that if I press push button then

one popup(Small screen) should display asking file name & I need to set F4 help in that file name.

Anybody will pls give me suggestion what I need to do for this case??

9 REPLIES 9
Read only

Former Member
0 Likes
1,034

Hi Neha,

/SAPDMC/LSM_F4_FRONTEND_FILE is the FM to get F4 help on presentation server files.

Check this link to place a button on application tool bar

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba80935c111d1829f0000e829fbfe/content.htm

Thanks,

Vinay

Read only

Former Member
0 Likes
1,034

Create a search help for PERNR using PA0002 infotype and attach to that screen field PERNR

see this and do accordingly

See the following ex:

TYPES: BEGIN OF TY_MBLNR,

MBLNR LIKE MKPF-MBLNR,

END OF TY_MBLNR.

DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.

data: it_ret like ddshretval occurs 0 with header line.

At selection-screen on value-request for s_mat-low.

Select MBLNR from mkpf into table it_mblnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MBLNR

  • FIELD_TAB =

RETURN_TAB = IT_RET

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

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 SY-SUBRC = 0.

read table it_ret index 1.

move it_ret-fieldval to S_mat-low.

ENDIF.

Go through the test program.

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Reward points for useful Answers

Providing Input Help (F4 Help)

Use

Users of an SAP System can use the F4 key to obtain information about the possible input values for a certain field on the screen.

Information about the possible values for a field should also be available to those users who are working with the data in the SAP System from an external program, via BAPI calls. For example, the user of a Visual Basic program, which incorporates a BAPI to display or modify data in an SAP System, should have transparent access to the functions of the F4 input help.

Features

In order to provide input help, a calling program can use the BAPI HelpValues.GetList(). This method is based on the RFC-enabled function module BAPI_HELPVALUES_GET, which obtains the possible input values for a field that is passed in a BAPI call. For detailed information about the structure and use of the HelpValues.GetList() BAPI, see the documentation on the function module BAPI_HELPVALUES_GET, which implements the Helpvalues.GetList method.

To determine the possible input values for a field in the check table, the BAPI HelpValues.GetList() uses the elementary search help or the domain fixed values linked to the field in the ABAP Dictionary.

For this reason, you have to create or specify relevant check tables, elementary search helps (matchcodes) or domain fixed values. Only then can the calling program access the relevant input values for your BAPI fields using the BAPI HelpValues.GetList().

As of Release 4.5A, you have to specify a foreign key, if a check table has been defined in the domain. Otherwise F4 input help cannot be displayed.

Authorization Check

In some cases you will only want to allow only those persons with a specific user profile to access information in F4 input help. To do this you can carry out authorization checks within the BAPI using table BAPIF4T.

Table BAPIF4T is provided for this purpose. This table comprises the following fields, which you have to fill with the values for your BAPI.

OBJTYPE (object type)

The technical name of the SAP business object type, for example, BUS1065.

METHOD (verb)

The name of a BAPI for the business object type named above, for example, GetList.

DTEL (data element)

The name of a data element for which a possible entry is specified. For example, an elementary input help could be specified for the data element PERNR_D and be protected from unauthorized access.

FNAM (name of the function module)

The name of the function module that you have to create and that checks authorizations for the data element. This function module must have the following predefined interface:

*"----


""Local interface:

*" IMPORTING

*" VALUE(OBJTYPE) LIKE BAPIF4F-OBJTYPE

*" VALUE(METHOD) LIKE BAPIF4F-METHOD

*" VALUE(DTEL) LIKE BAPIF4F-DTEL

*" VALUE(SHLPNAME) LIKE BAPIF4F-SHLPNAME

*" VALUE(TABNAME) LIKE BAPIF4F-TABNAME

*" EXPORTING

*" VALUE(RETURN) LIKE BAPIF4F-RETURN

*"----


As the template for your function module you can use the function module BF_BAPI_F4_AUTHORITY which provides exactly this interface. Copy this function module and follow the documentation provided with it.

The additional parameter SHLPNAME contained in the function module interface provides the name of the active input help for the table or for the data element. The parameter TABNAME contains the name of the value table.

The return code of the parameter RETURN is:

'X' if the user of the BAPI is not authorized to call up the valid input values for a field.

' ' (no value), if the user of the BAPI is authorized to display the input values for a field.

During runtime the function module is called dynamically by the BAPI HelpValues.GetList().

An authorization check can be carried out at business object type, method or data element level:

To check authorizations at this level…

... ......the following fields in table BAPIF4T must be filled.

Business object type

OBJTYPE, FNAM

BAPI

OBJTYPE, METHOD, FNAM

Data Element

OBJTYPE, METHOD, DTEL, FNAM

Read only

Former Member
0 Likes
1,034

Hi,

Use the FM POPUP_TO_SEARCH_VALUE

Regards

Kannaiah

Read only

paruchuri_nagesh
Active Contributor
0 Likes
1,034

hai

use event at user coomand

and use function module ism_popup_to_select_from_list.

regards

nagesh.paruchuri

Read only

Former Member
0 Likes
1,034

hi, try this code hope it helps:

type-pools:vrm.

PARAMETER : p_int AS LISTBOX VISIBLE LENGTH 30.

DATA : name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

AT SELECTION-SCREEN OUTPUT.

name = 'P_INT'.

value-key = '1'.

value-text = 'gl file'.

APPEND value TO list.

value-key = '2'.

value-text = 'sd file'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

CLEAR list.

plz reward points

Read only

0 Likes
1,034

Hi,

I would like to repeat my requirement.

Actually I need one push button in application toolbar. If i select the push button then

one small window having field name file should appear. If I press F4 on file then it will

give the path of my desktop.

Any suggestion which FM I need to use??

Read only

0 Likes
1,034

Hi..

This is the Code for ur Requirement. Plz get back for queries.

&----


*& Report ZSELFILE1 *

*& *

&----


REPORT zselfile1 .

TABLES:sscrfields.

**Create the Additional Selection screen to input filename

SELECTION-SCREEN: BEGIN OF SCREEN 10.

PARAMETERS: p_file TYPE rlgrap-filename.

SELECTION-SCREEN: END OF SCREEN 10.

**Create Application Toolbar Button on the Standard selection Screen

SELECTION-SCREEN FUNCTION KEY 1. "Its fcode will be FC01

PARAMETERS : p_werks TYPE marc-werks.

INITIALIZATION.

sscrfields-functxt_01 = 'Enter File'. "Assign the Text to the Button

AT SELECTION-SCREEN.

CASE sscrfields-ucomm. "Check the Fcode

WHEN 'FC01'.

CALL SELECTION-SCREEN 10 STARTING AT 5 8 ENDING AT 85 20.

ENDCASE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME' "Local file browser

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = 'P_FILE'

IMPORTING

file_name = p_file.

START-OF-SELECTION.

**Write ur Further Logic

<b>Reward if Helpful</b>

Read only

0 Likes
1,034

Hi Neha,

U can use the FM

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = space

IMPORTING

file_name = gw_file.

where gw_file gives the path of the file on ur presentation server.

Regards,

Kasinath.

Read only

Former Member
0 Likes
1,034

Hi Neha,

M Assuming that u know how get the button the application bar, So when the button is clicked you can Call the below mentioned function module in the user command step.

Function Module POPUP_TO_GET_VALUE.

Usage

POPUP_TO_GET_VALUE

Exporting

FIELDNAME = 'MATNR'

TABNAME = 'MARA'

TITEL = 'Material

VALUEIN = 'Any Default Value'

Importing

ANSWER

VALUEOUT .

VALUEOUT will contain the value . ( as for the F4 on the file name, i guess you can use the standard Data types which will give you the standard F4 )

Reward Points if found helpful.

Regards

Divakar Goud