Former Member

### Mapping Logic:- multiplying qty with rate, adding all the line item and mapping to a header field

Hi Experts,

We have a scenario for multiple line items where in the quantity is multiply by rate for each line. if suppose there are 3 lines, then we need to implement the same logic i.e., qty*rate and then adding all the line total to form the grand total and the same need to map at header level.

<LINE1>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>2.5</D_118>
<D_331>15</D_331>
</S_SAC>
</LINE1>

<LINE2>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>3.5</D_118>
<D_331>15</D_331>
</S_SAC>
</LINE2>

<LINE3>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>4.5</D_118>
<D_331>15</D_331>
</S_SAC>
</LINE3>

the below is the logic for the mapping multiply D_118 with D_212 for each line then we need to add the total of all lines and map the same to header

Hi Experts,

We have a scenario for multiple line items where in the quantity is multiply by rate for each line. if suppose there are 3 lines, then we need to implement the same logic i.e., qty*rate and then adding all the line total to form the grand total and the same need to map at header level.

<LINE1>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>2.5</D_118> "RATE
<D_331>15</D_331>
</S_SAC>
</LINE1>

<LINE2>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>3.5</D_118>
<D_331>15</D_331>
</S_SAC>
</LINE2>

<LINE3>
<D_212>1</D_212>
<S_SAC>
<D_248>N</D_248>
<D_1300>G830</D_1300>
<D_118>4.5</D_118>
<D_331>15</D_331>
</S_SAC>
</LINE3>

The logic for the mapping is multiply D_118 with D_212 for each line then we need to add the total of all lines and map the same to header field TOTAL

for line1

if D_1300 = G830

then 2.5 * 1 = 2.5

for line2

if D_1300 = G830

then 3.5 * 1 = 3.5

for line3

if D_1300 = G830

then 4.5 * 1 = 4.5

then add line total i.e., 2.5+3.5+4.5 = 10.5 and mapping to TOTAL field at target side

TOTAL (field a target header level)= 10.5

your help is highly appreciated. points will be rewarded for correct answers

Regards

Faisal

10|10000 characters needed characters exceeded

• Feb 03, 2017 at 01:50 PM

Hi Faisal!

Standard mapping functions IfWithoutElse (for checking condition if D_1300 = G830), multiply (for multiplying D_118 with D_212 ) and sum (for getting totals) will help you to fulfill your requirements.

Regards, Evgeniy.

10|10000 characters needed characters exceeded
• Feb 03, 2017 at 02:56 PM

Hi Abdul,

Here is the graphical mapping for you. Make sure Context of D_1300 and D_118 is LINE.

capture.jpg

Thanks,

Apu