09-29-2010 6:07 AM
Hi,
I have created a parameter list box on the selection screen using VRM_SET_VALUES fn module and populating the list box. Now my problem is when i select one value from the list box and executing, it shows null value.
AT SELECTION-SCREEN OUTPUT.
PERFORM f_f4help.
FORM f_f4help .
REFRESH: gt_tvaut,
gs_list.
CLEAR: gs_tvau,
gs_value.
SELECT spras
augru
bezei
FROM tvaut
INTO TABLE gt_tvaut
WHERE spras EQ sy-langu.
IF NOT gt_tvaut[] IS INITIAL.
LOOP AT gt_tvaut INTO gs_tvau.
gs_value-key = sy-tabix.
CONCATENATE gs_tvau-augru
gs_tvau-bezei
INTO gs_value-text
SEPARATED BY space.
APPEND gs_value TO gs_list.
ENDLOOP.
ENDIF.
param = 'P_AUGRU'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = param
values = gs_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
How to get the value which is selected in the selection screen becoz i'm using p_augru in further selection queries..
i have tried reading gs_list table but its not working.
09-29-2010 6:43 AM
How to get the value which is selected in the selection screen becoz i'm using p_augru in further selection queries..+. the values wil be automatically populated in p_augru if you are using the same in at selection-screen/start-of-selection event.
09-29-2010 6:21 AM
Hi Ramya,
U havchosen a wrong event. Do it in initialization piortion.
Regards,
Amitava
09-29-2010 6:30 AM
Hi,
Once the selection screen is displayed i need to fill the list box so for tat i'm using at selection-screen o/p event.
And for reading the value selected from the list box u mean i need to do this in initialization event?
09-29-2010 6:39 AM
Hi,
U need to populate the help before the selection screen coming. For that reason it should be done in Initialization event.
After selction screen is coming u select any one value. and check that in Start of selection event by putting one breakpouint.
Regards,
Amitava
09-29-2010 6:31 AM
Move the portion of function call 'VRM_SET_VALUES' to event at selection-screen on value-request for P_AUGRU. Rest is OK...
I mean, Your code should be like this.
AT SELECTION-SCREEN OUTPUT.
PERFORM f_f4help_values.
FORM f_f4help_values.
REFRESH: gt_tvaut,
gs_list.
CLEAR: gs_tvau,
gs_value.
SELECT spras
augru
bezei
FROM tvaut
INTO TABLE gt_tvaut
WHERE spras EQ sy-langu.
IF NOT gt_tvaut[] IS INITIAL.
LOOP AT gt_tvaut INTO gs_tvau.
gs_value-key = sy-tabix.
CONCATENATE gs_tvau-augru
gs_tvau-bezei
INTO gs_value-text
SEPARATED BY space.
APPEND gs_value TO gs_list.
ENDLOOP.
ENDIF.
ENDFORM.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_AUGRU.
PERFORM f_f4help.
FORM f_f4help
param = 'P_AUGRU'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = param
values = gs_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
Rgds,
Birendra
09-29-2010 6:40 AM
Hi,
check this program RSDEMO_DROPDOWN_LISTBOX. U might get some help. U will have to assign MODIF ID to the parameter P_AUGRU to capture the value u r selecting from the dropdown list.
09-29-2010 6:43 AM
How to get the value which is selected in the selection screen becoz i'm using p_augru in further selection queries..+. the values wil be automatically populated in p_augru if you are using the same in at selection-screen/start-of-selection event.
09-29-2010 10:45 AM
Hi,
Thanks for ur replies. I have done a small mistake while appending values into vrm fn module.
Now i have another one before filling the values table of the fn module i need to fecth the text from tvaut table depending on the user's logon lang. if the text is maintained in the user's logon lang then text can be appended if it not maintained then it should check for spras = ' E' then the text shd be passed.
SELECT a~augru
b~spras
b~bezei
INTO TABLE gt_tvaut
FROM tvau AS a INNER JOIN tvaut AS b
ON a~augru = b~augru
WHERE b~spras EQ sy-langu.
Now how to appeng the values based on logon language.. Need an hint..
09-29-2010 11:55 AM
1. Select all augru for sy-langu.
SORT ltab BY augru.
DELETE ADJACENT DUPLICATES FROM itab COMPARING augru.
2. Select all augru for EN , not reuqired if sy-langu is EN
SORT ltab1 BY augru.
DELETE ADJACENT DUPLICATES FROM itab1 COMPARING augru.
IF ltab IS INITIAL.
itab[] = itab1[].
ELSE.
LOOP AT itab1 into wa.
READ TABLE itab transporting NO FIELDS WITH KEY augru = wa-augru.
IF sy-subrc NE 0.
APPEND wa to itab.
ENDIF.
ENDLOOP.
endif.
Use ITAB for listbox.