Java maaping used in value mapping
Hi Friends,
Iam new to value mapping...I have hardcorde below values in javamapping..i need to pass it in value mapping.can anyone suggest me on this?
<aClientId>SWClient</aClientId><aUser>Honk</aUser><aPassword>XXXXX</aPassword><aDomain>PR</aDomain><aApplication>HAM</aApplication><aSchema>IDOC</aSchema><aDestination>E</aDestination><aReference>1</aReference><aMessage>"+strContentID + "</aMessage><aMessageFormat>4</aMessageFormat><aDuplicates>1</aDuplicates>
Thanks
dinu
hi,
so you have a java mapping and want to use the PI value mapping tables ?
maybe this will help [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5?quicklink=index&overridelayout=true]
Similar Messages
-
File to File using BPM & value mapping
Hi,
I have the following scenario to do. sample file structure is given below.
source:
HDR 13052008INDIA
BDY 123456
BDY 1234567
EOF
Target:
HDR 2IN BDY 123456 EOF
HDR 2IN BDY 1234567 EOF
for the above mentioned source and target mapping. we have to use BPM and value mapping.
In the HDR row 13052008 is the date value this has to be passed to RFC function module and it will return 2, this value has to be mapped to target
And INDIA has to be mapped to IN using the value mapping option. similarly we have many coutry code.
could anyone let me know the step by step procedure to achieve this, I followed the blog https://weblogs.sdn.sap.com/pub/wlg/1926. [original link is broken] [original link is broken] [original link is broken] but it does not fit to my scenario.
help is appreciated.
Regards
RDSHey,
This is a normal file to file scenario.
You need to use RFC look up instead of value mapping.(as you need to extract 2 and IN from an RFC)
There is no need for a BPM.
refer to this blog(for RFC look up)
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
this will solve your problem.
Output of RFC look up will be 2 and IN . So use the concat function.
Other values map them directly from source to target.
Also, set the occurence for the target structure as 0 to unbounded in the mapping.(this is to be done in order to have one file for each record of the source)
You also need to configure file content conversion.(both at sender and reciever side) to convert the text file to XML on the sender side and then XML to text at the reciever side.
refer to this link for FCC.
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
This is for sender file content conversion.
http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/frameset.htm
This is for reciever FCC.
http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/frameset.htm
reward points if useful.
regards,
Milan -
Export/Import the mapping value used in Value Mapping Function
I used value mapping function, so I defined some mapping data at Integration Directory. now I need migration from development xi to production xi, so How to export the data I input at development xi and later import it? or anyone could provide other solution for replacing value mapping function?
Hope from your helps
Thanks
Spring
Message was edited by: Spring Tang
Message was edited by: Spring Tang
Message was edited by: Spring TangHi Spring Tang,
You can export your mapping object in .mte format.
For this press ctrl+shift and right click in the
mapping editor. Then go to tools and export the same.
Similarly you can import the mapping object.
Hope this will solve your problem.
Thanks and Regards
Vishal Kumar -
Whatu0092s the name of the table used for value mapping?
Hi,
Does anyone know whats the name of the table where the value mapping values are stored in XI?
Br.samuliHello,
The table name will be XI_RUNVALMAPGR. It is the Java Scheme table.
So you can see the table only from DB Management Tool, for instance Enterprise Manager for SQL Server.
Best regards,
Mari -
Accessing Party identifiers using value mapping
Hello
Does anyone know if it is possible to access identifiers defined under a party using a value mapping (in my case from an xslt mapping calling a java function, but it doesn't really matter I guess).
For party ADVDENV_US I have the following identifiers:
http://sap.com/xi/XI XIParty ADVDENV_US
INTERNAL GLN 1806367142
At runtime I have value 1806367142 and I would like to retreive the value ADVDENV_US in order to perform dynamic receiver determination... would that work?
Thanks
Greg
Edited by: Grégory VIAL on May 19, 2008 8:06 AMGrégory,
If you wish to use identifier during the java mapping then check in below mention value mapping java docs.
https://help.sap.com/javadocs/NW04S/current/pi/index.html
Gaurav Jain -
Hello,
we want to use the value mapping table in ID with XSLT.
Here is my source:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Source xmlns:ns0="http://comsol-ag.com/xi/rfcxslt">
<CustomerNumber>A</CustomerNumber>
</ns0:Source>
XSLT Mapping:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:trg="http://comsol-ag.com/xi/rfcxslt" xmlns:ns0="http://test/xi/tsts" xmlns:ValueMap="java:com.sap.aii.mapping.value.api.XIVMService">
<xsl:template match="/">
<trg:Target>
<CustomerInfo>
<xsl:variable name="sourceValue" select="ns0:Source/CustomerNumber"/>
<ID>
<xsl:value-of select="$sourceValue"/>
</ID>
<xsl:variable name="response" select="ValueMap:executeMapping('http://sap.com/XI/xi','SourceAgency','SourceScheme',string($sourceValue),'http://sap.com/XI/xi','TargetAgency','TargetSchema')"/>
<Name>
<xsl:value-of select="$response"/>
</Name>
</CustomerInfo>
</trg:Target>
</xsl:template>
</xsl:stylesheet>
Target:
<?xml version="1.0" encoding="utf-8" ?>
<trg:Target xmlns:trg="http://comsol-ag.com/xi/rfcxslt">
<CustomerInfo>
<ID>A</ID>
<Name /> ???????????????????????????????????
</CustomerInfo>
</trg:Target>
But the receiving data is not converted to value table in ID:
Integration Directory Value Table :
http://www.image-load.eu/out.php/i26896_pic1.PNG
Please point out where i m going wrong.
Thanksproblem solved!
-
Table lookup instead of fixed value mapping
Hi Folks,
My current scenario is that I have used fixed value mapping to map a single target field. These details are actually maintained in the TP_Code table in R3 (a sample table).
TradingPartner:SAP:Short Text
PA:PA:Package
PL:PAL:Pallet
The table contains 20 entries.
I am thinking that fixed value mapping is not a good option since there might have future changes in the TP_Code table.
Is rfc lookup a good option? But I am not sure which rfc to use and if there is any udf availble to be used in parsing the xml payload.
Please advise.
Thanks a ton!Thanks so much for the links!
I managed to use and run the RFC lookup to an R3 table using JCo. However, I am not getting the right result.
I am getting the result in this format -> 800,PA,PAC,Package
The correct output is PAC which is the third node. Could this only be achieved by using java tokenizer?
The code that I have used is as follows:
Import com.sap.mw.jco.*;
//write your code here
String DBTABLE = a;
String WHERE_CLAUSE = b" = ""'"c"'" ;
String sapClient = "xxx";
String hostName = "nnnxxx";
String systemNumber = "xx";
String userName = "nnnnn";
String password = "******";
String language = "EN";
JCO.Repository mRepository;
JCO.Client mConnection = JCO.createClient(
sapClient,
userName,
password,
language,
hostName,
systemNumber );
// connect to SAP
mConnection.connect();
// create repository
mRepository = new JCO.Repository( "SAPLookup", mConnection );
// Create function
JCO.Function function = null;
IFunctionTemplate ft = mRepository.getFunctionTemplate("RFC_READ_TABLE");
function = ft.getFunction();
// Obtain parameter list for function
JCO.ParameterList input = function.getImportParameterList();
// Pass function parameters
input.setValue( DBTABLE, "QUERY_TABLE");
input.setValue( "," , "DELIMITER");
//Fill the where clause of the table
JCO.ParameterList tabInput = function.getTableParameterList();
JCO.Table inputTable = tabInput.getTable("OPTIONS");
inputTable.appendRow();
inputTable.setValue(WHERE_CLAUSE,"TEXT");
mConnection.execute( function );
JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
String resultSet = valueSet.getString("WA");
mConnection.disconnect();
return resultSet; -
What is value mapping ? when it is used ?
HI,
A perticular object/field could have different interprtations from applications to applications and Business to Business. For e.g Suppose a particular document XYZ has an identity code 001 in one application or may be in one orgnization. But the same document could have different ID in different applications.
With the help of Value Mapping you could map these IDs with each other, thus while transaction of the data XI will act as an smart mapper to pass the Application specific values.
http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
There are many docs available about Value mapping in SDN forum.
How to Perform Value Mapping A Walkthrough
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5
http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/frameset.htm
SDN Discussions
/people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions
SAP - XI Value Mapping : Mapping two values to a single value
Value Mapping Issue in SAP XI
thanks
Swarup -
Hi Folks,
please, i need a step by step Solution for calling Value Mapping with XSLT Mapping Program.
best regards MichaelXSLT call Value Mapping
Maintain the value mapping using the option available in the Integration directory. The following values should be entered for maintaining the value mapping. In the XSLT Mapping use the Java function Valuemappingaccessor to read the values from the table.
Class ValueMappingAccessor
This class is used read the Value mapping stored in the Integration server (Java Cache). Class has a method getValueMapping. The Class is imported into the SWC Eyyy_xxxx under namespace http://xxx.ash.com/COMMON/Common
Method public static String getValueMapping(String srcContext, String dstContext, String srcAgency, String srcSchema, String dstAgency, String dstSchema, String key, Map inputParam, String throwException)
Paramters Description
srcContext Source context in the Integration server (Java Cache) under which, the value is stored.
For example, if the source values are stored using standard Value mapping table in the ID, then use source context as http://sap.com/xi/XI
dstContext Destination context in the Integration server (Java Cache) under which the value is stored
For example, if the source values are stored using standard Value mapping table in the ID, then Target context as http://sap.com/xi/XI
srcAgency Source Agency, a unique identifying value, value to be used is not yet decided.
srcSchema Source Schema, For example this can be source field name
key Source field value, that is required to determine the target, In the figure 1 shown below, We need to send IN to get India
dstAgency Destination Agency, a unique identifying value, value to be used is not yet decided
dstSchema Destination Schema, For example this can be target field name
inputParam Mapping transformation constants, to write the trace into the header of the message
throwException An indicator to throw an exception, if the value is not found in the cache. If the parameter is set to true or TRUE, an exception is raised & message fails in the mapping step of the Pipe line.
Returns the value, that is stored in the Value mapping context for the given parameters
If the value mapping is maintained using Integration Directory value mapping, then we need to call the value mapping function as follows
If it has to be called using XSLT Mapping., then the sample code shows how to use the java class the java class ValueMappingAccessor.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.ashok.com/idoctofile/employee" xmlns:ValueMap="java:com.xxx.yyy.ValueMappingAccessor">
<xsl:param name="CountryCode">
<xsl:value-of select="ns0:MT_EMPDETAILS/Country"/>
</xsl:param>
<xsl:param name="inputparam"/>
<xsl:template match="/">
<ns0:MT_EMPADDRESS xmlns:ns0="http://www.ashok.com/idoctofile/employee">
<EmployeeNo>
<xsl:value-of select="ns0:MT_EMPDETAILS/EmployeeNo"/>
</EmployeeNo>
<FirstName>
<xsl:value-of select="ns0:MT_EMPDETAILS/FirstName"/>
</FirstName>
<LastName>
<xsl:value-of select="ns0:MT_EMPDETAILS/LastName"/>
</LastName>
<Address1>
<xsl:value-of select="ns0:MT_EMPDETAILS/AddressLine1"/>
</Address1>
<Address2>
<xsl:value-of select="ns0:MT_EMPDETAILS/AddressLine2"/>
</Address2>
<City>
<xsl:value-of select="ns0:MT_EMPDETAILS/City"/>
</City>
<State>
<xsl:value-of select="ns0:MT_EMPDETAILS/State"/>
</State>
<Country>
<xsl:if test="function-available('ValueMap:getValueMapping')">
<xsl:value-of select="ValueMap:getValueMapping('http://sap.com/XI/xi', 'http://sap.com/XI/xi', 'Canonical','Country', 'KCRS', 'Country', $CountryCode, $inputparam, 'TRUE')"/>
</xsl:if>
</Country>
<ZipCode>
<xsl:value-of select="ns0:MT_EMPDETAILS/Zipcode"/>
</ZipCode>
</ns0:MT_EMPADDRESS>
</xsl:template>
</xsl:stylesheet>
If the values are maintained using Value mapping replication technique
Edited by: Ashok Reddy Thatigutla on Feb 15, 2008 9:43 AM
Edited by: Ashok Reddy Thatigutla on Feb 15, 2008 9:44 AM
Edited by: Ashok Reddy Thatigutla on Feb 15, 2008 10:06 AM -
ABAP Mapping with Value Mapping
Hi folks,
Anyone knows if it is possible to query a value mapping table inside an ABAP mapping?
Thanks in advance,
Ricardo.Hi Bhavesh,
Thanks for your prompt answer.
Im 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 doesnt 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 cant found any standard function to fulfill this requirement. Maybe this is easy with UDF, but Im not filling comfortable with Java and I dont know how to do it. If you know, please let me know.
Thanks in advance.
Regards,
Ricardo. -
can any one differentiate value mapping and fixvalues..........
because both are doing the same function....Here's a list of the main differences between the tools:
- Within Value Mapping you can specify the keys (Agency and Scheme) to access your tables which adds more flexibility to the tool.
- Contrary to the FixValues function, the table content of Value Mappings is not bound to a specific Message Mapping, but can be used in multiple mappings
- Value Mapping tables can be used by multiple mapping techniques (Message Mappings, Java mappings and XSLT mappings)
- The Value Mapping tables can be filled on the fly using the Value Mapping Replication interface.
check this:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
page num 76 to 80 to understand it.
Message was edited by:
Nisar Khan -
Reg: Value Mapping - Recommended Max Entries/Size
Hi,
Just curious to know if there is any recommendation on the max number of entries stored and retrieved in a Value Maps.
Is it suitable for storing entries in order of 5000 or 10000. Also is it effecient for retrieval from such a big Map.
Since it is stored in Java Cache, is there any limitation on the size (Number of Entries).
Anticipating your valuable inputs.
Thanks,
Sudharshan N AHi
There will be performance problem if more entries are used in Value mapping.
Value mapping replication will be better choice for huge records.
Regards
Abhijit -
What are "value mapping tables"..
hi friends,
I am not getting the clear idea of value mapping tables and how it refers in cache monitoring....pls help me out...
with regards,
Santosh.Hi,
Value Mapping
A perticular object/field could have different interprtations from applications to applications and Business to Business. For e.g Suppose a particular document XYZ has an identity code 001 in one application or may be in one orgnization. But the same document could have different ID in different applications.
With the help of Value Mapping you could map these IDs with each other, thus while transaction of the data XI will act as an smart mapper to pass the Application specific values.
http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
There are many docs available about Value mapping in SDN forum.
How to Perform Value Mapping A Walkthrough
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5
http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/frameset.htm
SDN Discussions
/people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions
SAP - XI Value Mapping : Mapping two values to a single value
Value Mapping Issue in SAP XI
Value mapping
VALUE MAPPING TABLE
Regards,
Phani -
N: 1 relationships in Value Mapping 3.0
Hi,
in our Value Mapping we need to process n:1 relationships between values. E.g. 2 different codes for reason-for-rejection in the sending system need to be mapped to 1 value in the receiving system.
As we see now, and this is also mentioned somewhere in this forum, this doesn't work. Is this correct?
As suggested in this forum one option would be to add the sending value in the receiving value and use mapping to trim the value. So e.g.
Agency: SystemX Agency: SystemY
Scheme: Augru Scheme: Augru
Value Value
A1 B
A2 B
would become
A1 A1_B
A2 A2_B
Of course, this would work, but just one-way (from SystemX to SystemY). From SystemY to SystemX this would not work, since only value B is available at that time. If you apply the same logic, so implement another value, this would eventually mean:
Agency: SystemX Agency: SystemY
Scheme: Augru Scheme: Augru
Value Value
A1 A1_B
A2 A2_B
C_A1 C_B
D_A2 D_B
So you end up with a lot of values to maintain.
Another option would be to use different Value Mapping scheme's, but this would influence the reusability of the mapping.
Any suggestions?
Thanks a lot!When you have an n:1 mapping and want to use this in both directions, you need a logic, how the values are determined, if you have several entries to choose.
In your example:
A1 -> B
A2 -> B
If you come from the other side, what value should B have?
For the default value you could use a unique prefix (eg: 1_) and add that prefix to the value before calling the value mapping.
Let us assume, you have maintained the table like this:
A1 -> 1_B
A2 -> 2_B
A3 -> 1_C
A4 -> 1_D
A5 -> 2_D
A6 -> 3_D
so you have B ->A1, C -> A3, D -> A4
Regards
Stefan -
How create a Value Mapping Table in XI 3.0?
Hi:
I wish make a single sample scenario where receiving data must be converted according to convertion table:
01 -
Legacy A | Legacy B -
M
Male: 01 | M
Female: 02 | F
And I don´t know how build it. Must I create anything in Integration Repository? (any special message mapping or function?).
Anyone know about weblog where explain step by step for "value mapping group" and "value mapping tables" creation?
Help me please.
Regards!!
David.Hi David,
You can create value mapping tables in Integration Directory.
First you have to create Value mapping group using menu Object>new>Value mapping Group
to Display value mapping you have to use Tools--> Value mapping.
Also refer to following link on help.sap.com
http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/content.htm
In IR Graphical mapping tool, use the standard function Conversions-->Value mapping.
Hope this helps.
Rgds,
Sam Raju
Message was edited by: Sam Raju
Message was edited by: Sam Raju
Maybe you are looking for
-
Different LOVs in af:query and af:form for the same VO attribute
Hi, We need to display different LOVs in af:query and af:form for the same attribute in VO. Is it possible to use LOV Switcher for this ? What condition can we use in LOV Switcher attribute to check if it is View Critearia row or VO row ?
-
What does it Take... What is the Wizer Move?
What does it take? What is the Wiser Move? Currently we are running Oracle EBS 11.5.10 with an RDBMS 10.2.0.4 on Windows 2003 32 bit. We would like to get to a 64 bit OS and we are looking at 64 bit Linux or Windows. I am interested in two main areas
-
Validate a XML file against multiple schema files
Hello everybody! How can I validate a XML file against multiple schema files? I have the following XML file: <?xml version="1.0" encoding="UTF-8"?> <bulkCmConfigDataFile xmlns:es="SpecificAttributes.3.0.xsd" xmlns:xn="generic
-
I have the old airport express but my iPad 3 is not able to connect to it even with the app downloaded. What can I do?
-
Search data in a 2d array and generate a signal when found
Hi, i am looking for an interactive way to search data from an array containing a 2d array found in a cluster. The data is in the 2d array. I have attached the vi containing the array. I want an interactive method to look up for the codes in the 2d a