‎2008 Jan 28 10:36 AM
Hi,
Below is the code that I have used to populate my listboxes. Please help me with the code; how to fetch back the key value from the listbox during runtime.
SELECT ACCNUMBER INTO ACCNUMBER FROM ZTABCSCUSTMASTER WHERE SAPUSER = SY-UNAME.
DROPDOWN-KEY = ACCNUMBER.
DROPDOWN-TEXT = ' '.
APPEND DROPDOWN TO VAL.
ENDSELECT. "ZTABCSCUSTMASTER
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ACCNO'
VALUES = VAL
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
Thanks
Anand D
‎2008 Jan 28 10:46 AM
Hi,
Have a look at the program DEMO_DYNPRO_DROPDOWN_LISTBOX, specifically the module user_command_200.
The selected value in the list box is stored in the structure as given in the program.
‎2008 Jan 28 10:46 AM
Hi,
Have a look at the program DEMO_DYNPRO_DROPDOWN_LISTBOX, specifically the module user_command_200.
The selected value in the list box is stored in the structure as given in the program.
‎2008 Jan 28 11:32 AM
hi Anand ,
I hope you atre getting the value in the list box and able to select the value from the list for your UI filed .
Now you can directly use the field ( STR-FIELDNAME ) used in the UI screen to fetch the value back to the program and use it further .
If you need further information then revert back .
Regards,
Ranjita
‎2008 Jan 28 11:39 AM
Hi Ranjitha,
Only the first value is obtained directly using the field ( STR-FIELDNAME ) name on the UI screen. But subsequent values cannot be fetched. i.e. they are blank when we get them directly using screen field names.
Thanks
Anand D
‎2008 Jan 28 11:58 AM
Hi Anand ,
May be I understood it in a different way , but if you are able to show the filled listbox in the UI, that means you already have an internal table which has got the values. So you need not fetch back the list from the UI, instead you can use the value filled internal table which you used previously .
If this is not exactly what you want then please be specific on the requirement so that we can figure out the solution ..
Regards,
Ranjita
‎2008 Jan 28 3:39 PM
Hi Ranjitha,
Could you please help me with a code snippet for populating and retrieving value from the list box. I need to get the user selected list box value on a button click event. I am fine with any sample code for the above requirement.
Thanks
Anand D
‎2008 Jan 29 5:10 AM
Here you go ..
This code sample will make you understand how to fill the listbox and retrieve values from it ..
&----
*& Report ZTRY
*&
&----
*&
*&
&----
REPORT ZTRY.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
Fill the list with values LINE 1 and LINE 2 .
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
Set the dropdown list for the required screen field
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.
Hope this is of help .
Regards,
Ranjita ..
‎2008 Jan 29 5:58 AM
‎2008 Jan 29 7:55 AM
‎2008 Aug 19 3:34 PM
Hi,
I have an issue where in i ve to populate the dropdown list at runtime in case of a normal report program (R/3 system). please help me in this regard.
*********Points will be awarded****************