Help me on message mapping
Hello,
Plzz help me how do i map if below condition arise.
REFAJ123
REFCD432
here REF is Record with 2 fields 1)REF01 2)REF02
I want to mapping this REF record to output side record.
Query is: If REF01 field is AJ then i need to map REF02 field(123) is to be map output side field. else ignore that record.
Output,
I need only value of 123 beacause( REF01 has value AJ) i dont want below REF data in Output.
Thanks,
Singh.
Ok fine,
Spend 5 more minutes for this.
In input file i am getting REF record 3 times.
i.e. REFCR!23
REFAJ234
REFDF345
IN output side Record has 2 field REC1 and REC2
I need output in Record REC1 has value = AJ
REC2 has value = 234.
I dont want to display 1 and 3 REF records in output.
Now in the same UDF do these things.
1. Change the code in UDF as
for(int i=0;i<REF01.length;i++)
if(REF01<i>.equals("AJ"))
result.addValue(REF02<i>);
2.in mapping change the context of REF01 and REF02 to message type.(top of records)
Right click on the REF01 and change the context on editor... same for REF02.
3.Now when mapping to Record, i.e
IN output side Record has 2 field REC1 and REC2
take REF01 and REF02 as input to UDF and out put of UDF to the Record(Target node)
Note:change context of REF01 and REF02 to message type.
2.When map to REC2...
take REF01 and REF02 as input to UDF and out put of UDF to the REC1(Target Element)
Note:Change the context here also as above.
3.When map to REC1
take REF01 and a REF01 as input to UDF and out put of UDF to the REC2(Target Element)
Note:Change the context here also as above.
Yes u r correct: when u r mapping to REC2.. u r giving REF01 as both inputs... it's just a work around.
Now Test the mapping..
This should work....
If still prblm do post..
Babu
Similar Messages
-
A little help needed in message mapping
a little help needed in message mapping
I have to map one of the idoc header segments as many times as it occurs to each Idoc when using the split message funcionality
let us say we have the segment seg1 and there is a QUALF in it
<seg1>
<qualf>001</qualf>
</seg1>
<seg1>
<qualf>002</qualf>
</seg1>
then we use the vbeln to split the idoc into 2.
so if we have
<vbeln> 1 </vbeln>
and
<vbeln>2 </vbeln>
then 2 Idocs should be created like this
<Idoc>
<vbeln> 1 </vbeln>
<seg1>
<qualf>001</qualf>
</seg1>
<seg1>
<qualf>002</qualf>
</seg1>
</Idoc>
<Idoc>
<vbeln> 2 </vbeln>
<seg1>
<qualf>001</qualf>
</seg1>
<seg1>
<qualf>002</qualf>
</seg1>
</Idoc>
it is easy to create the segment by using createif with the QUALF field but my problem how to map the qualf twice for each idoc
Thanks.UseOneAsMany is the function you need to use.
It takes three parameters:
1 --- The node you want to duplicated
2 --- How many times you want to duplicated
3 --- The context you want to place for it.
Regards
Liang -
Help needed in message mapping
Hi,
We have a Flat file message coming in with the structure mentioned below: The segments *Record, ItemData1 and ItemData2* are flat structures of the *Recordset*.
Recordset - Occurs 1
-- Record - Occurs N
-- ItemData1 - Occurs N
-- ItemData2 - Occurs N
Ex:
Recordset
--REC1
--IDATA1R11
--IDATA1R12
--IDATA1R13
--IDATA2R11
--IDATA2R12
--IDATA2R13
--REC2
--IDATA1R21
--IDATA1R22
--IDATA2R21
--IDATA2R22
This needs to be mapped to a nested structure mentioned below. The *Itemdata1 and Itemdata2* segments are part of *Record*
Recordset - Occurs 1.
-- Record - Occurs N
ItemData1 - Occurs N
ItemData2 - Occurs N
Ex:
--REC1
IDATA1R11
IDATA1R12
IDATA1R13
IDATA2R11
IDATA2R12
IDATA2R13
--REC2
IDATA1R21
IDATA1R22
IDATA2R21
IDATA2R22
The problem we have is we donot have a key linking the ItemData1 and ItemData2 with the Record and we need to fillup the nested structure based on the values coming .
Any idea how we can achive this.
Regards,
ArunavaHi Arunava,
If you dont have any key field in ItemData1 and ItemData2 in the incoming flat file, then you have to insert a keyfield in both the ItemData1 ,ItemData2 .
For this ,you need to use ItemData1.keyFieldValue and ItemData2.keyFieldValue in your FCC parameters.
Also, need to mention the keyFieldName in both ItemData1 ,ItemData2.(ex:ItemData1.fieldNames).
Hope the below blog would help you.
/people/sukumar.natarajan/blog/2007/06/12/content-conversion-in-sender-file-adapter--2-new-useful-parameters
Regards,
Swetha. -
Hello Expert
I am woking in IS retail Outbound Scenario for article master where enhancement segment E1WXX01 repeat multiple time and contain different -2 value and I want to collect that different value in different Target filed
Suppose
When first time segment E1WXX01 come contain
fldname Zcolor
Fldvalue red
Target field Color
In second time segment E1WXX01 contain value
fldname ZSIZE
Fldvalue 40
Target filed SIZE
And so on
I want configure that scenario with the help of graphical message mapping
Thanks
Amit ShivhareHi Shakif,
<b>CONTEXT CHANGE</b>
Please go through these links which clearly explains context and context changes in mapping.....
http://help.sap.com/saphelp_nw04/helpdata/en/40/7b8e40496f6f1de10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/35/fb8c4057d5701de10000000a1550b0/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/42/f7293b2dbe1a71e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
Go thru this guide~good source
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
<b>REMOVE CONTEXT</b>
Remove context removes all the higher-level contexts of a source field thereby delete all hierarchy levels and generate a list.In simple form
removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue
<b>SPLIT BY VALUE</b>
The SplitByValue () function is the counterpart to removeContexts(): Instead of deleting a context, we can insert a context change in the source value queue. We then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. A maximum of minOccurs top node target fields can be inserted here.
We can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.
refer this for node functions
http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm
Cheers...
Vasu
<b>** REward POints if found useful **</b> -
Hello,
I need some help for a message mapping.
In the source message is one element named options.
The value of this field is semicolon and bracket/comma separated value. e.g. skip;ignore;retry(1,2,3).
Each one of the semicolon separated values should be a own element in the target message. If one option has values in the brackets, this options should get some child's. For example:
<options>skip;ignore;retry(1,2,3)</options>
should be
<options>
<option value='skip'/>
<option value='ignore'/>
<option value='retry'>
<choices>
<choice>1</choice>
<choice>2</choice>
<choice>3</choice>
<choices>
</option>
</options>
Is it possible, to produce such message with the message editor?
Thanks and regards,
DanielHi Daniel,
Yes, its possible to produce such a message.But Have you defined message interface for the target structure described in your post?
You may need to write some user-defined functions / use susbstring operation to achieve what you need.
Regards,
Sridhar -
Need Help with Message Mapping in PI 7.1 - JDBC to IDOC
I have an outgoing SQL function that sends multiple rows of data for use in creating an IDOC in ECC. I am trying to key the creation of new IDOCs (already did the maxOccurs trick to the IDOC definition) based on a field in the JDBC return data...
JDBC Message Format...
SEGNAM - TRANS_ID - MATERIAL - VKORG...ETC
MARA - 00001 - 1234 - <space> - ...
MARC - 00001 - 1234 - VK01 - ...
MARA - 00002 - 9876 - <space> - ...
MAKT - 00002 - 9876 - <space> - material description - ...
Each time there is a new TRANS_ID, I need to indicate a new IDOC in the message mapping. I have tried all kinds of combinations of TRANS_ID --> dropContext --> splitValue and TRANS_ID --> collapseContext --> splitValue, but nothing has worked.
Has anyone done this kind of message map (without any BPM please)?
Thanks,
NathanHello Nathan,
For this one, you have to play with contexts.
row 1 SEGNAM = MARA, TRANS_ID = 1, MATNR = 123...
row 2 SEGNAM = MARC, TRANS_ID = 1, MATNR = 123, WERKS = PL01...
row 3 SEGNAM = MARA, TRANS_ID = 2, MATNR = 987
This also depends on the occurrence of the parent node. example, if I want MATNR to be populated, the logic would be like
ex:
IDOC1..unbounded) (The logic is the already provided in an earlier response)
-->MATNR (1..1)
MATNR --------> removeContext ----------------> FormatByExample --> MATNR
TRANS_ID --> removeContext --> splitByValue:ValueChange --> /
If the rows are not in order of trans_id, then you need to incorporate sorting into the logic above.
Hope this helps,
Mark -
Need help on message mapping screen
Hi folks,
I am working on file to idoc scenario. I Imported the IDOC to my scenario. In Messaga Mapping IDOC structure displaying fields as a documention. but i need techincal names of those fields.
for Example: In my IDOC 1 field is showing companycode but I want to see that field as a BUKRS.
How to see the technical names of IDOC fields in Message Mapping.
Your help is highly appreciaHi,
I dont think we would be able to see the data element names of the IDOC in XI. Even the imported XSD of Idoc doesnot contain data element name.
We would be only dealing with the field names/ structure of the IDOC for field message mappings. The field names are internally mapped to the data element names in SAP R3 system.
To view the internal mapping between field names and data element names of the Idoc fields, you can go to the transaction 'WE30'. Give the basic type of the Idoc and go to the segment editor. You can find the data element names for each field name there.
Thank you.
Regards,
Subbu -
MESSAGE MAPPING PROBLEM PLS HELP
hi forum i have a problem in message mapping...
i have a file to file scenario...with a BPM..
the components are:
1. one outbound async MI:-> MI_OA_fileSender
2. one abstract async MI:-> MI_AA_fileSender
the above two has messsage structure as:
<ns0:MT_sourceFile xmlns:ns0="http://zpoc.com.test/rana3">
<recordset> 1...1
<record> 1..unbound
<batch_num/> 1..1
<quantity/> 1..1
</record>
</recordset>
</ns0:MT_sourceFile>
3. one abstract async MI: -> MI_AA_fileDestination
4. one inbound async MI:-> MI_IA_fileDestination..
the above two has messsage structure as:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_destinationFile xmlns:ns0="http://zpoc.com.test/rana3">
<recordset> 1..1
<record> 1..unbound
<rec_number/> 1...1
<qty/> 1...1
</record>
</recordset>
</ns0:MT_rana3_destinationFile>
inside the BPM i m doing a simple one to one interface mapping between MI_AA_fileSender and MI_AA_fileDestination AND then use a send step to send it to receiver service. But inside the graphical editor, for the message maaping in the interface mapping, i change the target structure a bit by duplicating <rec_number> making it:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_destinationFile xmlns:ns0="http://zpoc.com.test/rana3">
<recordset> 1..1
<record> 1.. unbound
<rec_number/> 0..1
<rec_number/> 0..1 //did right click and "duplicate sub-tree, so it becomes 0...0"
<qty/>
</record>
</recordset>
</ns0:MT_destinationFile>
But i dont change the original structure of MT_destinationFile.
Now in the resultant file in the receiver side i recive two <rec_number> tags....
but since i didnt change the original structure of MT_destinationFile.....but i only made a change in the mapping by duplicating the node <rec
_number>(right click and done "duplicate sub tree").............SHOULD IT NOT THROW AN ERROR
Message was edited by:
sudeep dhar
Message was edited by:
sudeep dhar>.............SHOULD IT NOT THROW AN ERROR
Not necessarily.
See, XI won't realize, by default, a schema validation in your messages. If you want a validation, you'll have to implement one, as described in
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm
However, for some particular steps in BPM, I have observed that an invalid XML will some times result in a error in BPM execution. In particular, if you have switch steps, container operation steps and/or correlations where you use a particular field of that message, it may throw some exception when you have an invalid xml. Also, I have observed some errors with conditional receiver determination for invalid messages.
As a best practice, if you have any kind of dependency on a particular message inside your system (like switches, container operations, correlations, condition in receiver or interface determination etc), it is a good idea to implement a schema validation.
Also, if you do want to create a thrustable scenario, you might want to perform schema validation for all your output messages.
Regards,
Henrique. -
How to Alert RFC connection failure via message mapping? Kindly Help!
Hi Experts,
I have a JMS - XI - RFC scenario.
JMS receives the Rosattenet PIP contents and sends it to RFC function module in remote SAP R/3 system.
I have a requirement where I have to monitor RFC connection failure because of the remote R/3 system being down. I have to send a email alert where the subject contains the PIP number to understand for which PIP the connection failed.
The PIP number exists in the PIP content at the interface.
If I use the Alert configuration in the runtime workbench for monitoring then I cannot dynamically pass the PIP number.
Only way I think of triggering alert is in the message mapping via a Java UDF.
But I am not sure how can I do this? How do I check in the UDF if RFC connection has failed? Is this the correct approach?
How to acheive my requirement? Note that my email subject content is dynamic bacause if PIP number.
Please help!
Thanks
Gopal
Message was edited by:
gopalkrishna baligaHi Gopal,
what version/sps of XI are u running?
The easiest way to do what u want inside a UDF is to
1. use JCo to try estabilish a connection to the remote SAP System
2. if that fails, use JavaMail to send an email message
Let your UDF work on the PIP number, accepting it as input, and (maybe) returning it as output if everything goes ok. Otherwise break the mapping execution as described by Michal in one of his last weblog (using Dynamic Configuration).
Note that the above method doesn't guarantee that the message will be actually delivered, as some seconds could last between your check and the real RFC delivery operated by the Adapter Engine...
I am evaluating a way to do the same with Alert Framework. I will let you know the result!
Cheers,
Alex -
Hi All
I have a source structure like this below. It's a big structure actually. I'm just pasting the relevant structure where I need your help.
</root>
<storage>
<id>AB</id>
<Type>TY</storType>
<Temp>100</Temp>
</storage>
----</root>
My requirement is to check the value coming in <Type> and if it is TY, then the target structure will be the exactly the same
If it is XY, then the target structure will have one more field <celsius> and will look like this below.
</root>
<storage>
<id>AB</id>
<Type>TY</storType>
<Temp>100</Temp>
<celsius>922</celsius>
</storage>
----</root>
The <storage> complex element with elements can repeat as many times in the source XML. But the values of <Type> will be either TY or XY and I have to create the target structure accordingly. Pls help. I am using graphical message mapping
thx
mikeHi Michael,
Please try below mapping
Regards,
Krupa -
Help with Message Mapping - Context Change
I need help with the following message mapping. I am filtering by EMP_STAT in the Message Mapping. I have this working for the ROW structures, but I can get the HEADER/REC_COUNT field to calculate. I can do just a record count of ROW and get it to work, but I can't get it to work with the filter EMP_STAT = 'REG' added. I get a context error. Could someone send me the mapping code.
Sender XML----
<RECORD>
<ROW>
<EMPLOYEE>111</EMPLOYEE>
<EMP_STAT>REG</EMP_STAT>
</ROW>
<ROW>
<EMPLOYEE>222</EMPLOYEE>
<EMP_STAT>PT</EMP_STAT>
</ROW>
<ROW>
<EMPLOYEE>333</EMPLOYEE>
<EMP_STAT>REG</EMP_STAT>
</ROW>
</RECORD>
Receiver XML----
<RECORD>
<HEADER>
<REC_COUNT>2</REC_COUNT>
</HEADER>
<ROW>
<EMPLOYEE>111</EMPLOYEE>
<EMP_STAT>REG</EMP_STAT>
</ROW>
<ROW>
<EMPLOYEE>333</EMPLOYEE>
<EMP_STAT>REG</EMP_STAT>
</ROW>
</RECORD>Hello,
You can use this mapping
For REC_COUNT:
EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> count -> REC_COUNT
EMPLOYEE -> /
For ROW:
EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> ROW
EMPLOYEE -> /
For EMPLOYEE:
EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> SplitByValue -> EMPLOYEE
EMPLOYEE -> /
For EMP_STAT:
Constant: REG -> EMP_STAT
Hope this helps,
Mark -
Message Mapping Help XMLDocument with in XML
I am trying to pass on some XMLDocument with in XML
Example
<Header>
<Detail><Text1>Text</Text1><Text2>Text</Text2></Detail>
</Header>
Message mapping giving error at present. My Message Type has only the following
<Header>
<Detail>
I am trying to include <Text1>Text</Text1><Text2>Text</Text2> with in Detail section. Not sure how to handle this with Message Map. Please explain if there is any possibility to achieve something like thisHi,
You can directly use CDATA in message mapping and can solve this.
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Else you can use xsl mapping as mentioned in this thread:
Re: CDATA in xml file
You can also try java mapping as mentioned here:
XML inside a field in XI
If you can give complete source payload, source message type and target message type then somebody here can help you out.
Regards,
---Satish -
Message mapping/UDF help..
Hi experts,
Can someone let me know whether there is a chance to fulfill the below requirement:
Input file:
In the Input CSV file, there is a fixed length field with length 9 char and has leading zeroes (ex: 000000650)
Output file:
In the O/p XML file, the corresponding value should be displayed as "6.50" (Have to remove the leading zeroes, right justified and the last two digits should be allocated for decimals)
Can anyone let me know if we can handle in Message mapping or should we write a UDF? If so can you please provide the code..
Any help would be highly appreciated !!
Thnx
- RaviHi Ravi,
UDF:
Create a function zerosuppress and take the cache as value and take one argument input. Then put the code below:
//Put this code
String output = input.replaceFirst("^0+","");
return output;
With this function your leading zeros will remove.
Then map like this:
source field --> zerosuppress (udf) --> divide by 100 --> target field.
This should solve your issue.
Regards,
---Satish -
Hi,
I am doing graphical message mapping.
Source structure looks like
<BAC>
<IXYZ>
<DEF>
<PQR>
All are 0.. 1.
Target field is item which is also 0.. unbounded.
If ABC is not blank, assign to target field item[0] as 1st occurance.
If DEF is not blank, assign the same to item[1] field as 2nd occurance and so on.
Can this be done using message mapping without udf or java? If not, pls let me know other ways.
Thanks
anandHi,
<ABC> -> lenth Function (TEXT)-> Greate Then -> 0 (using the IF Condition)
<ABC> -> CopyValue(docuble click and give the index 0) -> to Target
<DEF> -> lenth Function (TEXT)-> Greate Then -> 0 (using the IF Condition)
<DEF> -> CopyValue(docuble click and give the index 1) -> to Target
Regards,
Venu. -
Installed Mavericks yesterday from Mountain Lion. Everything worked OK then tried to download iPhoto and iMovie update. My laptop power dies accidentally and now App Store, Messages, Maps, iBooks won't even open (Bounce once then nothing). Also running ridiculously slow now!
Hi,
Try Rebooting the computer and holding down the CMD and R keys together to access the Recovery process.
7:27 pm Sunday; October 27, 2013
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
Maybe you are looking for
-
I want to download Acrobat X. I am traveling with my laptop with a now expired Acrobat XI trial. I want to reinstitute X. What is the link to download X.
-
There is a PR needs to be updated. I can update it with ME23n. but when i use BAPI_REQUISITION_CHANGE to update. it shows error as : Create account 5401xxxx for YYY/MM/DD as a cost element in control area XXX. SO I maintain the cost element of accou
-
The linux plugin download page seems to have a bad link: fpdownload.macromedia.com server not found. It's been like this for a few days for me. Any thoughts on how to get the plugin?
-
Download of adobe acrobat XI Pro
the product I just downloaded isn't coming up and so my computer isn't recognizing my serial #
-
Cisco 4503 "1000BaseLH" SFP light is not coming
Dear Team, I have Cisco 4503 and I have inserted 1000BaseLH and light is not coming up but for 1000BaseSX its fine. Please suggest. CORE#show int GigabitEthernet1/18 GigabitEthernet1/18 is down, line protocol is down (notconnect) Hardware is Gigabi