cancel
Showing results for 
Search instead for 
Did you mean: 

Consolidation of tables into one structure

Former Member
0 Kudos

Hello,

I am doing a mapping from a BAPI to an XML structure. In the BAPI there are two tables each that have an element called <i>division</i>. In the target structure there is one structure that is a super set of each of the tables elements. I would like to map each of the table structures where the division is equal into the target structure. What is the most efficient way to do this? I can simulate this using the concat function, but that does not ensure the divisions are equal and it requires each context to be in the same order.

Desired Result:

Input

-


Table 1 Row 1: Division1,X1,Y1

Table 2 Row 1: Division1,A1,B1

Table 1 Row 2: Division2,X2,Y2

-


Output

-


Result 1 Row 1: Divison 1,X1,Y2,A1,B1

Result 1 Row 2: Division 2, X2,Y2

Your help is much appreciated.

Thanks,

Dustin

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dustin,

First of all the output wihich you shown for Result 1 Row 1 is having <b>Y2</b> but it should be

Result 1 Row 1: Divison 1,X1,<b>Y1</b>,A1,B1

Correct me if i am wrong.

I think it could be achived by using bewlo mentioned function.

1. RemoveContext

2. SplitByValue (value changed)

3. CollapseContexts

4. Concat

But to use these function i will require the source & target mapping structure.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

Your catch on my example is correct - it should have been Y1 in the first row.

I'm not sure of the best way to give you a source to target, but I'll give you an example.

Source TABLES:

T1 (0...*)

-


Division

Quantity

T2 (0...*)

-


Division

Price

Target Structure (XML) (0...*)

Division

Quantity

Price

-


Thanks,

Dustin

Former Member
Former Member
0 Kudos

hi Dusting,

You can try using JOIN statement to collect data from two tables and then consolidate into required 1 structure.

JOIN ensures data consolidation from outbound side of XI only, i think it should be efficient

regards

ramesh P

Former Member
0 Kudos

Where is this join function that you speak of? Are you talking about a SQL join or something similar? I would expect the solution would be in a message mapping object. I looked through all the function categories and did not see join.