Skip to Content
avatar image
Former Member

Comparison of Header and Line Items

hi,

i have a tag <ShipTo> in the header as well as in the Line Items.

Scenario:

-


1. I am using ZIDOC = ORDERS05 + Extra field "Ship To Site"

This "Ship To Site" code can vary from line item to line item or can be the same for a particular PO.

So Lets say in a PO there are 3 line Items and all the 3 line items can have the "Ship To Site" as "ABCDEF" or "ABCDEF", "EFGHIJ","KLMNOP".

Client's Requirements:

-


Based on the values of the "Ship To Site" code in the line items i have to correspondingly map the header <ShipTo> or line item <ShipTo> address details.

Business Rule:

-


1. If values of all the 3 "Ship To Site" are equal then take the "Ship To" address details and map it to the header <Ship To> address details.

2. Else if all the 3 values are different then leave the header <ShipTo> and fill the line items <ShipTo>

Can we achieve this logic using Graphical Mapping tool?

Thanks,

Tirumal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2006 at 02:08 PM

    Hi,

    I assume the line items are all in the same context.

    You can achieve this through simple graphical mapping.

    Use the if then node.

    check if lineitem1,lineitem2, lineitem3 are equal,

    then, map <ShipTo> to <target-ShipTo>

    In order to map the line items if the values are not equal,

    If <lineitem1> <lineitem2> <lineitem3>--- != then,

    map <lineitem1> to target <lineitem1>.

    Similarly for the other two line items.

    Regards,

    Smitha.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      If the number of <line items> are dynamic, we could import the entire structure as a queue, count the number of <line items> in it, compare their value.

      If equal, you could map it directly to the header <ship-to> else,

      do a direct mapping from source <line item> to target <line item>.

      Regards,

      Smitha.

  • avatar image
    Former Member
    Apr 13, 2006 at 01:31 PM

    Tirumal,

    can you give a few more details. From what i understand , your target structure in Message Mapping is the ORDERS idoc. Is your source strucure a custom DT that you have created and used in the outbound interface of a file adpater or any other sender adapter ?

    If so , Is your source structure a SINGLE message, (meaning Message cardinality is 1 in source ) with header node defined as a repeating node ?

    Regards

    Saravana

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      pls ignore , looks like u got the solution

      Tirumal, if the src target message cardinality is the same, then ur requirement is straightforward i beleive , a simple 1:1 mapping, where in you can write a UDF, pass the ShipTo data in ur line items as an array or something , compare them and if equal , map it to ur target header ShipTo field.

      Regards

      Saravana

      Message was edited by: Saravana Kumar Kuppusamy

  • avatar image
    Former Member
    Apr 13, 2006 at 01:46 PM

    Hi Tirumal,

    You can write a user defined funcation by name isuniqueShipToSite which returns true or false (1 or 0). depending on the value of Ship To Site in the items.

    depending on output of that user defined funcation you can calculate Ship To Site in header and in the item node.

    Add comment
    10|10000 characters needed characters exceeded