I want to update SAP standard tables
Hi,
I want to update SAP tables using BAPI. can you please suggest me how can i do this and which BAPI i should use for that purpose. I want to update KNVV , FKKMAKO , FKKVKP table.
Hello Sourabh
I am not sure if there is a BAPI around for updating KNVV customer data. The appropriate function module would be SD_CUSTOMER_MAINTAIN_ALL.
Regards,
Uwe
Similar Messages
-
Updating SAP standard table LTAP
I want update and insert new records into LTAP table.
I should not use MODIFY and INSERT commands to update directly as it is not prefered.
Please give me FM's which are used to update LTAP table if anybody knows.
Regards,
jayaram.Hi
Use the fun module
L_TO_UPDATE_PREPARE
for LTAP table update
<b>Reward points for useful Answers</b>
Regards
Anji -
How to change the lenth of existing field in sap standard table
Hi all,
can anybody help,my requirement is, how to change the length of existing field in sap standard table....
thanks in advance..Which field are you thinking of in particular? Are you wanting to increase or decrease the length?
Some fields are used so extensively that a change to their length will mean adjusting many tables, some of them potentially very large, and hence taking a long time to adjust.
Some standard SAP programs expect certain fields to be of specific lengths and won't work if the length is changed.
Some screens could cease to work.
If you decrease length, then you could lose data.
matt -
Want to convert Sap standard report s_alr_87012085 into alvgrid
i Want to convert Sap standard report s_alr_87012085 into alvgrid please help me.
REPORT RFKOPR00
MESSAGE-ID FR
LINE-SIZE 132
NO STANDARD PAGE HEADING.
TABLES: B0SG,
LFA1, "Daten auf Mandantenebene
LFB1, "Daten auf Buchungskreisebene
LFB5, "Mahndaten
LFC1, "Verkehrszahlen
LFC3, "Sonderumsätze
BSIK, "Offend Posten
BKPF,
BSEG,
BSEGA.
TABLES:
BHDGD,
T001,
T001S,
*T001S,
T074T,
T074U,
TBSL,
TBSLT,
TCURX,
ADRS,
RFPDO,
RFPDO1,
RFSDO,
FAEDE.
FIELD-SYMBOLS: .
*Hilfsfelder
*---Prüfung ob mehrere Hauswährungen verarbeitet werden.
DATA: CFAKT(3) TYPE P,
CHECKSALDO(8) TYPE P,
CHECKAGOBL(8) TYPE P,
WAERS LIKE T001-WAERS,
WFLAG(1) TYPE P VALUE '0',
WAERS2 LIKE T001-WAERS,
WFLAG2(1) TYPE P VALUE '0',
PH-LINE(132) TYPE C.
*---Ermittlung aktuelles Geschäftsjahr über Funktionsbaustein.
DATA: CURRY LIKE BSIK-GJAHR.
*-Ermittlung Zahlungseingang bei Zahlungen mit Skontoabzug--
*ATA: ZVTAGE LIKE KNB4-VZS01, "Verzugstage
ZVSKONTO(8) TYPE P, "Zahlungsvolumen bei Zahlung mit Skonto
ZVNETTO(8) TYPE P, "Zahlungsvolumen bei Nettozahlung
ZVVERZUG(8) TYPE P, "Verzugstage
ZVMALVZ(8) TYPE P, "Zahlungvolumen * Verzugstage
"KNB4-VZSxx)
ZVTYP(1) TYPE C, "Skonto oder Nettozahler
ZVPER(4) TYPE C. "Periode letze Zahlung
*---Zeilenanzahl fü Adressausgabe -
DATA: ZEILENANZAHL LIKE ADRS-ANZZL VALUE 7.
DATA: KSALDO(6) TYPE P. "Saldovortrag
BEABZUG(6) TYPE P, "Berechtigte Abzüge
UBABZUG(6) TYPE P, "Unberechtigte Abzüge
JAHRAUG(6) TYPE P, "Kumulierter Jahresausgleich
KUMZINS(6) TYPE P. "Kumulierter Zins
Ausgabe der Mahndaten pro Buchungskreis.
DATA: INDEX(2) TYPE P VALUE 0.
Hilfsfelder
DATA: HF(1) TYPE C.
DATA: TXT_1(78) TYPE C, "Mahnbereich
TXT_2(78) TYPE C, "Mahnart
TXT_3(78) TYPE C, "Mahnempfänger
TXT_4(78) TYPE C, "Mahndatum
TXT_5(78) TYPE C, "Mahnstufe
TXT_6(78) TYPE C, "Mahnsperre
TXT_7(78) TYPE C, "Mahnverfahren
TXT_8(78) TYPE C. "Sachbearbeiter
DATA: BEGIN OF XMAHN OCCURS 10.
INCLUDE STRUCTURE LFB5.
DATA: END OF XMAHN.
Hilfsfelder
DATA: CHAR1(1) TYPE C.
DATA: FLAG1(1) TYPE C.
DATA: INTENS(1) TYPE C.
DATA: FLAG2(1) TYPE C.
*---- K o n s t a n t e n -
*---- DNULL zum Vergleich mit Datumsfeldern -
DATA: DNULL(8) TYPE C VALUE '00000000'.
*---- DECKBLATT = 'N' ==> Kein Deckblatt bei NEW-SECTION -
DATA: DECKBLATT TYPE C VALUE 'N'.
*---- 'H' = Hilfsfelder, die jederzeit fuer Berechnungen ver- -
*---- wendet werden koennen. -
DATA: BEGIN OF H,
STICHTAG(8),
OFFSET(2) TYPE P,
OFFSE1(2) TYPE P,
SOLL LIKE LFC1-UM01S,
HABEN LIKE LFC1-UM01H,
SALDO LIKE LFC1-UMSAV,
SHBKZ LIKE LFC3-SHBKZ, "Sonderhauptbuchkennzeichen
SALDV LIKE LFC3-SALDV, "Sonderhauptbuch-Saldovortrag
SHBLS LIKE LFC3-SOLLL, "Sonderhauptbuch-Lfd.-Saldo
SHBSL LIKE LFC3-SOLLL, "Sonderhauptbuch-Lfd.-SOLL
SHBHB LIKE LFC3-HABNL, "Sonderhauptbuch-Lfd.-HABEN
GBNUM LIKE lfC1-GBN01, "Geschaeftsber. Nummer ECKERT
GBUMS LIKE lfC1-GBU01, "Geschaeftsber. Umsatz
TEXT(15),
UMLOW LIKE BSIK-UMSKZ, "Umsatzkennzeichen
UMHIG LIKE BSIK-UMSKZ, "Umsatzkennzeichen
END OF H.
---- 'C' = Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C,
SALDO TYPE P, "Saldo
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
END OF C.
---- 'C2'= Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C2 OCCURS 0,
BUKRS LIKE LFC1-BUKRS,
SALDO TYPE P, "Saldo
WEXOB TYPE P, "Wechsel-Obligo W,S,B
ANZOB TYPE P, "Anzahlungs-Obligo A
ZANFB TYPE P, "Zahlungs-Anforderung F
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
ZVTYP(1) TYPE C, "Flag Skonto oder Nettozahler
ZVPER(6) TYPE C, "letze Zahlungsperiode
ZVVERZUG(8) TYPE P, "Durchschittliche Verzugst
END OF C2.
---- 'C3'= Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C3,
SALDO TYPE P, "Saldo
WEXOB TYPE P, "Wechsel-Obligo W,S,B
ANZOB TYPE P, "Anzahlungs-Obligo A
ZANFB TYPE P, "Zahlungs-Anforderung F
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
ZVTYP(1) TYPE C, "Flag Skonto oder Nettozahler
ZVPER(6) TYPE C, "letze Zahlungsperiode
ZVVERZUG(8) TYPE P, "Durchschittliche Verzugst
END OF C3.
DATA: SHBETRAG LIKE BSEGA-DMSHB. "TYPE P.
*---- 'RTAB' = Rastertabelle fuer offene Posten -
DATA: BEGIN OF RTAB OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIK-BUKRS,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesprrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RTAB.
*---- 'RBUS' = Rastertabelle fuer Summen pro Sachbearbeiter -
*ATA: BEGIN OF RBUS OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
BUKRS LIKE BSIk-BUKRS,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIk-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RBUS.
*---- 'RBUK' = Rastertabelle fuer Summen pro Buchungskreis -
DATA: BEGIN OF RBUK OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIK-BUKRS,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesprrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RBUK.
---- 'RSUM' = Rastertabelle pro Währung über alle Buchungskreise ---
DATA: BEGIN OF RSUM OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
BUKRS LIKE BSIk-BUKRS,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesperrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RSUM.
*---- interne Tabelle für Periodenabgrenzung----
RANGES: BMONAT FOR RFPDO-DOPRBMON.
---- In die Felder RP01 bis RP05 werden dynamisch die von aussen ---
*---- eingegebenen Rasterpunkte uebertragen -
DATA: RP01(2) TYPE P, " 0
RP02(2) TYPE P, " 20
RP03(2) TYPE P, " 40
RP04(2) TYPE P, " 80
RP05(2) TYPE P, " 100
RP06(3) TYPE P, " 1
RP07(3) TYPE P, " 21
RP08(3) TYPE P, " 41
RP09(3) TYPE P, " 81
RP10(3) TYPE P. " 101
*---- In die Felder RC01 bis RC10 werden die Rasterpunkte in -
---- charakterform abgestellt. (fuer REPLACE-Funktion in Variabler -
*---- Ueberschrift) -
DATA: RC01(4) TYPE C, " 0
RC02(4) TYPE C, " 20
RC03(4) TYPE C, " 40
RC04(4) TYPE C, " 80
RC05(4) TYPE C, " 100
RC06(4) TYPE C, " 1
RC07(4) TYPE C, " 21
RC08(4) TYPE C, " 41
RC09(4) TYPE C, " 81
RC10(4) TYPE C. " 101
*---- Felder für Umsatzkennzeichen -
*---- für Ausweis der Sonderumsätze----
DATA: HUMKZ1 LIKE LFC3-SHBKZ,
HUMKZ2 LIKE LFC3-SHBKZ,
HUMKZ3 LIKE LFC3-SHBKZ,
HUMKZ4 LIKE LFC3-SHBKZ,
HUMKZ5 LIKE LFC3-SHBKZ,
HUMKZ6 LIKE LFC3-SHBKZ,
HUMKZ7 LIKE LFC3-SHBKZ,
HUMKZ8 LIKE LFC3-SHBKZ,
HUMKZ9 LIKE LFC3-SHBKZ,
HUMKZ10 LIKE LFC3-SHBKZ.
*---- GBZAEHL - In diesem Feld wird vermerkt, fuer wieviele Ge- -
*---- schaeftsbereiche ein OP-Raster ausgegeben wird. -
---- Wird das Raster nur fuer einen Geschaeftsbereich ge- -
*---- druckt, so entfaellt das Summen-Raster. -
DATA: GBZAEHL(3) TYPE P.
---- TOP-FLAG '1' = bei TOP-OF-PAGE Einzelpostenueberschrift ausg. --
*---- '2' = bei TOP-OF-PAGE Ueberschrift fuer Raster ausgeb. *
*---- '3' = bei TOP-OF-PAGE ULINE ausgeben. -
---- '4' = bei TOP-OF-PAGE Stammsatzueberschrift ausgeben --
DATA: TOP-FLAG(1) TYPE C.
*---- SEL-STAMM 'J' = Stammsatz wird ausgewertet *
*---- 'N' = Stammsatz wird nicht ausgewertet *
*---- SEL-POSTN 'J' = Stammsatz hat Posten gerastert *
*---- 'N' = Stammsatz hat keine Posten gerastert *
DATA: BEGIN OF SEL,
STAMM(1) TYPE C,
POSTN(1) TYPE C,
POST2(1) TYPE C,
END OF SEL.
*---- SATZART '1' = Stammdaten -
*---- '2' = Faelligkeitsraster -
*---- '3' = Einzelposten -
DATA: SATZART(1) TYPE C.
*---- RART = Erste ausgewaehlte Rasterart -
DATA: RART(1) TYPE C.
*---- TAGE = Tage nach denen die Posten sortiert sind -
DATA: TAGE(4) TYPE P,
*---- NTAGE = Tage fuer Netto-Faelligkeit -
NTAGE(4) TYPE P,
*---- STAGE = Tage fuer Skonto1-Faelligkeit -
STAGE(4) TYPE P,
*---- ATAGE = Alter der Belege -
ATAGE(4) TYPE P,
*---- UTAGE = Tage fuer Ueber-Faelligkeit -
UTAGE(4) TYPE P.
*---- RASTERUU dient zur Sortierung der Einzelposten. Die Posten -
*---- gemaess ihrer Rasterung die Werte '1' bis '6' -
DATA: RASTERUU(1) TYPE C.
*---- RAART Rasterart -
---- Die einzelnen Felder der Feldleiste werden bei SART-OF-SELECTION
*---- mit 1 oder 0 bestueckt. -
*ATA: BEGIN OF RAART,
NET(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
SKT(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
UEB(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
END OF RAART.
DATA: BEGIN OF GB,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
END OF GB.
*---- Variable Ueberschriften -
DATA: BEGIN OF VARUEB1,
FELD1(45) TYPE C,
FELD2(14) TYPE C,
FELD3(14) TYPE C,
FELD4(14) TYPE C,
FELD5(14) TYPE C,
FELD6(14) TYPE C,
FELD7(14) TYPE C,
END OF VARUEB1.
DATA: BEGIN OF VARUEB2,
FELD1(45) TYPE C,
FELD2(14) TYPE C,
FELD3(14) TYPE C,
FELD4(14) TYPE C,
FELD5(14) TYPE C,
FELD6(14) TYPE C,
FELD7(14) TYPE C,
END OF VARUEB2.
DATA: VARUEB3(132),
VARUEB4(132),
VARTXT1(40),
VARTXT(40) TYPE C.
*---- Variable für Ausgabe der Sonderumsätze----
DATA: SHBBEZ LIKE T074T-LTEXT.
DATA: ASUMS TYPE P. "
*---- Interne Tabelle für Bezeichnungen der SHBKZ----
DATA: BEGIN OF BEZSHB OCCURS 10,
SHBKZ LIKE T074T-SHBKZ,
LTEXT LIKE T074T-LTEXT,
END OF BEZSHB.
*---- Interne Tabelle für Zwischenspeicherung -
DATA: BEGIN OF BLKEY,
BUKRS LIKE BSIK-BUKRS,
BELNR LIKE BSIK-BELNR,
GJAHR LIKE BSIK-GJAHR,
BUZEI LIKE BSIK-BUZEI,
END OF BLKEY.
DATA: BEGIN OF RTAGE,
NTAGE LIKE NTAGE,
STAGE LIKE STAGE,
ATAGE LIKE ATAGE,
UTAGE LIKE UTAGE,
END OF RTAGE.
DATA: BEGIN OF HBSIK OCCURS 10.
INCLUDE STRUCTURE BSIK.
INCLUDE STRUCTURE BSEGA.
INCLUDE STRUCTURE RTAGE.
DATA: END OF HBSIK.
DATA: BEGIN OF REFBL OCCURS 10.
INCLUDE STRUCTURE BLKEY.
INCLUDE STRUCTURE RTAGE.
DATA: END OF REFBL.
DATA: BEGIN OF HLFB1 OCCURS 10.
INCLUDE STRUCTURE LFB1.
DATA: END OF HLFB1.
DATA: BEGIN OF HT001 OCCURS 10.
INCLUDE STRUCTURE T001.
DATA: END OF HT001.
*---- Interne Tabelle für Ausgabe der Obligos -
DATA: BEGIN OF AOBLIGO OCCURS 12,
OBART TYPE C, "Flag für Obligoart 1 = Kontokorrent
" 2 = SHBKZ
" 3 = sonstige SHB
SHBKZ LIKE T074T-SHBKZ, "SHB-Kennzeichen
LTEXT LIKE T074T-LTEXT, "Bezeichnung
OBLIG TYPE P, "Obligobetrag
END OF AOBLIGO.
*---- Declarationen für Accessibility /ALV GRID -
data: ACC_MODE type c.
Data: UEBTEXT(22) type c.
Data: UEKTEXT(15) type c.
Data: TITTEXT(100) type c.
Data: DATTEXT(10) type c.
DATA: BEGIN OF RTAB_ALV OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIk-BUKRS,
lifnr LIKE LFA1-lifnr,
busab like lfb1-busab,
SORTL LIKE lfA1-SORTL,
LAND1 LIKE lfA1-LAND1,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIk-WAERS,
hwaer like rf140-hwaer,
RAART like RF140-RAART, "Rasterart
shkzg like bsik-shkzg,
XGUTS TYPE C, "Gutschrift
KUMUM LIKE RF140-KUMUMHW, "Umsatz
ANZAH like rf140-anzbthw, "Anzahlungen
OPSUM like RF140-gsaldd, "Offene Posten Summe
RAST1 like RF140-rast1, "Rasterfeld 1
RAST2 like RF140-rast2, "Rasterfeld 2
RAST3 like RF140-rast3, "Rasterfeld 3
RAST4 like RF140-rast4, "Rasterfeld 4
RAST5 like RF140-rast5, "Rasterfeld 5
RAST6 like RF140-rast6, "Rasterfeld 6
END OF RTAB_ALV.
*"General Data
TYPE-POOLS: SLIS.
*DATA: BEGIN OF GT_OUTTAB OCCURS 0.
INCLUDE STRUCTURE rtab_alv.
*DATA: END OF GT_OUTTAB.
Data: GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_EXIT_CAUSED_BY_CALLER,
GS_EXIT_CAUSED_BY_USER TYPE SLIS_EXIT_BY_USER,
G_REPID LIKE SY-REPID,
G_GRID_TITLE TYPE LVC_TITLE.
*"Callback
*Data: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
G_STATUS_SET TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
Data: G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
G_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
G_TOP_OF_LIST TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',
G_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST'.
*"Variants
DATA: GS_VARIANT LIKE DISVARIANT,
G_SAVE.
Global structure of list
fieldcatalog
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
sort
*DATA: GT_SORT TYPE SLIS_T_SORTINFO_ALV.
events
*DATA: GT_EVENTS TYPE SLIS_T_EVENT.
*----- Structure for specific color settings -
*DATA: COL_TAB_T TYPE SLIS_T_SPECIALCOL_ALV,
COL_TAB TYPE SLIS_SPECIALCOL_ALV.
DATA: G_TABNAME TYPE SLIS_TABNAME VALUE 'RTAB_ALV'.
print
*DATA: GS_PRINT TYPE SLIS_PRINT_ALV.
*---- FIELD-GROUPS -
FIELD-GROUPS:
HEADER,
STAMMDATEN,
OP-RASTER,
EINZELPOSTEN.
INSERT
LFB1-BUKRS " Buchungskreis
lfB1-BUSAB " Sachbearbeiter
LFA1-LIFNR " Kontonummer
SATZART " Satzart
RTAB-SORTK " Sortkz fuer Tabelle RTAB
" '0' = normale Eintraege
" '1' = Summeneintraege
GB " Geschaeftsbereich
" - GB-GSBER
" - GB-WAERS
RASTERUU " Kennzeichen fuer Detailposten bzw Raster
ab hier nur fuer Einzelposten -
TAGE " Rastertage fuer Detailposten
BSIK-UMSKZ " Umsatzkennzeichen
BSIK-BLART " Belegart
BSIK-ZUONR " Zuordnungsnummer
BSIK-BELNR " Belegnummer
BSIK-BUZEI " Belegzeile
INTO HEADER.
INSERT
Addressdaten
ADRS-LINE0 " 1. Zeile Adressenaufbereitung
ADRS-LINE1 " 2. " "
ADRS-LINE2 " 3. " "
ADRS-LINE3 " 4. " "
ADRS-LINE4 " 5. " "
ADRS-LINE5 " 6. " "
ADRS-LINE6 " 7. " "
ADRS-LINE7 " 8. " "
ADRS-LINE8 " 9. " "
ADRS-LINE9 " 10." "
Umsatzdaten
C-KUMUM " Umsatz
C-BABZG " Berechtigt. Abzuege
C-UABZG " Unberechtigt. Abzuege
C-KZINS " Zinszahlungen
C-KUMAG " Kum. Jahresausgleich
Obligos
C-SALDO " Saldo ohne SHB-Vorgänge
C-UMKZ1 "SHBKZ 1
C-SUMS1 "Sonderumsatz 1
C-UMKZ2 "SHBKZ 2
C-SUMS2 "Sonderumsatz 2
C-UMKZ3 "SHBKZ 3
C-SUMS3 "Sonderumsatz 3
C-UMKZ4 "SHBKZ 4
C-SUMS4 "Sonderumsatz 4
C-UMKZ5 "SHBKZ 5
C-SUMS5 "Sonderumsatz 5
C-UMKZ6 "SHBKZ 6
C-SUMS6 "Sonderumsatz 6
C-UMKZ7 "SHBKZ 7
C-SUMS7 "Sonderumsatz 7
C-UMKZ8 "SHBKZ 8
C-SUMS8 "Sonderumsatz 8
C-UMKZ9 "SHBKZ 9
C-SUMS9 "Sonderumsatz 9
C-UMKZ10 "SHBKZ 10
C-SUMS10 "Sonderumsatz 10
C-SONOB " Sonst. Obligen
Limits
C-AGOBLI " Absolutes Gesamtobligo
Zahlungdaten
LFB1-ZTERM "Zahlungsbedingung
LFB1-ZAHLS "Sperrschlüssel für Zahlung
LFB1-ZWELS "Zahlwege
LFB1-XVERR "Zahlungsverrechnung
LFB1-WEBTR "Wechsellimit
LFB1-BUSAB " Sachbearbeiter
lfa1-sortl
lfa1-land1
INTO STAMMDATEN.
INSERT
RTAB-RAART "Rasterart
RTAB-SPERR "gesperrte Posten
RTAB-KUMUM "Umsatz
RTAB-ANZAH "Anzahlungen
RTAB-OPSUM "Offene Posten Summe
RTAB-RAST1 "Rasterfeld 1
RTAB-RAST2 "Rasterfeld 2
RTAB-RAST3 "Rasterfeld 3
RTAB-RAST4 "Rasterfeld 4
RTAB-RAST5 "Rasterfeld 5
RTAB-RAST6 "Rasterfeld 6
INTO OP-RASTER.
INSERT
BSIK-BUDAT " Buchungsdatum
BSIK-BLDAT " Belegdatum
BSIK-CPUDT " CPU-Datum
BKPF-USNAM " User-ID
BSIK-WAERS " Wahrungsschluessel
BSEGA-NETDT " Nettofaelligkeitsdatum
FAEDE-NETDT " Nettofaelligkeitsdatum
BSIK-ZFBDT " Zahlungsfristen-Basisdatum
BSIK-BSCHL " Buchungsschluessel
BSIK-ZLSCH " Zahlungsschluessel
BSIK-MANST " Mahnstufe
SHBETRAG " Hauswaehrungsbetrag
BSEGA-DMSHB " Hauswaehrungsbetrag
BSEGA-WRSHB " Fremwaehrungsbetrag
INTO EINZELPOSTEN.
BEGIN_OF_BLOCK 1.
*ELECT-OPTIONS:
GESBER FOR BSIK-GSBER.
PARAMETERS:
MONAT LIKE RFPDO-DOPRBMON.
SELECT-OPTIONS:
KKSALDO2 FOR RFSDO-KOPRSAL2, "Saldovortrag
AGOBLIG2 FOR RFSDO-KOPRAGO2. "Absolutes Obligo
RGOBLIGO FOR RFSDO-DOPRRGOB. "Relatives Obligo
SELECT-OPTIONS:
LAND FOR LFA1-LAND1,
KONTENGR FOR LFA1-KTOKK,
SACHBEAR FOR LFB1-BUSAB,
AKONTS FOR LFB1-AKONT,
AKONTP FOR BSIK-HKONT.
SELECT-OPTIONS:
BUDAT FOR BSIK-BUDAT,
BLDAT FOR BSIK-BLDAT,
NETDT FOR BSEGA-NETDT.
PARAMETERS: N_BELEGE LIKE RFPDO-BPETNBEL
DEFAULT 'X', "Normale Belege.
STAT_BLG LIKE RFPDO-BPETSBEL. "Statistische Belege
END_OF_BLOCK 1.
*ELECT-OPTIONS:
BERABZU1 FOR LFC1-BABZG,
UNBABZU1 FOR LFC1-UABZG,
ZINSE1 FOR LFC1-KZINS,
JHRAUSG1 FOR LFC1-KUMAG.
BERABZUG FOR BEABZUG NO-DISPLAY, "Berechtigter Abzug
UNBABZUG FOR UBABZUG NO-DISPLAY, "Unberechtigter Abzug
ZINSEN FOR KUMZINS NO-DISPLAY, "Kumulierter Zins
JHRAUSGL FOR JAHRAUG NO-DISPLAY. "Kumulierter Jahresausgl.
BEGIN_OF_BLOCK 2.
PARAMETERS:
SORTART LIKE RFPDO1-KOPRSOAR DEFAULT '1', "Doku
VERDICHT LIKE RFPDO1-KOPRVERD DEFAULT '1', "Doku
RASTVERD LIKE RFPDO1-KOPRRAST DEFAULT '0', "Doku
KONZVERS LIKE RFPDO-DOPOKONZ, "Konzernversion
XBUKRDAT LIKE RFPDO3-ALLGBUKD DEFAULT 0, "Bukr.daten
KAUSGABE like rfpdo3-ALLGKAOR.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(30) TEXT-030.
PARAMETERS: RART-NET LIKE RFPDO-DOPRRNET DEFAULT 'X'.
SELECTION-SCREEN COMMENT 33(01) TEXT-028.
PARAMETERS: RART-SKT LIKE RFPDO-DOPRRSKT DEFAULT 'X'.
SELECTION-SCREEN COMMENT 35(01) TEXT-028.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RART-ALT LIKE RFPDO1-KOPRRALT DEFAULT 'X'.
SELECTION-SCREEN COMMENT 03(28) TEXT-031.
SELECTION-SCREEN POSITION POS_HIGH.
PARAMETERS RBLDAT LIKE RFPDO2-KORD10BD.
SELECTION-SCREEN COMMENT 61(12) TEXT-032.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN COMMENT 37(01) TEXT-028.
PARAMETERS: RART-UEB LIKE RFPDO-DOPRRUEB DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(31) TEXT-026.
PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
SELECTION-SCREEN COMMENT 35(02) TEXT-027.
PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '020'.
SELECTION-SCREEN COMMENT 41(02) TEXT-027.
PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '040'.
SELECTION-SCREEN COMMENT 47(02) TEXT-027.
PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '080'.
SELECTION-SCREEN COMMENT 53(02) TEXT-027.
PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '100'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(31) TEXT-029.
PARAMETERS: FAKTOR LIKE RFPDO-DOPRFAKT DEFAULT '0'.
SELECTION-SCREEN COMMENT 35(1) TEXT-028.
PARAMETERS: STELLEN LIKE RFPDO-DOPRFAKT DEFAULT '0'.
SELECTION-SCREEN END OF LINE.
PARAMETERS: PZUOR LIKE RFPDO2-DOPRZUOR.
PARAMETERS: UMSATZKZ LIKE RFPDO1-DOPRSHBO. "DEFAULT 'WSABIMVD'.
PARAMETERS:
TITLE LIKE RFPDO1-ALLGLINE,
LISTSEP LIKE RFPDO-ALLGLSEP,
MIKFICHE LIKE RFPDO-ALLGMIKF.
PARAMETERS:
P_LVAR LIKE Gs_VARIANT-VARIANT DEFAULT SPACE modif id 508.
END_OF_BLOCK 2.
AT SELECTION-SCREEN OUTPUT.
if acc_mode is initial.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = '508'.
SCREEN-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
AT SELECTION-SCREEN ON AKONTS.
Konvertierung der Kontonummer
LOOP AT AKONTS.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTS-LOW AKONTS-LOW.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTS-HIGH AKONTS-HIGH.
MODIFY AKONTS.
ENDLOOP.
AT SELECTION-SCREEN ON AKONTP.
Konvertierung der Kontonummer
LOOP AT AKONTP.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTP-LOW AKONTP-LOW.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTP-HIGH AKONTP-HIGH.
MODIFY AKONTP.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LVAR.
Gs_VARIANT-REPORT = SY-REPID.
Gs_VARIANT-VARIANT = P_LVAR.
PERFORM F4_FOR_S_LVAR USING Gs_VARIANT.
P_LVAR = Gs_VARIANT-VARIANT.
AT SELECTION-SCREEN.
IF NOT RASTBIS5 IS INITIAL.
IF RASTBIS5 GT RASTBIS4
AND RASTBIS4 GT RASTBIS3
AND RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS4 IS INITIAL.
IF RASTBIS4 GT RASTBIS3
AND RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS3 IS INITIAL.
IF RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS2 IS INITIAL.
IF RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
nichts zu tun
ENDIF.
ENDIF.
END -
Updating a standard table from a custom tableq
hi to all experts,
My requirement is to update a standard table from the maintenance screens of the custom table whatever the data the user maintains in the custom table and save should automatically saved in the standard table
for that i decided to use the table maintenance events (event 05 ) ( while saving data) how to capture the data from the screens to the form of the table maintenance events.Hi gautham,
The requirement is like that actually user want to maintain value in z table ( with one extra field ) . the table updation of table is important -
I want to update the Custom table using the data available in ITAB.
Hi,
I want to updaste the Custom Table which is created by me (Ztable) using the data available in itab.(which i got from defferent standard tables)
I want to update the custom table using the itab data How is it possible?
Is any possible by using Modify ?
DPK.example here
modifying datbase table useing internal table
advises before updating this datbase table plz lock that table to avoid incosistency
write the logic for modifying
Modify the database table as per new dunning procedure
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
and finally unlock the table
example
*To lock table for further operations
constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = lc_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
To fetch all the contract accounts for customers of the segment
Households/SME.
PERFORM fetch_contract_accounts using lc_tabname .
ENDIF. " IF sy-subrc EQ 0.
*wrote the logic
Modify the database table as per new dunning procedure from internal table
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
*unlock the tbale
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
TABNAME = uc_tabname . -
Unable to see SAP standard table in HANA Studio
Hello Experts,
I have requirement to built calculation view of SAP Standard Table like BSEG, BKPF table
but i am unable to view this table in Catalog view in HANA Studio.
Do i require any authorization or configuration to be done to view this table in those catalog view in hana studio.
Regards,
Mr. DeheyDehey,
Assuming that your SAP HANA is the primary database for your backend ERP instance (Suite on HANA), you need to have minimum SELECT privilege on the SAP<SID> schema, <SID> is the system identifier of your ERP instance.
Ask youur SAP HANA admin to grant the SELECT privilege on SAP<SID> schema to your user ID by executing the below SQL query from SQL console.
GRANT SELECT ON SCHEMA SAP<SID> TO <YOUR_USER_ID>;
Hope this helps.
Regards,
Srinivas K. -
What are the methods to modify SAP standard tables?
hi
what are the methods to modify SAP standard tables?.APPEND structures AND CUSTOMIZING INCLUDES.
these are the two methods.. but customizing includes we, as a developers do not use.
generally we use .APPEND structures to modify standard tables.
note that we need an access key to modify atandard tables.
we can create an apend structure and add that structure to the standard table at the end.
note that .append structures should only be added only at the end.
that is the reason we use .append structures to modify standard tables.as we should not include a field in the middle and disturb the original order of the standard table fields as it may effect many objects depending on the standard table.
but Some standard tables for which there is a LONG datatype field can never be modified.
the reason is the LONG datatype field should always be there at the end and also .APPEND strutures should always be there at the end. there will be a conflict. so, some standard tables can not be appended. -
Changing auth group of a SAP standard Table
I was wondering if someone could advise what the implications are if I changed the auth group of a SAP standard table (PA0033).
Does it affect programs behind the scenes, support packs, upgrades?I am not aware of any reason why an authorization group on a SAP standard table should not be changed.
I have also seen this done for specific infotypes without any problems.
See the documentation on transaction SUCU and SE54, and SAP notes and some of the discussions here on them.
Kind regards,
Julius -
Procedure for creating an Index on SAP standard table
Hi,
I need to create an Index on a SAP standard table. Please help me out with the process of doing so.
Regards,
SharadenduPlease search the forum. You will find lots of related threads:
how to create an index
how to create secondary index -
How to update a standard table
Hi all,
I want to update table makt with a program from table itab.
Loop at itab into wa.
modify makt from wa.
endloop.
I even can not debug the loop...
Is it not possible to update sap tables?
Thanks.You can definitely modify Standard Database table from ABAP Program.
1.Syntax for modifying Database table from Workarea is,
MODIFY dbtab FROM workarea.
Effect
When a wa work area that is not table-type is specified, which meets the requirements for use in Open SQL statements, a line is searched for in the database table that has the same content in the primary key as the corresponding beginning part of the work area.
If such a line is not found, a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found, this line is overwritten according to the same rules as for the UPDATE statement.
If the change would lead to a double entry in a unique secondary index, then it is not executed and sy-subrc is set to 4.
Notes
The wa work area should always be declared with reference to the database table or the view in the ABAP Dictionary.
If the the database table or view is specified statically, then you the specification of the work area using FROM wa can be ommitted outside of classes if a dbtab table work area is declared for the corresponding database table or for the view using the TABLES statement. The system enhances the MODIFY statement implicitly with the FROM dbtab addition.
Eg. :
DATA message_wa TYPE t100.
message_wa-sprsl = 'EN'.
message_wa-arbgb = 'MYMSGCLASS'.
message_wa-msgnr = '100'.
message_wa-text = 'Some new message ...'.
MODIFY t100 FROM message_wa.
2. Syntax for changing Database table from internal table is ,
MODIFY dbtab FROM TABLE itab.
Effect
If an itab internal table is specified, the system processes all lines in the internal table according to the rules for the wa work area. The line type of the internal table has to meet the requirements for use in Open SQL statements.
If the change to a line in the internal table would lead to a double entry in a unique secondary index, the corresponding line is not inserted and sy-subrc is set to 4. If the internal table is empty, sy-subrc is set to 0. The sy-dbcnt system field is always set to the number of lines that were actually processed
Reward if helpful. -
Want to convert Sap standard report into alvgrid
HI PLEASE HELP THIS IS CODE BELOW OF SAP STANDARD REPORT CODE WANT TO CONVERT INTO ALVGRID
LEAS HELP
REPORT RFKOPR00
MESSAGE-ID FR
LINE-SIZE 132
NO STANDARD PAGE HEADING.
TABLES: B0SG,
LFA1, "Daten auf Mandantenebene
LFB1, "Daten auf Buchungskreisebene
LFB5, "Mahndaten
LFC1, "Verkehrszahlen
LFC3, "Sonderumsätze
BSIK, "Offend Posten
BKPF,
BSEG,
BSEGA.
TABLES:
BHDGD,
T001,
T001S,
*T001S,
T074T,
T074U,
TBSL,
TBSLT,
TCURX,
ADRS,
RFPDO,
RFPDO1,
RFSDO,
FAEDE.
FIELD-SYMBOLS: .
*Hilfsfelder
*---Prüfung ob mehrere Hauswährungen verarbeitet werden.
DATA: CFAKT(3) TYPE P,
CHECKSALDO(8) TYPE P,
CHECKAGOBL(8) TYPE P,
WAERS LIKE T001-WAERS,
WFLAG(1) TYPE P VALUE '0',
WAERS2 LIKE T001-WAERS,
WFLAG2(1) TYPE P VALUE '0',
PH-LINE(132) TYPE C.
*---Ermittlung aktuelles Geschäftsjahr über Funktionsbaustein.
DATA: CURRY LIKE BSIK-GJAHR.
*-Ermittlung Zahlungseingang bei Zahlungen mit Skontoabzug--
*ATA: ZVTAGE LIKE KNB4-VZS01, "Verzugstage
ZVSKONTO(8) TYPE P, "Zahlungsvolumen bei Zahlung mit Skonto
ZVNETTO(8) TYPE P, "Zahlungsvolumen bei Nettozahlung
ZVVERZUG(8) TYPE P, "Verzugstage
ZVMALVZ(8) TYPE P, "Zahlungvolumen * Verzugstage
"KNB4-VZSxx)
ZVTYP(1) TYPE C, "Skonto oder Nettozahler
ZVPER(4) TYPE C. "Periode letze Zahlung
*---Zeilenanzahl fü Adressausgabe -
DATA: ZEILENANZAHL LIKE ADRS-ANZZL VALUE 7.
DATA: KSALDO(6) TYPE P. "Saldovortrag
BEABZUG(6) TYPE P, "Berechtigte Abzüge
UBABZUG(6) TYPE P, "Unberechtigte Abzüge
JAHRAUG(6) TYPE P, "Kumulierter Jahresausgleich
KUMZINS(6) TYPE P. "Kumulierter Zins
Ausgabe der Mahndaten pro Buchungskreis.
DATA: INDEX(2) TYPE P VALUE 0.
Hilfsfelder
DATA: HF(1) TYPE C.
DATA: TXT_1(78) TYPE C, "Mahnbereich
TXT_2(78) TYPE C, "Mahnart
TXT_3(78) TYPE C, "Mahnempfänger
TXT_4(78) TYPE C, "Mahndatum
TXT_5(78) TYPE C, "Mahnstufe
TXT_6(78) TYPE C, "Mahnsperre
TXT_7(78) TYPE C, "Mahnverfahren
TXT_8(78) TYPE C. "Sachbearbeiter
DATA: BEGIN OF XMAHN OCCURS 10.
INCLUDE STRUCTURE LFB5.
DATA: END OF XMAHN.
Hilfsfelder
DATA: CHAR1(1) TYPE C.
DATA: FLAG1(1) TYPE C.
DATA: INTENS(1) TYPE C.
DATA: FLAG2(1) TYPE C.
*---- K o n s t a n t e n -
*---- DNULL zum Vergleich mit Datumsfeldern -
DATA: DNULL(8) TYPE C VALUE '00000000'.
*---- DECKBLATT = 'N' ==> Kein Deckblatt bei NEW-SECTION -
DATA: DECKBLATT TYPE C VALUE 'N'.
*---- 'H' = Hilfsfelder, die jederzeit fuer Berechnungen ver- -
*---- wendet werden koennen. -
DATA: BEGIN OF H,
STICHTAG(8),
OFFSET(2) TYPE P,
OFFSE1(2) TYPE P,
SOLL LIKE LFC1-UM01S,
HABEN LIKE LFC1-UM01H,
SALDO LIKE LFC1-UMSAV,
SHBKZ LIKE LFC3-SHBKZ, "Sonderhauptbuchkennzeichen
SALDV LIKE LFC3-SALDV, "Sonderhauptbuch-Saldovortrag
SHBLS LIKE LFC3-SOLLL, "Sonderhauptbuch-Lfd.-Saldo
SHBSL LIKE LFC3-SOLLL, "Sonderhauptbuch-Lfd.-SOLL
SHBHB LIKE LFC3-HABNL, "Sonderhauptbuch-Lfd.-HABEN
GBNUM LIKE lfC1-GBN01, "Geschaeftsber. Nummer ECKERT
GBUMS LIKE lfC1-GBU01, "Geschaeftsber. Umsatz
TEXT(15),
UMLOW LIKE BSIK-UMSKZ, "Umsatzkennzeichen
UMHIG LIKE BSIK-UMSKZ, "Umsatzkennzeichen
END OF H.
---- 'C' = Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C,
SALDO TYPE P, "Saldo
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
END OF C.
---- 'C2'= Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C2 OCCURS 0,
BUKRS LIKE LFC1-BUKRS,
SALDO TYPE P, "Saldo
WEXOB TYPE P, "Wechsel-Obligo W,S,B
ANZOB TYPE P, "Anzahlungs-Obligo A
ZANFB TYPE P, "Zahlungs-Anforderung F
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
ZVTYP(1) TYPE C, "Flag Skonto oder Nettozahler
ZVPER(6) TYPE C, "letze Zahlungsperiode
ZVVERZUG(8) TYPE P, "Durchschittliche Verzugst
END OF C2.
---- 'C3'= Zwischenergebnisse, die aus Feldern des C-Segmentes ---
*---- berechnet werden. -
DATA: BEGIN OF C3,
SALDO TYPE P, "Saldo
WEXOB TYPE P, "Wechsel-Obligo W,S,B
ANZOB TYPE P, "Anzahlungs-Obligo A
ZANFB TYPE P, "Zahlungs-Anforderung F
UMKZ1 LIKE LFC3-SHBKZ, "SHBKZ 1
SUMS1 TYPE P, "Sonderumsatz 1
UMKZ2 LIKE LFC3-SHBKZ, "SHBKZ 2
SUMS2 TYPE P, "Sonderumsatz 2
UMKZ3 LIKE LFC3-SHBKZ, "SHBKZ 3
SUMS3 TYPE P, "Sonderumsatz 3
UMKZ4 LIKE LFC3-SHBKZ, "SHBKZ 4
SUMS4 TYPE P, "Sonderumsatz 4
UMKZ5 LIKE LFC3-SHBKZ, "SHBKZ 5
SUMS5 TYPE P, "Sonderumsatz 5
UMKZ6 LIKE LFC3-SHBKZ, "SHBKZ 6
SUMS6 TYPE P, "Sonderumsatz 6
UMKZ7 LIKE LFC3-SHBKZ, "SHBKZ 7
SUMS7 TYPE P, "Sonderumsatz 7
UMKZ8 LIKE LFC3-SHBKZ, "SHBKZ 8
SUMS8 TYPE P, "Sonderumsatz 8
UMKZ9 LIKE LFC3-SHBKZ, "SHBKZ 9
SUMS9 TYPE P, "Sonderumsatz 9
UMKZ10 LIKE LFC3-SHBKZ, "SHBKZ 10
SUMS10 TYPE P, "Sonderumsatz 10
SONOB TYPE P, "Sonstige Umsatz-Kz
BABZG TYPE P, "Berechtigte Abzuege
UABZG TYPE P, "Unberechtigte Abzuege
KZINS TYPE P, "Zinszahlungen
KUMUM TYPE P, "Umsatz
KUMAG TYPE P, "Kum. Jahresausgleich
KREUEB TYPE P, "Kreditueberschreitung
AGOBLI TYPE P, "Gesamt-Obligo (absolut)
AGOBLI LIKE LFC1-UMSAV, "Gesamt-Obligo (absolut)
RGOBLI TYPE P, "Gesamt-Obligo (relativ)
LFTAGE(3) TYPE P, "Langfristige Überzugstage
MFTAGE(3) TYPE P, "Mittelfristige Überzugstage
KFTAGE(3) TYPE P, "Kurzfristige Überzugstage
ZVTYP(1) TYPE C, "Flag Skonto oder Nettozahler
ZVPER(6) TYPE C, "letze Zahlungsperiode
ZVVERZUG(8) TYPE P, "Durchschittliche Verzugst
END OF C3.
DATA: SHBETRAG LIKE BSEGA-DMSHB. "TYPE P.
*---- 'RTAB' = Rastertabelle fuer offene Posten -
DATA: BEGIN OF RTAB OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIK-BUKRS,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesprrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RTAB.
*---- 'RBUS' = Rastertabelle fuer Summen pro Sachbearbeiter -
*ATA: BEGIN OF RBUS OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
BUKRS LIKE BSIk-BUKRS,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIk-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RBUS.
*---- 'RBUK' = Rastertabelle fuer Summen pro Buchungskreis -
DATA: BEGIN OF RBUK OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIK-BUKRS,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesprrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RBUK.
---- 'RSUM' = Rastertabelle pro Währung über alle Buchungskreise ---
DATA: BEGIN OF RSUM OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
BUKRS LIKE BSIk-BUKRS,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIK-WAERS,
RAART TYPE C, "Rasterart
"1 = Netto-Faelligkeit
"2 = Skonto1-Faelligkeit
"3 = Zahlungseingang
"4 = Ueber-Faelligkeit
SPERR TYPE P, "gesperrte Posten
KUMUM TYPE P, "Umsatz
ANZAH TYPE P, "Anzahlungen
OPSUM TYPE P, "Offene Posten Summe
RAST1 TYPE P, "Rasterfeld 1
RAST2 TYPE P, "Rasterfeld 2
RAST3 TYPE P, "Rasterfeld 3
RAST4 TYPE P, "Rasterfeld 4
RAST5 TYPE P, "Rasterfeld 5
RAST6 TYPE P, "Rasterfeld 6
END OF RSUM.
*---- interne Tabelle für Periodenabgrenzung----
RANGES: BMONAT FOR RFPDO-DOPRBMON.
---- In die Felder RP01 bis RP05 werden dynamisch die von aussen ---
*---- eingegebenen Rasterpunkte uebertragen -
DATA: RP01(2) TYPE P, " 0
RP02(2) TYPE P, " 20
RP03(2) TYPE P, " 40
RP04(2) TYPE P, " 80
RP05(2) TYPE P, " 100
RP06(3) TYPE P, " 1
RP07(3) TYPE P, " 21
RP08(3) TYPE P, " 41
RP09(3) TYPE P, " 81
RP10(3) TYPE P. " 101
*---- In die Felder RC01 bis RC10 werden die Rasterpunkte in -
---- charakterform abgestellt. (fuer REPLACE-Funktion in Variabler -
*---- Ueberschrift) -
DATA: RC01(4) TYPE C, " 0
RC02(4) TYPE C, " 20
RC03(4) TYPE C, " 40
RC04(4) TYPE C, " 80
RC05(4) TYPE C, " 100
RC06(4) TYPE C, " 1
RC07(4) TYPE C, " 21
RC08(4) TYPE C, " 41
RC09(4) TYPE C, " 81
RC10(4) TYPE C. " 101
*---- Felder für Umsatzkennzeichen -
*---- für Ausweis der Sonderumsätze----
DATA: HUMKZ1 LIKE LFC3-SHBKZ,
HUMKZ2 LIKE LFC3-SHBKZ,
HUMKZ3 LIKE LFC3-SHBKZ,
HUMKZ4 LIKE LFC3-SHBKZ,
HUMKZ5 LIKE LFC3-SHBKZ,
HUMKZ6 LIKE LFC3-SHBKZ,
HUMKZ7 LIKE LFC3-SHBKZ,
HUMKZ8 LIKE LFC3-SHBKZ,
HUMKZ9 LIKE LFC3-SHBKZ,
HUMKZ10 LIKE LFC3-SHBKZ.
*---- GBZAEHL - In diesem Feld wird vermerkt, fuer wieviele Ge- -
*---- schaeftsbereiche ein OP-Raster ausgegeben wird. -
---- Wird das Raster nur fuer einen Geschaeftsbereich ge- -
*---- druckt, so entfaellt das Summen-Raster. -
DATA: GBZAEHL(3) TYPE P.
---- TOP-FLAG '1' = bei TOP-OF-PAGE Einzelpostenueberschrift ausg. --
*---- '2' = bei TOP-OF-PAGE Ueberschrift fuer Raster ausgeb. *
*---- '3' = bei TOP-OF-PAGE ULINE ausgeben. -
---- '4' = bei TOP-OF-PAGE Stammsatzueberschrift ausgeben --
DATA: TOP-FLAG(1) TYPE C.
*---- SEL-STAMM 'J' = Stammsatz wird ausgewertet *
*---- 'N' = Stammsatz wird nicht ausgewertet *
*---- SEL-POSTN 'J' = Stammsatz hat Posten gerastert *
*---- 'N' = Stammsatz hat keine Posten gerastert *
DATA: BEGIN OF SEL,
STAMM(1) TYPE C,
POSTN(1) TYPE C,
POST2(1) TYPE C,
END OF SEL.
*---- SATZART '1' = Stammdaten -
*---- '2' = Faelligkeitsraster -
*---- '3' = Einzelposten -
DATA: SATZART(1) TYPE C.
*---- RART = Erste ausgewaehlte Rasterart -
DATA: RART(1) TYPE C.
*---- TAGE = Tage nach denen die Posten sortiert sind -
DATA: TAGE(4) TYPE P,
*---- NTAGE = Tage fuer Netto-Faelligkeit -
NTAGE(4) TYPE P,
*---- STAGE = Tage fuer Skonto1-Faelligkeit -
STAGE(4) TYPE P,
*---- ATAGE = Alter der Belege -
ATAGE(4) TYPE P,
*---- UTAGE = Tage fuer Ueber-Faelligkeit -
UTAGE(4) TYPE P.
*---- RASTERUU dient zur Sortierung der Einzelposten. Die Posten -
*---- gemaess ihrer Rasterung die Werte '1' bis '6' -
DATA: RASTERUU(1) TYPE C.
*---- RAART Rasterart -
---- Die einzelnen Felder der Feldleiste werden bei SART-OF-SELECTION
*---- mit 1 oder 0 bestueckt. -
*ATA: BEGIN OF RAART,
NET(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
SKT(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
UEB(1) TYPE C, "X = ausgewaehlt, ' ' = nicht ausgewaehlt
END OF RAART.
DATA: BEGIN OF GB,
GSBER LIKE BSIK-GSBER,
WAERS LIKE BSIK-WAERS,
END OF GB.
*---- Variable Ueberschriften -
DATA: BEGIN OF VARUEB1,
FELD1(45) TYPE C,
FELD2(14) TYPE C,
FELD3(14) TYPE C,
FELD4(14) TYPE C,
FELD5(14) TYPE C,
FELD6(14) TYPE C,
FELD7(14) TYPE C,
END OF VARUEB1.
DATA: BEGIN OF VARUEB2,
FELD1(45) TYPE C,
FELD2(14) TYPE C,
FELD3(14) TYPE C,
FELD4(14) TYPE C,
FELD5(14) TYPE C,
FELD6(14) TYPE C,
FELD7(14) TYPE C,
END OF VARUEB2.
DATA: VARUEB3(132),
VARUEB4(132),
VARTXT1(40),
VARTXT(40) TYPE C.
*---- Variable für Ausgabe der Sonderumsätze----
DATA: SHBBEZ LIKE T074T-LTEXT.
DATA: ASUMS TYPE P. "
*---- Interne Tabelle für Bezeichnungen der SHBKZ----
DATA: BEGIN OF BEZSHB OCCURS 10,
SHBKZ LIKE T074T-SHBKZ,
LTEXT LIKE T074T-LTEXT,
END OF BEZSHB.
*---- Interne Tabelle für Zwischenspeicherung -
DATA: BEGIN OF BLKEY,
BUKRS LIKE BSIK-BUKRS,
BELNR LIKE BSIK-BELNR,
GJAHR LIKE BSIK-GJAHR,
BUZEI LIKE BSIK-BUZEI,
END OF BLKEY.
DATA: BEGIN OF RTAGE,
NTAGE LIKE NTAGE,
STAGE LIKE STAGE,
ATAGE LIKE ATAGE,
UTAGE LIKE UTAGE,
END OF RTAGE.
DATA: BEGIN OF HBSIK OCCURS 10.
INCLUDE STRUCTURE BSIK.
INCLUDE STRUCTURE BSEGA.
INCLUDE STRUCTURE RTAGE.
DATA: END OF HBSIK.
DATA: BEGIN OF REFBL OCCURS 10.
INCLUDE STRUCTURE BLKEY.
INCLUDE STRUCTURE RTAGE.
DATA: END OF REFBL.
DATA: BEGIN OF HLFB1 OCCURS 10.
INCLUDE STRUCTURE LFB1.
DATA: END OF HLFB1.
DATA: BEGIN OF HT001 OCCURS 10.
INCLUDE STRUCTURE T001.
DATA: END OF HT001.
*---- Interne Tabelle für Ausgabe der Obligos -
DATA: BEGIN OF AOBLIGO OCCURS 12,
OBART TYPE C, "Flag für Obligoart 1 = Kontokorrent
" 2 = SHBKZ
" 3 = sonstige SHB
SHBKZ LIKE T074T-SHBKZ, "SHB-Kennzeichen
LTEXT LIKE T074T-LTEXT, "Bezeichnung
OBLIG TYPE P, "Obligobetrag
END OF AOBLIGO.
*---- Declarationen für Accessibility /ALV GRID -
data: ACC_MODE type c.
Data: UEBTEXT(22) type c.
Data: UEKTEXT(15) type c.
Data: TITTEXT(100) type c.
Data: DATTEXT(10) type c.
DATA: BEGIN OF RTAB_ALV OCCURS 30,
SORTK(1) TYPE C, "0 = Summe Gesber
"1 = Summe aller Gesber
"2 = Umsatzdaten
BUKRS LIKE BSIk-BUKRS,
lifnr LIKE LFA1-lifnr,
busab like lfb1-busab,
SORTL LIKE lfA1-SORTL,
LAND1 LIKE lfA1-LAND1,
GSBER LIKE BSIk-GSBER,
WAERS LIKE BSIk-WAERS,
hwaer like rf140-hwaer,
RAART like RF140-RAART, "Rasterart
shkzg like bsik-shkzg,
XGUTS TYPE C, "Gutschrift
KUMUM LIKE RF140-KUMUMHW, "Umsatz
ANZAH like rf140-anzbthw, "Anzahlungen
OPSUM like RF140-gsaldd, "Offene Posten Summe
RAST1 like RF140-rast1, "Rasterfeld 1
RAST2 like RF140-rast2, "Rasterfeld 2
RAST3 like RF140-rast3, "Rasterfeld 3
RAST4 like RF140-rast4, "Rasterfeld 4
RAST5 like RF140-rast5, "Rasterfeld 5
RAST6 like RF140-rast6, "Rasterfeld 6
END OF RTAB_ALV.
*"General Data
TYPE-POOLS: SLIS.
*DATA: BEGIN OF GT_OUTTAB OCCURS 0.
INCLUDE STRUCTURE rtab_alv.
*DATA: END OF GT_OUTTAB.
Data: GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_EXIT_CAUSED_BY_CALLER,
GS_EXIT_CAUSED_BY_USER TYPE SLIS_EXIT_BY_USER,
G_REPID LIKE SY-REPID,
G_GRID_TITLE TYPE LVC_TITLE.
*"Callback
*Data: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
G_STATUS_SET TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
Data: G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
G_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
G_TOP_OF_LIST TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',
G_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST'.
*"Variants
DATA: GS_VARIANT LIKE DISVARIANT,
G_SAVE.
Global structure of list
fieldcatalog
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
sort
*DATA: GT_SORT TYPE SLIS_T_SORTINFO_ALV.
events
*DATA: GT_EVENTS TYPE SLIS_T_EVENT.
*----- Structure for specific color settings -
*DATA: COL_TAB_T TYPE SLIS_T_SPECIALCOL_ALV,
COL_TAB TYPE SLIS_SPECIALCOL_ALV.
DATA: G_TABNAME TYPE SLIS_TABNAME VALUE 'RTAB_ALV'.
print
*DATA: GS_PRINT TYPE SLIS_PRINT_ALV.
*---- FIELD-GROUPS -
FIELD-GROUPS:
HEADER,
STAMMDATEN,
OP-RASTER,
EINZELPOSTEN.
INSERT
LFB1-BUKRS " Buchungskreis
lfB1-BUSAB " Sachbearbeiter
LFA1-LIFNR " Kontonummer
SATZART " Satzart
RTAB-SORTK " Sortkz fuer Tabelle RTAB
" '0' = normale Eintraege
" '1' = Summeneintraege
GB " Geschaeftsbereich
" - GB-GSBER
" - GB-WAERS
RASTERUU " Kennzeichen fuer Detailposten bzw Raster
ab hier nur fuer Einzelposten -
TAGE " Rastertage fuer Detailposten
BSIK-UMSKZ " Umsatzkennzeichen
BSIK-BLART " Belegart
BSIK-ZUONR " Zuordnungsnummer
BSIK-BELNR " Belegnummer
BSIK-BUZEI " Belegzeile
INTO HEADER.
INSERT
Addressdaten
ADRS-LINE0 " 1. Zeile Adressenaufbereitung
ADRS-LINE1 " 2. " "
ADRS-LINE2 " 3. " "
ADRS-LINE3 " 4. " "
ADRS-LINE4 " 5. " "
ADRS-LINE5 " 6. " "
ADRS-LINE6 " 7. " "
ADRS-LINE7 " 8. " "
ADRS-LINE8 " 9. " "
ADRS-LINE9 " 10." "
Umsatzdaten
C-KUMUM " Umsatz
C-BABZG " Berechtigt. Abzuege
C-UABZG " Unberechtigt. Abzuege
C-KZINS " Zinszahlungen
C-KUMAG " Kum. Jahresausgleich
Obligos
C-SALDO " Saldo ohne SHB-Vorgänge
C-UMKZ1 "SHBKZ 1
C-SUMS1 "Sonderumsatz 1
C-UMKZ2 "SHBKZ 2
C-SUMS2 "Sonderumsatz 2
C-UMKZ3 "SHBKZ 3
C-SUMS3 "Sonderumsatz 3
C-UMKZ4 "SHBKZ 4
C-SUMS4 "Sonderumsatz 4
C-UMKZ5 "SHBKZ 5
C-SUMS5 "Sonderumsatz 5
C-UMKZ6 "SHBKZ 6
C-SUMS6 "Sonderumsatz 6
C-UMKZ7 "SHBKZ 7
C-SUMS7 "Sonderumsatz 7
C-UMKZ8 "SHBKZ 8
C-SUMS8 "Sonderumsatz 8
C-UMKZ9 "SHBKZ 9
C-SUMS9 "Sonderumsatz 9
C-UMKZ10 "SHBKZ 10
C-SUMS10 "Sonderumsatz 10
C-SONOB " Sonst. Obligen
Limits
C-AGOBLI " Absolutes Gesamtobligo
Zahlungdaten
LFB1-ZTERM "Zahlungsbedingung
LFB1-ZAHLS "Sperrschlüssel für Zahlung
LFB1-ZWELS "Zahlwege
LFB1-XVERR "Zahlungsverrechnung
LFB1-WEBTR "Wechsellimit
LFB1-BUSAB " Sachbearbeiter
lfa1-sortl
lfa1-land1
INTO STAMMDATEN.
INSERT
RTAB-RAART "Rasterart
RTAB-SPERR "gesperrte Posten
RTAB-KUMUM "Umsatz
RTAB-ANZAH "Anzahlungen
RTAB-OPSUM "Offene Posten Summe
RTAB-RAST1 "Rasterfeld 1
RTAB-RAST2 "Rasterfeld 2
RTAB-RAST3 "Rasterfeld 3
RTAB-RAST4 "Rasterfeld 4
RTAB-RAST5 "Rasterfeld 5
RTAB-RAST6 "Rasterfeld 6
INTO OP-RASTER.
INSERT
BSIK-BUDAT " Buchungsdatum
BSIK-BLDAT " Belegdatum
BSIK-CPUDT " CPU-Datum
BKPF-USNAM " User-ID
BSIK-WAERS " Wahrungsschluessel
BSEGA-NETDT " Nettofaelligkeitsdatum
FAEDE-NETDT " Nettofaelligkeitsdatum
BSIK-ZFBDT " Zahlungsfristen-Basisdatum
BSIK-BSCHL " Buchungsschluessel
BSIK-ZLSCH " Zahlungsschluessel
BSIK-MANST " Mahnstufe
SHBETRAG " Hauswaehrungsbetrag
BSEGA-DMSHB " Hauswaehrungsbetrag
BSEGA-WRSHB " Fremwaehrungsbetrag
INTO EINZELPOSTEN.
BEGIN_OF_BLOCK 1.
*ELECT-OPTIONS:
GESBER FOR BSIK-GSBER.
PARAMETERS:
MONAT LIKE RFPDO-DOPRBMON.
SELECT-OPTIONS:
KKSALDO2 FOR RFSDO-KOPRSAL2, "Saldovortrag
AGOBLIG2 FOR RFSDO-KOPRAGO2. "Absolutes Obligo
RGOBLIGO FOR RFSDO-DOPRRGOB. "Relatives Obligo
SELECT-OPTIONS:
LAND FOR LFA1-LAND1,
KONTENGR FOR LFA1-KTOKK,
SACHBEAR FOR LFB1-BUSAB,
AKONTS FOR LFB1-AKONT,
AKONTP FOR BSIK-HKONT.
SELECT-OPTIONS:
BUDAT FOR BSIK-BUDAT,
BLDAT FOR BSIK-BLDAT,
NETDT FOR BSEGA-NETDT.
PARAMETERS: N_BELEGE LIKE RFPDO-BPETNBEL
DEFAULT 'X', "Normale Belege.
STAT_BLG LIKE RFPDO-BPETSBEL. "Statistische Belege
END_OF_BLOCK 1.
*ELECT-OPTIONS:
BERABZU1 FOR LFC1-BABZG,
UNBABZU1 FOR LFC1-UABZG,
ZINSE1 FOR LFC1-KZINS,
JHRAUSG1 FOR LFC1-KUMAG.
BERABZUG FOR BEABZUG NO-DISPLAY, "Berechtigter Abzug
UNBABZUG FOR UBABZUG NO-DISPLAY, "Unberechtigter Abzug
ZINSEN FOR KUMZINS NO-DISPLAY, "Kumulierter Zins
JHRAUSGL FOR JAHRAUG NO-DISPLAY. "Kumulierter Jahresausgl.
BEGIN_OF_BLOCK 2.
PARAMETERS:
SORTART LIKE RFPDO1-KOPRSOAR DEFAULT '1', "Doku
VERDICHT LIKE RFPDO1-KOPRVERD DEFAULT '1', "Doku
RASTVERD LIKE RFPDO1-KOPRRAST DEFAULT '0', "Doku
KONZVERS LIKE RFPDO-DOPOKONZ, "Konzernversion
XBUKRDAT LIKE RFPDO3-ALLGBUKD DEFAULT 0, "Bukr.daten
KAUSGABE like rfpdo3-ALLGKAOR.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(30) TEXT-030.
PARAMETERS: RART-NET LIKE RFPDO-DOPRRNET DEFAULT 'X'.
SELECTION-SCREEN COMMENT 33(01) TEXT-028.
PARAMETERS: RART-SKT LIKE RFPDO-DOPRRSKT DEFAULT 'X'.
SELECTION-SCREEN COMMENT 35(01) TEXT-028.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RART-ALT LIKE RFPDO1-KOPRRALT DEFAULT 'X'.
SELECTION-SCREEN COMMENT 03(28) TEXT-031.
SELECTION-SCREEN POSITION POS_HIGH.
PARAMETERS RBLDAT LIKE RFPDO2-KORD10BD.
SELECTION-SCREEN COMMENT 61(12) TEXT-032.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN COMMENT 37(01) TEXT-028.
PARAMETERS: RART-UEB LIKE RFPDO-DOPRRUEB DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(31) TEXT-026.
PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
SELECTION-SCREEN COMMENT 35(02) TEXT-027.
PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '020'.
SELECTION-SCREEN COMMENT 41(02) TEXT-027.
PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '040'.
SELECTION-SCREEN COMMENT 47(02) TEXT-027.
PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '080'.
SELECTION-SCREEN COMMENT 53(02) TEXT-027.
PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '100'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(31) TEXT-029.
PARAMETERS: FAKTOR LIKE RFPDO-DOPRFAKT DEFAULT '0'.
SELECTION-SCREEN COMMENT 35(1) TEXT-028.
PARAMETERS: STELLEN LIKE RFPDO-DOPRFAKT DEFAULT '0'.
SELECTION-SCREEN END OF LINE.
PARAMETERS: PZUOR LIKE RFPDO2-DOPRZUOR.
PARAMETERS: UMSATZKZ LIKE RFPDO1-DOPRSHBO. "DEFAULT 'WSABIMVD'.
PARAMETERS:
TITLE LIKE RFPDO1-ALLGLINE,
LISTSEP LIKE RFPDO-ALLGLSEP,
MIKFICHE LIKE RFPDO-ALLGMIKF.
PARAMETERS:
P_LVAR LIKE Gs_VARIANT-VARIANT DEFAULT SPACE modif id 508.
END_OF_BLOCK 2.
AT SELECTION-SCREEN OUTPUT.
if acc_mode is initial.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = '508'.
SCREEN-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
AT SELECTION-SCREEN ON AKONTS.
Konvertierung der Kontonummer
LOOP AT AKONTS.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTS-LOW AKONTS-LOW.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTS-HIGH AKONTS-HIGH.
MODIFY AKONTS.
ENDLOOP.
AT SELECTION-SCREEN ON AKONTP.
Konvertierung der Kontonummer
LOOP AT AKONTP.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTP-LOW AKONTP-LOW.
PERFORM ALPHAFORMAT(SAPFS000)
USING AKONTP-HIGH AKONTP-HIGH.
MODIFY AKONTP.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LVAR.
Gs_VARIANT-REPORT = SY-REPID.
Gs_VARIANT-VARIANT = P_LVAR.
PERFORM F4_FOR_S_LVAR USING Gs_VARIANT.
P_LVAR = Gs_VARIANT-VARIANT.
AT SELECTION-SCREEN.
IF NOT RASTBIS5 IS INITIAL.
IF RASTBIS5 GT RASTBIS4
AND RASTBIS4 GT RASTBIS3
AND RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS4 IS INITIAL.
IF RASTBIS4 GT RASTBIS3
AND RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS3 IS INITIAL.
IF RASTBIS3 GT RASTBIS2
AND RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
ENDIF.
ELSE.
IF NOT RASTBIS2 IS INITIAL.
IF RASTBIS2 GT RASTBIS1.
ELSE.
MESSAGE E379.
EHi Laxman,
I have checked the program and found out following:
the field "acc_mode" which gets populated by FM "GET_ACCESSIBILITY_MODE".
If this field is initial, then normal list gets displayed and
If this field has value, then ALV grid gets displayed.
regards,
Dharitree -
Hi, I want to know that standard tables for vendor analasys report and sale
Hi, I want to know that standard reports for vendor analasys report and sale order and customer order report...? why most probably we use tables and fetch the fields rather than standard reports >
Hi
This is the sample report for vendor aging:
Std reports Tcodes are:
customer : s_alr_87012178
vendor : s_alr_87012084
Custom designed:
REPORT zfi_customer_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: kna1, " Customer Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Customer Open Items Data
DATA: BEGIN OF int_bsid OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
shkzg LIKE bsid-shkzg, " Dr/Cr Indicator
belnr LIKE bsid-belnr, " Document Number
xblnr LIKE bsid-xblnr, " Ref Doc No
blart LIKE bsid-blart, " Document Type
zfbdt LIKE bsid-zfbdt, " Base Line Date
zbd1t LIKE bsid-zbd1t, " Due date1
zbd2t LIKE bsid-zbd2t, " Due Date2
zbd3t LIKE bsid-zbd3t, " Due Date3
waers LIKE bsid-waers, " Currency
dmbtr LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_bsid.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
total1 LIKE bsid-dmbtr, " Amount in Local Curr
total2 LIKE bsid-dmbtr, " Amount in Local Curr
total3 LIKE bsid-dmbtr, " Amount in Local Curr
total4 LIKE bsid-dmbtr, " Amount in Local Curr
total5 LIKE bsid-dmbtr, " Amount in Local Curr
total6 LIKE bsid-dmbtr, " Amount in Local Curr
total LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsid-dmbtr, " Amount Totals
v_gtotal2 LIKE bsid-dmbtr, " Amount Totals
v_gtotal3 LIKE bsid-dmbtr, " Amount Totals
v_gtotal4 LIKE bsid-dmbtr, " Amount Totals
v_gtotal5 LIKE bsid-dmbtr, " Amount Totals
v_gtotal6 LIKE bsid-dmbtr, " Amount Totals
v_gtotal LIKE bsid-dmbtr, " Amount Totals
v_subtotal1 LIKE bsid-dmbtr, " Amount Totals
v_subtotal2 LIKE bsid-dmbtr, " Amount Totals
v_subtotal3 LIKE bsid-dmbtr, " Amount Totals
v_subtotal4 LIKE bsid-dmbtr, " Amount Totals
v_subtotal5 LIKE bsid-dmbtr, " Amount Totals
v_subtotal6 LIKE bsid-dmbtr, " Amount Totals
v_subtotal LIKE bsid-dmbtr, " Amount Totals
v_date LIKE bsid-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsid-zfbdt, " Date Range 1
r_date2 FOR bsid-zfbdt, " Date Range 2
r_date3 FOR bsid-zfbdt, " Date Range 3
r_date4 FOR bsid-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr. "Customer account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Customer Code
CLEAR kna1-kunnr.
SELECT kunnr UP TO 1 ROWS
INTO kna1-kunnr
FROM kna1
WHERE kunnr IN s_kunnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Customer Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Customer Open Items data from bsid
SELECT l~kunnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsid
FROM knb1 AS l INNER JOIN kna1 AS l1
ON lkunnr = l1kunnr
INNER JOIN bsid AS b
ON lkunnr = bkunnr AND
lbukrs = bbukrs
WHERE l~kunnr IN s_kunnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsid WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsid BY kunnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Customer Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Customer#'(015) CENTERED,
13 sy-vline ,14(35) 'Customer Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsid.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsid-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsid-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsid-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsid-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsid-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsid-dmbtr.
ENDIF.
AT END OF kunnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-kunnr = int_bsid-kunnr.
int_final-name1 = int_bsid-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-kunnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsid-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsid-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsid-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsid-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsid-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsid-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsid-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsid BY belnr zfbdt.
LOOP AT int_bsid WHERE kunnr EQ int_final-kunnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsid-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsid-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsid-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsid-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsid-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsid-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsid-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsid-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Customer Open Invoices as on'(024)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Customer#'(015) CENTERED,
23 sy-vline, 24(35) 'Customer Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1
REPORT zfi_vendor_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
Report Name : Vendor Open Items Ageing Report
Purpose : This report displays the Vendor Open Items based on
different Ageing days (Calculated by taking the Base
Line date and the days mentioned in Payment Terms)
M O D I F I C A T I O N L O G
Date | Change Number | Initials | Description
30-Aug-2004 | DTSK900**** | Anji Reddy | Initial
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Vendor Open Items Data
DATA: BEGIN OF int_bsik OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
belnr LIKE bsik-belnr, " Document Number
xblnr LIKE bsik-xblnr, " Ref Doc No
blart LIKE bsik-blart, " Document Type
zfbdt LIKE bsik-zfbdt, " Base Line Date
zbd1t LIKE bsik-zbd1t, " Due date1
zbd2t LIKE bsik-zbd2t, " Due Date2
zbd3t LIKE bsik-zbd3t, " Due Date3
waers LIKE bsik-waers, " Currency
dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_bsik.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
total1 LIKE bsik-dmbtr, " Amount in Local Curr
total2 LIKE bsik-dmbtr, " Amount in Local Curr
total3 LIKE bsik-dmbtr, " Amount in Local Curr
total4 LIKE bsik-dmbtr, " Amount in Local Curr
total5 LIKE bsik-dmbtr, " Amount in Local Curr
total6 LIKE bsik-dmbtr, " Amount in Local Curr
total LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
v_gtotal LIKE bsik-dmbtr, " Amount Totals
v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
v_subtotal LIKE bsik-dmbtr, " Amount Totals
v_date LIKE bsik-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
r_date2 FOR bsik-zfbdt, " Date Range 2
r_date3 FOR bsik-zfbdt, " Date Range 3
r_date4 FOR bsik-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Vendor Code
CLEAR lfa1-lifnr.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Vendor Open Items data from BSIK
SELECT l~lifnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsik
FROM lfb1 AS l INNER JOIN lfa1 AS l1
ON llifnr = l1lifnr
INNER JOIN bsik AS b
ON llifnr = blifnr AND
lbukrs = bbukrs
WHERE l~lifnr IN s_lifnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsik WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsik BY lifnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsik.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsik-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsik-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsik-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsik-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsik-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsik-dmbtr.
ENDIF.
AT END OF lifnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-lifnr = int_bsik-lifnr.
int_final-name1 = int_bsik-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-lifnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsik BY belnr zfbdt.
LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsik-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsik-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsik-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsik-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsik-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsik-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsik-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1
<b>The below link will give Tables & Relations.</b>
http://www.erpgenie.com/abap/tables.htm
http://goldenink.com/abap/files_in_sap.html
http://abap4.tripod.com/SAP_Tables.html
http://www.geocities.com/sapcircle/Relations.pdf
Regards,
Sree -
Can we update oracle standard table Attributes column by custom trigger?
Can we update the oracle Standard table's Attributes column using custom trigger? Is it allowed by oracle? Is this supported?
ThanksATTRIBUTE columns store DFF information and therefore custom code can be used to update their contents. Care must be taken that such updates do not cause "logical" corruption (an ATTRIBUTE column may be designed to store the color of a product, for example, but an incorrect SQL statement can update the value to a numeric one, thus causing corruption - Oracle does not have a means to check the validity of these update statements). Also, some localizations, such as Brazil and India, reserve some ATTRIBUTE columns for their use - updating such columns is not supported. More information may be found in the Flexfields Guide for your release at http://www.oracle.com/technology/documentation/applications.html
HTH
Srini -
I want to update the FND_FLEX_VALUES_TL table "DESCRIPTION" Column
Hi,
i want to update the description column in Fnd_Flex_Values_Tl Table for a specific value set id, but my question is my client is having two languages AR & US he wants the description of AR in Description of US so help me to update the description column as per the AR language for all accounts.
select ffv.flex_value_set_id,
ffv.flex_value_id,
ffv.flex_value,
ffvtl.flex_value_id,
ffvtl.language,
ffvtl.description
from fnd_flex_values_copy ffv,
fnd_flex_values_tl_copy ffvtl
where ffv.FLEX_VALUE_ID=ffvtl.FLEX_VALUE_ID
and ffv.flex_value_set_id='1007630'
order by flex_value,language
Regards,
PashaAs expected...
Isn't that message self-explanatory?
You're updating a child record, and if you're updating the cild_table.parent_id then that parent_id has to exist in the parent_table.
SQL> create table prnt(a varchar2(10) primary key);
Table created.
SQL> create table chld(a varchar2(10), b varchar2(10) references prnt (a));
Table created.
SQL> insert into prnt values('Parent 1');
1 row created.
SQL> insert into chld values('Child 1','Parent 1');
1 row created.
SQL> update chld set b = 'Parent 2';
update chld set b = 'Parent 2'
ERROR at line 1:
ORA-02291: integrity constraint (INFO.SYS_C00311351) violated - parent key not found
SQL> insert into prnt values('Parent 2');
1 row created.
SQL> update chld set b = 'Parent 2';
1 row updated.
Maybe you are looking for
-
How to send ALV report Output through mail in background !
Hi , I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background an
-
I have lost the automatic date/time stamp
I have lost the automatic date/time stamp when a form is submitted on my response page. How do I make it start doing it again? The column just appears blank now with new submissions.
-
I've about had it with Safari...
I've been using Safari for nearly 3 years now (always the latest version). Lately, I've been getting a lot of lockups (spinning disk) nearly once a day. The only way to get out of it is to do a "Force Quit". Then, Safari might be fine for the rest of
-
Unable to open all applications on my iphone 3g
Hi there, I'm wondering if anyone has experienced this issue before and what I can do to rectify it. I am unable to open any applications on my iphone 3g. When I select an application it will begin to load and then immediately close. This is happenin
-
Is the latest ThinkVanta​ge System Update safe to use?
I just reinstalled the factory version of XP onto my T60. Then I downloaded and ran the latest ThinkVantage System Update, and there were maybe 20 or 30 updates that I can install. Some of those updates require you to uninstall your current version