2008 Dec 05 12:25 PM
Hi All,
My requirement is to fetch values from database table.A particular field in the table
has certain values,which i am supposed to create as radiobuttons.i.e
i need to pick the values and create a dynamic selection screen.
Can any one help me in this.
Thanks in Advance!!
Hi All,
My requirement is to fetch values from database table.A particular field in the table
has certain values,which i am supposed to create as radiobuttons.i.e
i need to pick the values and create a dynamic selection screen.
Can any one help me in this.
Thanks in Advance!!
2008 Dec 08 9:10 AM
2008 Dec 08 9:12 AM
Hi,
Create the Dfferent Blocks on the selection screen....depending on the radio button display the corresponing block. For this use Loop at Screen....Endloop in the At Selection-screen Event.
2008 Dec 08 9:18 AM
2008 Dec 08 1:21 PM
Hi MVPhani,
If u wish to create radio-buttons ( or check-boxes only ) dynamically, then u can achieve the same functionality using the below simpler alternative...
Put a button and while clicking it show the list of possible values ( taken from ur DB table ).. based on the selection display ur report... something like F4 help...
Check the below example..
TYPE-POOLS : slis.
TYPES : BEGIN OF ty_radiobuttons,
matnr TYPE matnr,
maktx TYPE maktx,
END OF ty_radiobuttons.
DATA : lt_radiobuttons TYPE STANDARD TABLE OF ty_radiobuttons,
ls_radiobutton TYPE ty_radiobuttons,
lt_fcat TYPE slis_t_fieldcat_alv,
ls_fcat TYPE LINE OF slis_t_fieldcat_alv.
PARAMETER selvalue TYPE matnr.
SELECTION-SCREEN PUSHBUTTON 60(20) text USER-COMMAND push.
INITIALIZATION.
MOVE 'Dynamic selection' TO text.
SELECT matnr
maktx
FROM makt UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE lt_radiobuttons
WHERE spras EQ sy-langu.
AT SELECTION-SCREEN .
CASE sy-ucomm.
WHEN 'PUSH'.
PERFORM popup.
WHEN OTHERS.
ENDCASE.
START-OF-SELECTION.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
FORM popup.
DATA : selected_row TYPE slis_selfield,
action.
PERFORM build_fcat.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_selection = 'X'
i_zebra = 'X'
i_tabname = 'LT_RADIOBUTTONS'
it_fieldcat = lt_fcat
IMPORTING
es_selfield = selected_row
e_exit = action
TABLES
t_outtab = lt_radiobuttons
EXCEPTIONS
program_error = 1
OTHERS = 2.
CHECK sy-subrc EQ 0.
CHECK action NE 'X'.
READ TABLE lt_radiobuttons INTO ls_radiobutton INDEX selected_row-tabindex.
MOVE ls_radiobutton-matnr TO selvalue.
ENDFORM. "popup
*&---------------------------------------------------------------------*
FORM build_fcat.
FREE lt_fcat.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-seltext_l = 'Material'.
ls_fcat-outputlen = '10'.
APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat.
ls_fcat-fieldname = 'MAKTX'.
ls_fcat-seltext_l = 'Description'.
ls_fcat-outputlen = '20'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ENDFORM. "build_fcatCheers,
Jose.
2008 Dec 09 3:56 AM
Phani,
check this link http://saptechnical.com/Tutorials/ABAP/ABAPMainPage.htm and you will find many examples on creating selection screen
Thanks
Bala Duvvuri
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |