cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order Block for Billing

Former Member
0 Kudos

Hi All

I have a bussiness where I am reciving the SP and SH address details from Idoc and and i want to block the sales order for billing if the country code is different.

My Proposed Solution :

I would like to write a pice of code in MV45AFZZ that if the sales order country code is differnt then it should make a billing block.

My question is do I need to validate the country code from VBPA table or there is any other way to do this. As I cant do that from KNA1 or any other customer master table beacuse that address details is coming from Idoc and that may not the same as address in customer master.

Looking forward for your suggestion.

Thanks

AJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumar,

You can only refer the VBPA table for such instances as the address details comes only through EDI idoc & will be different from the one maintained at the customer master.

however instead of using VBPA table which will normally get updated only when you have the sales document number & going backwards to update the billing block, try putting a logic in EDI to populate the billing block field for certain country codes. (if possible).

Regards

Ilango

Former Member
0 Kudos

Hello

Thanks for the quick reply.

Basically the midwear can validate the field so is there any other way that I can validate when i am saving the Sales order.

may be validate xvbak-kunnr as a Sold to and some xvbak-kunnr for Ship to party.

Is that posable..?

Thanks

AJ

Former Member
0 Kudos

Hi AJ,

i fear that this field cannot be used as VBAK cannot be used effectively here because VBAK will give out the customer SAP number & can be checked via KNA1 which will again be the customer master data, but your case is that the sales document created may have a different address than when compared to the customer master & hence you can only use the VBPA table by passing the recently created sales order number along with the SHIP to party partner function (SH, if it is ship to party country code you are referring), get the ADRNR number & pass it to ADRC table which can provide the information on the country code

have the technical team work on passing the billing block field (from VBAK, not sure abt the field name as am currently not into SAP system), & the country code obtained from VBPA+ADRC table for a certain combinations.

the above enhancement is very much possible with an user exit, but try populating this from EDI if possible.

rgds

ilango

Former Member
0 Kudos

Hello RV

Thanks again for the quick reply.

If i can populate the recently creted sales document number in VBPA then then i can validate the country code also.

In VBPA against the currently created sales doc. number and the partner function and in VBPA the country code is also a field.

So i hope i can validate if I can populate the sales document number in VBPA. (as i am going to write the code in MV45AFZZ).

Is That make any sence or I have to use both VBPA and ADRC. I hope ADRC is save the data in master data level not in sales order level.

Cheers

AJ

Former Member
0 Kudos

Hi AJ,

i think you are referring to the LAND1 field on the VBPA table, i think if this is sufficient you can proceed to use the same field for your requirement, i did not know that there is country key available in VBPA as i was not in SAP system, while i had answered your question earlier.

However for a better understanding, please ensure that LAND1 refers to the ship to party's country code or the sales document related country code (like is it from shipping point/ plant/ sales org).

Regards

ilango

Former Member
0 Kudos

Thanks all for the reply.

we can validate the country code from vbpa.

Cheers

AJ

Answers (3)

Answers (3)

sarthak_mohantysd
Active Contributor
0 Kudos

Hello Kumar,

Could you be more specific in describing your business requirement ?

I have a bussiness where I am reciving the SP and SH address details from Idoc and 
i want to block the sales order for billing if the country code is different.

What i could sense is for creation of Sales Order, you are getting the details for Sold-To-party and Ship-To-Party from IDOC, the business requirement is if the Country code is not same as that of master then the Sales Order processing should be blocked for Billing.

If this is the actual requirement for blocking the Sales order, then the right approach should be of fetching the Country code from ADRC table with reference to ADRNR number which you can pick up from KNVP table. And then you can go ahead with ABAper and write lines of code at MV45AFZZ.

Please update this thread to make a clear line of thoughts.

Regards,

Sarthak

Former Member
0 Kudos

In the Userexit you can use the VBPA --Land1 to find the the country code by partner number from Idoc .

If the comparasion between the SP and SH ,

Code need to Read the Land1 of the both the partners from the IDOC data and compare it if the both land1 details different the update the field VBAK-FAKSK with required billing block .

Former Member
0 Kudos

Hello Kumar,

ADRC is the only location where you will have the true/valid country codes as per customer master settings. You have to use both ADRC and VBAP tables to do this validation.

Hope this helps.

-Vignodhar