2013 Jul 29 4:16 PM
Hi experts,
When run FPY1 in FICA, I would like to check the total amount of all transactions.If total is above XXXX amount,
I will not sedn the XML payment file to the bank, instead filoe will be blocked and an email has to be sent to a super user.
the sper user chekc the file, if everything is ok, he unblock the file.
has anyone deal with this before, to give any good idea ?
Reagrds,
Thierno.
2013 Jul 29 9:49 PM
Thierno:
You can execute the payment run in simulation mode. Then your custom program could check DPAYH and get the total for your desired outcome.
regards,
bill.
2013 Jul 30 2:45 AM
Hi Thierno,
Just adding to Bill's point, its recommended to have the approval\unblocking from the Super User before the actual payment run is scheduled as because if the file is not approved\unblocked for some reason, the actual payment run has to be reversed in SAP.
You can plug in an enhancement in event 601, where in once the payment amount in the simulated payment run is greater than a given amount , it would trigger a workflow to the super user.
If the super user approves the payment amount, then it will get stored in a custom table, based on the date ID and identification of the payment run.
Now, when the actual payment run is executed and the total amount is greater than a given amount, it would check the custom table and depending on the entries maintained in the custom table it would proceed\error out the payment run.
Hope it helps..
Thanks,
Amlan
2013 Jul 30 11:48 AM
Hi,
Thnak you Amlan and William for your replies. It looks a good idea to start a work flow when a certain amount is reached but I first need to get this amount. When I look to the xml payment file in the tag <CtrlSum> </CtrlSum>, I can find the toatl amount I need.
From which event (may be 0601) I can get the value of this tag so that I can test ?
If total amount > XXX then
start workflow to send infor to inbox super user
don't send file to the bank
else
continue, generate file
sedn file to the bank
endif
the program FPY1 will be scheduled in background so, it wil not be run in simulation mode.
Thanks in advance
2013 Aug 01 1:18 AM
Hi Thierno,
Event 601 would give you the total amount that you are getting from a payment run and which would eventually go into the payment file.
I don't think so the payment file is created at this point.
You have to also think of the scenario, where the Super User does not approves the file.
So in that scenario, you have to reverse the payment documents that have already been created in SAP.
This is where the payment run in simulation mode comes in to play. If you are running the payment run in simulation mode and triggering the workflow and it gets routed to the Super User, where in, if its approved, then you can proceed with the actual payment run in the background.
However, if its not, you can delete the simulated payment run from the System. This would reduce the effort of reversing the payment entries in SAP.
Hope it helps..
Thanks,
Amlan
2013 Aug 01 7:48 AM
Hi,
In our project too, we run FPY1 first in simulation mode, get the approval and then run FPY1 in actual mode. This saves the risk of reversing the payment documents in case file is rejected or has got some issue.
Regards,
Ravi
2013 Aug 02 1:32 PM
Hi,
Thank you Amlan & Ravi. I think it's a good idea to first run id in sumilation mode and there afetr if everything is ok, run it in actual mode.
If I understand you, I have to schedule one job for FPY1 in simulation mode. In event 601, then I test the amount.
If it's ok how to rerun the payment in actual mode, as the job should already finished ?
To get the total amount, do I have to aggregate value of T_0601-BETRH (amount in local currency for current item) ? But what is the structure containing all selected items in the payment run ?
How can I loop through the strcuture to get the total amount ?
Thanks in advance.
Regards,
Tierno
2013 Aug 02 2:07 PM
When you run the FPY1 in simulation mode, it just creates the payment list without updating any tables. Now, if you want to automate the approval process, you can use event 601 based on amount you get from simulation mode. If this can be manual, simply send the payment list to approver.
Now, once approved you can run FPY1 in actual mode. For this, just use the same parameters as in simulation mode without checking the simulation run. This should be ok as simulation mode just creates payment list but does not post the actual payment document.
Regards,
Ravi
2013 Aug 02 3:12 PM
Thank you Ravi for your quick reply.
this operation must be automated, this is a business requirement to run in the night the payment program.
I’m still looking how to go
further of your idea, with other words:
How to run the program in simulation mode, test the amount:
if it’s ok run in actual mode(without manual intervention) ?
else trigger Workflow to a user
How can you get the total amount in simulation mode from event 601, when debugging there I see only one line item in t_0601 so cannnot make the sum?
Thanks in advance for your ideas.
Regards,
Tierno
2013 Aug 07 7:42 AM
Hello all,
Just in addition to the problem of Thierno there is something you have to concider using the test run / actual run in the FPY1.
When in the time between the test run and actual run a new document is posted (that will suit the parameters of the payment run) then this new document will not be shown in the test run but will but payed / collected in the actual run.
Please note that this could also be the case if a document is reversed / cleared somewhere in another process. So in this case a document could appear on the test run but not in the actual run.
Regards,
Lukas
2013 Aug 07 9:09 AM
Hi,
Thanks all of you for your effort. It has became more clera for me how to deals with this.
I dont' succeed to get the total amount in simulation mode in event 0601.
Can anyone tell where to get this value so that i test if is greater or not. Or do i have to calculate it in loop ?
Thanks in advance.
Regards,
Tirenro
2013 Aug 13 12:48 AM
Hi Thierno,
I think event 630 will cater your requirement.
All the data used in payment program are stored in tables DPAYH and DPAYP.
Table DPAYH has an entry for each payment order. This table contains application and customer includes whose fields can be filled in this event. All information available to the payment program is transferred:
So you can use this event to find the total amount against a particular combination of date ID and identification.
Hope it helps..
Thanks,
Amlan