Using multiple inputs in a functional map

A functional map may require more than one input. For example, you are mapping an input purchase order to an output purchase order. The input PO consists of a header and multiple details. The output PO is composed of a series of item records. Each ItemRecord contains the PO# and the company name, which must be mapped from the Header of the input PO. Each ItemRecord also contains item, quantity and price information, which is mapped from a Detail in the input.

You need a functional map to generate an ItemRecord. The inputs of the functional map would be everything that is necessary to generate one ItemRecord: both the Detail and Header from the input. A suitable name for the functional map may be MakeItemRecord.

The input PO is composed of one Header and multiple Details. You want to generate one ItemRecord for each Detail.

The functional map MakeItemRecord takes one Detail at a time, along with the Header, and creates one ItemRecord.

The two input arguments of MakeItemRecord are Detail and Header. You would enter the following map rule for the output ItemRecord(s):

= MakeItemRecord (Detail:Input, Header:Input)

In the map MakeItemRecord, you would create two input cards. The first input card corresponds to the first input argument, Detail. The second input card corresponds to the second input argument, Header.

  • The input arguments must match the input card types, in the same order.
  • The order of the arguments does not affect the number of times a rule is evaluated. However, it may affect the order in which the output objects appear and the performance at run time. For more information on how rules are evaluated, see the Functions and Expressions documentation.

In MakeItemRecord, map the PO# and Company from the Header into the components of ItemRecord. Map the Item, Qty, and Price from the Detail.