cancel
Showing results for 
Search instead for 
Did you mean: 

Sort & sum

Former Member
0 Kudos

Hi everybody!

<u>I have the following source structure:</u>

<b>Invoice_Mobilephones</b> 1..1

-


<b>G01</b> 1..999999

-


<b>G01.Cost center</b> 1..1

-


<b>G01.Name</b> 1..1

-


<b>G01.Phone no.</b> 1..1

-


<b>G01.Costs</b> 1..1

<u>The incoming data looks like this:</u>

<b>Invoice_Mobilephones</b>

-


<b>G01</b>

-


<b>G01.Cost center</b> 0010

-


<b>G01.Name</b> employee1

-


<b>G01.Phone no.</b> 111111111

-


<b>G01.Costs</b> 50.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0010

-


<b>G01.Name</b> employee2

-


<b>G01.Phone no.</b> 222222222

-


<b>G01.Costs</b> 30.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0020

-


<b>G01.Name</b> employee3

-


<b>G01.Phone no.</b> 333333333

-


<b>G01.Costs</b> 20.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0040

-


<b>G01.Name</b> employee4

-


<b>G01.Phone no.</b> 444444444

-


<b>G01.Costs</b> 110.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0040

-


<b>G01.Name</b> employee5

-


<b>G01.Phone no.</b> 555555555

-


<b>G01.Costs</b> 80.00

<u>The destination message should look like this:</u>

<b>Invoice_Mobilphones_sums</b>

-


<b>G01</b>

-


<b>G01.Cost center</b> 0010

-


<b>G01.Name</b> employee1

-


<b>G01.Costs</b> 50.00

-


<b>G01.Name</b> employee2

-


<b>G01.Costs</b> 30.00

-


<b>G01.Sum</b> 80.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0020

-


<b>G01.Name</b> employee3

-


<b>G01.Costs</b> 20.00

-


<b>G01.Sum</b> 20.00

-


<b>G01</b>

-


<b>G01.Cost center</b> 0040

-


<b>G01.Name</b> employee4

-


<b>G01.Costs</b> 110.00

-


<b>G01.Name</b> employee5

-


<b>G01.Costs</b> 80.00

-


<b>G01.Sum</b> 190.00

Does anyone know how to solve this problem?

Thanks for your help!

Chris

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Hi Chris,

it is not possible to create alternating elements in the message mapping.

-


G01.Name employee1

-


G01.Costs 50.00

-


G01.Name employee2

-


G01.Costs 30.00

Regards

Stefan

former_member206604
Active Contributor
0 Kudos

Hi Chris,

Yes as everyone said this is not a simple one to do, I also tried. Java or ABAP mapping would be the best wey to do it. You can also try with Conversion Agent but am not sure how much it will help you in solving this problem.

Thanks,

Prakash

Former Member
0 Kudos

Hi Prakash,

thanks for your reply!

I have never heard of a Conversion Agent. Could you please describe this function/possibility?

Kind regards

Christian

prasad_ulagappan2
Contributor
0 Kudos

Hav look at this doc...

www.itemfield.com/resourcecenter/ Conversionagent_ds_1001.pdf<a href="http://www.itemfield.com/resourcecenter/ Conversionagent_ds_1001.pdf">Conversion agent</a>

Also help.sap.com/saphelp_nw04/helpdata/ en/43/4c38c4cf105f85e10000000a1553f6/content.htm

Message was edited by: Prasad Ulagappan

<a href="http://help.sap.com/saphelp_nw04/helpdata/ en/43/4c38c4cf105f85e10000000a1553f6/content.htm">HELP</a>

Message was edited by: Prasad Ulagappan

Shabarish_Nair
Active Contributor
0 Kudos

this is a nice blog on it .. do read ..

/people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield

former_member206604
Active Contributor
0 Kudos

Hi,

Yes you can refer the links given by our friends Prasad and Shabarish. Even I know the same links.

Thanks,

Prakash

Former Member
0 Kudos

To everybody!

Thank you very much for your help! I will come back as soon as I solved the problem!

Greetings from Austria

Chris

Former Member
0 Kudos

Hi again!

Now I was able to solve the problem by adding an additional group ("G02").

<u>The changed structure of the target message looks like this:</u>

<b>Invoice_Mobilphones_sums

-


G01

-


G01.Cost center

-


G02

-


G02.Costs

-


G02.Name

-


G01.Sum</b>

Now it works!

Thanks a lot for your help!

Regards

Chris

Answers (3)

Answers (3)

prasad_ulagappan2
Contributor
0 Kudos

Hi Chris,

I have tried some ways in Graphical mapping, but couldnt get the desired result. So, the better option is go for java mapping.

Regards,

Prasad U

stefan_grube
Active Contributor
0 Kudos

Check this thread:

Here are some patterns you can use.

Regards

Stefan

Former Member
0 Kudos

hay Chris,

Sorry but I don't see any easy way to do it, what I would do is develop a Java/Abap program that insert all the record in a table and then getting the results sorted and sumed as you mentioned using SQL is simple, but it's a costly way performance wise.

Uri Lifshitz.