cancel
Showing results for 
Search instead for 
Did you mean: 

Read new Sales Order header

Former Member
0 Kudos

Hi Guys,

I have the following problem:

When we are making quotations for potentially new customers, we are using a CPD-customer.

When now order is placed by the customer you don't create a customer master record, only when the customer is placing a order, we create the customer master record.

As we want to have the sales order related to the new customer number

we change the sold-to-party while creating the sales order with reference to the quotation.

This is only possible, as the fiield for the customer number is changed to editable in a userexit.

Now we are having the problem that fields as the INCOTERM or ZTERM aren't read again from the DB

(from the new customer master record).

The same problem is when we are having a sales order and create a return - after a long time.

Then we are also creating a sales order with reference to the return for sending new goods to the customer.

When the ZTERM has changed since the creation of the original sales order we create a new sales order with the old ZTERM.

Is there any possibility to read a complete new sales order head during coping from an old sales order ?

Greatings and many Thanks in advance.

Manuel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Manuel,

pardon me if I haven't your question correctly..structure XVBAK or YVBAK should contain the header details while creation.

try to check this in debug mode and change values to XVBAK during runtime and see if this helps.

Regards

Raghu.

Former Member
0 Kudos

Hi Raghu,

unfortunately this isn't solving our problem.

While copiing a reference order into a new order the header of the old sales oders is in CVBAK (as a master copy).

This data is copied into XVBAK - which is the new sales order header.

Now we are facing the this challenge:

Quotation with CPD-Customer 0100 - ZTERM = ZR01 / INCOTERM = EXW.

The sales order is created with reference to the quotation, but the sold-to-party is changes to the "real" customer 0200.

The new customer has the following data: ZTERM = ZR02 / INCOTERM CIP.

The new sales order is now still having the ZTERM and INCOTERM of the CPD-customer.

The wish is to create the sales order with reference to the quotation, but read a complete new header,

according to the new customer entered in the dialogue.

Greatings

Manuel

Former Member
0 Kudos

Hi Manuel,

You can try reading 'new' customer from screen field KUAGV-KUNNR and read his data from KNA1/ KNB1 for the required data and populate with ZTERM and INCOTERM. by the way, the ZTERM and inco1/2 are part of XVBKD, so try modifying the values in this structure/table from KNA1/KNB1.

I hope this helps.

Regards,

Raghu.

Former Member
0 Kudos

Hi Raghu,

you are right these are fields from VBKD - not from VBAK.

Thanks for your help.

When I read my thread now, I see that I described my problem to specific with 2 fields - as I wanted to provide as much information as possible. Sorry for that.

Your proposal is a possible way - could also be done while copy control.

As we would like to read the whole header new from the customer master record this would be really complex,

as we would like to update the complete header - what would mean VBKD, VBAK and VBPA, texts,..

Do you - or any one else have a easier way -> e.g. by calling a function ?

Regards

Manuel

Former Member
0 Kudos

Hi Manuel,

I think the best way is by getting the details by calling a FM..and I think you can find out the FM too?

Just in case: check this BAPI_DEBTOR_GETDETAIL.

Regards,

Raghu.

Edited by: Rags on Oct 4, 2011 2:17 PM

Answers (0)