cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Mapping with Value Mapping

Former Member
0 Kudos

Hi folks,

Anyone knows if it is possible to query a value mapping table inside an ABAP mapping?

Thanks in advance,

Ricardo.

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

Richard ,

Please map the source node to the target node with a advanced udf with the following code and cache the entire queue.It should work for you for sure.

code :

int i=0;

for (i=0;i<a.length;i++)

{

if (a<i>.equals("MOD"))

{

result.addValue("");

result.addValue("");

}

else

result.addValue("");

}

Make sure you have set the field occurence that has the value "MOD" as 0 to unbounded.

I assume the source and target nodes are linear.

Answers (2)

Answers (2)

STALANKI
Active Contributor
0 Kudos

The old id and new id can be passed into result.Addvvalue itself by calling the value mapping.

Former Member
0 Kudos

Thank you all, specially to Sravya, it's working now

Cheers,

Ricardo.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Ricardo,

Though not an answer to your question, why not use a RFC and a ZTABLE and then call this from your ABAP Mapping?

As value mappings are stored in the Runtime cache of XI, we will be making another call from ABAP stack to the Java Stack of XI. Again just my 2 cents tho not addressing the exact problem here.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

Thanks for your prompt answer.

I’m already using the Value Mapping with Master data Replication on several graphical mappings. Unfortunately, some changes happened for one mapping program, the complexity increased and the graphical mapping doesn’t fulfill these new requirements. So, I thought to use ABAP mapping, because is a language that I know well.

I understood your concern; we are talking about two levels, ABAP and Java stack. It will be needed a call from ABAP stack to Java Stack, but maybe there is an API for that? But, about system performance, I guess Value Mapping its better then RFC lookup, right?

My mapping problem is: I need to generate two nodes (not a field) every time the code “MODI” (modification) comes in a source field. Inside these two nodes, I have to fill a field, into first node, with an old id and for the second node with the new id.

I can’t found any standard function to fulfill this requirement. Maybe this is easy with UDF, but I’m not filling comfortable with Java and I don’t know how to do it. If you know, please let me know.

Thanks in advance.

Regards,

Ricardo.

henrique_pinto
Active Contributor
0 Kudos

Ricardo,

could you please provide source and target structures?

That should be easily done with Message Mapping (just create 2nd node if value from source node = "MODI").

Regarding the Ids (old and new), they are available in the source structure or you should do lookup to get them?

Regards,

Henrique.

bhavesh_kantilal
Active Contributor
0 Kudos

Ricardo

In the Graphical Mapping, select the node that needs to occur twice, right click on it and say Duplicate SubTree. Now, you can provide mapping rules one for each Node.

Does this help?

Regards

Bhavesh