‎2009 May 26 2:38 PM
Hi Experts,
Can any one tell me how to maintain values in dropdown list on screen of module pool.
I have ' z' module pool program in which i have screen for z tcode and i want to add new values in drop down list . please tell me where to do modification.
Regards,
Rahul S
‎2009 May 26 2:39 PM
in PBO, use the FM VRM_SET_VALUES for getting the drop down.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = V_id -> field fro which u want drop down
values = it_values[] -> values that u need to display in the dropdown
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.
also in the layout set the property of the field to drop down with key.
‎2009 May 26 3:10 PM
Thanks for your reply.As i said i hv already customised module pool program which is having dropdown list containg three valuse . Now i want to add two more values in that list. iam not able to find out the logic of existing dropdown list values and can u tell me what and where i hv to add these two extra values..Not able to find out the FM vrm_set_values.Awaitng for your reply.
Regards,
Rahul S
‎2009 May 26 3:21 PM
jus try to debug and check where the values are being populated from. if it being populated from an internal table u can the two values here. U need to check in the PBOof the screen.
‎2009 May 26 2:39 PM
Hi,
In the Layout go to Attributes of the field and in Drop Down select List Box and in the PBO use FM 'VRM_SET_VALUES' to populate your list box.
Cheers
‎2009 May 26 2:44 PM
try below example in PBO
name = 'PS_PARM'. " List Control Name
value-key = '1'. value-text = 'Line 1'. APPEND value TO list.
value-key = '2'. value-text = 'Line 2'. APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
Edited by: Ganesh Modhave on May 26, 2009 3:45 PM
‎2009 May 26 2:52 PM
Hi,
Check the below code.
TYPE-POOLS: VRM.
DATA:V_NUM TYPE I.
DATA:NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
DATA:I_WORKPATTERN LIKE ZWORKPAT OCCURS 0 WITH HEADER LINE.
DATA:ZPATTXT(60).
MODULE WORKPATTERN_LISTBOX OUTPUT.
NAME = 'P9434-ZWORKPATTERN'. --> Screen Field
IF V_NUM IS INITIAL.
CLEAR I_WORKPATTERN.
REFRESH I_WORKPATTERN.
SELECT *
FROM ZWORKPAT --> List box contents from the z table
INTO TABLE I_WORKPATTERN.
IF NOT I_WORKPATTERN[] IS INITIAL.
LOOP AT I_WORKPATTERN.
VALUE-KEY = I_WORKPATTERN-ZWORKPATTERN.
VALUE-TEXT = I_WORKPATTERN-ZWORKPATTERN.
APPEND VALUE TO LIST.
ENDLOOP.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC 0.
CLEAR SY-SUBRC.
ENDIF.
V_NUM = V_NUM + 1.
ENDIF.
Regards,
Kumar Bandanadham
Edited by: Velangini Showry Maria Kumar Bandanadham on May 26, 2009 3:53 PM