Syntax selection screen

Select screen program syntax

1. PARAMETERS (see 1.6)

SSCRFIELDS selected fields on the screen

The COMMAND-FCode the USER : in the push button can be worked before, must TABLES sscrfields. Statement structure is SSCRFIELDS ABAP dictionary data interfaces to define workspace. When the user clicks a button triggers the AT SELECTION-SCREEN event, and code function  the FCode will be stored sscrfields-ucomm field.

PARAMETERS: A1(10) TYPE C,

 A2      TYPE I.

WRITE: / A1,/ A2.

2.SELECT-OPTIONS

SELECT-OPTIONS selcrit FOR {dobj|(name)}
               [screen_options]
               [value_options]
               [ldb_options].

l  screen_options

... [obligatory | NO-the DISPLAY]
    [VISIBLE the LENGTH VLEN]
    [NO-EXTENSION] . "Limit selection table to a single line, the input element does not appear behind the button
    [NO INTERVALS] " field appears only LOW,
    [Modif ID modid ] .... selection screen in the parameter options  MEMORY ID function is equivalent to the dialog screen in the SET / GET parameter, which is the effect is the same (both for SAP Memory), except for a select screen, for a dialogue screen.

l  value_options

... [DEFAULT val1 [TO val2] [OPTION opt] [SIGN sgn]]
    [LOWER CASE]
    [MATCHCODE OBJECT search_help]
    [MEMORY ID pid] ... .

SELECT-OPTIONS selcrit FOR {dobj|(name)}

The statement generates a named selcrit selected within condition table, the global table structure type following rows:

The DATA: the BEGIN. OF selcrit the OCCURS 0,
  Sign (1), "C Sign length field is a data type which is 1-bit flag, allowed values. The I and E
  Option (2)," data type OPTION field is C, length is 2, OPTION comprising operator selecting "
  low-MATNR the LIKE Mara, the data type of the field f low of the same type, the value range is selected and specified lower bound
  high LIKE mara-matnr," f the same data type field type HIGH the value range is selected and specified upper bound
END oF selcrit.

Syntax example:

s_werks FOR marc-werks OBLIGATORY DEFAULT 1001 to 1007 SIGN I OPTION BT 

3.SELECT-SCREEN.

SELECTION-SCREEN - BEGIN OF SCREEN.

  1. 1.  SELECTION-SCREEN BEGIN OF SCREEN dynnr [TITLE title]
                                           [AS WINDOW].
    SELECTION-SCREEN END OF SCREEN dynnr
  2. SELECTION-SCREEN BEGIN OF SCREEN dynnr AS SUBSCREEN
                            [NO INTERVALS] 创建的框架中限制SELECT只有一个输入项
                            [NESTING LEVEL n]. adjust the width of the subscreen if it is to be included in a tabstrip control in one or more frames. You must specify n directly as a number between 0 and 4.

SELECTION-SCREEN END OF SCREEN dynnr.

SELECTION-SCREEN - screen_elements


1. SELECTION SCREEN-the SKIP [n] [ldb_additions]. Space n rows

2. SELECTION SCREEN-ULINE [[/] [POS] (len)] [Modif ID modid]
                         [ldb_additions]. Position and length, to draw a horizontal line It must be used to effect the BLOCK
3. SELECTION SCREEN-the COMMENT [/] [POS] (len)
                           {text | {[text] the FOR the FIELD SEL}}
                           [VISIBLE the LENGTH VLEN]
                           [Modif ID modid]
                           . [ldb_additions]
. 4 . sELECTION-sCREEN PUSHBUTTON, [/] [POS] (len) BUTTON_TEXT position and length, the name
                         uSER-COMMAND ucom specified character code when the trigger button on the user selection screen
                              [VISIBLE lENGTH vlen]
                              [Modif ID modid]
                              [ldb_additions].
5. The SELECTION-SCREEN the BEGIN. OF the LINE. The generated screen control elements in a row.
  [SELECTION-SCREEN POSITION pos [ldb_additions ]]. In the BLOCK is generated in the space.
  The END. OF the LINE-SCREEN SELECTION.
6. The SELECTION SCREEN the BEGIN. OF-BLOCK Block
                           [the WITH the FRAME [TITLE title]] with a title frame
                           [NO INTERVALS].
  SELECTION SCREEN the END. OF-BLOCK Block.
7. The SELECTION SCREEN the BEGIN. OF-BLOCK tblock Tabbed n-LINES the FOR.
  ...
  SELECTION SCREEN-the TAB (len) the USER-Tab the COMMAND UCOM
                   [DEFAULT [PROGRAM prog] SCREEN dynnr].
  ...
  SELECTION-SCREEN END OF BLOCK tblock.
8. SELECTION-SCREEN FUNCTION KEY n [ldb_additions]. the application toolbar contains five inactive pushbuttons, to which the function codes FC01 to FC05 are assigned. This statement activates the pushbutton of the function code FC0n, whereby a value between 1 and 5 must be entered for n.

 

Syntax example:

 

Example 1:


SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
PARAMETERS: p1 TYPE c LENGTH 10,
            p2 TYPE c LENGTH 10,
            p3 TYPE c LENGTH 10.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
PARAMETERS: q1 TYPE c LENGTH 10,
            q2 TYPE c LENGTH 10,
            q3 TYPE c LENGTH 10.
SELECTION-SCREEN END OF SCREEN 200.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                  TAB (20) button1 USER-COMMAND push1,
                  TAB (20) button2 USER-COMMAND push2,
                  END OF BLOCK mytab.

INITIALIZATION.
  button1 = 'Selection Screen 1'.
  button2 = 'Selection Screen 2'.
  mytab-prog = sy-repid.
  mytab-dynnr = 100.
  mytab-activetab = 'PUSH1'.
AT SELECTION-SCREEN.
  CASE sy-dynnr.  “当前屏幕号
    WHEN 1000.
      CASE sy-ucomm.
        WHEN 'PUSH1'.
          mytab-dynnr = 100.
        WHEN 'PUSH2'.
          mytab-dynnr = 200.
        WHEN OTHERS.  
      ENDCASE.
  ENDCASE.

 

 

 

 

 

Example Two:

TYPE-POOLS icon.
TABLES sscrfields.            “选择屏幕上的字段
DATA functxt TYPE smp_dyntxt. “
动态文本的程序接口
PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.
SELECTION-SCREEN: FUNCTION KEY 1,   “FC01
                           FUNCTION KEY 2.   “FC02
INITIALIZATION.
  functxt-icon_id   = icon_ws_plane.
  functxt-quickinfo = 'Preselected Carrier'.
  functxt-icon_text = 'LH'.
  sscrfields-functxt_01 = functxt.
  functxt-icon_text = 'UA'.
  sscrfields-functxt_02 = functxt.
AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
    WHEN 'FC01'.
      p_carrid = 'LH'.
      p_cityfr = 'Frankfurt'.
    WHEN 'FC02'.
      p_carrid = 'UA'.
      p_cityfr = 'Chicago'.
    WHEN OTHERS.
  ENDCASE.

 

SELECTION-SCREEN INCLUDE

( Call existing screen elements )


PARAMETERSpara
   [OBLIGATORY [OFF]]
   [MODIF ID modid]
   [ID id].

 

 

 

 

SELECT-OPTIONS selcrit
 [OBLIGATORY [OFF]]
 [NO INTERVALS [OFF]]
 [NO-EXTENSIONS

[OFF]]
 [MODIF ID modid]
 [ID id].

 

COMMENT [/][pos](len) text
[FOR FIELD sel]
[MODIF ID modid]
[ID id].

 
PUSHBUTTON [/][pos](len) button_text
[USER-COMMAND ucom]
[MODIF ID modid]
[ID id].


BLOCKS block [ID id].

 


 

 


Syntax example:

 

SELECTION-SCREEN: BEGIN OF BLOCK block,
                  COMMENT /1(40) text,
                  ULINE.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK block.
SELECTION-SCREEN: BEGIN OF SCREEN 500 AS WINDOW,
                  INCLUDE BLOCKS block,
                  END OF SCREEN 500.
INITIALIZATION.
  text = 'Standard Selection'.
START-OF-SELECTION.
  CALL SELECTION-SCREEN '0500' STARTING AT 10 10. “调用屏幕

 

CALL SELECTION-SCREEN

CALL SELECTION-SCREEN dynnr
                      [STARTING AT col1 lin1
                      [ENDING   AT col2 lin2]]
                      [USING SELECTION-SET variant].

CALL SELECTION-SCREEN '0500' STARTING AT 10 10. " call screen

AT SELECTION-SCREEN

PAI is processed, after the selection screen, in response to the transport, F8, F1, F4 and other events.
      (1) Select screen event, where the variable is declared local variables.
     (2) check sy-ucomm determines a user command.
     (3) In response to this incident, the effectiveness of the inspection can be performed on the screen field, but you can not modify the selection screen.

 

{OUTPUT}  control (PBO treatment is invoked before the selection screen element value of each screen is a screen output; incident on the response screen, the user ENTER or F8 after also called; may modify the selection screen fields by a modify screen )
  | {{para the ON |}} selcrit check the specific input field is complete or correct


  | {END OF selcrit ON}
  |} {ON BLOCK Block trigger event framework (control input element values framework of the screen)
  | RADIOBUTTON the GROUP Radi} {ON radio button event, you must enter an overall inspection
  | {}
  | { {-the REQUEST the HELP the ON |} of VALUE the REQUEST- value- <the F4> trigger key help- <Fl> when bond
  | FOR {para | selcrit-low | selcrit-high}} check the specific input field is complete or correct
  | { ON EXIT-COMMAND}. response "BACK", "CANCEL", "EXIT" other events

Syntax example:

PARAMETERS p_carrid TYPE spfli-carrid.

AT SELECTION-SCREEN ON p_carrid.

IF p_carrid IS INITIAL.

Guess you like

Origin www.cnblogs.com/xj159/p/11949234.html