cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in Mapping Logic

Former Member
0 Kudos

Hi all,

In mapping i need to mapp like this

Idoc--file scenario, sending delivery document to file system

in header of file structure, i have a field called Total Units, the logic for this field shld be

Sum up the field ZCONV_QUAN for each delivery.

How to do this please help me

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Vamsi,

Since you are putting the context of ZCONV_QUAN for each idoc, so if an idoc has 10 of these values, all of these 10 values you are asking to sum and send to Total Units.

Regards,

---Satish

Answers (4)

Answers (4)

former_member185881
Active Participant
0 Kudos

Hi vamsi

You can do this without UseasMany function also.

send me the details of the source structure and target structure let me see what i can do

Regards

Dheeraj kumar

Former Member
0 Kudos

use removeContext before sum

Former Member
0 Kudos

Hi satish,

I have to do some thing more in this.

As you said i mapped the field to sum and to target field.its fine

Now this field is there at header level and comes only ones, i should repeat this field as many number of times the line item repeats.

Now iam using the ligic like this

ZCONV_QUAN--UseOneAsMany-Sum--Target Field

to UseOnaAsMany function i mapped ZCONV_QUAN as first argument and changed the context to Idoc and the second argument as line Item segment changed the context to Idoc, third argument as line itme segment.

its giving the error as

Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue

Regards

former_member200962
Active Contributor
0 Kudos

Check this to know what should be mapped to the first, second, third argument of the UseOneAsMany

For practical example: /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

But I am not sure how you can use this in your mapping ...... useOneAsMany is used when the source is repeating only once whereas the target to which it is mapped is repeating N number of times.....so this function wont help you...when you say "sum"

You seem to have assigned the marks but forgot to mark the thread as solved?

Regards,

Abhishek.

Former Member
0 Kudos

Hi,

Then how can i achieve these both functionality ( UseOneAsMany & Sum ) at a time

I want to repeat the field ZCONV_QUAN which is coming in header once as many number of time the lin item repeats in Idoc

And also i have to sumup the field ZCONV_QUAN and mapp to target

Please help us

Regards

Vamsi Krishna

Edited by: Vamsi Krishna on Jul 7, 2009 10:45 PM

Former Member
0 Kudos

Vamsi,

You can use copyvalue standard function. After Sum put copyvalue.

Regards,

---Satish

former_member181962
Active Contributor
0 Kudos

How about this logic?

ZCONV_QUAN -


Multiply-------Target field

Itemnode---Count-/

Regards,

Ravi Kanth Talagana

Former Member
0 Kudos

Vamsi,

Map like this:

ZCONV_QUAN (change context to idoc) --> sum --> Total Units

Regards,

---Satish

Former Member
0 Kudos

Hi satish,

If i mapp like that means, could you please explain in general what is the functionality applied here

Regards

VijayKonam
Active Contributor
0 Kudos

You are adding all the field values at the idoc context level.

VJ

Former Member
0 Kudos

Hi Could you please give an Payload Example?

Former Member
0 Kudos

Hi Satish,

You are just simply solved my queries

Lot of help from your end

Regards

Vamsi