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 to use Value-Request on Screen Field

Former Member
0 Kudos

Hi

I m facing a problem .. the scenario is i have to limit search help on Screen 100 field . but the following line is not working

AT SELECTION-SCREEN ON help-REQUEST FOR wa-soffice.

kindly help me out

Regards

Ammad

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

As per ur requirement u should fetch the relavant data which u want in F4 in the below event

INITIALIZATION.

*Get data for F4 help - RFC

SELECT rfcdest

INTO TABLE t_rfc FROM rfcdes

WHERE rfcdest LIKE '%CRM%' AND

rfctype = 'T'.

Now use this event to display the same

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_rfc.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'RFCDEST'

dynpprog = sy-repid

dynpnr = '1000'

dynprofield = 'P_RFC'

value_org = 'S'

TABLES

value_tab = t_rfc

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Hope this helps.

Regds

Seema

19 REPLIES 19

Former Member
0 Kudos

Hi,

You have to write Your code on POH(Process on Help-Request) event of Screen 100.

How to write Code see the following link,

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

Hope This Resolves your issue.

Regards,

Raghava Channooru.

0 Kudos

I think i wasn't communicated properly .. i want to limit F4 Search help on Screen 100 Field . as we do on parameter through FM 'F4IF_INT_TABLE_VALUE_REQUEST'

Regards

Ammad

0 Kudos

I think i wasn't communicated properly .. i want to limit F4 Search help on Screen 100 Field . as we do on parameter through FM 'F4IF_INT_TABLE_VALUE_REQUEST'

Regards

Ammad

0 Kudos

Then refer to program DEMO_DYNPRO_F4_HELP_MODULE .

Regards

Marcin

Former Member
0 Kudos

Hi,

As per ur requirement u should fetch the relavant data which u want in F4 in the below event

INITIALIZATION.

*Get data for F4 help - RFC

SELECT rfcdest

INTO TABLE t_rfc FROM rfcdes

WHERE rfcdest LIKE '%CRM%' AND

rfctype = 'T'.

Now use this event to display the same

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_rfc.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'RFCDEST'

dynpprog = sy-repid

dynpnr = '1000'

dynprofield = 'P_RFC'

value_org = 'S'

TABLES

value_tab = t_rfc

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Hope this helps.

Regds

Seema

0 Kudos

Seema its fine with parameter but its not working on Screen field... as we place text field on the screen

0 Kudos

Do you mean ur using Module Pool? Can you please explain the requirement?

0 Kudos

I have called a screen 100 in my program .... i have fields of sales office and sales group on the screen.

Sales office field name is wa-soffice

Sales group field name is wa-sgroup

what is happening all the entries of both fields in search help are appearing.

what i want is if i select sales group then only sales office of that group should be displayed in sales office search help.

the method we used for parameteres is not working here ....

Regards

0 Kudos

Basically you want to populate the F4 values based on some other field. If yes, this has been answered in the forum many times. A simple search from your end would have saved your time & effort.

Try searching in SDN & get back if you have any specific problem.

BR,

Suhas

0 Kudos

Hi again,

Ok got it... Now create a search help with 2 fields sales office and sales group ok dont forget to tick all the 4 check boxes for both the fields i.e. imp and exp and than assign this search help to any one of the fields. This will work for sure let me knw if u face any issues.

Regds

0 Kudos

Hi Ammad,

Create an elementary search help for sales group and assign it to that field.

select data for sales office according to sales group using SELECT query (for this create MODULE in POV event).

Then assign that selected fields in Sales office field using POV event (process on value request).

Regards,

Ankur.

0 Kudos

I retrieved the field but i m unable to select the value .... code is as followssss kindly help me

TYPES: BEGIN OF values,

VKBUR TYPE H_TVKBZ-VKBUR,

BEZEI TYPE H_TVKBZ-BEZEI,

END OF values.

data: values_tab TYPE TABLE OF values,

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values.

CLEAR: field_value, dynpro_values.

field_value-fieldname = 'WA-VKORG'.

APPEND field_value TO dynpro_values.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = dynpro_values.

READ TABLE dynpro_values with KEY fieldname = 'WA-VKORG' INTO field_value.

if field_value-FIELDVALUE is NOT INITIAL.

SELECT VKBUR INTO CORRESPONDING FIELDS OF TABLE values_tab FROM TVKBZ

WHERE vkorg = wa-vkorg

AND vtweg = wa-vtweg

AND spart = wa-spart.

endif.

  • DELETE values_tab WHERE WA-SOFFICE IS INITIAL OR submi = ''.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WA-SOFFICE'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'WA-SOFFICE'

value_org = 'S'

TABLES

value_tab = values_tab.

field_tab = values_tab.

0 Kudos

I think you are making mistake right here



READ TABLE dynpro_values WITH KEY fieldname = 'WA-VKORG' INTO field_value.
IF field_value-fieldvalue IS NOT INITIAL.
  SELECT vkbur INTO CORRESPONDING FIELDS OF TABLE values_tab FROM tvkbz
  WHERE vkorg = wa-vkorg  "you should what you read, so FIELD_VALUE-FIELDVALUE not WA-VKORG, as it is empty
  AND vtweg = wa-vtweg
  AND spart = wa-spart.
ENDIF.

Try it out.

Regards

Marcin

0 Kudos

hi

i did try this but didn't work .. i m understanding the problem but unable to solve it .. problem is i m unable to write back the selected values to wa-soffice.

Regards

Ammad

0 Kudos

Hi,



CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'WA-SOFFICE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'WA-SOFFICE'
value_org = 'S'
TABLES
value_tab = values_tab.
*field_tab = values_tab " I think this is not right one 
return_tab = values_tab.  " Try this 

Hope this resolves your issue

Regards,

Raghava Channooru

0 Kudos

Assuming you made the corrections as mentioned by Marcin & values are populated successfully in VALUES_TAB. You should try making these changes to the function call & check :

DATA: IT_RET LIKE DDSHRETVAL OCCURS 0 WITH header line. "-->Add the Return Table

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'VKBUR' "--> This should be the field of VALUES_TAB which should be returned to RETURN_TAB
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'WA-SOFFICE'
value_org = 'S'
TABLES
value_tab = values_tab.
RETURN_TAB = it_ret. "You have to use RETURN_TAB to get the value back to the screen field

BR,

Suhas

0 Kudos

Hi

I perform all the suggestions but i m fail to assign selected value to wa-soffice

regards

Ammad

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

What is the problem you are exactly facing ?

Is it while using fm 'F4IF_INT_TABLE_VALUE_REQUEST'

or

to retrieve the values that are to be passed to 'F4IF_INT_TABLE_VALUE_REQUEST'.

Former Member
0 Kudos

* Screen flow logic........

PROCESS BEFORE OUTPUT.
*MODULE PBO_MODULE.

PROCESS AFTER INPUT.
*MODULE PAI_MODULE.

PROCESS ON VALUE-REQUEST. "F4
  FIELD EKPO-EBELP MODULE help_ekpo.


* populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
*&------------------------------------------------------------------*
*&      Module  help_responsibility  INPUT
*&------------------------------------------------------------------*
*       text
*-------------------------------------------------------------------*
MODULE help_ekpo INPUT.


**Transport values to table dynpro/screen table control
  DATA: l_stepl LIKE  sy-stepl,
        l_indx  LIKE  sy-stepl.
  DATA: dynpfields        LIKE dynpread OCCURS 5 WITH HEADER LINE.

* Adjust for scroling within table control
  CALL FUNCTION 'DYNP_GET_STEPL'
    IMPORTING
      povstepl        = l_stepl
    EXCEPTIONS
      stepl_not_found = 0
      OTHERS          = 0.

  l_indx = tc_ekpotable-top_line + l_stepl - 1.
          "tc_ekpotable should already have been declared

  REFRESH dynpfields.
  CLEAR   dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELN'.
  dynpfields-fieldvalue = '00010'   "wa_ekpo-ebeln.
  dynpfields-stepl      = l_stepl.
  APPEND dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELP'.
  dynpfields-fieldvalue = '00020'   "wa_ekpo-ebelp.
  dynpfields-stepl      = l_stepl.
  APPEND dynpfields.

  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname     = 'SAPLZZ_EKKO'    "Program name
      dynumb     = '0100'           "Screen number
    TABLES
      dynpfields = dynpfields
    EXCEPTIONS
      OTHERS     = 0.
ENDMODULE.                 " help_ekpo  INPUT