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: 

Default selection for input field

Former Member
0 Kudos

Hi

I have two fields on my selection screen. When the user clicks the drop down for the second field the possible values displayed is dependant on the first field. I have done this using AT SELECTION-SCREEN ON VALUE-REQUEST FOR and CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'. This is working correctly

I want to be able to populate the second field with all of the possible values by default.

So I want a user to enter a name in the first field and have the second field automatically populated with several names depending on whats in the first field.

Is this at all possible?

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Simon,

If you manually type the value in the first field i suppose you cannot have the data populated in the second field automatically. The application has no way to know that the value in the first field has been changed / inserted.

As suggested by Ram you either attache a dropdown list to the first field or create an F4 help. Because as long as there is no user interaction in the screen the application cannot trigger an event on its own

Hope you get the point.

BR,

Suhas

4 REPLIES 4

Former Member
0 Kudos

During the event "on selection-screen output", populate the internal table (which will be value table) for the second input field.

Then call the function module "F4IF_INT_TABLE_VALUE_REQUEST" based on the above mentioned internal table. Call this function module on the event "at selection-screen on value-request for <second input field>".

Regards

Vinod

former_member1245113
Active Contributor
0 Kudos

Hi Simon,

Yes, This is possible only in one way(To the best of my knowledge)

[Refer to this i had a similar Issue|;

In TOP Include
  data : sval type standard table of sval with header line,
            first.
" I dont know to what extent you are convinced with this but this made my requirement realized

at selection-screen output.
data : str type string.
  if first = 'X'. " Declare this in TOP Include and Clear this in START-OF-SELECTOIN
Otherwise when you press back button this pop up agian Comes and Asks for input
    sval-tabname = 'T001W'.
    sval-fieldname = 'WERKS'.
    sval-field_obl = 'X'.
    append sval.
    perform popup_plant.
    select single werks from t001w into p_werks
      where werks = p_werks.
    if sy-subrc ne  0.
      concatenate 'Plant' p_werks 'Does not exist'
      'Check your Entry' into str separated by space.
      message str type 'W'.
      perform popup_plant. " You recieve the Value for FIrst Field from here
Based on this First Value, you can now populate your List Box
    endif.

As per Suhas suggestion you can make the First input Field non Editable.

loop at screen.
if screen-name = 'P_WERKS'.
screen-input = 0.
modify Screen.
endif.
endloop.

After this Follow your Earlier Post

form popup_plant.
  call function 'POPUP_GET_VALUES'
    exporting
     no_value_check        = ' '
      popup_title           = 'Please Enter Plant'
* IMPORTING
*   RETURNCODE            = RETURNCODE
    tables
      fields                = sval
   exceptions
     error_in_fields       = 1
     others                = 2
            .
  if sy-subrc = 0.
    read table sval index 1.
    if sy-subrc = 0.
      move sval-value to p_werks.
    endif.
  endif.
endform.                    "popup_plant

former_member418469
Participant
0 Kudos

hi,

Try to use following function modules:

DYNP_VALUES_READ

DYNP_VALUES_UPDATE

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Simon,

If you manually type the value in the first field i suppose you cannot have the data populated in the second field automatically. The application has no way to know that the value in the first field has been changed / inserted.

As suggested by Ram you either attache a dropdown list to the first field or create an F4 help. Because as long as there is no user interaction in the screen the application cannot trigger an event on its own

Hope you get the point.

BR,

Suhas