Application Development 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: 

VATRegisteration Number

Former Member
0 Kudos

Hello,

I am creating a sales order using BAPI_SALESORDER_CREATEFROMDAT2 which internally calls SD_SALESDOCUMENT_CREATE.

The order is for a one time customer created in KNA1. The address lines are fed in to the BAPI while creating order and also VAT REG No.

Structure PARTNERS_EX of SD_SALESDOCUMENT_CREATE has the VAT_REG_NO field.

Here I am specifying the country code and the VAT REg No for the Sold to Party and Ship To Party.

I am specifying the address in PARTNERADDRESSES structure.

The order is created with correct details, but the VAT_REG_NO is not populated from the BAPI field.

However, if i ammend the order in VA02, the order accepts VAT_REG_NO and calculates tax for EU countries correctly.

Any idea why the VAT reg Number is blanked out while creating order from BAPI?

7 REPLIES 7

Former Member
0 Kudos

Hi Vaishali ,

How u are passing the Partner_ex data from <b>BAPI_SALESORDER_CREATEFROMDAT2</b> to <b>SD_SALESDOCUMENT_CREATE</b> .

Regards

Prabhu

0 Kudos

I have created a copy of SD_SALESDOCUMENT_CREATE and am using that to create orders.

I wanted to copy the BAPI, but then BAPI_SALESORDER_CREATEFROMDAT2 ultimately calls SD_SALESDOCUMENT_CREATE , hence I am using a copy of that.

0 Kudos

Hi vaishali ,

check / debug this in ur Copied Program

<b>if partners_ex is requested.

perform map_vbpa_to_bapisdpart tables e_vbpa

partners_ex.</b>endif.

Regards

Prabhu

0 Kudos

Hi Prabhu,

I found in debug mode that e-vbpa is blank. Hence the

loop on e_vbpa fails and VAT no is not populated.

any idea why e_vbpa is blank? I will have to look at SD_SALES_DOCU_MAINTAINto see why it returns e_vbpa as blank.

0 Kudos

Hi Vaishali,

It is something to do with the Partner functions for the customer. Just check up in the customer master for the customer you have selected whether the partner functions are defined correctly. You can take help of a functional guy in this.

Pls reward points if useful.

Regards,

Laxman Nayak.

0 Kudos

Hi,

When I use BAPI_SALESORDER_CREATEFROMDAT1, the VAT Reg number gets populated in the order all right; which means the config is okay. Which means I am missing something on the paramters.

Any clues please?

javier_campos1
Discoverer
0 Kudos

do you need to apply this SAP NOTE

2851130 - VAT registration number missing from BAPIs
II