Hi Hari,
As per Standard SAP functionality, payment order lot creation and processing is only successful, when there is payment order posted against the account, which has blocked (technically not clear) the outstanding receivables.
So, on posting the payment order lot, the payment order is reversed and item in the payment order lot (FP45) gets settled with the outstanding receivables.
Now in your scenario, you are trying to create a payment order lot without having a payment order in the first place.Moreover, if you have already posted the payment order lot, then what activity is Step-2 performing?
I don't think the payment order functionality fits in the business scenario, that you have mentioned.
Instead, as you are performing the Bank validation in real time, then why not post a payment through a payment lot.
You can achieve this using the function modules BAPI_CTRACPAYMINC_CREATE, BAPI_CTRACPAYMINC_APPEND, BAPI_CTRACPAYMINC_SCHEDULE
BAPI_CTRACPAYMINC_RELEASE and BAPI_CTRACPAYMINC_CLOSE.
You can go through the documentation for understanding the purpose and sequence in which these FM's need to be called.
I am still unclear about Step-2.
Hope it helps..
Thanks,
Amlan