2009 Jun 05 12:53 PM
Hi all,
I need to create a list box on selection screen in a report and depends on the user input have to fetch data from a data base table.
please help me in acheving this,
thanks in advance,
usha.
Hello Usha,
SAP does not give you the opportunity to use LISTBOX with SELECT-OPTIONS. But may i ask you why do you want to use a listbox with SELEC-OPTIONS?
Can you not try standard F4 helps?
Plz revert back.
BR,
Suhas
2009 Jun 05 1:02 PM
Try like this.......
data : begin of it_kan1 occurs 0,
kunnr type kna1-kunnr,
name1 type kna1-name1,
end of it_kan1.
PARAMETERS p_kunnr TYPE kna1-kunnr
AS LISTBOX VISIBLE LENGTH 20
DEFAULT '1'.
select kunnr
name1 from kna1 into table it_kan1 where kunnr = p_kunnr.
2009 Jun 05 1:06 PM
2009 Jun 05 1:10 PM
See this also,it will give you better solution
parameter : p_field(30) TYPE c AS LISTBOX VISIBLE LENGTH 20.
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_field.
name = 'p_field'.
value = 'PLANT'.
APPEND value to list.
value = 'COUNTRY'.
APPEND value to list.
value = 'CODE'.
APPEND value to list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.Edited by: sekhar manda on Jun 5, 2009 2:16 PM
2009 Jun 05 1:12 PM
Hi,
You can define like below.
PARAMETERS p_matnr like mara-matnr
AS LISTBOX VISIBLE LENGTH 20
DEFAULT '00000000000000001'.
You can fetch the value into databse table like where matnr = p_matnr. So p_matnr hold the value is 1.
let me know if you required further help
Regards
Thiru
2009 Jun 05 2:16 PM
Thanks for the answers ,
but I need to define a select-option instead of parameter..Is it possible.?
regards,
usha
2009 Jun 05 3:09 PM
Hello Usha,
SAP does not give you the opportunity to use LISTBOX with SELECT-OPTIONS. But may i ask you why do you want to use a listbox with SELEC-OPTIONS?
Can you not try standard F4 helps?
Plz revert back.
BR,
Suhas
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |