03-02-2011 7:12 AM
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
03-02-2011 10:52 AM
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
03-02-2011 7:19 AM
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
03-02-2011 7:34 AM
Srinivas,
I have to manually handle the creation of address numbers.And am working on to achieve it.
03-02-2011 7:44 AM
Hi,
May be try with the FM SDPARTNERUPDATE you will get an idea.
Regards,
SRinivas
03-02-2011 10:52 AM
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
03-03-2011 6:50 AM
Thanks Andrea.
I tried with both the FM .It returns an error saying " No Master record data exists".
Please suggest.
Regards
Najam
03-03-2011 8:59 AM
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
03-04-2011 5:39 AM
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
03-04-2011 11:29 AM
Sorry but how do we help you unless you give us the error details?
Regards,
Andrea
03-04-2011 3:23 PM
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...
03-05-2011 8:03 AM
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
03-05-2011 8:44 AM
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' ?
03-07-2011 6:28 AM
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
03-02-2011 1:57 PM
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.