2015 Jun 25 2:51 PM
Hi gurus i have a problem releasing the sales order created from va01 , and has and asociated offer from va21 , what i need to do is when it comes from an offer , i try several exit for this and i using the function
SD_ORDER_CREDIT_RELEASE , but allways says that the document is not yet created , i supose that is for the commit to the database , but i need to release the sales order after the save button triiger .
Please help
2015 Jun 25 7:53 PM
Dear Alan,
It can be done by a separate program that gets automatically called for credit release once sales order created. We can't execute this functionality within VA01 unless you want to simulate credit release overall functionality upon save sales order customer exits. Please inform if you have further questions.
Regards,
Sriram.
2015 Jun 25 8:46 PM
2015 Jun 25 9:06 PM
Dear Alan,
We have multiple options depends on business
Option 1 - Use exit MV45AFZZ under perform userexit_save_document_prepare call credit release functionality upon sales order save.
Note - check with business how it should revert back if any changes to sales order using VA02 as well if any validations necessary.
Option 2 - we can have an automated small utility batch program that runs to check the sales order created recently and credit release call based on certain conditions and validations.
Note - how frequently to run this program is to be decided depends on average volume of order creation.
I prefer option 1 if its suits your business as its more efficient way unless custom development gets complex while integrating release functionality.
Please check and inform if it works :-).
Regards,
Sriram.
2015 Jun 26 2:23 PM
User exit userexit_save_document_prepare does not run after saving, as OP was asking. Its name is self-explanatory - it's used to do last-minute checks/changes before saving.
2015 Jun 25 8:31 PM
Hello Alan,
generally BTEs(= "Business Transaction Event") are nice tools for such requirements (doing something after save/commit).
See BTE 00501014 "Sales documents: Final checks II" & FM SAMPLE_INTERFACE_00501014 (specifically for VA01/VA02) and transaction FIBF "Maintenance transaction BTE" (generally for BTE; note that you have to activate your own FM derived from sample interface in this transation).
Kind Regards
TomT
2015 Jun 25 8:38 PM
Not sure why some additional "release" is needed (what are you releasing exactly?), you might want to check with SD consultant.
But from the technical standpoint you can assign a function to the order output. Output is triggered after the document update and may be used for all kinds of subsequent activities. This has been discussed on SCN before, do some search.
Or you could use a standalone program and just run it in background regularly if this "release" doesn't have to be immediate.
2015 Jun 26 2:47 PM
To add to Jelena Perfiljeva's point,
If an order is to be released immediately after creation, then why have you even configured a credit check functionality on it? Please check with SD consultant on ways to avoid credit checks.
Apart from Output type and standalone program, you can also configure a workflow standard task, which can be triggered based on sales order creation event, to release the credit.
Thanks,
Juwin
2015 Jun 26 3:00 PM
Juwin Pallipat Thomas wrote:
If an order is to be released immediately after creation, then why have you even configured a credit check functionality on it? Please check with SD consultant on ways to avoid credit checks.
Good point. Too frequently ABAPers get wrapped up in solving a problem instead of thinking how the problem could be avoided in the first place (or rather we assume that people who gave us the spec already thought about it, which is not always true ). Even if for some reason credit check can't be removed in configuration, there might be user exits available in the credit check functionality itself.
2015 Jun 26 3:25 PM
Of course you could wrap the FM in a customer RFC enabled Z_FM and call it IN BACKGROUND TASK so it should execute after commit work and update task are fully performed, but is it he best solution... yes / no / don't know ?
First look for Customizing option or specific user exits For Credit Checks (And Risk Management)
Regards,
Raymond