VI import: Assigning Next EntryNo in Header, and use that for all detail records IM TransactionHeader

SOLVED

Hi, In importing through VI into IM_TransactionHeader (which also has L and LL), how do I use "Next" operation for EntryNo and apply the first EntryNo generated to all L and LL lines??  Or should I be using different Operation or can I simply not achieve this in one job and have to separate header and line import into different jobs?  I have a following job definition, and VI keeps assigning a different EntryNo for each lines, instead of putting everything into one EntryNo.  (No batch entry enabled)

Field Name OP Col/Pos Msk/Val
H.TransactionType ASSN 6
H.EntryNo NEXT
H.Transactiondate ASSN <MODULEDATE>
L.ItemCode REPL 00001
L.UnitOfMeasure ASSN EACH
L.WarehouseCode ASSN 000
L.TransactionQty REPL 00002 ###,###.00

i feel like this is a very basic question but I am stuck and feel so defeated....Thank you in advance for any hints!

Ken 

  • 0

    The NEXT operation will automatically increment anytime the data change in the header record each time it reads the source.

    So are you also importing LL records or just the H and L records?

    Do you have the job configured with Header and Line data on the same source record or separate?

    If separate, are you using anything on the Record tab to identify what is a Header record and what is a Line record?

  • +1
    verified answer

    I believe the issue you are experiencing is because you are not actually assigning any values read from your source into a Header field. 

    You will need to have at least one field in your source file that has a Header field pointed to it.

    From the looks of it, you have your source file pretty simplified to only include the ItemCode and TransactionQty. If you can also include the warehouse code, you could point the H.DefaultFromWhseCode to it and that will do what you need it to.

    If you absolutely don't want to include a header field in your source file for whatever reason, you could use PERFORM logic on the After Read event to set a value into a column number that you know won't be used by your source and then point a Header field to the column you choose.

    This is the perform logic.


    IMP$[3]="000" ! '


    The number within the brackets represents the column number.

  • 0 in reply to David Speck

    Thanks David!  That was exactly the cause.   Not having a single column in the source pointed to a header field caused every record to be treated as a separate header entry.  Having one field, regardless of what it was, fixed it.  Thank you again!