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

PROCESS ON VALUE-REQUEST question..

tony_bramhill2
Participant
0 Likes
4,041

Hi, can anyone make a suggestion:

I have an input field (on screen 200) which can be prompted with F4. When this happens the PROCESS ON VALUE-REQUEST calls a module to bring up a choice window (screen 300). Once the choice is made, a selection statement in screen 300 populates the description field on screen 200. However, while screen 200 shows the new <i>value</i> chosen, the <i>description</i> field still holds the old description. This is only refreshed when the user hits ENTER. I would like the description field to be showing the correct description immediately after the choice was made in the F4 prompt. Hope this make sense.

(I notice even standard SAP programs have this too - just hit F4 on a choice field in say VD02, the description doesn't change until the next ENTER or button click).

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,413

HAi

-When u press F4 its dispaly help window but when we select any value from that its take only that value which help is decalre. So for that write SELECT SINGLE for description after selection F4 value.Its happening with all SAP standard program .(i will try with MIGO)

**Please reward suitable points***

With Regards

Navin Khedikar

4 REPLIES 4
Read only

Former Member
0 Likes
2,414

HAi

-When u press F4 its dispaly help window but when we select any value from that its take only that value which help is decalre. So for that write SELECT SINGLE for description after selection F4 value.Its happening with all SAP standard program .(i will try with MIGO)

**Please reward suitable points***

With Regards

Navin Khedikar

Read only

Former Member
0 Likes
2,413

Hi Tony,

This is standard SAP behaviour for dynpro. The screen does not refresh until an input (enter/button), as this triggers the Processing After Input (PAI) module, followed by the Processing Before Output (PBO) where the output is then redisplayed. However, using F4 results in PAI and PBO of your screen 300, but not your initial screen (200).

Read only

p291102
Active Contributor
0 Likes
2,413

Hi,

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

Thanks,

Shankar

Read only

former_member194669
Active Contributor
0 Likes
2,413

Tony,

Afer POV control will not go to PBO until y pressed ENTER . for overcome this you need to set a dummy OKCODE. in the following way.

CALL FUNCTION “SAPGUI_SET_FUNCTIONCODE”

EXPORTING

FUNCTIONCODE = “=”

EXCEPTION

FUNCTION_NOT_SUPPORTED = 1

OTHERS = 2

Here is the sample code


PROCESS BEFORE OUTPUT. 

  MODULES l201_blanklines. 
  LOOP RK intdrad WITH CONTROL tab_x CURSOR tab_x-current_line. 
    MODULES l201_init. 
  FINAL LOOP. 

PROCESS AFTER INPUT. 

  MODULES l201_new. 
  LOOP RK intdrad.                                         
    CHAIN. 
      FIELD equi equnr. 
      MODULES l201_bear. 
    FINAL CHAIN. 
  FINAL LOOP. 
  MODULES l201_end. 

--Importantly-- 
PROCESS ON VALUE REQUEST. 
  field EQUI EQUNR of modules ZZ_DMS_MULTIPLE_EQUIS. 
--Importantly-- 

--End to screen Logic 

Modules ZZ_DMS_MULTIPLE_EQUIS 

CALL FUNCTION “F4IF_FIELD_VALUE_REQUEST” 
  EXPORTING 
    TABNAME = “EQUI” 
    FIELDNAME = “EQUNR” 
    SEARCHHELP = “EQUI” 
    SHLPPARAM = “EQUNR” 
    DYNPPROG = system-repid 
    DYNPNR = system-dynnr 
    DYNPROFIELD = “EQUI EQUNR” 
    MULTIPLE_CHOICE = “X” 
 TABLES 
   RETURN_TAB = lt_return_tab 
 EXCEPTION 
   FIELD_NOT_FOUND = 1 
   NO_HELP_FOR_FIELD = 2 
   INCONSISTENT_HELP = 3 
   NO_VALUES_FOUND = 4 
   OTHERS = 5 
          . 


CALL FUNCTION “SAPGUI_SET_FUNCTIONCODE” 
 EXPORTING 
   FUNCTIONCODE = “=” 
 EXCEPTION 
   FUNCTION_NOT_SUPPORTED = 1 
   OTHERS = 2 
          . 

... 

CALL FUNCTION “DYNP_VALUES_UPDATE” 
  EXPORTING 
    DYNAME = system-repid 
    DYNUMB = system-dynnr 
  TABLES 
    DYNPFIELDS = lt_dynpfields 
 EXCEPTION 
   INVALID_ABAPWORKAREA = 1 
   INVALID_DYNPROFIELD = 2 
   INVALID_DYNPRONAME = 3 
   MORE INVALID_DYNPRONUMMER = 4 
   INVALID_REQUEST = 5 
   NO_FIELDDESCRIPTION = 6 
   UNDEFIND_ERROR = 7 
   OTHERS = 8 

aRs