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!!

Former Member
0 Likes
288

Hi All,

I have created a module pool where i have three fields on the screen.

I am writing process on value request for three fields...

but unless i press enter first value entered on the selection screen doesn't get reflected in the ztable-fieldname.....

as based on the first field value ...second F4 help will be fetched..but unless i press enter first value doesnt come...

whats the way out?

Regards

Gunjan

Points for sure....

1 REPLY 1
Read only

Former Member
0 Likes
268

Hi.

catch the return table of the first F4 hlp FM and based on that prepare the second F4 input help itab....for this enter is not required.............

check the below code(for sel-screen).......

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.