2005 Oct 20 6:35 PM
Any Function module which display Internal table values with radio button as popup.
O LP1
O LP2
O LP3
O LP4
O LP5
LP1 - LPn are values into internal table. I need Popup as mentioned above and Choose and cancel Button.
2005 Oct 20 6:41 PM
Interested in a slightly more elegant approach?
report zrich_0002
no standard page heading.
type-pools: slis.
data: sel type slis_selfield.
data: it001 type table of t001 with header line.
select * into corresponding fields of table it001
from t001.
call function 'REUSE_ALV_POPUP_TO_SELECT'
exporting
* I_TITLE =
i_selection = 'X'
* I_ZEBRA = ' '
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'T001'
i_structure_name = 'T001'
* IT_FIELDCAT =
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE =
importing
es_selfield = sel
* E_EXIT =
tables
t_outtab = it001
* EXCEPTIONS
* PROGRAM_ERROR = 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.
REgards,
Rich Heilman
2005 Oct 20 6:39 PM
No - but in debugging you can display a line of an internal table:
itab[11]
and then double click on the line to get the field values.
Rob
2005 Oct 20 6:41 PM
Interested in a slightly more elegant approach?
report zrich_0002
no standard page heading.
type-pools: slis.
data: sel type slis_selfield.
data: it001 type table of t001 with header line.
select * into corresponding fields of table it001
from t001.
call function 'REUSE_ALV_POPUP_TO_SELECT'
exporting
* I_TITLE =
i_selection = 'X'
* I_ZEBRA = ' '
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'T001'
i_structure_name = 'T001'
* IT_FIELDCAT =
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE =
importing
es_selfield = sel
* E_EXIT =
tables
t_outtab = it001
* EXCEPTIONS
* PROGRAM_ERROR = 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.
REgards,
Rich Heilman
2005 Oct 20 7:42 PM
Well maybe a <i>bit</i> more user friendly. I was thinking this was for development, not for the user.
But nice. I like it.
Rob
2005 Oct 20 8:05 PM
Rich,
Won't this be more like a multi-selection?
Amandeep wanted something with radio-buttons since with
Radio-buttons, you can select only one unique entry?
Hope there is a function that we can use to popup values
and can be used as radio-buttons.
2005 Oct 20 8:09 PM
2005 Oct 20 8:38 PM
Cool.
I should have tested it before I posted. Sorry.
I jumped the gun after reading only the first line on the function module documentation
("List in dialog box to choose one or more entries (or display only)")
Thanks Rich.
2009 Jan 29 5:54 AM
Hi Rich,
I am using REUSE_ALV_POPUP_TO_SELECT. But in this we can check multiple check boxes. And it is returning the index of last selected line. Can you please tell me how can I make it work with radio button like functionality. In which user can mark only one row.
Thanks & regards,
Shailly
2005 Oct 21 7:31 AM
Hi,
You can use POPUP_TO_DECIDE_LIST...
For example,
DATA: l_answer,
t_spopli LIKE spopli OCCURS 0 WITH HEADER LINE.
t_spopli-varoption = 'Option1'.
APPEND t_spopli.
t_spopli-varoption = 'Option2'.
APPEND t_spopli.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
CURSORLINE = 1
MARK_FLAG = ' '
MARK_MAX = 1
START_COL = 15
START_ROW = 6
textline1 = 'Hello'
TEXTLINE2 = ' '
TEXTLINE3 = ' '
titel = 'Test'
DISPLAY_ONLY = ' '
IMPORTING
ANSWER = l_answer
tables
t_spopli = t_spopli
EXCEPTIONS
NOT_ENOUGH_ANSWERS = 1
TOO_MUCH_ANSWERS = 2
TOO_MUCH_MARKS = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF l_answer EQ '2'. "Continue
READ TABLE t_spopli WITH KEY selflag = 'X'.
IF sy-subrc EQ 0.
WRITE t_spopli-varoption.
ENDIF.
ELSEIF l_answer EQ 'A'. "Cancel
ENDIF.
Hope this helps..
Sri