REPORT ZVVF_M014_CT1_BALAMT NO STANDARD PAGE HEADING LINE-SIZE 112.
*&---------------------------------------------------------------------*
*& Report ZVVF_M014_CT1_BALAMT *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
DATA : IT_CT1 LIKE TABLE OF ZVVF_CT1_PO.
DATA : WA_CT1 LIKE ZVVF_CT1_PO.
DATA : W_BAL_AMT TYPE ZVVF_MDBALAMT,
W_FLAG TYPE I,
W_NUMLIN TYPE I,
W_CLOBAL(16) TYPE P DECIMALS 4,
W_BOND_VALUE(16) TYPE P DECIMALS 4,
W_TEMP(25) TYPE C.
*----------------------------------------------------------------------*
* START-OF-SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM F001_FETCH_DATA.
*----------------------------------------------------------------------*
* END-OF-SELECTION *
*----------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM F002_DISPLAY_DATA.
FORMAT RESET.
WRITE : /1(112) TEXT-009 CENTERED.
*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
TOP-OF-PAGE.
PERFORM F003_HEADER.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
* EXPORTING
** I_INTERFACE_CHECK = ' '
** I_BYPASSING_BUFFER =
** I_BUFFER_ACTIVE = ' '
** I_CALLBACK_PROGRAM = ' '
** I_CALLBACK_PF_STATUS_SET = ' '
** I_CALLBACK_USER_COMMAND = ' '
* I_STRUCTURE_NAME = 'ZVVF_CT1_PO'
** IS_LAYOUT =
** IT_FIELDCAT =
** IT_EXCLUDING =
** IT_SPECIAL_GROUPS =
** IT_SORT =
** IT_FILTER =
** IS_SEL_HIDE =
** I_DEFAULT = 'X'
** I_SAVE = ' '
** IS_VARIANT =
** IT_EVENTS =
** IT_EVENT_EXIT =
** IS_PRINT =
** IS_REPREP_ID =
** I_SCREEN_START_COLUMN = 0
** I_SCREEN_START_LINE = 0
** I_SCREEN_END_COLUMN = 0
** I_SCREEN_END_LINE = 0
** IMPORTING
** E_EXIT_CAUSED_BY_CALLER =
** ES_EXIT_CAUSED_BY_USER =
* TABLES
* T_OUTTAB = IT_CT1
** EXCEPTIONS
** PROGRAM_ERROR = 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.
*&---------------------------------------------------------------------*
*& Form F001_FETCH_DATA
*&---------------------------------------------------------------------*
FORM F001_FETCH_DATA .
SELECT * FROM ZVVF_CT1_PO
INTO TABLE IT_CT1.
ENDFORM. " F001_FETCH_DATA
*&---------------------------------------------------------------------*
*& Form F002_DISPLAY_DATA
*&---------------------------------------------------------------------*
FORM F002_DISPLAY_DATA .
DESCRIBE TABLE IT_CT1 LINES W_NUMLIN.
IF W_NUMLIN > 0.
LOOP AT IT_CT1 INTO WA_CT1.
W_BOND_VALUE = WA_CT1-BOND_VALUE.
AT NEW BOND_NO.
W_CLOBAL = W_BOND_VALUE.
CLEAR W_TEMP.
WRITE W_BOND_VALUE ROUND 0 TO W_TEMP.
CONDENSE W_TEMP.
WRITE : /1 SY-VLINE, 2(15) 'Tracking No. :', WA_CT1-BOND_NO,
109 SY-VLINE.
WRITE : /1 SY-VLINE, 2 'Opening Balance :', 19 W_TEMP,
109 SY-VLINE.
ULINE AT /1(109).
ENDAT.
W_CLOBAL = W_CLOBAL - WA_CT1-EXCISE_AMT.
* WRITE : /1 SY-VLINE, 2(11) WA_CT1-BOND_NO,
* SY-VLINE, 15(17) WA_CT1-EBELN,
* SY-VLINE, 34(5) WA_CT1-EBELP,
* SY-VLINE, 41(10) WA_CT1-VALID_FROM,
* SY-VLINE, 53(10) WA_CT1-VALID_UPTO,
* SY-VLINE, 65(17) WA_CT1-EXCISE_AMT RIGHT-JUSTIFIED ,
* SY-VLINE, 84(17) WA_CT1-ITEM_VAL RIGHT-JUSTIFIED ,
* SY-VLINE, 103(18) WA_CT1-MATNR RIGHT-JUSTIFIED ,
* SY-VLINE.
PACK WA_CT1-MATNR TO WA_CT1-MATNR.
WRITE : /1 SY-VLINE, 2(17) WA_CT1-EBELN,
SY-VLINE, 21(5) WA_CT1-EBELP,
SY-VLINE, 28(10) WA_CT1-VALID_FROM,
SY-VLINE, 40(10) WA_CT1-VALID_UPTO,
SY-VLINE, 52(17) WA_CT1-EXCISE_AMT RIGHT-JUSTIFIED ,
SY-VLINE, 71(17) WA_CT1-ITEM_VAL RIGHT-JUSTIFIED ,
SY-VLINE, 90(18) WA_CT1-MATNR RIGHT-JUSTIFIED ,
SY-VLINE.
ULINE AT /1(109).
AT END OF BOND_NO.
CLEAR W_TEMP.
WRITE W_CLOBAL ROUND 0 TO W_TEMP.
CONDENSE W_TEMP.
WRITE : /1 SY-VLINE, 2(15) 'Tracking No. :', WA_CT1-BOND_NO,
109 SY-VLINE.
WRITE : /1 SY-VLINE, 2 'Closing Balance :', W_TEMP,
109 SY-VLINE.
CLEAR W_CLOBAL.
ULINE AT /1(109).
ENDAT.
ENDLOOP.
ELSE.
WRITE :/1 SY-VLINE, 2(100) TEXT-010 CENTERED,
150 SY-VLINE.
ENDIF.
ENDFORM. " F002_DISPLAY_DATA
*&---------------------------------------------------------------------*
*& Form F003_HEADER
*&---------------------------------------------------------------------*
FORM F003_HEADER .
FORMAT COLOR 1 INTENSIFIED OFF.
ULINE AT 1(109).
** WRITE : /1 SY-VLINE, 2(11) TEXT-001,
* WRITE : /1 SY-VLINE, 15(17) TEXT-002,
* SY-VLINE, 34(5) TEXT-003,
* SY-VLINE, 41(10) TEXT-004,
* SY-VLINE, 53(10) TEXT-005,
* SY-VLINE, 65(17) TEXT-006 RIGHT-JUSTIFIED ,
* SY-VLINE, 84(17) TEXT-007 RIGHT-JUSTIFIED ,
* SY-VLINE, 103(18) TEXT-008 RIGHT-JUSTIFIED ,
* SY-VLINE.
WRITE : /1 SY-VLINE, 2(17) TEXT-002,
SY-VLINE, 21(5) TEXT-003,
SY-VLINE, 28(10) TEXT-004,
SY-VLINE, 40(10) TEXT-005,
SY-VLINE, 52(17) TEXT-006 RIGHT-JUSTIFIED ,
SY-VLINE, 71(17) TEXT-007 RIGHT-JUSTIFIED ,
SY-VLINE, 90(18) TEXT-008 RIGHT-JUSTIFIED ,
SY-VLINE.
ULINE AT /1(109).
ENDFORM. " F003_HEADER
* W_FLAG = 0.
* LOOP AT IT_CT1 INTO WA_CT1.
* W_FLAG = 0.
* AT NEW BOND_NO.
* WA_CT1-BOND_VALUE = WA_CT1-BOND_VALUE.
* W_FLAG = 1.
* ENDAT.
* IF W_FLAG <> 1.
* WA_CT1-BOND_VALUE = WA_CT1-BAL_AMT.
* WA_CT1-BAL_AMT = WA_CT1-BOND_VALUE - WA_CT1-EXCISE_AMT.
* ENDIF.
* MODIFY IT_CT1 FROM WA_CT1.
* ENDLOOP.
No comments:
Post a Comment