2018 Jun 27 11:58 AM
Dear experts,
I am not sure if locking is the isolated solution to my problem.My scenario can make things understand better.
1.Tcode VF01 is executed to create an invoice.
2.Open items BSID table of customers amount is adjusted against invoice amount.Further a cheque no is also assigned at end of billing. All this is achieved by custom abap coding using userexit and BADI.
During monthends or in exclusive cases,where server is highly resource burdened.
Suppose a person A create invoice X of customer Y with 100 lineitems.He press save button and cursor go to wait state .This wait state gets over in 26 second.Finally he see some claim that was present for this customer (from bsid) is adjusted against invoice amount.He has a cheque no in front of him to choose from five options in dropdown.He choose and end the process.Ultimately he get a message that invoice no I1 created.
Now suppose another person B within this 26 second create another invoice of same customer Y with say only 1 lineitem and wind up the process < 10 seconds.Ultimately he get a message that invoice no I2 created.
My problem is same advance amount open for this customer Y will get adjusted in both of these invoices.Because during processing of invoice I2 ,I1 processing is too running in parallerl and is yet unable to make the advance disappear from BSID.
How to overcome this situation that at time only one advance gets adjusted on first hold basis.Same should apply in selection of cheque no also.
Dear experts,
I am not sure if locking is the isolated solution to my problem.My scenario can make things understand better.
1.Tcode VF01 is executed to create an invoice.
2.Open items BSID table of customers amount is adjusted against invoice amount.Further a cheque no is also assigned at end of billing. All this is achieved by custom abap coding using userexit and BADI.
During monthends or in exclusive cases,where server is highly resource burdened.
Suppose a person A create invoice X of customer Y with 100 lineitems.He press save button and cursor go to wait state .This wait state gets over in 26 second.Finally he see some claim that was present for this customer (from bsid) is adjusted against invoice amount.He has a cheque no in front of him to choose from five options in dropdown.He choose and end the process.Ultimately he get a message that invoice no I1 created.
Now suppose another person B within this 26 second create another invoice of same customer Y with say only 1 lineitem and wind up the process < 10 seconds.Ultimately he get a message that invoice no I2 created.
My problem is same advance amount open for this customer Y will get adjusted in both of these invoices.Because during processing of invoice I2 ,I1 processing is too running in parallerl and is yet unable to make the advance disappear from BSID.
How to overcome this situation that at time only one advance gets adjusted on first hold basis.Same should apply in selection of cheque no also.
2018 Jun 28 6:34 AM
It depend on what make 26 seconds.
If the update database is the cause, so use LOCK table is the best thing I know or you have to narrow it.
If your code is the reason then you should start the tuning.
Probably you need check program performance first.
2018 Jun 28 7:26 AM
there are some riddles in your story.
First you talk about VF01 which is a standard SAP transaction, so I wonder what the post actually has to do with the ABAP tag.
Then you continue with "He has a cheque no in front of him to choose from five options in dropdown.He choose and end the process.Ultimately he get a message that invoice no I1 created." which needs a lot more information and probably even screenshots.
I cannot imagine where a cheque has five options in dropdown. Are you still in VF01 or is this another transaction now? And ending a process that result in invoice created is contradictory too, then I rather think the ending did not work.
26 seconds...you have 100 items to process there are lot updates that happen in the system, almost the same time needed like for 100 invoices with 1 item. If you think VF01 is slow then check for performance notes. Maybe your system is slow?
You further wrote "same advance amount open for this customer Y will get adjusted in both of these invoices." I assume this is a value on the invoice and it is fetched by own coding in the print program. Can you explain why it is incorrect? Should it only show the value of a single invoice or is it supposed to tell the customer all his open amounts?
2018 Jun 29 4:54 PM
These are all custom addons applied as per business requirement in BADI_SD_BILLING.
Sorry for replying late
2018 Jun 29 5:00 PM
so how can we help without knowing what someone in your company programmed?