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: 

Multiple address to a single ship to party

Former Member
0 Kudos

Hello Guys,

I have a requirement,where a user from front end should have a provision to create a new delivery address

to an existing ship to party.Interaction between front end and ECC is RFC.Now in my rfc i need to adda code so as for every new address entered for a specific sales order at front end should get added to ship to party.

I tried manually doing it ECC side and observed that the only difference between the two will be address number.

Please suggest.

Regards

Najam

1 ACCEPTED SOLUTION

andrea_olivieri
Contributor
0 Kudos

Hi,

this is the so called "One Time Ship To Party"

Functionally, you don't need to create a Ship To Party every time the shipping address changes.

Just change the Ship To Party address data in the sales document header or, in case you need to send different materials to different addresses, at item level.

Thus the BAPIs BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE already manage this scenario.

Change the address data (street, postcode country etc. ..) in the interface table BAPIPARTNERS[ ] for the Ship to Party (WE).

Regards,

Andrea

13 REPLIES 13

Former Member
0 Kudos

Hi,

Yes you are right for every new address you will get a new address number and I think this will create an entry in the table ADRC for this Customer and Address number combination. I guess you no need to handle this logic this will be taken care by the new address number generated.

Please verify this once and let me know in case of any.

Regards,

SRinivas

0 Kudos

Srinivas,

I have to manually handle the creation of address numbers.And am working on to achieve it.

0 Kudos

Hi,

May be try with the FM SDPARTNERUPDATE you will get an idea.

Regards,

SRinivas

andrea_olivieri
Contributor
0 Kudos

Hi,

this is the so called "One Time Ship To Party"

Functionally, you don't need to create a Ship To Party every time the shipping address changes.

Just change the Ship To Party address data in the sales document header or, in case you need to send different materials to different addresses, at item level.

Thus the BAPIs BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE already manage this scenario.

Change the address data (street, postcode country etc. ..) in the interface table BAPIPARTNERS[ ] for the Ship to Party (WE).

Regards,

Andrea

0 Kudos

Thanks Andrea.

I tried with both the FM .It returns an error saying " No Master record data exists".

Please suggest.

Regards

Najam

0 Kudos

Hello,

the error occurs because you have to specify the ship to party customer code (filed PARTN_NUMB) while you're overwriting the address data.


(...)
LS_BAPIPARNR-PARTN_ROLE = 'WE'.                                "Ship To Party Role
LS_BAPIPARNR-PARTN_NUMB = '9999999999'.                 "Ship To Party Code
LS_BAPIPARNR-NAME = 'Overvwrite existing name'.
*LS_BAPIPARNR-NAME_2 =
*LS_BAPIPARNR-NAME_3 =
*LS_BAPIPARNR-NAME_4 =
*LS_BAPIPARNR-STREET = 'Overvwrite existing Street'.
*LS_BAPIPARNR-COUNTRY =
*LS_BAPIPARNR-POSTL_CODE =
(...)

This is what you could do manually when you're editing the partner data in the sales order.

Regards,

Andrea

0 Kudos

Hello Andrea,

Passing of following things is giving me an error.

SALESDOCUMENT = '0000043028'.

ORDER_HEADER_INX-UPDATEFLAG = 'U'.

wa_order_partners-PARTN_ROLE ='WE'.
wa_order_partners-PARTN_NUMB = '100518'.
wa_order_partners-NAME = 'Over write Name'.
wa_order_partners-STREET = 'Street 1234'.
wa_order_partners-COUNTRY = 'FR'.
wa_order_partners-POSTL_CODE = '54623'.
wa_order_partners-CITY = 'CITY'.
append  wa_order_partners to order_partners.
clear : wa_order_partners.


CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
  EXPORTING
    salesdocument               = salesdocument
*   ORDER_HEADER_IN             =
    order_header_inx            = ORDER_HEADER_INX
  tables
    return                      = return
    PARTNERS                    =  order_partners.

Please Suggest

Regards

Najam

0 Kudos

Sorry but how do we help you unless you give us the error details?

Regards,

Andrea

0 Kudos

Probably 'partner does not exist' because you specified the external format for the partner number, but Andrea's right. Just saying 'fix my error' without giving the error won't get you very far. You might also try solving it on your own by debugging/stopping at the error message...

0 Kudos

Andrea,

I have mentioned the error in my previous post and our discussion was in continuation with it.So I thought you will refer my

previous post.For your reference am pasting it again :

1	E	VP	200	No customer master record exists for customer 100518
2	E	V4	219	Sales document 0000043028 was not changed

This customer is existing in the system.

Regards

Najam

0 Kudos

See the reply from Brad. Have you tried to apply conversion exit before passing the Partner number to BAPI, like passing the partner number as '0000100518' ?

0 Kudos

As of know Pasted VA02 recording in the code and it looks fine.

After passing the customer as suggest by you all.it gives an update termination error.

Need debug and find the cause.Thank you all for ur help.

Regards,

Najam

Former Member
0 Kudos

Normally, you would have multiple ship-to addresses for a SOLD-TO party.... this is what allows multiple addresses for a customer. It's not logical to have multiple ship-to addresses for a single ship-to customer....that's not how SD/LE is designed.