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

At Selection-screen

Former Member
0 Likes
475

Hi ,

In my requirement , i have 2 parameter fields which is refference to some database table fields , the search help for the parameter2 should be based on the value of parameter1 , (i.e i have to create a search help for the parameter2 based on the valued of parameter1).

can any one tell me how to do this.

thanks

3 REPLIES 3
Read only

Former Member
0 Likes
456

You have to use FM 'DYNP_VALUES_READ' to catch the value of parameter1 in an internal table.

Now pass this internal table in FM 'F4IF_FIELD_VALUE_REQUEST' .

Regards,

Chandru

Read only

Former Member
0 Likes
456

Hi,

Check this sample code..........

PARAMETERS : p_state TYPE char20,
             p_city  TYPE char18.

DATA       : BEGIN   OF   t_state OCCURS 0,
             state   TYPE char20,
             END     OF   t_state,
             BEGIN   OF   t_city  OCCURS 0,
             city    TYPE char18,
             END     OF   t_city.

DATA       : r_state TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_state.
  REFRESH t_state.
  APPEND 'Tamil nadu' TO t_state.
  APPEND 'Kerala'     TO t_state.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'STATE'
      dynpprog        = sy-repid
      dynpnr          = '1000'
      dynprofield     = 'P_STATE'
      window_title    = 'State'
      value_org       = 'S'
    TABLES
      value_tab       = t_state[]
      RETURN_TAB      = r_state[]
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
  ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_city.
  REFRESH t_city.
  LOOP AT r_state.
    CASE    r_state-fieldval.
      WHEN  'TAMIL NADU'.
        APPEND 'Chennai'    TO t_city.
        APPEND 'Madurai'    TO t_city.
      WHEN  'KERALA'.
        APPEND 'Trivandrum' TO t_city.
        APPEND 'Kochi'      TO t_city.
    ENDCASE.
  ENDLOOP.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'CITY'
      dynpprog        = sy-repid
      dynpnr          = '1000'
      dynprofield     = 'P_CITY'
      window_title    = 'City'
      value_org       = 'S'
    TABLES
      value_tab       = t_city[]
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
  ENDIF.

Cheers,

jose.

Read only

Former Member
0 Likes
456

hi in this way we can find

change some conditions in that

&----


*& Report ZNNR_REPORT2

*&

&----


*&

*&

&----


REPORT ZNNR_REPORT2.

DATA : BEGIN OF IT_PLANT OCCURS 0,

MATNR LIKE MARc-MATNR,

WERKS LIKE MARC-WERKS,

END OF IT_PLANT.

TABLES mara.

********SELECTION SCREEN DESIGN ***********

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

PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.

SELECT-OPTIONS : S_matnr FOR mara-matnr NO INTERVALS MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

******END OF SELECTION SCREEN DESIGN****************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_matnr-LOW.

SELECT matnr werks FROM marc

INTO TABLE it_plant

WHERE werks = p_werks.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATNR'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_matnr'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_plant

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.

ENDIF.

.