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

regarding pop up fields restriction

Former Member
0 Likes
452

Hi All,

i have a requirement that in a pop up i will have 3 fields for input.if i press f4 in first field it displays all possible values and if i

select one value then on the second field if i press f4 it should displays values that are related to first screen field input value.that is based on the value selected on first field my second field values should be come in f4 help for second field.

Hi All,

i have a requirement that in a pop up i will have 3 fields for input.if i press f4 in first field it displays all possible values and if i

select one value then on the second field if i press f4 it should displays values that are related to first screen field input value.that is based on the value selected on first field my second field values should be come in f4 help for second field.

2 REPLIES 2
Read only

rvinod1982
Contributor
0 Likes
393

Hi,

Create a Search Help for the required fields and use this search help in the selection screen.

Regards,

Vinod

Read only

venkat_o
Active Contributor
0 Likes
393

Hi, <li>You need to use DYNP_VALUES_READ function module to read first field value when you press F4 on second field. <li>Try this sample program.


  REPORT ztest_notepad.

DATA: BEGIN OF it_marc OCCURS 0,
        matnr TYPE marc-matnr,
        werks TYPE marc-werks,
      END OF it_marc.
DATA:it_dynpread TYPE TABLE OF dynpread,
     wa_dynpread LIKE LINE OF it_dynpread.
DATA: it_return_tab TYPE ddshretval OCCURS 0,
      wa_return LIKE LINE OF it_return_tab.
PARAMETERS:
        p_werks TYPE marc-werks,
        p_matnr TYPE marc-matnr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

  wa_dynpread-fieldname = 'P_WERKS'.
  APPEND wa_dynpread TO it_dynpread.
  CLEAR  wa_dynpread.
 "DYNP_VALUES_READ read screen
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-repid
      dynumb     = sy-dynnr
    TABLES
      dynpfields = it_dynpread.
  READ TABLE it_dynpread INTO wa_dynpread INDEX 1.
  p_werks = wa_dynpread-fieldvalue.
  IF it_marc[] IS INITIAL.
    SELECT * FROM marc INTO CORRESPONDING FIELDS OF TABLE it_marc WHERE werks = p_werks.
  ENDIF.
  "F4 help F4IF_INT_TABLE_VALUE_REQUEST
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'MATNR'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_MATNR'
      value_org   = 'S'
    TABLES
      value_tab   = it_marc
      return_tab  = it_return_tab.
  IF sy-subrc EQ 0.
    READ TABLE it_return_tab INTO wa_return INDEX 1.
    IF sy-subrc EQ 0.
      p_matnr = wa_return-fieldval.
    ENDIF.
  ENDIF. 
Thanks Venkat.O