cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset parameter value

Former Member
0 Kudos

Hi,
I have a created a parameter(List box) in report using vrm_set_values i have assigned data to it.
Data format ex:
                    1. key:  ab_12

                        text:  Testing1
                    2.Key:  ab_13
                       Text: Testing2
So according to above data, Testing1 and Testing2 are desplaying in list box.
case: when i select any value(eg:Testing2 ) in list box and press F8. report is executing in a right way.
After execution, list box is showing selected value's key (ab_13). this is not user friendly.
Dropdown should not show key value.
Pls help me on this.

Accepted Solutions (0)

Answers (5)

Answers (5)

raymond_giuseppi
Active Contributor
0 Kudos

Did you try to clear the parameter in INITIALIZATION, you will also be required to add an initial record to VALUES table ?

Regards,
Raymond

Former Member
0 Kudos

Hi Raymond,

I do not think clearing at Initialization will work because Initialization triggers only once when program loads but the requirement is to clear the Selection screen after F8 is pressed.

Please revert if i am wrong.

BR,

Ankit.

raymond_giuseppi
Active Contributor
0 Kudos

Another solution is to add a LEAVE TO CURRENT TRANSACTION at the end of the report

and I could obtain different results when using back,exit or cancel funcion (green, yellow and red icon)

Regards,

Raymond

PS: forget the sample, I did not activated it...

Former Member
0 Kudos

Hi All,
Thanks for ur relplies.
I tried according to your repies, but i didn't get through.
Finally my aim is:
to make list box as blank after pressing F8.
I tried to do this in initialization, but not working as expected.
Pls help me on this.

Former Member
0 Kudos

Can you post your code

Former Member
0 Kudos

Hi Nagaraju,

Did you try writing this in end-0f-selection event.

END-OF-SELECTION.

  FIELD-SYMBOLS : <fs>  .

   ASSIGN ('(RSDBRUNT)MEMKEY-INT_MODE') TO <fs> .

   IF sy-subrc = 0 .

     <fs> = '01' .

   ENDIF.

I tested the code given previously by me and it is working.

Please try and revert.

BR,

Ankit.

Former Member
0 Kudos

Did you add empty line at the beginning of the internal table? If not add initial empty line and check. At INITIALIZATION event write the below logic:

APPEND INITIAL LINE TO itab.   "This will add empty value in the list box

wa-key = '1'.

wa-text ='Value1'.

APPEND wa TO itab.

CLEAR wa.

wa-key = '2'.

wa-text ='Value2'.

APPEND wa TO itab.

CALL FUNCTION 'VRM_SET_VALUES'

  EXPORTING

       id     = 'P_TEST'

       values = itab.

Former Member
0 Kudos

Hi Nagaraju,

Don't write your code in AT SELECTION SCREEN OUTPUT because whenever an event is triggered then your selected value gets initiated.

Assume you have written code(VRM_SET_VALUES) in AT SELECTION SCREEN OUTPUT. Now you selected an 2nd value from the list box. Now if you press enter, then again the value will be reload into the list box. So again it displays 1st value from the list box.

So it is better to write your logic in INITIALIZATION event. Call function module VRM_SET_VALUES in INITIALIZATION event. This event  is called only once, when you press back after executing then again this event will be called.

Revert if you have any problems.

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi Nagaraju,

Try below code it will works for your issue.let me know if any issue.

TYPE-POOLS: vrm.

PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 10.

DATAit_list TYPE vrm_values,

           wa_list  LIKE LINE OF it_list.

AT SELECTION-SCREEN OUTPUT.

   CLEAR: wa_list,

          it_list[].

   wa_list-key = '1'.

   wa_list-text ='Testing1'.

   APPEND wa_list TO it_list.

   CLEAR wa_list.

   wa_list-key = '2'.

   wa_list-text ='Testing2'.

   APPEND wa_list TO it_list.

   CALL FUNCTION 'VRM_SET_VALUES'

     EXPORTING

       id     = 'P_TEST'

       values = it_list.

Regards,

Guru

Former Member
0 Kudos

Hi Nagaraju/Guru,

I have modified Guru's Code a bit and the below code works perfectly fine for your need Nagaraju.

The red part is the main logic for clearing the selection screen data after execution.

*&---------------------------------------------------------------------*

*& Report  Z_DYNAMIC_LIST

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  z_dynamic_list.

TYPE-POOLS: vrm.

PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 10.

DATA:  it_list TYPE vrm_values,

            wa_list  LIKE LINE OF it_list.

AT SELECTION-SCREEN OUTPUT.

   CLEAR: wa_list,

          it_list[].

   wa_list-key = '1'.

   wa_list-text ='Testing1'.

   APPEND wa_list TO it_list.

   CLEAR wa_list.

   wa_list-key = '2'.

   wa_list-text ='Testing2'.

   APPEND wa_list TO it_list.

   CALL FUNCTION 'VRM_SET_VALUES'

     EXPORTING

       id     = 'P_TEST'

       values = it_list.

END-OF-SELECTION.

   WRITE : 'Junk'.

   FIELD-SYMBOLS : <fs>  .

   ASSIGN ('(RSDBRUNT)MEMKEY-INT_MODE') TO <fs> .

   IF sy-subrc = 0 .

     <fs> = '01' .

   ENDIF.

Please revert in case anything is not clear.

regards,

Ankit.

kavindra_joshi
Active Contributor
0 Kudos

Wrong forum but this may help

AT SELECTION-SCREEN OUTPUT

you can prepare the key values again and call

  call function 'VRM_SET_VALUES'

    exporting

      id     = lv_name

      values = lt_list.

~Kavindra