Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

This report for Vendor Balance Reconcillation.......

Hi Seniors,

Please help me with this issue........i have to develope a New report Vendor balance Reconcillation ......Using the Standard report S_ALR_87012082 vendor balances in local currency.....it should be same like this Standard report but this Report is not Designed to give Line Items Because it has Picked up the Data only from few tables like LFA1 LFB1 LFC3.....which give Direct Balances in these tables......But i have Developed a report to Some Extent....But Finding it Difficult in Adding a Special GL Date which is Reflecting in the LFC3 Table....I have to Keep a Check Box Special GL balances in the Selection-Screen when when ever i select Special GL Balances indicator ....Date from LFC3

should be Selected and Addred to the Final in the Internal Table....I have Written a program .......Based on GSBER And LIFNR SUBTOTALS.....I have to Add this New check box in this Slection-Screen.....this report should be same like this Standard Report....S_ALR_87012082...the Program for this Report is RFKSLD00...please tel me the logic or help me with the Modification my below Report.....If i am not clear please reply me back...

waiting for your replys...

Thank you...

&----


*& Report ZVENDOR_BALANCES

*&

&----


*&

*&

&----


REPORT ZMM_PO_CHECKLIST.

TYPE-POOLS : SLIS.

DATA: it_fcat TYPE slis_t_fieldcat_alv,

wa_fcat LIKE LINE OF it_fcat,

lt_top_of_page TYPE slis_t_listheader,

ls_layout TYPE slis_layout_alv,

gt_events TYPE slis_t_event.

TYPES : BEGIN OF TY_BSEG,

LIFNR TYPE BSEG-LIFNR,

BUKRS TYPE BSEG-BUKRS,

BELNR TYPE BSEG-BELNR,

GJAHR TYPE BSEG-GJAHR,

SHKZG TYPE BSEG-SHKZG,

GSBER TYPE BSEG-GSBER,

DMBTR TYPE BSEG-DMBTR,

WRBTR TYPE BSEG-WRBTR,

SGTXT TYPE BSEG-SGTXT,

buzei TYPE bseg-buzei,

buzid TYPE bseg-buzid,

augdt TYPE bseg-augdt,

augcp TYPE bseg-augcp,

augbl TYPE bseg-augbl,

bschl TYPE bseg-bschl,

koart TYPE bseg-koart,

umskz TYPE bseg-umskz,

zuonr TYPE bseg-zuonr,

saknr TYPE bseg-saknr,

hkont TYPE bseg-hkont,

END OF TY_BSEG,

BEGIN OF TY_LFA1,

LIFNR TYPE LFA1-LIFNR,

LAND1 TYPE LFA1-LAND1,

NAME1 TYPE LFA1-NAME1,

END OF TY_LFA1,

BEGIN OF TY_LFC1,

LIFNR TYPE LFC1-LIFNR,

BUKRS TYPE LFC1-BUKRS,

GJAHR TYPE LFC1-GJAHR,

UMSAV TYPE LFC1-UMSAV,

END OF TY_LFC1,

BEGIN OF TY_BKPF,

BUKRS TYPE BKPF-BUKRS,

BELNR TYPE BKPF-BELNR,

GJAHR TYPE BKPF-GJAHR,

BLart type bkpf-blart,

BUDAT TYPE BKPF-BUDAT,

bldat TYPE bkpf-bldat,

monat TYPE bkpf-monat,

usnam TYPE bkpf-usnam,

xblnr TYPE bkpf-xblnr,

END OF TY_BKPF,

BEGIN OF it_bsak,

bukrs TYPE bsak-bukrs,

lifnr TYPE bsak-lifnr,

umskz TYPE bsak-umskz,

augdt TYPE bsak-augdt,

augbl TYPE bsak-augbl,

zuonr TYPE bsak-zuonr,

gjahr TYPE bsak-gjahr,

belnr TYPE bsak-belnr,

buzei TYPE bsak-buzei,

budat TYPE bsak-budat,

bldat TYPE bsak-bldat,

xblnr TYPE bsak-xblnr,

blart TYPE bsak-blart,

monat TYPE bsak-monat,

bschl TYPE bsak-bschl,

shkzg TYPE bsak-shkzg,

gsber TYPE bsak-gsber,

dmbtr TYPE bsak-dmbtr,

wrbtr TYPE bsak-wrbtr,

sgtxt TYPE bsak-sgtxt,

saknr TYPE bsak-saknr,

hkont TYPE bsak-hkont,

END OF it_bsak,

BEGIN OF it_skat,

spras TYPE skat-spras,

saknr TYPE skat-saknr,

txt20 TYPE skat-txt20,

txt50 TYPE skat-txt50,

END OF it_skat,

BEGIN OF TY_ITAB,

GSBER TYPE BSEG-GSBER,

LIFNR TYPE BSEG-LIFNR,

BUKRS TYPE BSEG-BUKRS,

BELNR TYPE BSEG-BELNR,

GJAHR TYPE BSEG-GJAHR,

SHKZG TYPE BSEG-SHKZG,

  • GSBER TYPE BSEG-GSBER,

DMBTR TYPE BSEG-DMBTR,

WRBTR TYPE BSEG-WRBTR,

SGTXT TYPE BSEG-SGTXT,

buzei TYPE bseg-buzei,

buzid TYPE bseg-buzid,

augdt TYPE bseg-augdt,

augcp TYPE bseg-augcp,

augbl TYPE bseg-augbl,

bschl TYPE bseg-bschl,

koart TYPE bseg-koart,

umskz TYPE bseg-umskz,

zuonr TYPE bseg-zuonr,

saknr TYPE bseg-saknr,

hkont TYPE bseg-hkont,

  • LIFNR TYPE LFA1-LIFNR,

LAND1 TYPE LFA1-LAND1,

NAME1 TYPE LFA1-NAME1,

DMBTR_H TYPE BSEG-WRBTR,

DMBTR_S TYPE BSEG-WRBTR,

DH TYPE BSEG-WRBTR,

DS TYPE BSEG-WRBTR,

HS TYPE BSEG-WRBTR,

BAL TYPE BSEG-WRBTR,

FLAG TYPE C,

  • LIFNR TYPE LFC1-LIFNR,

  • BUKRS TYPE LFC1-BUKRS,

  • GJAHR TYPE LFC1-GJAHR,

UMSAV TYPE LFC1-UMSAV,

UM(15) TYPE P DECIMALS 2,

  • BUKRS TYPE BKPF-BUKRS,

  • BELNR TYPE BKPF-BELNR,

  • GJAHR TYPE BKPF-GJAHR,

BLart type bkpf-blart,

BUDAT TYPE BKPF-BUDAT,

bldat TYPE bkpf-bldat,

monat TYPE bkpf-monat,

usnam TYPE bkpf-usnam,

xblnr TYPE bkpf-xblnr,

spras TYPE skat-spras,

  • saknr TYPE skat-saknr,

txt20 TYPE skat-txt20,

txt50 TYPE skat-txt50,

LINE_COLOR(4) TYPE C,

LINE_CTR(4) TYPE C,

END OF TY_ITAB,

BEGIN OF TY_TEMP,

LIFNR TYPE BSEG-LIFNR,

GSBER TYPE BSEG-GSBER,

BUKRS TYPE BSEG-BUKRS,

BELNR TYPE BSEG-BELNR,

GJAHR TYPE BSEG-GJAHR,

SHKZG TYPE BSEG-SHKZG,

  • GSBER TYPE BSEG-GSBER,

DMBTR TYPE BSEG-DMBTR,

WRBTR TYPE BSEG-WRBTR,

SGTXT TYPE BSEG-SGTXT,

buzei TYPE bseg-buzei,

buzid TYPE bseg-buzid,

augdt TYPE bseg-augdt,

augcp TYPE bseg-augcp,

augbl TYPE bseg-augbl,

bschl TYPE bseg-bschl,

koart TYPE bseg-koart,

umskz TYPE bseg-umskz,

zuonr TYPE bseg-zuonr,

saknr TYPE bseg-saknr,

hkont TYPE bseg-hkont,

  • LIFNR TYPE LFA1-LIFNR,

LAND1 TYPE LFA1-LAND1,

NAME1 TYPE LFA1-NAME1,

  • LIFNR TYPE LFC1-LIFNR,

  • BUKRS TYPE LFC1-BUKRS,

  • GJAHR TYPE LFC1-GJAHR,

UMSAV TYPE LFC1-UMSAV,

DMBTR_H TYPE BSEG-WRBTR,

DMBTR_S TYPE BSEG-WRBTR,

HS TYPE BSEG-WRBTR,

BAL TYPE BSEG-WRBTR,

FLAG TYPE C,

  • FLAG TYPE C,

  • BUKRS TYPE BKPF-BUKRS,

  • BELNR TYPE BKPF-BELNR,

  • GJAHR TYPE BKPF-GJAHR,

BLart type bkpf-blart,

BUDAT TYPE BKPF-BUDAT,

bldat TYPE bkpf-bldat,

monat TYPE bkpf-monat,

usnam TYPE bkpf-usnam,

xblnr TYPE bkpf-xblnr,

  • bukrs TYPE bsak-bukrs,

  • lifnr TYPE bsak-lifnr,

  • umskz TYPE bsak-umskz,

  • augdt TYPE bsak-augdt,

  • augbl TYPE bsak-augbl,

  • zuonr TYPE bsak-zuonr,

  • gjahr TYPE bsak-gjahr,

  • belnr TYPE bsak-belnr,

  • buzei TYPE bsak-buzei,

  • budat TYPE bsak-budat,

  • bldat TYPE bsak-bldat,

  • xblnr TYPE bsak-xblnr,

  • blart TYPE bsak-blart,

  • monat TYPE bsak-monat,

  • bschl TYPE bsak-bschl,

  • shkzg TYPE bsak-shkzg,

  • gsber TYPE bsak-gsber,

  • dmbtr TYPE bsak-dmbtr,

  • wrbtr TYPE bsak-wrbtr,

  • sgtxt TYPE bsak-sgtxt,

  • saknr TYPE bsak-saknr,

  • hkont TYPE bsak-hkont,

spras TYPE skat-spras,

  • saknr TYPE skat-saknr,

txt20 TYPE skat-txt20,

txt50 TYPE skat-txt50,

LINE_COLOR(4) TYPE C,

LINE_CTR(4) TYPE C,

END OF TY_TEMP.

DATA : IT_BSEG TYPE STANDARD TABLE OF TY_BSEG WITH HEADER LINE,

IT_LFA1 TYPE STANDARD TABLE OF TY_LFA1 WITH HEADER LINE,

IT_LFC1 TYPE STANDARD TABLE OF TY_LFC1 WITH HEADER LINE,

IT_BKPF TYPE STANDARD TABLE OF TY_BKPF WITH HEADER LINE,

  • IT_BSIK TYPE STANDARD TABLE OF TY_BSIK WITH HEADER LINE,

  • IT_BSAK TYPE STANDARD TABLE OF TY_BSAK WITH HEADER LINE,

  • IT_BSIP TYPE STANDARD TABLE OF TY_BSIP WITH HEADER LINE,

IT_SKAT TYPE STANDARD TABLE OF IT_SKAT WITH HEADER LINE,

IT_ITAB TYPE STANDARD TABLE OF TY_ITAB WITH HEADER LINE,

IT_TEMP TYPE STANDARD TABLE OF TY_TEMP WITH HEADER LINE.

TABLES : BSEG, LFA1, LFC1, BKPF ,SKAT.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T001.

SELECT-OPTIONS: Vendor FOR BSEG-LIFNR OBLIGATORY.

PARAMETERS : CoCd LIKE BSEG-BUKRS OBLIGATORY.

PARAMETERS : Fiscal LIKE BSEG-GJAHR OBLIGATORY.

SELECT-OPTIONS : Period FOR BKPF-MONAT .

*SELECT-OPTIONS : b_monate for rfsdo-allgbmon "Berichtsperioden

  • no-extension,

*SELECT-OPTIONS: SO_LIFNR FOR BSEG-LIFNR.

  • SO_BELNR FOR BSEG-BELNR.

SELECTION-SCREEN END OF BLOCK B1.

PERFORM DATA_RETRIVE.

*PERFORM SUB_MOVE_DATA.

**

**PERFORM SUB_FETCH_EXTRA_DATA.

**PERFORM SUB_MOVE_EXTRA_DATA.

*

PERFORM SUB_CALC.

PERFORM SUB_FIELDCAT.

PERFORM SUB_DISPLAY.

&----


*& Form DATA_RETRIVE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form DATA_RETRIVE .

SELECT LIFNR BUKRS BELNR GJAHR SHKZG GSBER DMBTR WRBTR SGTXT BUZEI

BUZID AUGDT AUGCP AUGBL BSCHL KOART UMSKZ ZUONR SAKNR HKONT

FROM BSEG INTO TABLE IT_BSEG

WHERE LIFNR IN vendor AND BUKRS = CoCd AND GJAHR = Fiscal.

IF NOT IT_BSEG[] IS INITIAL.

SELECT LIFNR LAND1 NAME1

FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_BSEG

WHERE LIFNR = IT_BSEG-LIFNR.

ENDIF.

IF NOT IT_BSEG[] IS INITIAL.

SELECT LIFNR BUKRS GJAHR UMSAV

FROM LFC1 INTO TABLE IT_LFC1 FOR ALL ENTRIES IN IT_BSEG

WHERE LIFNR = IT_BSEG-LIFNR AND BUKRS = IT_BSEG-BUKRS AND GJAHR = IT_BSEG-GJAHR.

ENDIF.

IF NOT IT_BSEG[] IS INITIAL.

SELECT BUKRS BELNR GJAHR BLART BUDAT BLDAT MONAT USNAM XBLNR

FROM BKPF INTO TABLE IT_BKPF FOR ALL ENTRIES IN IT_BSEG

WHERE MONAT IN Period AND BUKRS = IT_BSEG-BUKRS AND GJAHR = IT_BSEG-GJAHR AND BELNR = IT_BSEG-BELNR.

ENDIF.

LOOP AT IT_BSEG.

IT_ITAB-LIFNR = IT_BSEG-LIFNR.

IT_ITAB-BUKRS = IT_BSEG-BUKRS.

IT_ITAB-BELNR = IT_BSEG-BELNR.

IT_ITAB-GJAHR = IT_BSEG-GJAHR.

IT_ITAB-SHKZG = IT_BSEG-SHKZG.

IT_ITAB-GSBER = IT_BSEG-GSBER.

IT_ITAB-DMBTR = IT_BSEG-DMBTR.

IT_ITAB-WRBTR = IT_BSEG-WRBTR.

IT_ITAB-SGTXT = IT_BSEG-SGTXT.

IT_ITAB-BUZEI = IT_BSEG-BUZEI.

IT_ITAB-BUZID = IT_BSEG-BUZID.

IT_ITAB-AUGDT = IT_BSEG-AUGDT.

IT_ITAB-AUGCP = IT_BSEG-AUGCP.

IT_ITAB-AUGBL = IT_BSEG-AUGBL.

IT_ITAB-BSCHL = IT_BSEG-BSCHL.

IT_ITAB-KOART = IT_BSEG-KOART.

IT_ITAB-UMSKZ = IT_BSEG-UMSKZ.

IT_ITAB-ZUONR = IT_BSEG-ZUONR.

IT_ITAB-SAKNR = IT_BSEG-SAKNR.

IT_ITAB-HKONT = IT_BSEG-HKONT.

READ TABLE IT_LFA1 WITH KEY LIFNR = IT_ITAB-LIFNR.

IF SY-SUBRC = 0.

IT_ITAB-LAND1 = IT_LFA1-LAND1.

IT_ITAB-NAME1 = IT_LFA1-NAME1.

ENDIF.

READ TABLE IT_LFC1 WITH KEY LIFNR = IT_ITAB-LIFNR

BUKRS = IT_ITAB-BUKRS

GJAHR = IT_ITAB-GJAHR

BINARY SEARCH.

IF SY-SUBRC = 0.

IT_ITAB-UMSAV = IT_LFC1-UMSAV.

ENDIF.

READ TABLE IT_BKPF WITH KEY BUKRS = IT_ITAB-BUKRS

BELNR = IT_ITAB-BELNR

GJAHR = IT_ITAB-GJAHR.

IF SY-SUBRC = 0.

IT_ITAB-BLART = IT_BKPF-BLART.

IT_ITAB-BUDAT = IT_BKPF-BUDAT.

IT_ITAB-BLDAT = IT_BKPF-BLDAT.

IT_ITAB-MONAT = IT_BKPF-MONAT.

IT_ITAB-USNAM = IT_BKPF-USNAM.

IT_ITAB-XBLNR = IT_BKPF-XBLNR.

ENDIF.

APPEND IT_ITAB.

CLEAR IT_ITAB.

ENDLOOP.

endform. " DATA_RETRIVE

&----


*& Form SUB_CALC

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form SUB_CALC .

*SORT IT_ITAB BY LIFNR GSBER GJAHR.

*LOOP AT IT_ITAB.

*

*IF IT_ITAB-SHKZG = 'S'.

*

  • IT_ITAB-DMBTR = IT_ITAB-DMBTR * ( -1 ).

*

*ENDIF.

*CLEAR IT_ITAB-DMBTR_S.

*MODIFY IT_ITAB.

*ENDLOOP.

*

*LOOP AT IT_ITAB.

*

*IT_ITAB-BAL = IT_ITAB-UMSAV + IT_ITAB-DMBTR.

*

*MODIFY IT_ITAB.

*CLEAR IT_ITAB.

*ENDLOOP.

*LOOP AT IT_ITAB.

  • IF IT_ITAB-SHKZG = 'S'.

  • IT_ITAB-DMBTR = IT_ITAB-DMBTR * ( -1 ).

  • ENDIF.

  • MODIFY IT_ITAB.

*ENDLOOP.

LOOP AT IT_ITAB.

IF IT_ITAB-SHKZG = 'S'.

IT_ITAB-DMBTR_S = IT_ITAB-DMBTR .

ELSE.

IF IT_ITAB-SHKZG = 'H'.

IT_ITAB-DMBTR_H = IT_ITAB-DMBTR.

ENDIF.

ENDIF.

  • IT_ITAB-DMBTR = ''.

MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S DMBTR.

"VAR.

CLEAR IT_ITAB.

ENDLOOP.

*MOVE CORRESPONDING IT_LFC1-UMSAV = IT_ITAB-UMSAV.

SORT IT_ITAB BY LIFNR GSBER.

  • LOOP AT IT_ITAB.

      • IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.

      • IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.

      • IT_ITAB-DH = IT_ITAB-DMBTR_H.

      • IT_ITAB-DS = IT_ITAB-DMBTR_S.

  • IT_ITAB-FLAG = 'X'.

    • IT_ITAB-CTR = 'X'.

  • IT_ITAB-HS = IT_ITAB-DMBTR_H - IT_ITAB-DMBTR_S.

  • IT_ITAB-BAL = IT_ITAB-UMSAV + IT_ITAB-HS.

  • MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S HS

  • FLAG BAL.

  • CLEAR IT_ITAB.

  • ENDLOOP.

*LOOP AT IT_ITAB.

**IF IT_ITAB-MONAT = ''.

  • DELETE IT_ITAB[] WHERE MONAT = ''.

*MODIFY IT_ITAB.

*ENDLOOP.

*

  • LOOP AT IT_ITAB.

  • AT END OF GSBER.

  • SUM.

      • IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.

      • IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.

      • IT_ITAB-DH = IT_ITAB-DMBTR_H.

      • IT_ITAB-DS = IT_ITAB-DMBTR_S.

  • IT_ITAB-FLAG = 'X'.

    • IT_ITAB-CTR = 'X'.

  • IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.

  • IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.

*

  • IT_ITAB-HS = IT_ITAB-DMBTR_S - IT_ITAB-DMBTR_H.

  • IT_ITAB-BAL = IT_ITAB-UMSAV - IT_ITAB-HS.

  • MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S HS

  • FLAG BAL.

  • ENDAT.

  • CLEAR IT_ITAB.

  • ENDLOOP.

LOOP AT IT_ITAB.

AT END OF GSBER.

SUM.

IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.

IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.

IT_ITAB-DH = IT_ITAB-DMBTR_H.

IT_ITAB-DS = IT_ITAB-DMBTR_S.

IT_ITAB-FLAG = 'X'.

  • IT_ITAB-CTR = 'X'.

IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.

IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.

IT_ITAB-BAL = IT_ITAB-UMSAV + ( IT_ITAB-DMBTR_H - IT_ITAB-DMBTR_S ).

MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S DH DS

FLAG BAL.

ENDAT.

CLEAR IT_ITAB.

ENDLOOP.

*

  • DELETE IT_ITAB[] WHERE FLAG <> 'X'.

  • SORT IT_ITAB BY LIFNR GSBER.

  • LOOP AT IT_ITAB.

  • MOVE-CORRESPONDING IT_ITAB TO IT_TEMP.

  • APPEND IT_TEMP.

  • ENDLOOP.

*

  • REFRESH IT_ITAB.

  • SORT IT_TEMP BY LIFNR GSBER.

*

  • LOOP AT IT_TEMP.

  • MOVE-CORRESPONDING IT_TEMP TO IT_ITAB.

  • APPEND IT_ITAB.

  • CLEAR IT_ITAB.

*

  • AT END OF LIFNR.

  • SUM.

  • IT_TEMP-FLAG = ''.

  • MODIFY IT_TEMP INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S FLAG.

*

      • MOVE-CORRESPONDING IT_ITEMP TO IT_ITAB.

  • IT_ITAB-LIFNR = ''.

  • IT_ITAB-NAME1 = ''.

  • IT_ITAB-BELNR = ''.

  • IT_ITAB-BUKRS = ''.

  • IT_ITAB-GJAHR = ''.

  • IT_ITAB-GSBER = ''.

    • IT_ITAB-UMSAV = '0000'.

  • IT_ITAB-DMBTR_H = IT_TEMP-DMBTR_H.

  • IT_ITAB-DMBTR_S = IT_TEMP-DMBTR_S.

  • IT_ITAB-BAL = IT_TEMP-DMBTR_H - IT_TEMP-DMBTR_S.

  • IT_ITAB-FLAG = 'Y'.

    • IT_ItAB-CTR = IT_TEMO-CTR.

*

  • APPEND IT_ITAB.

*

  • ENDAT.

*

    • IF IT_ITAB-FLAG = 'Y'.

    • it_itab-line_color = 'C600'.

    • MODIFY IT_ITAB.

    • ENDIF.

*

  • CLEAR IT_TEMP.

  • ENDLOOP.

*

*

  • LOOP AT IT_ITAB WHERE FLAG = 'Y'.

  • it_itab-line_color = 'C602'.

  • MODIFY IT_ITAB INDEX SY-TABIX.

  • CLEAR IT_ITAB.

  • ENDLOOP.

*

    • loop at it_itab WHERE FLAG = ''.

    • it_itab-line_color = 'C103'.

      • IT_ITAB-LINE_CTR = 'C103'.

    • MODIFY IT_ITAB INDEX SY-TABIX.

    • CLEAR IT_ITAB.

    • ENDLOOP.

**

PERFORM SUB_CALC_1.

endform. " SUB_CALC

&----


*& Form SUB_FIELDCAT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SUB_FIELDCAT .

WA_FCAT-FIELDNAME = 'LIFNR'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Vendor No'. "'VENDOR NAME'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'NAME1'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Vendor Name'. "'VENDOR NAME'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

  • WA_FCAT-FIELDNAME = 'BELNR'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'SAP Document No'. "'DOC NUMBER'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR WA_FCAT.

  • WA_FCAT-FIELDNAME = 'BLDAT'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'Doc Date'. "'FISCAL YEAR'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR wa_fcat.

WA_FCAT-FIELDNAME = 'GSBER'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'BusA'. "'BUSINESS AREA'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'UMSAV'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Balance Carry Forward'. "'BAL CARRIED FORWARD'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'FLAG'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'FLAG'. "'DOC NUMBER'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

*

  • WA_FCAT-FIELDNAME = 'SHKZG'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'SHKZG'. "'DOC NUMBER'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'DMBTR_S'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Credit'. "'DOC NUMBER'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'DMBTR_H'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Debit'. "'DOC NUMBER'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'MONAT'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'PERIOD'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

  • WA_FCAT-FIELDNAME = 'DH'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'DH'. "'DOC NUMBER'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR WA_FCAT.

*

  • WA_FCAT-FIELDNAME = 'DS'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'DS'. "'DOC NUMBER'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'BAL'.

WA_FCAT-TABNAME = 'IT_ITAB'.

WA_FCAT-SELTEXT_M = 'Accumlated Bal'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

*

  • WA_FCAT-FIELDNAME = 'SGTXT'.

  • WA_FCAT-TABNAME = 'IT_ITAB'.

  • WA_FCAT-SELTEXT_M = 'Text'. "'DOC NUMBER'.

  • APPEND WA_FCAT TO IT_FCAT.

  • CLEAR WA_FCAT.

ls_layout-info_fieldname = 'LINE_COLOR'.

ENDFORM. " SUB_FIELDCAT

&----


*& Form SUB_DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SUB_DISPLAY .

IF NOT IT_ITAB[] IS INITIAL.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'SY-REPID'

IT_FIELDCAT = IT_FCAT

I_SAVE = 'A'

is_layout = ls_layout

TABLES

T_OUTTAB = IT_ITAB

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.

ENDIF.

ENDFORM. " SUB_DISPLAY

&----


*& Form SUB_CALC_1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SUB_CALC_1 .

LOOP AT IT_ITAB WHERE FLAG = 'Y'.

it_itab-line_color = 'C603'.

MODIFY IT_ITAB INDEX SY-TABIX.

CLEAR IT_ITAB.

ENDLOOP.

ENDFORM. " SUB_CALC_1

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question