Map Field names to target side
Hi Gurus,
I have a critical Requiremnet where in i need to map the field names from Source structute to the target structure..
For Example:
My Source structure:
<matnr> 123</matnr>
<maktn>XYZ</maktn>
Expected Target structure:
<Node>
<Fieldname>matnr </DFieldname>
<Fieldvalue>123</Fieldvalue>
</Node>
<Node>
<Fieldname>maktn </DFieldname>
<Fieldvalue>XYZ</Fieldvalue>
</Node>
Any Blog on this is highly Appreciated.
Best regards,
Sainath Chutke
Edited by: Sainath Chutke on Feb 23, 2009 8:42 PM
Hi Sainath,
This is possible using graphical mapping with the help of UDF.
A simplified mapping will look like this:
For Fieldname
constant: MATNR --> useOneAsMany --> 1. UDF -
> Fieldname
MATNR --> removeContext --> /
MATNR --> removeContext --> /
constant: MAKTN --> useOneAsMany --> 2.
MATNR --> removeContext --> /
MATNR --> removeContext --> /
where 1 and 2 are the inputs to the UDF.
For Fieldvalue
MATNR --> removeContext --> 1. UDF --> Fieldvalue
MAKTN --> removeContext --> 2.
Note that you can eliminate the node removeContext just make sure that you set the context to the topmost level of the hierarchy.
The UDF that will be used is of context type: There are two input arguments, input1 and input2:
Here is the code:
StringBuffer e = new StringBuffer();
String b = null;
for (int a = 0; a<input1.length; a++){ e = e.append( "/" + input1[a]);}
for (int a = 0; a<input2.length; a++){ e = e.append( "/" + input2[a]);}
e = new StringBuffer(e.substring(1,e.length())); b = e.toString();
String c[] = b.split("/");
for (int a = 0; a<c.length; a++){result.addValue(c[a]);}
What this UDF does is to add the contexts of the input, it is also taken into consideration multiple occurrences of the MATNR and MAKTN e.g.
MATNR = 12,1234
MAKTN = XYW,XYZ
The output for Fieldname is MATNR,MATNR,MAKTN,MAKTN
The output for Fieldvalue is 12, 1234, XYW, XYZ
Hope this helps,
Similar Messages
-
Hi! I am trying to get the Field name of the XML element, when I am defining my own function. Can someone please provide me some help! Example:
In the Graphical Editor, let's just say we drop the following fields:
Source Target
City to City
How can I grab the XML field name "City"?
Thanks,
RobHi Robert,
In the Message Mapping, there is a button named 'Text Preview', just below the Tab names 'Design - Test - Messages'. If you click that, it displays the complete mapping in a text area. It conatins full paths of all mapped fields, similar to the XPath, which you can use in your function.
If this helps you, please remember to award the points and close the post.
Good luck,
Bhanu -
Pick a particular file and keep on target side with the same file name
Hi Guys,
I have got couple of files in a folder. I need to pick only two files, I have setup BPM procedure 2 payloads merge. To keep these merged file with the same source filename.
Source side file Directory
abc_12345_20100408101029.xml (abc_seq number_timestamp.xml)
xxx12345.xml
test.xml
abc_12345_20100408101149.xml
Target Side, How do I keep with the same file name?
abc_12345_20100408111239.xml --- same file name with diffrent timestamp.
One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
Does anybody has got quick idea, any links etc.,
Your quick and positive response will be much appreciates.
Kind Regards
SanHi,
One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
For this you can Availability time planning (i.e you can schedule the file adapter to poll for the files with in the time interval i.e 2 -5)...
for generating the file name at target side you need to look for the Dynamic Configuration as you need to change the timestamp for the file..and i am not sure how this works in BPM..
in normal scenarios dynamic configuration will help....
HTH
Rajesh -
BB Desktop Manger v5 with 9500 unable to sync Calendar with categories map fields
BB Desktop Manger v5 with BB Storm 9500
Two laptops one with XP sp3 with office/outlook 2003 and the other vista 64bit with office/outlook 2007
The sync of both the Address book and Tasks are great as I can use the catergories "map field" in both of these options.
The device and the application "outlook 2007/2003" both have the catergories field.
The problem is I am unable to sync The Calendar with categories map fields.
The device side of the map field does'nt have the catergories option but the application side "outlook 2007/2003" does.
From the main menu on the BB Desktop manager / Synchronization / Synchronization tab / Advanced Tab / Calendar / Map Fields Tab
The left side of the screen is the Device listing and the right side is Microsoft outlook.
Is their a way I can add this field to the map fields option for the device?
ThanksHi damlandberg,
Welcome to the BlackBerry Support Community.
This KB article should provide more information on the synchronization error you are receiving as well as a workaround to enable your synchronization. ""The organizer module could not load and will be turned off" when configuring synchronization in BlackBerry Desktop Software 7.1" http://bbry.lv/SdDLCO
Hope this helps.
-FS
Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.
Click Solution? for posts that have solved your issue(s)! -
UDF to read a file name and use some of its contents to map fields in target.
I have a scenario where I need to take the month and year from the file name and map it to suitable fields in the target. Ex - filename_apr2014 from this i should be able to read the month and year and map it. How to do this? I tried the udf -
public String getFileName(Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
got this error while testing the mapping -
Runtime exception when processing target-field mapping /ns0:MT_<<>>_Output/I<<>>; root message: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.mapping.api.DynamicConfigurationKey) of a null object loaded from a local variable at slot 2] in class <<>> method getSourceFileName[com.sap.aii.mappingtool.tf7.rt.Context@5b04fc0f]
See error logs for detailsHi Satish - You declared "conf" twice.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
UDF -
String filename = "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = conf.get(key);
return filename;
And did you define the variable slot 2 in any of your UDF's?
The above UDF return the filename and you should handle the sub string later.. -
Need billing text field name for IDoc mapping
Hi Friends,
our users use CRM web application to send orders to SAP via IDocs. They want to have billing text (In German it is called Rechnungstext or Faktura text) so that they can enter some text here if they want to enter something. My question is, what is the field name and IDoc segment for billing text? We need this information to map in XI.
Br, Sats.The solution is:
The standard Idoc text segment can be used for the text in sales order. From SD side the text types have to be customized. This is necessary for the XI mapping.
Regards,
Sats. -
Message Mapping on the Target side
Hi
I am working on Proxy to SOAP in PI 7.1, and have node which is defined on the target side as Unbounded (table)
Here is the structure of the table that has been defined on the target side,
CodeList - 0- Unbounded (Table)
Id XSD Id
CodeList Name String
CodeList Version String
CodeListOwnerCd String
Source System(ECC) is not sending any values and the values which needs to be assigned to the above structure are fixed on the target side,
how can I assign multiple values to the Code List table
Ex CodelistName Should contain ClaimsPartyRoleCdList, PolicyTypeCdLis , PaymentTypeCdList
Please let me know how can I assign Multiple values to the target side table
Thanks
PRHey
You can easily do this via advanced UDF.
Map the root node to the below UDF.Make sure that you have set the Cache as Queue for this.There will be no input values to this UDF
//write your code here
result.addValue(" ");
result.addValue(" ");
Map the underlying Nodes to the below UDF.Make sure that you have set the Cache as Context for this.There will be no input values to this UDF
//write your code here
result.addValue("3");
result.addContextChange();
result.addValue("4");
result.addContextChange();
I was able to acheieve the below XML by using the above two
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MI_Multiple xmlns:ns0="http://fxp.com">
<Record>
<First>3</First>
<Second>3</Second>
</Record>
<Record>
<First>4</First>
<Second>4</Second>
</Record>
</ns0:MI_Multiple>
Hope this works for you.
Thanks
Aamir -
How to map multiple occurrences of a source field into a target field
Hi friends
I need multiple occurences of MATNR field, of idocs collected, to be concatenated into a single field on target side.
Warm Regards
Arjun GhoseHi Priyanka
I am using the below code
String material ="";
for(int i=0; i<MATNR.length();i++)
material = material +MATNR<i>; //var(i)
result.addVAlue(material);
But I am getting the below errors:
Activation of the change list canceled Check result for Message Mapping COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse | urn:bp:xi:dwn:lu:common:Logistics:100: Starting compilation Source code has syntax error: C:/usr/sap/IXV/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map11a81744fef611e0a49b000000aa1a4a/source/com/sap/xi/tf/_COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_.java:123: array required, but java.lang.String found material = material +MATNR<i>; //var(i) ^ C:/usr/sap/IXV/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map11a81744fef611e0a49b000000aa1a4a/source/com/sap/xi/tf/_COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_.java:126: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_ result.addVAlue(material); ^ 2 errors
Edited by: GhoseArjun on Oct 25, 2011 12:57 PM -
Want to disable a field (1..unbounded) at target side dynamically.
Hello,
I want to disable a field (1..unbounded) at target side dynamically in message mapping on the basis of a condition.
Please help me out. I serached in existing threads but culdnt find it.
regards,
RahulHello,
I want to disable a field (1..unbounded) at target side dynamically in message mapping on the basis of a condition
You can't really disable it using normal mapping because at least it will occur once. What you can do is to change the occurrence to 0..unbounded or use XSLT/Java Mapping.
Hope this helps,
Mark -
Mapping of Business One Field names to SAP R/3 Field Names
Hi experts,
We are downgrading from SAP R/3 to SAP Business One. I am having difficulties in mapping the SAP R/3 fields to Business One fields. Hope you could help me by providing the field names in R/3 linked to Business One field names.
Thank you very muchHi,
I have ever used SAP R/3 and I knew that there is a feature to export data from SAP R/3 to excel.
I suggest export it first if you want to migrate data from R/3 to SAP B1. The data in the excel file could be used to enter into data transfer workbench (DTW) excel template file. DTW is an addon to import data into SAP B1 database system.
You could open this folder :
C:\Program Files\SAP\Data Transfer Workbench\Templates\Templates
after full installation of SAP B1 (begin from server tools, server application, application client, SDK, DI API, DTW).
To know more about the column template definition and location in SAP B1, you could use SDK help center file. This file is only available if you installed the SDK. This helpfile could be used to know the fields name and meaning in all SAP B1 tables
Rgds, -
XSLT for dynamic target field names
Hello,
I got a requiremt where I need to create target field names from input values.
Input XML -
<?xml version="1.0" encoding="UTF-8"?>
<Createelement_MT>
<Field Name="A">
<Value>1</Value>
</Field>
<Field Name="B">
<Value>1</Value>
</Field>
</Createelement_MT>
Expected OutPut XML -
<?xml version="1.0" encoding="UTF-8"?>
<Createelement_MT>
<Statement><TableName><table>XYZ</table>
<access>
<A> 1 </A>
<B> 2 </B>
</access>
</Statement></TableName>
</Createelement_MT>
The value of the attribute 'Name' of field 'Field' should be the name of target field.
XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Createelement_MT">
<xsl:element name="statement">
<xsl:element name="TableName">
<xsl:element name="table">ABC</xsl:element>
<xsl:element name="access">
<xsl:for-each select="Field">
<xsl:element name="{@Name}">
<xsl:value-of select="Value"></xsl:value-of></xsl:element></xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Error:
Error: at xsl:element on line 15 of file:///......: XTDE0820: Invalid element name. Invalid QName {}
Please help me with the xslt code for this requirement.
Thanks!Hi,
Please try this code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="/">
<Createelement_MT>
<Statement>
<TableName>
<table>XYZ</table>
<access>
<xsl:for-each select="Createelement_MT/Field">
<xsl:variable name="field" select="@Name"></xsl:variable>
<xsl:element name="{$field}">
<xsl:value-of select="Value"></xsl:value-of>
</xsl:element>
</xsl:for-each>
</access>
</TableName>
</Statement>
</Createelement_MT>
</xsl:template>
</xsl:stylesheet>
input xml
<?xml version="1.0" encoding="UTF-8" ?>
- <Createelement_MT>
- <Field Name="A">
<Value>1</Value>
</Field>
- <Field Name="B">
<Value>1</Value>
</Field>
</Createelement_MT>
output xml
<?xml version="1.0" encoding="UTF-8" ?>
- <Createelement_MT>
- <Statement>
- <TableName>
<table>XYZ</table>
- <access>
<A>1</A>
<B>1</B>
</access>
</TableName>
</Statement>
</Createelement_MT>
One small request, if you think your question has been answered,could you please kindly, if possible, close this thread.
regards
Anupam -
Question: map the whole source message into one field in the target.
Hi Friends,
Is there a way to populate the whole source message into one of the fields in the target message?
I am trying to do this in message mapping. Guide if this could be done in any other way or is there a way to do it in message mapping.
Waiting for your valuable guidance,
Regards,
LakshmiHi Friends,
I tried to convert the source message into a string using XSLT mapping. It was successful, however i need to have the source message in XML format and not in any other format. This is because, I am mapping the source XML into a field in a WSDL. The webservice requires the entire source message be inside a field called "Request" in the WSDL (it is like XML inside another XML).
Is there any way to do this? Please suggest.. (Im not good at java programming... may be i dont know) -
Field names with spaces in target file using fcc
Hello Friends,
My target structure fields:
MT_Target
ItemNo, ItemName, ItemQuantity, AmountValue, TotalAmount
My requirement here is - In the target file - these fields should be generated with space. Shown as below:
Item No, Item Name, Item Quantity, Amount Value, Total Amount
How can i achieve this.
Thanx
S.if i understood u correctly u want to have a header line in ut target file same as that ur field names but with a space in between??
if yes the use :
NameA.addHeaderLine=3
NameA.headerLine =Item No, Item Name, Item Quantity, Amount Value, Total Amount
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm -
Table name in Oracle for the User Mapping field?
Does anyone know the table name for the user Mapping field in EP6.0?
ThanksHi Alan,
why do you want to access the DB directly?! You can access the information via the Java API, which is in general the most secure way for the DB scheme is always "subject to change without notice"...
Best regards
Detlev -
Hi People
I am doing one scenario that is multiple receiver mapping
i create 1DTsen 2DTrec, same 1MTsen 2MTrec, MI one for sender outbound and asyn, 2inbound and asyn total 3MI and MM in message tab i assigned 2 target message types with using unbound and IM target side 2MI's
design part is ok
problem is only configuration , i created business service sender side i assigned sender message interface receiver side receiver interface CC's are 2sen and rec on same Business service
In receiver determination ok, only i am getting problem in Interface determination i assigned inbound interfaces 2 what ever i created target side but thing is i am not getting interface mapping in interface determination what is the problem,
i am trying normal file to file scenario but multi mapping
can you send me to ASAP
Thanks & Regards
ShekarAre you using Business Service for this ? If so , you need to explicitly add your Sender and Reciever Interfaces to the Business Service.
Because Business Service is an Abstarct.
So for this go to Business Service and under Sender and Reciever Tab add specific interfaces(outbound/inbound).
Activate it
Goto Interface Determination, you are able to add interface mapping for that corresponding message interfaces.
Maybe you are looking for
-
How to capture event in Master Detail report of OBIEE
Hi, Is there is any way we can capture which account is clicked in master report and store it in BI variable i.e. presentation\request\session? My requirement is that in 1st report there will be certain account and some more column. Each account here
-
How do i make my output compatible with advertising standards?
Hi. This is my first time posting in these forums - apologies for any mistakes (spelling and/or other). I'm looking into Adobe Edge as a potential new tool for creating web-banners for advertising. I'm more of a designer than a coder, but i have some
-
NoRoutetoHostException on installing Java Security Config Assistant in 10G
Hi I am trying to install the infrastructure for Oracle 10G AS 9.0.4 on Red Hat Linux 2.1 Advanced Server. The installation proceeds smoothly upto the time that I have to install the Java Security Configuration Assistant when it throws the No Route t
-
BUG - Edge animate 2014.1.1 (February) pivot doesn't remain in browser
When animating in Edge Animate I manually position the "anchor point" with the "Transform Tool (q)" or the origin percentages in the Transform panel. I can animate my rotations around this pivot and in Edge this looks correct. But when I publish the
-
Studio 11 CC performace as compared to ext3
Hi, I have a C++ program that uses fstreams to read a million lines and write them to a file as soon as the line is read. Compilation done with default options and 64bit binaries generated. These are the 'time' outputs 1. Solaris snv56 + CC compilati