cancel
Showing results for 
Search instead for 
Did you mean: 

Change partners address in BAPI_SALESORDER_CREATEFROMDAT2

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I would like to change the address of a specific ship-to party.

I've seen it is possible via SE37 with a 'B' in the addr_orig parameters.

But when I use the same parameters with the RFC call (inside my WD app) SAP return :

<b>Specify the address number or the address handler</b>

Someone can help me ?

regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In this Bapi all are Optional fields.It can be execute without the input parameter.Clear all other unwanted input to the BAPI and try to execute it.

Kind Regards

Mukesh

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I don't think you understood my request. Actually, I want to change the address of a specific partners without saving this new address.

for example : I set my order with my ship to number 10066,and its original address is XX street Marlon Brando. My request is i only want to change this address to YY street James Deem for the same ship to.

Regards

Former Member
0 Kudos

HI,

For the Updation u have to execute a seperate BAPI

Saravanan K

Joseph_BERTHE
Active Contributor
0 Kudos

It is not an updatation process, and unfortunatly, I can't set a flag like 'update'. It is in the Order_Partners tables.

Anyway, which BAPI are talking about ?

Former Member
0 Kudos

HI,

It is need to build a new BAPI to make the change in the table Order_Partners

Regards,

Saravanan K

Joseph_BERTHE
Active Contributor
0 Kudos

hi,

can you precise deeply your last post. Because I don't get it. I mean, Why should I create an other BAPI only to change the address of my ShipTo ?

regards

Former Member
0 Kudos

Hi,

For the change in the table. You have to create a new BAPI and using that update the address

Regards,

Saravanan K

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Thanks for answering to my question, but unfortunatly, I really don't get your answers.

Can you please be more explecit about your solution to my issu.

Regards,

Former Member
0 Kudos

Hi

Do you want to change the Address in R/3 use the

BAPI_SALESORDER_CHANGE Bapi.

And set the corresponding import parameters and execute the BAPI

Kind Regards

Mukesh

Joseph_BERTHE
Active Contributor
0 Kudos

hi,

Actually, I want to create an order with BAPI_SALESORDER_CREATEFROMDAT2. And during this creation, instead of having the normal address of one of my shipto, I want to change this address without record it inside the R3.

Thus, if I check out with a XD03 of my partners, I have to see the normal address and not the modified address.

However, If i check out in the VA03, i have to see the new address of my partners.

Regards

Former Member
0 Kudos

Hi,

Does this do it:


//You have already done the following line, I'm assuming
Bapi_Salesorder_Createfromdat2_Input input = new Bapi_Salesorder_Createfromdat2_Input();

//For address
Bapiaddr1 address = new Bapiaddr1();
    	
address.set<attribute1 name>(<value>);
address.set<attribute2 name>(<value>);
//etc...

input.addPartneraddresses(address);

Regards,

Satyajit.

Joseph_BERTHE
Active Contributor
0 Kudos

hi,

I've try to add an address like you said, but i'm wondering hoow to tell to the BAPI that it has to use this new address ? Do i need to make a reference into the ORDER_PARTNERS of the PARTNERADDRESSES ?

Regards

Former Member
0 Kudos

Hi,

Have you tried to execute the BAPI after using this code?

As for your question, I think you will need to reference Bapiparnr(ORDER_PARTNERS) and set the addresses.

From the FM documentation for the BAPI:

<i>"This table parameter is used to enter partners such as sold-to party, or ship-to party, both at header and item level.

The minimum requirement is that the sold-to party is entered at header level. Additional partner functions can then be automatically determined.

You can also enter different addresses in the structure

"</i>

Regards,

Satyajit.

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Satyajit,

actually, there is my code :

<i>partners = wdContext.createOrder_PartnersElement(new Bapiparnr());

partners.setPartn_Numb(wdContext.currentContextElement().getShipToPartyList4DropKey());

partners.setPartn_Role("WE");

if (wdContext.currentShipToPartyElement().getIsChanged()) {

wdComponentAPI.getMessageManager().reportSuccess("Change");

// New Addr Address

IPublicSalesOrders.IPartneraddressesElement partnerAddr = wdContext.createPartneraddressesElement(new Bapiaddr1());

<b>partnerAddr.setAddr_No("0000000001");

partners.setAddr_Orig("B");

partners.setAddr_Link("0000000001");</b>

partnerAddr.setName(wdContext.currentShipToPartyElement().getName());

partnerAddr.setName_2(wdContext.currentShipToPartyElement().getName2()); partnerAddr.setCity(wdContext.currentShipToPartyElement().getCity()); partnerAddr.setCountry(wdContext.currentShipToPartyElement().getCountry());

partnerAddr.setStreet(wdContext.currentShipToPartyElement().getAddress());

partnerAddr.setFax_Number(wdContext.currentShipToPartyElement().getFax());

partnerAddr.setPostl_Cod1(wdContext.currentShipToPartyElement().getPostCode());

partnerAddr.setRegion(wdContext.currentShipToPartyElement().getRegion());

partnerAddr.setTel1_Ext(wdContext.currentShipToPartyElement().getTel1());

<b>wdContext.nodePartneraddresses().bind(partnerAddr);</b>

}

wdContext.nodeOrder_Partners().addElement(partners);</i>

I've tried this in the SE37 and it worked, but with my WD it doesn't !!!

Regards

Message was edited by: berthe joseph

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I've still my problem, so if someone has an answer, I'm open

Regrads,

Former Member
0 Kudos

Hi Joseph,

Do you want to modify the Ship-To party Address in the customer master, or only for that particular order?

Regards,

Shubham

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Shubham,

Only for that particular order

Regrads,

Former Member
0 Kudos

Hi Berthe,

You dont need to pass the following.

partnerAddr.setAddr_No("0000000001");

partners.setAddr_Orig("B");

partners.setAddr_Link("0000000001");

Since you want to change the ship to addess at the Order Level, you need to pass the Ship-To party number and address details. While creating the order, the system will create the new ADRNR by itself.

Regards,

Shubham

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Shubham,

So I've tried :

  • In ORDER_PARTNER :

PARTN_ROLE = WE

PARTN_NUMB = #ofmyshipto

NAME = "JohnDoe"

  • In ORDER_PARTNER :

PARTN_ROLE = WE

PARTN_NUMB = #ofmyshipto

NAME = "JohnDoe"

AADR_ORIG = "B"

Don't work !!

But I have a question, what is the minimum values needed for an address ?

Regards,

Former Member
0 Kudos

Hi Berthe,

What is the error message its returning?

I dont call the standard BAPI directly.

Instead I have a wrapper over it

I pass the following values

CLEAR: lt_vbpakom.

lt_vbpakom-parvw = l_parvw.

lt_vbpakom-kunnr = wa_knvp-kunn2.

lt_vbpakom-name1 = 'James Brown ShipTo'.

lt_vbpakom-land1 = 'US'.

lt_vbpakom-regio = 'CA'.

lt_vbpakom-ort01 = 'ORANGE'.

lt_vbpakom-pstlz = '92606'.

lt_vbpakom-txjcd = 'USCA92606XXXX0'.

APPEND lt_vbpakom.

It works for me.

Regards,

Shubham

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Shubham,

First of all, i'm using WD for Java, so I can't make what you told me to do.

Anyway, I've tried, (it is nearest your code 😞

partners = wdContext.createOrder_PartnersElement(new Bapiparnr());
partners.setPartn_Numb(wdContext.currentContextElement().getShipToPartyList4DropKey());

partners.setPartn_Role("WE");
partners.setName("John");
partners.setCity("Lyon");
partners.setCountry("FR");
partners.setAddr_Orig("B");

wdContext.nodeOrder_Partners().addElement(partners);

And it still don't wortk :(. Actually I don't understand why it works with the transaction SE37 and not with Web Dynpro..... I'm getting crazy

Regards,

Former Member
0 Kudos

Hi Berthe,

I know you are using WD for Java.

I call my wrapper RFC around BAPI_SALESORDER_CREATE...

How do you say its not working?

What is the error messages the BAPI returns.

Are you calling the commit BAPI, BAPI_TRANSACTION_COMMIT incase there is no Return Messages from the BAPI?

Did you tried Remote Debugging to see what values are being passed to the BAPI?

Regard,

Shubham

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Shubham,

So i've found out my mistake. In fact, I didn't filled the countryiso attribute. Then now it work well.

Below the code which worked :

partners = wdContext.createOrder_PartnersElement(new Bapiparnr());
partners.setPartn_Numb("######");
partners.setPartn_Role("WE");
partners.setAddr_Orig("B");
partners.setAddr_Link("1");		
		
IPublicSalesOrders.IPartneraddressesElement partnerAddr = wdContext.currentPartneraddressesElement();
partnerAddr.setName("John");
partnerAddr.setName_2("Doe");
<b>partnerAddr.setCountryiso("FR");</b>
partnerAddr.setAddr_No("1");

wdContext.nodePartneraddresses().bind(partnerAddr);
wdContext.nodeOrder_Partners().addElement(partners);

Joseph_BERTHE
Active Contributor
0 Kudos

Anyway, Thankss everybody