Relation Sales Header and Sales Line

At Sales Header, we have Field No.

And at Sales line , we have Field Document No.

Like we know, while we make Document Like Sales Order… If We input sales order no for example SO-001

and then automatically will be added if we add item, the document no. in Sales Line will be SO-001

my question is… where i can find to customize this code?

thanks :slight_smile:

Not sure about your question… you want to set your own No. on Sales Header when you create a new Order (for example) OR you want to change the No. of your actual orders?

nope…

I want to add new field in Sales order, name Shipset

and then in Sales Line I have field shipset too

So I want to input Shipset in Sales Header Only, and then it should be in Sales Line too (Field Shipset)

Handling depends on the way you want to handle that:

  • add your field shipset to both tables (T36, 37)
    a) if you enter the shipset BEFORE adding the lines, go to the sales line table and look at the code of OnValidate Trigger of field No. There you can identify a paragraph where information is populated from the header.

b) if you enter the shipset AFTER adding the lines go to the sales header table and look for the code in the OnValidate trigger of e.g. field Shipment Date. A function ‘UpdateSalesLines’ is called. You can do something similar…

c) BEFORE or AFTER creating sales lines: combine both

I think Joerg is on the good way to inform lines with the Shipset value of the header but if you don’t want to make another calculations with this field on lines… couldn’t you use a FlowField?, this would just display on lines the header value for Shipset [*-)]

Agreed, the flowfield is a possibility if you are sure that you will not have several different shipsets in your sales lines, only using the header information as default…

Thanx Joerg

I use That “a” option of yours

:slight_smile: