본문 바로가기
ERP-SAP/ABAP

<ABAP> DEFINE의 활용.

by 행복한워니의 기록 2010. 12. 23.
728x90
반응형

이런 프로그램...

*----------------------------------------------------------------------*
* PROGRAM      :  ZFTARMM12                                            *
* DESCRIPTION  :  [FTA] Database 초기화                                *
* MODULE       :                                                       *
* DEVELOPER    :  KCJ                                                  *
* EXTERNAL REF :                                                       *
* CREATED DATE :  2010.12.01                                           *
* TRANSACTION  :  ZFTATMM12                                            *
*----------------------------------------------------------------------*
* MODIFIED HISTORY :                                                   *
*  DEVELOPER        DATE          DESCRIPTION                          *
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*

REPORT  zftarmm12  MESSAGE-ID zfta_cls_msg.


*----------------------------------------------------------------------*
* INCLUDE
*----------------------------------------------------------------------*
INCLUDE zftarmm12top.   <- 여기 선언된 DEFINE 을 보자.
INCLUDE zftarmm12evt.
INCLUDE zftarmm12f01.



------------------------------------------------------------------------------------------

TOP 부분!!

*&---------------------------------------------------------------------*
*&  Include           ZFTARMM12TOP
*&---------------------------------------------------------------------*

*----------------------------------------------------------------------*
* DATA & TYPE
*----------------------------------------------------------------------*
TYPE-POOLS:
  col,
  icon,
  abap.


TYPES:
  BEGIN OF t_db,
    status  TYPE icon-id,
    tabname TYPE dd02l-tabname,
    ddtext  TYPE dd02t-ddtext,
    msg     TYPE bapi_msg,
    mark(1) TYPE c,
  END OF t_db.


DATA:
  gr_table     TYPE REF TO cl_salv_table,
  gt_delete_db TYPE STANDARD TABLE OF t_db.


FIELD-SYMBOLS:
  <delete_db> TYPE t_db.


DEFINE %check_box.                       <- 이곳에 정의되어있다.
  selection-screen begin of line.
  selection-screen position 3.
  parameters:      p_&1 type c as checkbox modif id chk   <- &1으로 되어있는것을 주목
                               user-command push.
  selection-screen comment (35) text-&1 for field p_&1.    <- &1으로 되어있는것을 주목
  selection-screen end of line.
END-OF-DEFINITION.

*----------------------------------------------------------------------*
* SELECTION-SCREEN
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK s10 WITH FRAME TITLE text-t01
                                    NO INTERVALS.
PARAMETERS:      p_alldb TYPE c RADIOBUTTON GROUP ch1
                                USER-COMMAND push    <- 이 부분도  다른면에서 봐줘야 될...
                                DEFAULT 'X',
                 p_seldb TYPE c RADIOBUTTON GROUP ch1.

SELECTION-SCREEN BEGIN OF BLOCK s11.
%check_box: d03,                       <-- 이곳이 DEFINE 을 활용하는 곳이다.
            d04,                       <-- &1에 D03, D04, D05가 순서대로 들어간다.
            d05,
            d07,
            d08,
            d09,
            d10,
            d12,
            d13.
SELECTION-SCREEN END OF BLOCK s11.
SELECTION-SCREEN END OF BLOCK s10.

SELECTION-SCREEN BEGIN OF BLOCK s02 WITH FRAME TITLE text-t02
                                    NO INTERVALS.
PARAMETERS:      p_vari TYPE disvariant-variant.
SELECTION-SCREEN END OF BLOCK s02.


-----------------------------------------------------

그러면 스크린에는...
사진이 안올라가네....




허허허..


스크린은...

  LOOP AT SCREEN.
    IF p_alldb = abap_true.
      IF screen-group1 = 'CHK'.
        screen-input = abap_false.   <-ABAP_FALSE 는 공백, ABAP_TRUE 는 X 이다.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.
  
이렇게 해서 CHK 가 된 그룹은 인풋이 안되도록 만든다 .


728x90
반응형