乱糟糟的笔记

DEMO_CDS_JOIN

 

1.显示/隐藏 选择屏幕

*&---------------------------------------------------------------------*
*& SELECT-OPTIONS
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-000.
PARAMETER: P1 RADIOBUTTON GROUP GRP DEFAULT 'X' MODIF ID BL0 USER-COMMAND RAD,
           P2 RADIOBUTTON GROUP GRP             MODIF ID BL0.
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
PARAMETERS: P1100 RADIOBUTTON GROUP GRP1 DEFAULT 'X' MODIF ID B1 USER-COMMAND RAD2,
            P1200 RADIOBUTTON GROUP GRP1 MODIF ID B1,
            P1300 RADIOBUTTON GROUP GRP1 MODIF ID B1,
            P1020 RADIOBUTTON GROUP GRP1 MODIF ID B1,
            W1100 RADIOBUTTON GROUP GRP1 MODIF ID B1.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: S_MATNR FOR MSEG-MATNR MODIF ID B1.

PARAMETERS : P_WERKS LIKE MSEG-WERKS DEFAULT '1000' MODIF ID B1,
             P_LGORT LIKE MARD-LGORT DEFAULT '1100' MODIF ID B1A.
SELECT-OPTIONS: S_LGORT FOR MARD-LGORT MODIF ID B1B.
PARAMETERS:  P_DATUM LIKE SY-DATUM DEFAULT SY-DATUM MODIF ID B1,
             P_MJAHR LIKE SER03-MJAHR DEFAULT SY-DATUM+0(4) MODIF ID BL2,
             P2_LGORT LIKE MARD-LGORT DEFAULT '1000' MODIF ID BL2.

SELECT-OPTIONS: S2_MATNR FOR MSEG-MATNR MODIF ID BL2,
                S2_SERNR FOR OBJK-SERNR MODIF ID BL2,
                S2_MBLNR FOR SER03-MBLNR MODIF ID BL2,
                S2_DATUM FOR SER03-DATUM MODIF ID BL2.
PARAMETERS : P2_DATUM LIKE SY-DATUM DEFAULT SY-DATUM MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK BLK.
  

 

LOOP AT SCREEN.
    IF SCREEN-GROUP1 'BL0'.
      CONTINUE.
    ENDIF.
    IF P1 'X'.
      IF SCREEN-GROUP1+0(1'B' AND SCREEN-GROUP1+0(2) <> 'B1'.
        SCREEN-ACTIVE 0.
      ENDIF.
      IF W1100 'X'.
        IF SCREEN-GROUP1 'B1A'.
          SCREEN-ACTIVE 0.
        ENDIF.
      ELSE.
        IF SCREEN-GROUP1 'B1B'.
          SCREEN-ACTIVE 0.
        ENDIF.
      ENDIF.
    ELSE.
      IF SCREEN-GROUP1+0(1'B' AND SCREEN-GROUP1 <> 'BL2'.
        SCREEN-ACTIVE 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

 

2.NUMBER_GET_NEXT的使用注意事项

调用这个函数的时候要注意锁住对应的OBJECT,

其中'00'是指T-COD:SNRO下面番号,

IGNORE_BUFFER  = 'X'是防止跳号,设成'X‘就不会跳号了。

具体使用方法见文章:

*------锁住对应的OBJECT

CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
      EXPORTING
        OBJECT                 = '<obj>'
      EXCEPTIONS
        FOREIGN_LOCK           = 1
        OBJECT_NOT_FOUND       = 2
        SYSTEM_FAILURE         = 3
        OTHERS                 = 4.

*----- 
      CALL FUNCTION 'NUMBER_GET_NEXT'
        EXPORTING
          NR_RANGE_NR                   = '01'
          OBJECT                        = '<obj>'
          IGNORE_BUFFER                 = 'X'
        IMPORTING
          NUMBER                        = NO
        EXCEPTIONS
          INTERVAL_NOT_FOUND            = 1
          NUMBER_RANGE_NOT_INTERN       = 2
          OBJECT_NOT_FOUND              = 3
          QUANTITY_IS_0                 = 4
          QUANTITY_IS_NOT_1             = 5
          INTERVAL_OVERFLOW             = 6
          BUFFER_OVERFLOW               = 7
          OTHERS                        = 8.
*----- 解锁
    CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
      EXPORTING
        OBJECT = '<obj>'.

3.ABAP 报表搜索程序

        RPR_ABAP_SOURCE_SCAN

4.ABAP 报表屏幕下拉菜单

 


INITIALIZATION.

DATA
:list TYPE vrm_values, value LIKE LINE OF list. SELECT * INTO CORRESPONDING FIELDS OF TABLE <itb> FROM WHERE . CLEAR list. REFRESH list. LOOP AT <itb>. value-key = <itb>-<KEY>. CONCATENATE <itb>-matkl ' ' <itb>-zttxt INTO value-text. APPEND value TO list. ENDLOOP. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = 'P_< >' values = list * 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.

 

posted @ 2016-04-27 11:02  明大叔  阅读(560)  评论(0编辑  收藏  举报