cancel
Showing results for 
Search instead for 
Did you mean: 

User exit - Change One-time customer address in sales document

Former Member
0 Kudos

Hi,

When referencing sales documents, we need to be able to change the address of the one time customer without affecting the address in the source document. We tried to change the copy control program, but now the address is being cleared.

Is there a way to change the address data of a one time customer in a sales document without affecting the source document?

Accepted Solutions (1)

Accepted Solutions (1)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi!

By referencing you copy the address key into the new order -> any change of the address data is valid for both orders.

But why do you reference orders of ONE-time customers? Create the new order without referencing. If necessary, read all the data separately and fill a BAPI_SALESORDER_CREATEFROMDAT2 with it.

Regards,

Christian

Former Member
0 Kudos

Hi Christian,

Thanks! I believe they reference one-time customers because this is their business process. I know the address is linked when referencing, so I would want to know if there's a way we can unlink these documents using user-exits.

Aside from unlinking the addresses, we also would need to default the address to the address from the referenced sales document.

Thanks,

Jeff

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Jeff!

Is the sales order created manually? If so, then you might need some more programming to get a good result.

Make a report (or transaction), where the source sales order can be chosen. Then create a new sales order (without reference). You can use the get_detail FM for selecting source values.

When you have only small orders (or you don't need the articles), then you might use call transaction to prefill the header data - in case of bigger orders, create a new sales order with the BAPI and call afterwards VA02 via call transaction.

Now users can add / change further data.

Programming in the copy routines seems to be more difficult - you need to create a new address before you can exchange the reference in the sales order - and this might be not the only disadvantage.

Think also about initial creation with a lock - maybe incompletion, because a order reason has to be filled or something like this.

Regards,

Christian

Answers (0)