Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SO BAPI BAPI_SALESORDER_CREATEFROMDAT2 CREDIT LIMIT ISSUE

former_member605939
Participant
0 Likes
6,292

Hi,

While creating sales order using BAPI_SALESORDER_CREATEFROMDAT2, when customer exceeds the credit limit

then that order is not getting saved and system throws the following message in RETURN[]:

S V4 233 SALES_ITEM_IN has been processed successfully

W V1 555 The sales document is not yet complete:

Edit data E V1 152 Dynamic credit check has been exceeded cannot be saved

My client wants to bypass the credit limit message so the the sales order will be generated.

When we generate the sales order manually then the system throws the information message and then by pressing the enter we can by pass the message and system will generate the Sales order.

How to handle the functionality.

Thanks

13 REPLIES 13
Read only

MateuszAdamus
Active Contributor
0 Likes
4,710

Hi abaplearner

Please check configuration in transaction OVA8.
There is a possibility to create a special ABAP routine with logic to bypass the Credit Check and assign this routine to desired Company Codes and document types.

regards,

Mateusz

Read only

venkateswaran_k
Active Contributor
0 Likes
4,710

Hi

There are ways to control it.

Option 1

It can be controlled by OVA8 - to give conditions to skip it.

Option 2

You please look into this badi - BADI BADI_SD_CM

Method : FSCM_CREDIT_CHECK_ORDER

In this set the flag no_check = 'X'

This will bypass your credit check.

Regards,

Venkat

Read only

0 Likes
4,710

Thanks for reply.

You suggested two options :OVA8 and BADI BADI_SD_CM.

My requirement is to post bapi the sales order without checking credit limit (only in bapi).

I want that the BAPI_SALESORDER_CREATEFROMDAT2 to post the sales order for customer without checking the credit limit.

But when run the VA01 sales order manualy it should pop up the information window about the credit limit ( as older system )

Basically donot want the remove the standard functionality of credit limit check.

Which option will work...

Read only

0 Likes
4,710

Hi

As per your requirement it is change in the standard behavior of the system. You cannot modify the BAPI. However, if your put your condition based if statement at this BADI - this will be executed only when Sales order created through BAPI...

Check the BADI method Method : FSCM_CREDIT_CHECK_ORDER

put if conditon that the sy-tcode NE 'VA01' - Then change the no_check = 'X'

So, normal VA01 will work as standard and when you create through BAPI - it will suppress.

Regards,

Venkat

Read only

0 Likes
4,710

Mr. Venkat,

I implemented the badi BADI_SD_CM

method IF_EX_BADI_SD_CM~FSCM_CREDIT_CHECK_ORDER.
BREAK-POINT.
IF SY-TCODE NE 'VA01'.
NO_CHECK = 'X'.
ENDIF.

endmethod.

While creating bapi or normal sales order the break-point is not triggering. control does not enter badi method. It is not working.

Read only

4,710

Can you please check this note

Check SAP Note 500585 - No credit warning message with order entry via BAPI.

Read only

0 Likes
4,710

Gone through the following SAP Note 500585 - No credit warning message with order entry via BAPI and your responses.

After checking the T-Code OVA8 , T-Code OVAK and T-Code :FD32 come to conclusion that in T-Code there is Risk category.

Our customization has two types of Risk Categories . I changed the Risk Category. Now Bapi is working fine.

Thanks for your valuable suggestions.

Read only

VeselinaPeykova
Active Contributor
0 Likes
4,710

If I were the consultant responsible for this change request, I would definitely challenge the requestor to explain the business logic behind it.

The way how system reacts to credit check for a certain sales order type and items should not depend on which technology you use for creating it. This is a very dangerous route to take - the users will not be happy with it (because for them it will be difficult to determine how exactly an order was created), I imagine that the auditors will also not endorse the idea, because it is difficult to monitor and control this. And it will be a nightmare to support such solution - every time the user sees a problem with credit check they will not know if this was the result of order creation via a BAPI or because there is indeed a serious system issue, or configuration problem, or master data... so they will be creating many tickets per day just to get a confirmation that everything works as expected.

It is a lot wiser to have a separate sales order type and document credit group, for which you can set deviating credit check rules - it will be easier for the credit clerks to have a clear picture on what is happening, you can block the new order type for manual processing (which means that users cannot create this document via VA01, but they can edit such orders if needed).

In such case there will be no need to introduce routines for bypassing or resetting credit checks, you will be using the standard functionality. And having a separate order type brings additional benefits in terms of reporting, you can have a separate pricing procedure or immediate delivery creation, if such need arises in the future.

Please, I understand that you are not a functional consultant, but in this specific case it makes a lot of sense to raise your concerns and suggest an alternative solution to your functional colleague.

Of course, if there is no need to prevent the creation of sales orders at all (no matter if the document is created via VA01 or via a BAPI), but just to block the orders for credit limit reasons - this is a trivial configuration task, your consultant should be able to do this in the development environment in a couple of minutes.

Read only

VeselinaPeykova
Active Contributor
0 Likes
4,710

From your explanations it is not even clear which kind of credit management you are using - FSCM or SD.

If this is S/4HANA then it can be only FSCM, but in the case or ECC6 - it can be any of these.

Come on, speak with your functional consultant! 🙂

At the very least you need to know which is the solution that you have to influence with custom code.

The badi, which you are trying to use, will only influence FIN-FSCM-CR credit checks, it will not work for the traditional SD credit control (SD-BF-CM).

Read only

0 Likes
4,710

Thanks veselina.peykova !

I have checked the system for FIN-FSCM-CR credit and SD-BF-CM credit. We have SD-BF-CM credit activated.

Want to suppress the message credit limit message in BAPI_SALESORDER_CREATEFROMDAT2 so that bapi will generate the

sales order. But for normal VA01 it will pop up for credit limit .

Read only

VeselinaPeykova
Active Contributor
0 Likes
4,710

I would still recommend the solution that I mentioned earlier - use a separate sales order type.

Is there any good and valid reason to use the same order type? What did your consultant say? Because it is a shame to write custom code, which will require extensive end-to-end testing compared to spending minutes to configure the system.

Anyways, for the sake of the exercise - kindly show the settings from OVA8 for the corresponding test case (credit control area, risk category and credit group). The easiest way to determine these values is to create an order via VA01 with exactly the same data that you use for order creation with BAPIs, use the order number in program CHECK_CM to get VBAK-KKBER, VBAK-CTLPC and TVAK-CMGRA.

After you provide a screenshot of your OVA8 settings I would have a better idea how to influence the current behavior.

*Spoiler alert*

In your case the use of a VOFM routine to bypass or reset the credit check seems not to be a good solution. If I understood you correctly, when you create a sales order via a BAPI, you still wish to perform credit check and block the order. If this is true, it is not the credit outcome that is causing a problem, it is the reaction part (warning or error) that needs adjusting.

The main reason why I ask for OVA8 screenshots is because I suspect that there may be already some custom logic implemented.

Read only

0 Likes
4,710
veselina.peykova

Gone through the following SAP Note 500585 - No credit warning message with order entry via BAPI and your responses.

After checking the T-Code OVA8 , T-Code OVAK and T-Code :FD32 come to conclusion that in T-Code there is Risk category.

Our customization has two types of Risk Categories . I changed the Risk Category. Now Bapi is working fine.

Thanks for your valuable suggestions.

Read only

4,710

abaplearner in this case - please close the question. It would be nice if you up-vote the answers which were helpful to you.