2006 Aug 03 10:45 AM
Hi Gyes,
In executable report selection screen,i want to list box in ranges(for examole from to to).
Thanks & regards,
Suresh
2006 Aug 03 11:11 AM
Hi suresh,
Use selection-screen begin of line ...
end of line
Just try this code (with standard table fields )
type-pools: vrm.
data:
IT_LIST TYPE VRM_VALUES," table to store values of listbox
*--Structure declaration
WA_LIST LIKE LINE OF IT_LIST,
*--Variable declaration
V_NAME1 TYPE VRM_ID. " to store Id of Value Set
selection-screen begin of line.
SELECTION-SCREEN COMMENT 1(20) text-001 FOR FIELD v_vbeln1.
parameters: v_vbeln1 type vbap-vbeln AS LISTBOX VISIBLE LENGTH 13.
SELECTION-SCREEN COMMENT 40(20) text-002 FOR FIELD v_vbeln2.
parameters:v_vbeln2 type vbap-vbeln AS LISTBOX VISIBLE LENGTH 13.
selection-screen end of line.
*--populating the values for the list box
WA_LIST-TEXT = '0000000011'.
WA_LIST-KEY = '0000000011'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
WA_LIST-TEXT = '0000000012'.
WA_LIST-KEY = '0000000012'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = V_NAME1
VALUES = IT_LIST.
Default vbelns in vbap get populated if we do not populate explicitly and declare as
p_vbeln type vbap-vbeln.
No values get populated if we declare as
p_vbeln type vbeln.
Regards,
Vidya.
Hi Gyes,
In executable report selection screen,i want to list box in ranges(for examole from to to).
Thanks & regards,
Suresh
2006 Aug 03 10:47 AM
2006 Aug 03 10:50 AM
2006 Aug 03 10:50 AM
Hi Suresh,
For list box try this
*--Table declaration
IT_LIST TYPE VRM_VALUES," table to store values of listbox
*--Structure declaration
WA_LIST LIKE LINE OF IT_LIST,
*--Variable declaration
V_NAME TYPE VRM_ID. " to store Id of Value Set
AT SELECTION-SCREEN OUTPUT.
V_NAME = 'P_ZPPUOM'.
*--populating the values for the list box
WA_LIST-TEXT = 'P'.
WA_LIST-KEY = 'P'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
WA_LIST-TEXT = 'H'.
WA_LIST-KEY = 'H'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = V_NAME
VALUES = IT_LIST.
and in the selection-screen declare the parameter as
parameters: P_ZPPUOM TYPE ZPP_MP_UOM AS LISTBOX VISIBLE LENGTH 4."UOM
Regards,
Vidya
2006 Aug 03 10:55 AM
Hi Vidya,
I want from and to option.
Plwase give me any standard table refrence name.
parameters: P_ZPPUOM TYPE ZPP_MP_UOM AS LISTBOX VISIBLE LENGTH 4."UOM
Thanks,
Suresh
2006 Aug 03 11:05 AM
I Believe, you can use LIST BOX option only for PARAMETERS.
if you want a range, you can use 2 PARAMETERS Adjacent to one another.
regards
srikanth
2006 Aug 03 11:08 AM
Hi srikanth,
How can i use 2 PARAMETERS Adjacent to one another.
Thanks,
Sursesh
2006 Aug 03 11:12 AM
Check the below program,
i have used 2 parameters for this purpose & placed them on the same line.
give some text to TEXT-001
PROGRAM zlist.
TYPE-POOLS : VRM.
DATA: param TYPE vrm_id,
values TYPE vrm_values,
value LIKE LINE OF values.
selection-screen begin of line.
SELECTION-SCREEN COMMENT 3(10) TEXT-001.
PARAMETERS: p_name(5) AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: p_name2(5) AS LISTBOX VISIBLE LENGTH 10.
selection-screen end of line.
AT SELECTION-SCREEN OUTPUT.
param = 'P_NAME'.
value-key = '1'.
value-text = 'JOHN'.
APPEND value TO values.
value-key = '2'.
value-text = 'PETER'.
APPEND value TO values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = param
values = values.
REFRESH VALUES.
param = 'P_NAME2'.
value-key = '1'.
value-text = 'NAME2'.
APPEND value TO values.
value-key = '2'.
value-text = 'NAME3'.
APPEND value TO values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = param
values = values.
START-OF-SELECTION.
WRITE 😕 'HELO'.
Regards
srikanth
2006 Aug 03 10:52 AM
check this link, may be helpful for your requirement.
here is the code copied from the above post,
PROGRAM zlist.
TYPE-POOLS : VRM.
DATA: param TYPE vrm_id,
values TYPE vrm_values,
value LIKE LINE OF values.
PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
param = 'P_NAME'.
value-key = '1'.
value-text = 'JOHN'.
APPEND value TO values.
value-key = '2'.
value-text = 'PETER'.
APPEND value TO values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = param
values = values.
regards
srikanth
2006 Aug 03 11:11 AM
Hi suresh,
Use selection-screen begin of line ...
end of line
Just try this code (with standard table fields )
type-pools: vrm.
data:
IT_LIST TYPE VRM_VALUES," table to store values of listbox
*--Structure declaration
WA_LIST LIKE LINE OF IT_LIST,
*--Variable declaration
V_NAME1 TYPE VRM_ID. " to store Id of Value Set
selection-screen begin of line.
SELECTION-SCREEN COMMENT 1(20) text-001 FOR FIELD v_vbeln1.
parameters: v_vbeln1 type vbap-vbeln AS LISTBOX VISIBLE LENGTH 13.
SELECTION-SCREEN COMMENT 40(20) text-002 FOR FIELD v_vbeln2.
parameters:v_vbeln2 type vbap-vbeln AS LISTBOX VISIBLE LENGTH 13.
selection-screen end of line.
*--populating the values for the list box
WA_LIST-TEXT = '0000000011'.
WA_LIST-KEY = '0000000011'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
WA_LIST-TEXT = '0000000012'.
WA_LIST-KEY = '0000000012'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = V_NAME1
VALUES = IT_LIST.
Default vbelns in vbap get populated if we do not populate explicitly and declare as
p_vbeln type vbap-vbeln.
No values get populated if we declare as
p_vbeln type vbeln.
Regards,
Vidya.
2006 Aug 03 11:11 AM
REPORT zes_sample.
TYPE-POOLS: vrm.
TABLES:mara.
PARAMETERS: p_matnr AS LISTBOX VISIBLE LENGTH 6.
DATA values TYPE vrm_values WITH HEADER LINE.
*AT SELECTION-SCREEN OUTPUT.
INITIALIZATION.
SELECT * FROM mara.
values-text = mara-matnr.
values-key = mara-matnr.
APPEND values.
ENDSELECT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_MATNR'
values = values[]
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |