cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if the SO you are creating (VA01) has a credit block?

Former Member
0 Kudos

Hi Experts-

Good day!

I would like to ask help on how to check if the sales order you are creating (VA01) will have a status B on field VBUK-CMGST when saved.

Here is the scenario.

1. I am creating a new routine via transaction VOFM for  recalculation of CONDITION BASE VALUE. This routine is ROUTINE 986 for output type YZ11.

2. I already configured it on V/08.

3. Now inside the routine, the user wants to add logic that if a credit message will appear upon saving (CREDIT LIMIT EXCEEDED and etc....), the condition base value should be cleared out. It should be set to ZERO since field VBUK-CMGST will have status 'B' after saving.

I tried using function module CREDIT_EXPOSURE inside the routine but in some cases it did not work. There was a time that when I tried saving an SO, it bypassed the validation and still the Condition Base Value sa recalculated even if the SO is still blocked after saving.

I traced how SO generated the MESSAGE and found out that it is using function module SD_ORDER_CREDIT_CHECK.

Now, I wanted to adopt this kinda validation on the routine before re-calculating the condition base value. Is this possible? What should I do?

I checked the order, it seems that the program code line of the new routine, ROUTINE 986, is being executed first until the whole SO creation calls the function module SD_ORDER_CREDIT_CHECK.

Hoping for your response.

Thank you!

Bert

Accepted Solutions (0)

Answers (2)

Answers (2)

moazzam_ali
Active Contributor
0 Kudos

Hi

You have explained the requirement in very good manner. What I understood is that you need a trigering point to check the credit status before pricing prepare. If in routine system calculates pricing before credit check then you can ceck in MV45AFZZ pricing prepare user exit. Test this exit and update.

If this exit also execute pricing before credit check then you have to look for some other work around as we can not change standard behavior of system

Thank$

Former Member
0 Kudos

Hi Sir MoazzaM-

Yeah, you were right on your understanding. I wanted to have a checking on a credit status BEFORE calculation of the pricing.

I've checked on the user exit you've mentioned but how do I do the checking on the credit status. Is there any function module that you've known to do this?

Currently, I am using function module CREDIT_EXPOSURE to check the credit limit of the customer but it won't work as I've said.

moazzam_ali
Active Contributor
0 Kudos

Hi

I am sorry I also don't know the exact function module which checks this but I will look into this. Meanwhile you can debug VA01 but it will take long time so be patient and just keep pressing F5 and see where system takes you. Let me see if I could help you to find the triggering point.

Thank$

Former Member
0 Kudos

hi bert,

can u show the billing document screen shot for previous sales order.I just want see how it is getting calculated.

regards

satish

Former Member
0 Kudos

Hi Satish-

Its just the same with the SO. The values of condition type YZ11 of each item were the same on billing.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Research the userexits in SD_ORDER_CREDIT_CHECK you can set in OVA8. Please, see this post: http://scn.sap.com/thread/1941067

Use your current option in OVA8 as a template and write with ABAP your additional requirements.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

hi bert,

1. like mozamm rightly said try MV45AFZZ  program

which has Pricing_Prepare_Tkmok. Write code in include .

2. Also tell me are you using horizon period in a ova8 and

RVKRED06 – Background jobs for checking blocked credit management.
If an order is no longer outside the horizon as defined in the dynamic credit check, (i.e. it is INSIDE the horizon) it can cause existing “good” orders to block. If you run this job every night, if you have your horizon set for 1 month it can cause a lot of blocks at beginning of month. Try to use ‘W’ for weekly horizon status.

regards

satish

Former Member
0 Kudos

Hi Eduardo-

I've tried setting external breakpoints on the user exits you've provided but when I create a sales order then saved it, no debugger was triggered. Message appeared (item number 3, first screenshot) in my first/main post.

-LVKMPTZZ

-LVKMPFZ1: USER_CREDIT_CHECK1

-LVKMPFZ2: USER_CREDIT_CHECK2

-LVKMPFZ3: USER_CREDIT_CHECK3

I've also executed VKM3, but debugger was not triggered.

I wanted to have a check inside the routine I've created if the sales order I am creating will be CREDIT BLOCKED.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

If you want system triggers break point in this point these flags in OVA8 must be on.

For further information see note 1464839 - How to customize credit control in transaction OVA8 using checks USER 1, USER 2 and USER 3

Regards

Eduardo