Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Sat Nov 29, 2008 4:42 pm Post subject: Making the selection screen
Code:
* 'Hide' selection options
SELECT-OPTIONS:
s_postp for t_daten-postp MODIF ID sel.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if screen-name = 'S_POSTP-LOW'
or screen-name = 'S_POSTP-HIGH'.
screen-input = '0'.
MODIFY SCREEN.
endif. " screen-name = S_BWART-LOW'
ENDLOOP. " AT SCREEN
* auch mal die Hilfe zur Tabelle SCREEN lesen!
~~~~~~~~~~~~~~~~~~
*Status offen
PARAMETERS dy_ofn LIKE rihea-dy_ofn DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(11) text-101 FOR FIELD dy_ofn ID 101.
*Mit Kosten ausgeben? - Checkbox rechts!
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(24) text-008 FOR FIELD p_kost.
SELECTION-SCREEN POSITION pos_low.
PARAMETERS: p_kost AS CHECKBOX.
SELECTION-SCREEN END OF LINE .
*Partnerrolle-1 als Drop-Down-Box
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) text-005 FOR FIELD p_parvw1.
PARAMETERS p_parvw1 LIKE ihpa-parvw AS LISTBOX VISIBLE LENGTH 22.
SELECTION-SCREEN END OF LINE.
~~~~~~~~~~~~~~~~~~
* Mehrere Reitertabs
selection-screen begin of tabbed block all for 22 lines.
selection-screen tab (20) sopt user-command 'SOPT' default screen 100.
selection-screen tab (20) spar user-command 'SPAR' default screen 200.
selection-screen tab (15) apar user-command 'APAR' default screen 300.
selection-screen tab (15) sort user-command 'SORT' default screen 400.
selection-screen tab (15) avar user-command 'AVAR' default screen 500.
selection-screen end of block all.
selection-screen begin of screen 100 as subscreen.
selection-screen begin of block sel with frame title text-001.
selection-screen skip.
select-options:
s_kunnr for wa_result-kunnr, " Kundennummer
s_spart for wa_result-spart. " Sparte
selection-screen end of block sel.
selection-screen end of screen 100.
*
selection-screen begin of screen 200 as subscreen.
selection-screen begin of block pars with frame title text-012.
selection-screen skip.
* Liferstatus
selection-screen begin of line.
selection-screen comment (20) for field p_lfgsa.
selection-screen position pos_low.
parameters: p_lfgsa type zzlsstat.
selection-screen end of line.
selection-screen end of block pars.
selection-screen end of screen 200.
* usw.
~~~~~~~~~~~~~~~~~~
* 4 Parameter in einer Zeile
SELECTION-SCREEN BEGIN OF LINE. "Bedarfsvorlaufkennzeichen
SELECTION-SCREEN COMMENT 1(25) text-004.
SELECTION-SCREEN POSITION 31.
PARAMETERS: p_shflgo AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN POSITION 38.
PARAMETERS: p_shflga(3).
SELECTION-SCREEN COMMENT 43(7) text-005.
PARAMETERS: p_shflgn(3). " like marc-shflg.
SELECTION-SCREEN POSITION 59.
PARAMETERS: p_shflgd AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
* 4 Checkboxen in einer Zeile
SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF LINE.
*Status offen
PARAMETERS dy_ofn LIKE rihea-dy_ofn DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(11) text-101 FOR FIELD dy_ofn ID 101.
*Status zurückgemeldet
PARAMETERS dy_rst LIKE rihea-dy_rst DEFAULT 'X'.
SELECTION-SCREEN COMMENT 16(10) text-102 FOR FIELD dy_rst ID 102.
*Status in Arbeit
PARAMETERS dy_iar LIKE rihea-dy_iar DEFAULT 'X'.
SELECTION-SCREEN COMMENT 29(10) text-103 FOR FIELD dy_iar ID 103.
*Status abgeschlossen
PARAMETERS dy_mab LIKE rihea-dy_mab DEFAULT 'X'.
SELECTION-SCREEN COMMENT 42(10) text-104 FOR FIELD dy_mab ID 104.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block0.
~~~~~~~~~~~~~~~~~~
* Selektionsvariante sichern
AT SELECTION-SCREEN.
data:
h_repid LIKE sy-repid.
seltab TYPE TABLE OF rsparams WITH HEADER LINE.
h_repid = sy-repid.
* Selektionsvariante für Protokollierung sichern
IF sy-ucomm EQ 'ONLI'.
REFRESH seltab.
CLEAR seltab.
* selektionen lesen und merken
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = h_repid
TABLES
selection_table = seltab.
ENDIF. " sy-ucomm eq 'ONLI'
~~~~~~~~~~~~~~~~~~
* Einzel-Parameter nicht eingabebereit machen
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_BLANK'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF. " screen-name = 'P_BLANK'
ENDLOOP. " AT SCREEN
~~~~~~~~~~~~~~~~~~
* Selektionsbildschirm mit mehreren Tabs
selection-screen begin of tabbed block all for 24 lines.
selection-screen tab (20) sopt user-command 'SOPT' default screen 100.
selection-screen tab (20) spar user-command 'SPAR' default screen 200.
selection-screen tab (15) apar user-command 'APAR' default screen 300.
selection-screen tab (15) sort user-command 'SORT' default screen 400.
selection-screen tab (15) avar user-command 'AVAR' default screen 500.
selection-screen end of block all.
* Registerblatt Selektionsoptionen
selection-screen begin of screen 100 as subscreen.
selection-screen begin of block sel with frame title text-001.
select-options:
s_kunnr for wa_result-kunnr. " Kundennummer
selection-screen end of block sel.
selection-screen end of screen 100.
~~~~~~~~~~~~~~~~~~
*Eingrenzen der Selektionsoptionen (zum Zeitpunkt INITIALIZATION)
* Werke, VKORGs, VTWEGs dürfen nur einzeln definiert werden um
* später über s_werks loopen zu können
SELECT-OPTIONS:
s_werks FOR t_daten-werks NO INTERVALS,
s_vkorg FOR t_daten-vkorg NO INTERVALS,
s_vtweg FOR t_daten-vtweg NO INTERVALS.
*&---------------------------------------------------------------------*
* Form initialization
*---------------------------------------------------------------------*
FORM initialization.
* Inkludieren des Typepools SSCR
TYPE-POOLS sscr.
* Definition des Objekts, das an den Parameter RESTRICTION übergeben
* wird.
DATA restrict TYPE sscr_restrict.
* Hilfsobjekte zum Füllen von RESTRICT
DATA opt_list TYPE sscr_opt_list.
DATA ass TYPE sscr_ass.
* EQ_AND_CP: nur EQ und CP erlaubt
CLEAR opt_list.
MOVE 'EQ_AND_CP' TO opt_list-name.
MOVE 'X' TO: opt_list-options-cp, opt_list-options-eq.
APPEND opt_list TO restrict-opt_list_tab.
* Angabe der betroffenen Selektionsoptionen
CLEAR ass.
MOVE: 'S' TO ass-kind,
'S_VKORG' TO ass-name,
'I' TO ass-sg_main,
'EQ_AND_CP' TO ass-op_main.
APPEND ass TO restrict-ass_tab.
MOVE: 'S_VTWEG' TO ass-name.
APPEND ass TO restrict-ass_tab.
MOVE: 'S_WERKS' TO ass-name.
APPEND ass TO restrict-ass_tab.
* Eingrenzung der möglichen Selektionsoptionen
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
* PROGRAM =
restriction = restrict
* DB = ' '
EXCEPTIONS
too_late = 1
repeated = 2
selopt_without_options = 3
selopt_without_signs = 4
invalid_sign = 5
empty_option_list = 6
invalid_kind = 7
repeated_kind_a = 8
OTHERS = 9
. " Punkt
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " sy-subrc <> 0 - CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.