*&---------------------------------------------------------------------*
*& REPORT Z_RADIO_BUTTON_REPORT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_RADIO_BUTTON_REPORT.
TABLES: SPFLI, SFLIGHT.
TYPES: BEGIN OF ST1,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
CITYFROM TYPE SPFLI-CITYFROM,
END OF ST1.
TYPES: BEGIN OF ST2,
FLDATE TYPE SFLIGHT-FLDATE,
PRICE TYPE SFLIGHT-PRICE,
CURRENCY TYPE SFLIGHT-CURRENCY,
END OF ST2.
DATA: WA1 TYPE ST1,
WA2 TYPE ST2.
DATA: ITAB1 TYPE STANDARD TABLE OF ST1,
ITAB2 TYPE STANDARD TABLE OF ST2.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : C1 RADIOBUTTON GROUP RG1 DEFAULT 'X' USER-COMMAND FLG,
C2 RADIOBUTTON GROUP RG1.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: FLIGHTS FOR SPFLI-CARRID MODIF ID ONE,
CONNID FOR SPFLI-CONNID MODIF ID ONE.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS:DATE FOR SFLIGHT-FLDATE MODIF ID TWO.
SELECTION-SCREEN END OF BLOCK B3.
AT SELECTION-SCREEN OUTPUT.
IF C1 IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ONE'.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF C2 IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'TWO'.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
IF C1 EQ 'X'.
PERFORM CARRID.
ELSE.
PERFORM DATE.
ENDIF.
*&---------------------------------------------------------------------*
*& FORM CARRID
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
* --> P1 TEXT
* <-- P2 TEXT
*----------------------------------------------------------------------*
FORM CARRID .
SELECT CARRID CONNID COUNTRYFR CITYFROM
INTO TABLE ITAB1
FROM SPFLI
WHERE CARRID IN FLIGHTS AND CONNID IN CONNID.
LOOP AT ITAB1 INTO WA1.
WRITE: / WA1-CARRID,
WA1-CONNID,
WA1-COUNTRYFR,
WA1-CITYFROM.
ENDLOOP.
IF SY-SUBRC NE 0.
SKIP.
ULINE.
WRITE : '|', 'DATA NOT FOUND FOR GIVEN CRITERIA' COLOR 7 INVERSE ON , 130 '|'.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& FORM DATE
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
* --> P1 TEXT
* <-- P2 TEXT
*----------------------------------------------------------------------*
FORM DATE .
SELECT FLDATE PRICE CURRENCY
INTO TABLE ITAB2
FROM SFLIGHT
WHERE FLDATE in DATE.
LOOP AT ITAB2 INTO WA2.
WRITE: / WA2-FLDATE,
WA2-PRICE,
WA2-CURRENCY.
ENDLOOP.
IF SY-SUBRC NE 0.
SKIP.
ULINE.
WRITE : '|', 'DATA NOT FOUND FOR GIVEN CRITERIA' COLOR 7 INVERSE ON , 130 '|'.
ENDIF.
ENDFORM.
*& REPORT Z_RADIO_BUTTON_REPORT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_RADIO_BUTTON_REPORT.
TABLES: SPFLI, SFLIGHT.
TYPES: BEGIN OF ST1,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
CITYFROM TYPE SPFLI-CITYFROM,
END OF ST1.
TYPES: BEGIN OF ST2,
FLDATE TYPE SFLIGHT-FLDATE,
PRICE TYPE SFLIGHT-PRICE,
CURRENCY TYPE SFLIGHT-CURRENCY,
END OF ST2.
DATA: WA1 TYPE ST1,
WA2 TYPE ST2.
DATA: ITAB1 TYPE STANDARD TABLE OF ST1,
ITAB2 TYPE STANDARD TABLE OF ST2.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : C1 RADIOBUTTON GROUP RG1 DEFAULT 'X' USER-COMMAND FLG,
C2 RADIOBUTTON GROUP RG1.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: FLIGHTS FOR SPFLI-CARRID MODIF ID ONE,
CONNID FOR SPFLI-CONNID MODIF ID ONE.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS:DATE FOR SFLIGHT-FLDATE MODIF ID TWO.
SELECTION-SCREEN END OF BLOCK B3.
AT SELECTION-SCREEN OUTPUT.
IF C1 IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ONE'.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF C2 IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'TWO'.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
IF C1 EQ 'X'.
PERFORM CARRID.
ELSE.
PERFORM DATE.
ENDIF.
*&---------------------------------------------------------------------*
*& FORM CARRID
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
* --> P1 TEXT
* <-- P2 TEXT
*----------------------------------------------------------------------*
FORM CARRID .
SELECT CARRID CONNID COUNTRYFR CITYFROM
INTO TABLE ITAB1
FROM SPFLI
WHERE CARRID IN FLIGHTS AND CONNID IN CONNID.
LOOP AT ITAB1 INTO WA1.
WRITE: / WA1-CARRID,
WA1-CONNID,
WA1-COUNTRYFR,
WA1-CITYFROM.
ENDLOOP.
IF SY-SUBRC NE 0.
SKIP.
ULINE.
WRITE : '|', 'DATA NOT FOUND FOR GIVEN CRITERIA' COLOR 7 INVERSE ON , 130 '|'.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& FORM DATE
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
* --> P1 TEXT
* <-- P2 TEXT
*----------------------------------------------------------------------*
FORM DATE .
SELECT FLDATE PRICE CURRENCY
INTO TABLE ITAB2
FROM SFLIGHT
WHERE FLDATE in DATE.
LOOP AT ITAB2 INTO WA2.
WRITE: / WA2-FLDATE,
WA2-PRICE,
WA2-CURRENCY.
ENDLOOP.
IF SY-SUBRC NE 0.
SKIP.
ULINE.
WRITE : '|', 'DATA NOT FOUND FOR GIVEN CRITERIA' COLOR 7 INVERSE ON , 130 '|'.
ENDIF.
ENDFORM.
Execution Mode:
Selection screen with radio button C1:
Output:
Output:
No comments:
Post a Comment