UDF in message mapping instead of Java Mapping. Pls advice urgent
Hi All,
My scenario
CRM --- XI -- CRM
In XI I have to open socket connection.
Pls refer link:
/people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
Can Java Mapping code given in above link for socket connection can be used in Message Mapping (CRM -- CRM)UDF?
Pls advice urgent
Regards
Hi Henry,
I understood your requirement.
But as per the architecture of XI/PI some message has to trigger your scenario.
In this case there is no adapter where you can directly communicate with CRM system.
Do one thing configure a dummy scenario on the sender side.
Use File adapter for simplicity. once it pools the file with some dummy data in the file it comes to Interface mapping(message mapping) of the PIPELINE steps. Now use the code as you mentioned above(within UDF) for opening socket to CRM system and implement you business logic within that program and write the response to target interface which will infact talk with CRM system.
Dont forget to do the coding in an infinite loop with some delay (if required). Other wise every time you have to put a message for File Adapter for triggering purposes.
You can also acheive the same if you use Java Mapping instead of Graphical mapping with UDF(code for Opening socket and business logic). I suggest you to use Java Mapping.
I dont know how you will comunicate with CRM system on receiver side.?
Thanks,
Gujjeti
Similar Messages
-
User Defined Function (UDF) help required. Pls advice urgent.
Hi ,
CRM -- XI (UDF) -- Socket Connection
Now in User Defined Function (UDF) of Message Mapping I will open Socket Connection.
Send CRM XML request to socket and get XML response from Socket and then map to some system.
Can I write Java Class code in User Defined Function (UDF) of Message Mapping instead of Java Mapping in blog below?
/people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
RegardsHenry,
Do you have a structure for your response...if you do then you can do extended reciever det with sync/async..shouldent matter, i just tried it and i dont get any error.
in your reciever determination..Check the box for standard rec det then add your first condition..of the value of a field to true..then send to A..
then you select add condition..and add for second reciever..that should be it, you shouldent need a bpm for such a simple scenario..it definetly is an overkill.
Regards
Ravi Raman -
Re-use message mapping from within java mapping?
Hi there,
I have a question regarding java mapping. What I would like to do is to re-use an existing message mapping from within java mapping.
Technicaly, message mapping is perfomed by com.sap.aii.mappingtool.tf3.AMappingProgram.execute, right? I would like to call that mapping program for a specifc message mapping from within my java mapping.
Pseudo java code would look like this:
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
com.sap.aii.mappingtool.tf3.AMappingProgram.execute(in,out,'SomeMessageMapping');
SomeMessageMapping is a message mapping that is defined in the integration repository.
Is it possible? If so, could you provide me with some details?
Thank you and best regards,
WolfgangHi Wolfgang,
very interesting idea?
I would activa a dummy message mapping. than I would have a look in the file directory of the java-stack and try to find out the name of the *.class or *.jar file.
On the other hand you could generate a tpz-transport-file an unpack this file, to explore the name of the *.class or *.jar
Unfortunately I do not have access to the file system. So I can't explore the name.
Regards Mario -
How to execute an ABAP Mapping after a Java Mapping
Hi, i have found a Bug in XI and SAP said to me that the only solution is to execute an ABAP mapping after my java mapping.
I have an IDOC to FILE scenario
Could anyone orient me on what do i have to configure, so after my java mapping i can execute an abap mapping ?.
Do i have to use process integration?
thanks
Mariano.i have developed a Java mapping originally, but XI has a bug. When you do not write anything to the outputStream XI instead of writing an emtpy file writes a file containing one byte ( 0x00 ) and this is a problem.
SAP said to me that they will not fix this issue so they recomend me to create an abap mapping after my java mapping that will send no information if it receives this byte (0x00) and if not it will write all the information as received.
My doubt regarding putting several mappings in the interface mapping configuration is this...
Actual configuration:
SOURCE MSG A -> ORIGINAL MAPPING -> TARGET MSG B
Proposed configuration
SOURCE. MSG A -> ORIGINAL MAPPING -> TARGET MSG B
SOURCE. MSG A -> PATCH MAPPING -> TARGET MSG B
I dont understand what receives de "patch mapping" it receives the structure from TARGET MSG B?
regards
mariano -
Calling a already existing mapping from a java mapping
Hi.
Is it possible to get a reference to an existing graphical mapping in a new java mapping or new user defined function?
RodHi,
If you have the mapping to run one after another and you need the output of mapping1 as input of mapping2 then you can add this in Interface mapping one after the other with required Message Interface.
Don't know if you can refer to a standard Graphical mapping in a Java mapping?
Regards
Vijaya -
Return delivery during PGI takes current MAP instead of old MAP
Re: Return Delivery Goods Receipt amount takes current MAP instead of old MAP
Re: Sales return delivery - amount takes current MAP instead of old MAP
I have similar question as above link. This link is marked as answered, however I am not able to resolve this using the same BADI .
LE_SHP_GOODSMOVEMENT.
Thanks,
Sam.Check if its parameters allow you to take the value back(export or Tables) from the BADI Method or not.
Also pl check in some BADIs, there are two set of tables/ structures, one for carrying back the data and other as an updation indicator (value = 'X') in corresponding returning field showing which value to be updated/taken back from BADI.
Rgds,
Naveen -
N:1 Mapping Possible using Java Mapping?
All,
Is it possible to do a N:1 mapping using Java Mapping?
If yes , how?
Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?
Regards,
BhaveshHi @ll;
i try the same.
to conduct a java mapping with 2 input structures that fills one target structure.
This mapping is part of a Integrationprocess.
I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.
At runtime this structure looks like this (different prefix)
<?xml version="1.0" encoding="UTF-8"?>
<sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
<sxi:Message1>
<YOURXML1>...</YOURXML1>
</sxi:Message1>
<sxi:Message2>
<YOURXML2>...</YOURXML2>
</sxi:Message2>
</sxi:Messages>
As I put it in the Integrationprocess unfortunately a strange error arises.
The trace Workflow-Protocoll shows following error.
<Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
<Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
<Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>
I can't make head nor tail of it.
what´s the mistake?
can anybody please help me?
Thanks in advance
Kind regards -
Is it a good idea to use BRE for Message transformation instead of using Maps?
We are thinking about a scenario of constructing multiple versions of hl7 messages from a source schema. We thought of constructing BRE vocabulary for both source schema and HL7 2.6 schema and then use policy per version with bunch of rules for
transforming the source schema to hl7 schema. We think this will provide more maintainability to tackle future changes but in other way this seems a over kill. Any suggestions or opinions would be highly appreciated. Thanks youIf you are using BizTalk 2010 and above, you can think of using BRE pipeline framework.
Pls read the description below and see if this fits into your requirement.
https://brepipelineframework.codeplex.com/
http://adventuresinsidethemessagebox.wordpress.com/2014/08/16/using-the-bre-pipeline-framework-to-execute-maps-dynamically/
Alternatively, refer:
https://social.msdn.microsoft.com/Forums/en-US/043527f4-cb1f-47b2-ab82-e412c149b9b3/dynamic-mapping-in-biztalk-using-bre?forum=biztalkgeneral
Rachit -
How can I go back to google maps instead of apple maps?
Apple maps are very very very bad. Is it possible to go back to google maps. I come from Spain and maps doesn't work. Always finds what you are not looking for and what you want does not exist in 75% of searches. You find places and apple maps is not able to give a route. Says that no route available and that's all
The app that comes with the operating system is a disaster.
Any way to go back to google maps???Download the Google Maps app from the App Store.
-
Return Delivery Goods Receipt amount takes current MAP instead of old MAP
Hi,
I'm facing a problem in the following scenario:
1. Sales order is created
2. Delivery is created
3. Goods Issue for the Delivery is posted (cost of goods sold = current moving average price of material = 100 SEK)
4. Invoice is created
Event: Moving average price of material is increased with 100 % (Moving average price changed from 100 SEK to 200 SEK)
Event: Customer returns the order for some reason
5. Return order is created with reference to the invoice in step 4 (same amount the invoice)
6. Return delivery is created
7. Credit note is created (same amount as the invoice)
8. Goods Receipt for the Returns delivery is posted (cost of goods sold = current moving average price of material = 200 SEK)
Result: The financial bookings after the Goods Receipt will use the new moving average price and the stock value will increase with 200 SEK, even though the initial stock deduction was only 100 SEK to delivery the material to the customer.
Problem: We have now created 100 SEK worth of stock --> This is not allowed
Question: How can I manipulate the goods receipt amount to use the old moving average price of 100 SEK instead of 200 SEK?
Thanks for your suggestions!
Edited by: Berglund Teodor on Jun 1, 2010 4:17 PMHi Teodor!
I have to solve the same problem. Could you give me some more information about tha way you used this badi?
Thank you .
Florina -
Java Mapping (not UDF) and Adapter-Specific Message Attributes
Hello everybody,
is it possible to create an Adapter-Specific Message Attributes in a java Mapping?
I found in the SAP Help that the API com.sap.aii.mapping.api.DynamicConfiguration allows only to read, change or delete the attributes.
best regards.
Adnane ElgouteHi,
try the follwoing code
import com.sap.aii.mapping.api.*;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
public class JavaProgram
implements StreamTransformation
public JavaProgram()
public void setParameter(Map map)
param = map;
if(param == null)
param = new HashMap();
public void execute(InputStream inputstream, OutputStream outputstream)
try
DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String s = dynamicconfiguration.get(dynamicconfigurationkey);
//Your logic
catch(Throwable throwable)
throwable.printStackTrace();
private Map param; -
How to set adapter specific message attributes on Pi 7.1 inside a Java map.
Hello,
how can I set adapter specific message attributes in a Java mapping on PI 7.1.? The TransformationInput grants access to the DynamicConfiguration but the TransformationOutput doesn't. I have found threads refering to the old way of implementing Java mappings (e.g. Get dynamic filename in a Java Mapping (NOT UDF)). But there doesn't seem to be one refering to the actual PI.
Kind regards,
HeikoUsing DynamicConfiguration from the TransformationInput works.
-
Hello -
I have a java mapping and a message mapping implemented in one interface.
Java mapping basically adds a header and does nothing else.
Message mapping has all the mapping. Its not complex but straight.
I have the Message mapping first and then the Java mapping in the Interface Mapping.
what happens is i could see the headers written through Java mapping in my output xml file which is good but i cannot view the message mapping output in the file.
Any ideas.
Thanks,
TirumalHi
I am generating the headers in the java mapping using this:
public void startDocument ()
throws SAXException {
write("<?xml version='1.0' encoding='UTF-8'?>");
write("<!DOCTYPE cXML SYSTEM 'http://xml.cxml.org/schemas/cXML/1.1.008/cXML.dtd'>");
Maintain Order at Runtime is checked in the Interface Determination.
Ok, in the interface Mapping Editor i get 2 messages:
1.
11:09:48 Start of test
Call method execute of the application Java mapping com.sap.xi.tf._Orders_MM_
Java mapping com/sap/xi/tf/_Orders_MM_ completed. (execute() of com.sap.xi.tf._Orders_MM_
Call method execute of the application Java mapping com.sap.aii.mapping.api.SampleWithSaxParser
Java mapping com/sap/aii/mapping/api/SampleWithSaxParser completed. (execute() of com.sap.aii.mapping.api.SampleWithSaxParser
Executed successfully
11:09:48 End of test
2. XML not well formed
None of the above messages seem to be of Message Mapping don't know why its not getting written in the output.
Thanks,
Tirumal -
Java Mapping of Adapter-Specific Message Attributes
Hi!
I've got a problem with the help.sap.com-example for the above mentioned task:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
FileName);
String valueOld = conf.get(key);
if (valueOld != null) {
String valueNew = valueOld.replaceAll(input,output);
conf.put(key, valueNew);
The Container-class I have doesn't offer the method getTransformationParameters(). Additionally, the method get() from class DynamicConfiguration doesn't accept a DynamicConfigurationKey-object. Finally: how do I instantiate the Container-object (I think it's stored in the Parameter-Map, but what's its name?).
Thanks!
BR
ChristianHi Christian,
Pls see these sap help links on the Java mapping.
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
As you would see in the example shown in the link...you donot require a container object in case of java mapping(that is required when you are using the user defined functions)...
here you can call the get() method from the map in the java mapping class....this map is set by the mapping runtime by calling the setParameter() method in your java mapping class.
Thanks,
Renjith -
Java Mapping, XSLT Mapping, ABAP Mapping
Hi Experts,
Could any one explain what is the main features of the following Mapping. How to pick the mapping?
Java Mapping - When to use and what is the advantage.
ABAP Mapping - When to use and what is the advantage.
XSLT Mapping - When to use and what is the advantage.
Graphical Mapping - When to use and what is the advantage.
cheers,
SuneeThere are 4 types of mapping in XI
1. Graphical Mapping
2. XSLT Mapping
3. JAVA Mapping
4. ABAP Mapping
When to use Message mapping
1 When the logic for your mapping is simple and straight forward, you can use
Advantages of message mapping
1)Easy to use.
2) has GUI drag and drop.
3) used for simple mapping cases
4) it does not involve any complex logic
Disadvantages of message mapping
1)has limitation in terms of complex hierarchy
When to use Java mapping
1) Java mapping are used when graphical mapping cannot help you.
Advantages of Java Mapping
1)you can use Java APIs and Classes in it.
2) file look up or a DB lookup is possible
3) DOM is easier to use with lots of classes to help you create nodes and elements.
Disadvantages of Java mapping
1)SAX parser is not easy to develop
2)DOM parser is intensive
3) Java knowledge is required
4) bit complexer
XSLT Mapping - When to use
1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
3)When data is to be filtered based on certain fields (considering File as source)
4)When data is to be sorted based on certain field (considering File as source)
5)When data is to be grouped based on certain field (considering File as source)
Advantages of using XSLT mapping
1)XSLT program itself defines its own target structure.
2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
4)File content conversion at receiver side can be avoided in case of text or html output.
5)Multiple occurrences of node within tree (source XML) can be handled easily.
6)XSLT can be used in combination with graphical mapping.
7)Multi-mapping is also possible using xslt.
8)XSLT can be used with ABAP and JAVA Extensions
Disadvantages of using XSLT mapping
1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
2)Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
3)XSLT mapping requires more memory than mapping classes generated in Java.
4)XSLT program become lengthier as source structure fields grows in numbers.
5)XSLT program sometimes become complex to meet desired functionality.
6)Some XSL functions are dependent on version of browser.
Advantages of Abap Mapping
1) A person comfortable with OOABAP can go for ABAP mapping instead.
Disadvantages of Abap Mapping
1) Abap knowledge is required
2) bit compexer
For further info on each of the mapping, refer to these links,
Graphical Mapping,
http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
XSLT Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
http://www.w3.org/TR/xslt20/
Java Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
DOM parser API
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Check this blog on Mapping:
/people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
Also, check this thread for more info,
Different types of Mapping in XI
Maybe you are looking for
-
I can no longer print to the 3 Canon printers on my local area network. The print dialog box states that the print file is accepted and the job is printing, but the files never print. Everything worked when the computer and printers were initially se
-
Problem with serial number with crossgrade
We are upgrading FCP 4.5 with crossgrade, but the old serial is not working. My understanding is that if you are upgrading from FCP 4.5, then you also need a new serial number. That we didn't get. Am I correct or did someone crossgrade from FCP 4.5 w
-
Can I set clip durations in iMovie 10.0.7 for Yosemite?
In earlier versions of iMovie I was able to go to preferences and display the clip durations as described in this link below. I could also see the approximate position of the entire video while it is playing. iMovie '11: Display the precise duration
-
The new update "broke" my Apple TV
Most of files are WAV files. I am experiencing an excessive lag time (more than 30 seconds) when navigating the Apple TV menus. The lag time seems much less when I select an iTunes - purchased AAC file. Anyone else having this problem?
-
I need 3 or 4 blank pages which I can add to at random - How, please ?
Hello, I have my home page on FF but I need several extra pages. I didn't realise that it could be difficult. I've used FF on my old PC for 2/3 years but I've added a few years and a new PC and I'm now 78yrs so please excuse the fuss !! Why would it