Komplette Rücknahme eines Zahlungslaufs

Komplette Rücknahme eines Zahlungslaufs

Postby Yannik3028 » Thu May 24, 2007 8:37 am

Hallo Forum,

kann man einen Zahlungslauf (Druck ist noch nicht erfolgt) komplett zurücknehmen ?

Oder muss wirklich jeder Beleg mit FBRA zurückgenommen und storniert werden ? Gibt's hierzu keine Massenverarbeitung ? Ich finde einfach nichts...

DANKE !
MAtthias
Yannik3028
...
...
 
Posts: 236
Joined: Tue Feb 22, 2005 7:47 pm

Postby Simon4398 » Fri May 25, 2007 9:45 am

mit RFCORR14 kann man den Mahnlauf zurücksetzen.
irgendwas in dieser Art sollte es auch für den Zahllauf geben..

grüsse
Simon4398
...
...
 
Posts: 296
Joined: Tue Jan 23, 2007 9:43 am

Re: Komplette Rücknahme eines Zahlungslaufs

Postby Lavinia3875 » Fri May 25, 2007 9:48 am

Matthias_L. hat geschrieben:Oder muss wirklich jeder Beleg mit FBRA zurückgenommen und storniert werden ? Gibt's hierzu keine Massenverarbeitung ? Ich finde einfach nichts...


Natürlich gibts nen Massenstorno. Man gibt die erste und die letzte Belegnummer an und lässt die Maschine rödeln.

Im FI: Beleg -> Massenstorno


Ralf
Lavinia3875
.....
.....
 
Posts: 1274
Joined: Sat Sep 18, 2004 2:07 pm

Postby Yannik3028 » Mon Jun 04, 2007 9:27 am

Hallo Ralf,

aber der Massenstorno bringt mir ja in diesem Fall nichts, weil die Belege des Zahllaufs ja bereits ausgeglichen sind. Wenn man diese versucht zu stornieren, kommt eine Fehlermeldung, dass die Belege bereits ausgeglichen sind.

Die Belege des Zahllaufs muss man doch mit der FBRA zurücknehmen (den Ausgleich) und stornieren.

Oder liege ich hier falsch ?

Danke
Matthias
Yannik3028
...
...
 
Posts: 236
Joined: Tue Feb 22, 2005 7:47 pm

Postby Bruno4782 » Mon Jun 04, 2007 2:32 pm

Hallo MAtthias,

mir ist auch nicht bekannt wie man einen Zahllauf maschinell umdrehen kann.
Wie schon geschrieben müssen die Ausgleiche zurück und dann die Posten storniert werden. Die Ausgleichsnummer bekommst du vielleicht über geschickte Tabellenabfrage heraus. Mit Aufzeichnungen kann du hier eine maschinelle Verarbeitung starten, hier kenn ich mir aber nich so gut aus. Mein Kollege der gewechselt hat kann ich derzeit nicht greifen.

Gruß
Thomas
Bruno4782
...
...
 
Posts: 207
Joined: Wed Jan 31, 2007 3:57 pm

Postby Lavinia3875 » Mon Jun 04, 2007 3:30 pm

Ich krieg auch nicht mehr zusammen, wie ich das damals (2002) zu meiner FI-Zeit immer gemacht habe... Aber der Arbeitsaufwand war vertretbar niedrig.

Ralf
Lavinia3875
.....
.....
 
Posts: 1274
Joined: Sat Sep 18, 2004 2:07 pm

Postby Ibrahim3632 » Tue Jun 05, 2007 3:23 pm

Hallo Matthias_L,

dazu mußt du ein kleines Programm schreiben.
1. Ausgleichsbelegnummern des Zahllauf selektieren
2. dazugehörige ausgeglichene Belege selektieren
3. nacheinander 2 FB aufrufen um Ausgleich zurückzunehmen
und Beleg zu stornieren

etwa in der Art: Achtung nur grobe Anleitung!

START-OF-SELECTION.
SELECT * FROM reguh WHERE laufd IN s_laufd
AND laufi IN s_laufi.
MOVE reguh-vblnr TO record-augbl_001.
APPEND record.

ENDSELECT.

LOOP AT record.
SELECT SINGLE * FROM bkpf WHERE belnr = record-augbl_001
AND gjahr = p_jahr
AND bukrs = p_buk.

SELECT * FROM bseg WHERE belnr = record-augbl_001
AND koart = p_koart
AND gjahr = p_jahr
AND bukrs = p_buk.
EXIT.
ENDSELECT.
CHECK sy-dbcnt > 0.
WRITE:/ bseg-belnr,bkpf-stblg,bseg-augbl.
CHECK bkpf-stblg <= '0000000000'.

IF bseg-augbl > '0000000001'.
CALL FUNCTION 'CALL_FBRA' "Rücknahme des Ausgleichs
EXPORTING
i_bukrs = p_buk
i_augbl = record-augbl_001
i_gjahr = p_jahr.
* i_xerlk = '01'
* i_augdt = sy-datum
* i_stodt = sy-datum.
* i_stomo = space
* TABLES
* t_accnt = xaccnt.
WRITE:/ syst.
ENDIF.
CALL FUNCTION 'CALL_FB08' "Storno des Ausgleichsbelegs
EXPORTING
i_bukrs = p_buk
i_belnr = record-augbl_001
i_gjahr = p_jahr
i_stgrd = '01'.
* i_budat = rf05r-budat
* i_monat = rf05r-monat.
WRITE:/ syst.
ENDLOOP.
Ibrahim3632
.
.
 
Posts: 1
Joined: Tue Jun 05, 2007 3:23 pm

Re: Komplette Rücknahme eines Zahlungslaufs

Postby Rosalie1273 » Mon Sep 12, 2016 9:41 am

es gibt zur massenhaften Rücknahme ein Programm von SAP, das allerdings nicht offiziell freigegeben wurde. Hier der Qelltext

*&---------------------------------------------------------------------*
*& Report Z_REVERSE_CLEARING
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT Z_REVERSE_CLEARING.



* This report can be used to reverse big clearing documents
* for G/L accounts, vendor or customer accounts if
* transaction FBRA fails.
* The clearing information is deleted in BSEG and the
* index tables are actualized.
* A C H T U N G
* =============
* Es werden lediglich die Ausgleichsinformationen in den ausgeglichenen
* Posten gelöscht und die Sekundärindices angepasst. Es werden keine
* Änderungsbelege geschrieben und es wird auch kein Stornobeleg gebucht.
* Im Anschluss an das Programm ist der Massenstorno F.80 durchzuführen.


*Eingabeparameter im Selektionsbild:
* p_bukrs: Buchungskreis
*
* p_accnt: Kontonummer des Sachkontos, Debitors oder Kreditors
*
* p_augdt: Ausgleichsdatum im Ausgleichsbeleg
*
* p_augbl: Belegnummer des Ausgleichsbelegs
*
* p_umsks: Vorgangsklasse Sonderhauptbuch
*
* p_umskz: Sonderhauptbuch-Kennzeichen
*
* Radiobutton:
*
* gl_doc: Ausgleich Sachkonten
*
* ap_doc: Ausgleich Kreditoren
*
* ar_doc: Ausgleich Debitoren



tables: bsis, bsas,
bsik, bsak,
bsid, bsad,
bkpf,
bseg.

selection-screen begin of block 001 with frame title text-001.
parameters: p_bukrs like bseg-bukrs obligatory,
* p_accnt like bseg-hkont obligatory,
p_augdt like bseg-augdt obligatory,
* p_augbl like bseg-augbl obligatory,
p_umsks like bseg-umsks,
p_umskz like bseg-umskz.
select-options: p_accnt for bseg-hkont obligatory,
p_augbl for bseg-augbl obligatory.
selection-screen end of block 001.

selection-screen begin of block 002 with frame title text-002.
parameters: gl_doc radiobutton group 0001 DEFAULT 'X',
ap_doc radiobutton group 0001, "default 'X',
ar_doc radiobutton group 0001.
selection-screen end of block 002.


data: i_bsas like bsas occurs 40000 with header line,
i_bsak like bsak occurs 40000 with header line,
i_bsad like bsad occurs 40000 with header line,
wa_bsis like bsis,
wa_bsik like bsik,
wa_bsid like bsid,
wa_bseg like bseg.

data: commit_counter type i,
n type i.

constants threashold type i value 100.

* define initial variables to initialize clearing information
data: init_augcp like bseg-augcp,
init_augdt like bseg-augdt,
init_augbl like bseg-augbl,
init_agzei like bseg-agzei,
init_auggj like bseg-auggj.


* *
* main *
* *
if gl_doc = 'X'. perform gl_reverse. endif.
if ap_doc = 'X'. perform ap_reverse. endif.
if ar_doc = 'X'. perform ar_reverse. endif.




* *
* FORM gl_reverse *
* *
form gl_reverse.
* copy all cleared line items into internal table I_BSAS
select * from bsas into table i_bsas where bukrs = p_bukrs
and hkont in p_accnt
and augdt = p_augdt
and augbl in p_augbl.

commit_counter = 0.
loop at i_bsas.
add 1 to commit_counter.
* reset clearing information in BSEG line item
update bseg set augcp = init_augcp
augdt = init_augdt
augbl = init_augbl
agzei = init_agzei
auggj = init_auggj
where bukrs = i_bsas-bukrs
and belnr = i_bsas-belnr
and gjahr = i_bsas-gjahr
and buzei = i_bsas-buzei.
perform check_result_gl using sy-subrc i_bsas 1.
* insert a new open item line into BSIS
wa_bsis = i_bsas.
wa_bsis-augbl = init_augbl.
wa_bsis-augdt = init_augdt.
wa_bsis-auggj = init_auggj.
insert bsis from wa_bsis.
perform check_result_gl using sy-subrc i_bsas 2.
* delete the cleared item line out of BSAS
delete bsas from i_bsas.
perform check_result_gl using sy-subrc i_bsas 3.
* perform a commit beyond a given threashold
n = commit_counter mod threashold.
if n = 0.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = commit_counter.
call function 'DB_COMMIT'.
endif.

write: / 'Ausgleich zurückgenommen ', i_bsas-bukrs,
i_bsas-hkont,
i_bsas-augbl,
i_bsas-augdt.
endloop.
endform. "G/L reverse

* *
* FORM check_result_gl *
* *
* describes the reaction for a failed UPDATE, INSERT or DELETE
* for G/L clearings
form check_result_gl using subrc key like bsas msg type i.
if subrc ne 0.
write: / 'Data base action failed with', key-bukrs,
key-belnr,
key-gjahr,
key-buzei.
case msg.
when 1. message a005(FI) with 'BSEG' key-belnr.
when 2. message a004(FI) with 'BSIS' key-belnr.
when 3. message a006(FI) with 'BSAS' key-belnr.
endcase.
endif.
endform. "check_result_gl


* *
* FORM ap_reverse *
* *
form ap_reverse.
* copy all cleared line items into internal table I_BSAK
select * from bsak into table i_bsak where bukrs = p_bukrs
and lifnr in p_accnt
and augdt = p_augdt
and augbl in p_augbl
and umsks = p_umsks
and umskz = p_umskz.
commit_counter = 0.
loop at i_bsak.
add 1 to commit_counter.

* check, if reconciliation account is single item managed
* first read document line item information
select single * from bseg into wa_bseg where bukrs = i_bsak-bukrs
and belnr = i_bsak-belnr
and gjahr = i_bsak-gjahr
and buzei = i_bsak-buzei.
perform check_result_ap using sy-subrc i_bsak 1.
If wa_bseg-xhres = 'X'.
* read BSAS entry regarding to vendor line item
select single * from bsas into i_bsas where bukrs = wa_bseg-bukrs
and hkont = wa_bseg-hkont
and augdt = wa_bseg-augdt
and augbl = wa_bseg-augbl
and zuonr = wa_bseg-hzuon
and gjahr = wa_bseg-gjahr
and belnr = wa_bseg-belnr
and buzei = wa_bseg-buzei.

perform check_result_ap using sy-subrc i_bsak 1.
* create a new BSIS entry
move i_bsas to wa_bsis.
wa_bsis-augbl = init_augbl.
wa_bsis-augdt = init_augdt.
wa_bsis-auggj = init_auggj.
insert bsis from wa_bsis.
perform check_result_gl using sy-subrc i_bsas 2.
* delete the BSAS entry
delete bsas from i_bsas .
perform check_result_gl using sy-subrc i_bsas 3.
endif.

* check, if the cleared document was posted net
* if so, reset clearing information in SKV line items and
* restore BSIS / delete BSAS
if ( i_bsak-xnetb = 'X' ) or ( i_bsak-augbl = i_bsak-belnr ).
perform reverse_skv_ap using i_bsak.
endif.

* handle vendor line item
* reset clearing information in BSEG line item
wa_bseg-augcp = init_augcp.
wa_bseg-augdt = init_augdt.
wa_bseg-augbl = init_augbl.
wa_bseg-agzei = init_agzei.
wa_bseg-auggj = init_auggj.
update bseg from wa_bseg.
perform check_result_ap using sy-subrc i_bsak 1.
* insert a new open item line into BSIK
wa_bsik = i_bsak.
wa_bsik-augbl = init_augbl.
wa_bsik-augdt = init_augdt.
wa_bsik-auggj = init_auggj.
insert bsik from wa_bsik.
perform check_result_ap using sy-subrc i_bsak 2.
* delete the cleared item line out of BSAK
delete bsak from i_bsak.
perform check_result_ap using sy-subrc i_bsak 3.
* perform a commit beyond a given threashold
n = commit_counter mod threashold.
if n = 0.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = commit_counter.
call function 'DB_COMMIT'.
endif.
* endloop.
*endform. "AP reverse
write: / 'Ausgleich zurückgenommen ', i_bsak-bukrs,
i_bsak-lifnr,
i_bsak-augbl,
i_bsak-augdt.

endloop.
endform. "ap_reverse

* *
* FORM reverse_skv_ap *
* *
* reset clearing information in SKV document line items and
* restore BSIS / delete BSAS
form reverse_skv_ap using key like bsak.
data: iwa_bsis like bsis,
iwa_bsas like bsas.
select * from bseg where bukrs = key-bukrs
and belnr = key-belnr
and gjahr = key-gjahr
and ktosl = 'SKV'.
* read BSAS entry
select single * from bsas into iwa_bsas
where bukrs = bseg-bukrs
and hkont = bseg-hkont
and augdt = bseg-augdt
and augbl = bseg-augbl
and zuonr = bseg-zuonr
and gjahr = bseg-gjahr
and belnr = bseg-belnr
and buzei = bseg-buzei.
perform check_result_ap using sy-subrc key 1.
* create a new BSIS entry
move iwa_bsas to iwa_bsis.
iwa_bsis-augbl = init_augbl.
iwa_bsis-augdt = init_augdt.
iwa_bsis-auggj = init_auggj.
insert bsis from iwa_bsis.
perform check_result_gl using sy-subrc iwa_bsas 2.
* delete the BSAS entry
delete bsas from iwa_bsas.
perform check_result_gl using sy-subrc iwa_bsas 3.
* reset clearing information in BSEG
bseg-augcp = init_augcp.
bseg-augdt = init_augdt.
bseg-augbl = init_augbl.
bseg-agzei = init_agzei.
bseg-auggj = init_auggj.
update bseg.
perform check_result_ap using sy-subrc key 1.
endselect.
endform. "reverse_SKV_AP

* *
* FORM check_result_ap *
* *
* describes the reaction for a failed UPDATE, INSERT or DELETE
* for AP clearings
form check_result_ap using subrc key like bsak msg type i.
if subrc ne 0.
write: / 'Data base action failed with', key-bukrs,
key-belnr,
key-gjahr,
key-buzei.
case msg.
when 1. message a005(FI) with 'BSEG' key-belnr.
when 2. message a004(FI) with 'BSIK' key-belnr.
when 3. message a006(FI) with 'BSAK' key-belnr.
endcase.
endif.
endform. "check_result_ap

* *
* FORM ar_reverse *
* *
form ar_reverse.
* copy all cleared line items into internal table I_BSAD
select * from bsad into table i_bsad where bukrs = p_bukrs
and kunnr in p_accnt
and augdt = p_augdt
and augbl in p_augbl
and umsks = p_umsks
and umskz = p_umskz.

commit_counter = 0.
loop at i_bsad.
add 1 to commit_counter.

* check, if reconciliation account is single item managed
* first read document line item information
select single * from bseg into wa_bseg where bukrs = i_bsad-bukrs
and belnr = i_bsad-belnr
and gjahr = i_bsad-gjahr
and buzei = i_bsad-buzei.
perform check_result_ar using sy-subrc i_bsad 1.
If wa_bseg-xhres = 'X'.
* read BSAS entry regarding to customer line item
select single * from bsas into i_bsas where bukrs = wa_bseg-bukrs
and hkont = wa_bseg-hkont
and augdt = wa_bseg-augdt
and augbl = wa_bseg-augbl
and zuonr = wa_bseg-hzuon
and gjahr = wa_bseg-gjahr
and belnr = wa_bseg-belnr
and buzei = wa_bseg-buzei.
perform check_result_ar using sy-subrc i_bsad 1.
* create a new BSIS entry
move i_bsas to wa_bsis.
wa_bsis-augbl = init_augbl.
wa_bsis-augdt = init_augdt.
wa_bsis-auggj = init_auggj.
insert bsis from wa_bsis.
perform check_result_gl using sy-subrc i_bsas 2.
* delete the BSAS entry
delete bsas from i_bsas .
perform check_result_gl using sy-subrc i_bsas 3.
endif.

* check, if the cleared document was posted net
* if so, reset clearing information in SKV line items and
* restore BSIS / delete BSAS
if ( i_bsad-xnetb = 'X' ) or ( i_bsad-augbl = i_bsad-belnr ).
perform reverse_skv_ar using i_bsad.
endif.

* handle customer line item
* reset clearing information in BSEG line item
wa_bseg-augcp = init_augcp.
wa_bseg-augdt = init_augdt.
wa_bseg-augbl = init_augbl.
wa_bseg-agzei = init_agzei.
wa_bseg-auggj = init_auggj.
update bseg from wa_bseg.
perform check_result_ar using sy-subrc i_bsad 1.
* insert a new open item line into bsid
wa_bsid = i_bsad.
wa_bsid-augbl = init_augbl.
wa_bsid-augdt = init_augdt.
wa_bsid-auggj = init_auggj.
insert bsid from wa_bsid.
perform check_result_ar using sy-subrc i_bsad 2.
* delete the cleared item line out of bsad
delete bsad from i_bsad.
perform check_result_ar using sy-subrc i_bsad 3.
* perform a commit beyond a given threashold
n = commit_counter mod threashold.
if n = 0.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = commit_counter.
call function 'DB_COMMIT'.
endif.

write: / 'Ausgleich zurückgenommen ', i_bsad-bukrs,
i_bsad-kunnr,
i_bsad-augbl,
i_bsad-augdt.
endloop.
endform. "AR reverse

* *
* FORM reverse_skv_ar *
* *
* reset clearing information in SKV document line items and
* restore BSIS / delete BSAS
form reverse_skv_ar using key like bsad.
data: iwa_bsis like bsis,
iwa_bsas like bsas.
select * from bseg where bukrs = key-bukrs
and belnr = key-belnr
and gjahr = key-gjahr
and ktosl = 'SKV'.
* read BSAS entry
select single * from bsas into iwa_bsas
where bukrs = bseg-bukrs
and hkont = bseg-hkont
and augdt = bseg-augdt
and augbl = bseg-augbl
and zuonr = bseg-zuonr
and gjahr = bseg-gjahr
and belnr = bseg-belnr
and buzei = bseg-buzei.
perform check_result_ar using sy-subrc key 1.
* create a new BSIS entry
move iwa_bsas to iwa_bsis.
iwa_bsis-augbl = init_augbl.
iwa_bsis-augdt = init_augdt.
iwa_bsis-auggj = init_auggj.
insert bsis from iwa_bsis.
perform check_result_gl using sy-subrc iwa_bsas 2.
* delete the BSAS entry
delete bsas from iwa_bsas.
perform check_result_gl using sy-subrc iwa_bsas 3.
* reset clearing information in BSEG
bseg-augcp = init_augcp.
bseg-augdt = init_augdt.
bseg-augbl = init_augbl.
bseg-agzei = init_agzei.
bseg-auggj = init_auggj.
update bseg.
perform check_result_ar using sy-subrc key 1.
endselect.
endform. "reverse_SKV_AR


* *
* FORM check_result_ar *
* *
* describes the reaction for a failed UPDATE, INSERT or DELETE
* for AR clearings
form check_result_ar using subrc key like bsad msg type i.
if subrc ne 0.
write: / 'Data base action failed with', key-bukrs,
key-belnr,
key-gjahr,
key-buzei.
case msg.
when 1. message a005(FI) with 'BSEG' key-belnr.
when 2. message a004(FI) with 'BSID' key-belnr.
when 3. message a006(FI) with 'BSAD' key-belnr.
endcase.
endif.
endform. "check_result_ar
Rosalie1273
.
.
 
Posts: 6
Joined: Fri Nov 17, 2006 2:50 pm


Return to Financials

Who is online

Users browsing this forum: No registered users and 1 guest

cron
  • Latest Topics