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

Values in the list box in report program

Former Member
0 Likes
2,833

Hi,

I have 2 parameters in the report program.

First field is the Input box and the second is the Drop down box.

I have to fill the drop down values basing on the values in the first input field.

In which event i can place my code to fill the values.

'On value request' is not working for drop down.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,090

Use DYNP_VALUES_READ to read the current values of the parameter 1 and then set the values of the list box based on that value. Search the forum for an example on how to use this function module. It is also well documented.

Hi,

I have 2 parameters in the report program.

First field is the Input box and the second is the Drop down box.

I have to fill the drop down values basing on the values in the first input field.

In which event i can place my code to fill the values.

'On value request' is not working for drop down.

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
2,090

assign a user command to the list box and try. but i dont think this will work.. user command will work when you select some thing from list box though..

at least you need to press enter on the input element, so that you can put your code in at selection-screen output.

the FM to be used is :

VRM_SET_VALUE

Read only

venkat_o
Active Contributor
0 Likes
2,090

Hi, <li>Try this way.


 REPORT ztest_notepad.
TYPE-POOLS vrm.
DATA: g_name  TYPE vrm_id,
      it_list TYPE vrm_values,
      wa_list LIKE LINE OF it_list.
PARAMETERS:p_data type c DEFAULT 'X'.
PARAMETERS  list AS LISTBOX VISIBLE LENGTH 20 USER-COMMAND uc1.

AT SELECTION-SCREEN.
CASE p_data.
 WHEN 'X'.
  wa_list-key  = '1'.
  wa_list-text = '1 is selected'.
  APPEND wa_list TO it_list.
  CLEAR wa_list.
  wa_list-key  = '2'.
  wa_list-text = '2 is selected'.
  APPEND wa_list TO it_list.
  CLEAR wa_list.
 WHEN 'Y'.
  wa_list-key  = '3'.
  wa_list-text = '3 is selected'.
  APPEND wa_list TO it_list.
  CLEAR wa_list.
  wa_list-key  = '4'.
  wa_list-text = '4 is selected'.
  APPEND wa_list TO it_list.
  CLEAR wa_list.
ENDCASE.
  g_name = 'LIST'.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = g_name
      values          = it_list
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2. 
Thanks Venkat.O

Read only

Former Member
0 Likes
2,091

Use DYNP_VALUES_READ to read the current values of the parameter 1 and then set the values of the list box based on that value. Search the forum for an example on how to use this function module. It is also well documented.

Read only

0 Likes
2,090

Thanks for the reply.

Dont we need to put the code in any event ?

Or else atleast the user have to press enter, isnt it ?

Even for At selection , there should be atleast enter or execute ?

Thanks,

Thanks,

Read only

0 Likes
2,090

Unfortunately, list box values cannot be changed unless a selection screen event happens and you can achieve it only by pressing ENTER after entering the value in parameter 1. User command option with list box triggers at selection screen event only when a value is selected from the list.

You should change your listbox option to a drop-down list like normal F4 and then you will be able to show the values as you wanted.

Read only

0 Likes
2,090

hi mate,

the vents are triggered on some action. at selection screen at least needs an ENTER, at selection-screen output needs some user command be done on screen(enter as well). but unfortunately list box doesnt respond to the user command till you havenot selected one element from it.

so you can either go for an F4 help, or try ENTER on the screen.

Read only

0 Likes
2,090

As explained in the abap documentation, VRM_SET_VALUES must be called in the PBO (AT SELECTION-SCREEN OUTPUT if it's a selection screen).

Read only

0 Likes
2,090

Hey Giri, Before screen is displayed, We don't get any value in the list box as we don't enter anything on the above field. So after entering value you need to press ENTER, to get any action done on selection-screen. There is no must in this case to keep code in the event AT SELECTION-SCREEN OUTOUT. Thanks Venkat.O