on 06-30-2008 10:48 AM
Hi there,
i am working on a multiple adapters scenario and would like to get some help from you experts.
I will try to explain the requirements of it:
1) An external system will send a request to XI (in order to "start" the process) --> SOAP adapter (sender/request)
2) XI will communicate with SAP and retrieve a table from there --> sRFC adapter (receiver)
3) XI will update a table (Oracle DB) of the source system (the external one from step1) --> JDBC adapter (??)
i have been involved in scenarios with SOAP adapter and JDBC separately but not all together.Thus i dont know how to elaborate the third step.In addition i would prefer avoiding the use of BPM if possible.
Questions:
a) What is the best practise here?
b) I am not using WS.response so i dont know how to retrieve back the data to the sorce (that is the target system at the same time) by using the JDBC (cause i need to update a table).
Could you please help me on this?
Thanks in advance and best regards,
David
To avoid BPM you will have to do the following
1. SOAP request comes to XI
2.Do a three step mapping,
i. Map the req to RFC req structure.
ii. Use java mapping and in that perform a lookup of the RFC table .
iii. you will get the responseRFC structure map it to jdbc structure to write.
3. call the jdbc adapter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
What do you mean with RFC lookup? I have done like this:
Create one DT for sender WS message: DT_sender (lets say)
Create one DT for receiver JDBC message: DT_receiver
Create MT for DT_sender: MT_Sender
Create MT for DT_receiver: MT_Receiver
Create MI (asynch) for the MT_Sender: MI_Sender
Create MI (synch) for the Z_RFC (request & response)
Create a MM to map MT_Sender with Z_RFC.Request
Create a MM to map Z_RFC.Response to MT_Receiver
Create 2 IM for the previous 2 MMs
So right now, i have to ellaborate on the JDBC receiver channel and its possible interfaces. could you please guide me through?
Thanks again and best regards,
David
David,
If I understand what you are asking properly and that is a big IF :-).
Then aside from doing what the guys above have suggested which is to only use the RFC as a mapping in the lookup but actually have a scenario which is:
SOAP --> PI --> JDBC
You would have to go for a BPM approach.
Neither of the above scenarios are very difficult. BPM is standard and if you want some info on how to perform an RFC lookup from within a UDF I have personally written a near idot proff step by step guide last year that would show you this...
Let me know your email and I'll send it to you if you decide to go this way. Believe me it really isnt to difficult.
**********
Please read the Forum's Rules of Engagement,
i.e.,
[/thread/117188 [original link is broken];
and refrain from using email correspondence as the main objective of the Forums is to share knowledge.
SDN PI/XI Forum Moderator
Hi Alex,
My scenario is sthg like: SOAP --> PI <-> RFC and once the data is in PI, it is sent to a DB using JDBC.
SOAP: sender CC used to start the process (by using it, PI starts the process)
sRFC: receiver CC used to retrieve data from SAP
JDBC: receiver? CC used to send this data to a table in an Oracle DB.
I know how to perform the first two steps but i am feeling confused about how to go through the third one....
i could try to ellaborate by using BPM (i am not familiar with it, though) but first of all i would like to know if this could be done without using it as we want to try to maximize the performance...
at first, i thought it wouldnt be necessary as we dont have to wait for some steps, the whole process can be done in sequence but right now, i am not sure.
could you please, give some guidelines?
Thanks in advance and best regards,
David
Hi there,
sRFC: receiver CC used to retrieve data from SAP
after u trigger the interface from SOAP u saying RFC as reciever at the same time retrieve could you tell me how u going to achive this.
JDBC: receiver? CC used to send this data to a table in an Oracle DB.
as above posts suggested..
if u want to retrieve data from R3 and updated JDBC..u have to use RFC lookup....either through BPM or some java mapping.
Regards
Rao
Hi,
Yes, i have already done scenarios in which i have used SOAP <->PI <-> RFC and the RFC retreives data. Just importing an RFC in IR (this RFC has import and export parameters) and mapping to the WS.response the contents were sent properly to the sender synchronously!!
Thus, i thought i could do the same by mapping to a JDBC adapter, but i dont know how to achieve this.
could you please tell me how to do that using java mapping ( can i use graphical mapping?)
thanks
david
Hi David,
OK I'll try to explain.
Any scanerio in PI without BPM is Sender --> PI --> Receiver
You cannot go Sender ---> PI --> Receiver --> another receiver
But the work around (hack) that people are suggesting is to do a
SOAP -->. PI --> JDBC
Notice that there is no RFC above. This because to achieve what you want without BPM you need to implement the RFC call from within a Mapping. Can be done in a Graphical Mapping with a UDF.
It is really quite a simple sceanrio.
Do you want me to send you a how to guide I wrote on how to perform RFC Mapping lookups from within a UDF?
ok u used for Synchronous interface.
in this case u r interface is like this SOAPPIJDBC..
u trigger the interface through SOAP adapter.
when data comes into XI with the help of BPM ( RFC suncronous) u fetch data from the SAP system..
or
In java mapping u call the RFC to fetch data from SAP and map this data to target structure after that with the help of JDBC adapter it updates in DB.
Hope u clear.
Regards
Rao
Ok guys, finally i got you!!!
So, if i am right you mean that there is no need to use the RFC adapter as its results can be obtained directly from Message Mapping (with UDF or whatever).
Alex,
please, send the documentation to me, if possible! "david.miguel @ ciber.com"
i will try to implement it.
**********
Please read the Forum's Rules of Engagement,
i.e.,
[/thread/117188 [original link is broken];
and refrain from using email correspondence as the main objective of the Forums is to share knowledge.
SDN PI/XI Forum Moderator
Hi Deivid,
Basically you have to import the RFC in the IR to be able to use the request / response structures, create a CC for the RFC and use this CC into a UDF in the mapping to get the values from the table. Please take a look to these blogs of the greats Michal and Bhavesh:
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439]
[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5001] [original link is broken] [original link is broken] [original link is broken];
Best Regards,
Paco
Hi,
Here is a sample code for RFC lookup
package com.ibis.mapping.lookup.websiteorders;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.MappingTrace;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.lookup.Channel;
import com.sap.aii.mapping.lookup.LookupException;
import com.sap.aii.mapping.lookup.LookupService;
import com.sap.aii.mapping.lookup.Payload;
import com.sap.aii.mapping.lookup.RfcAccessor;
import com.sap.aii.mapping.lookup.XmlPayload;
public class RFCLookup implements StreamTransformation
{
public Map param = null;
public static void main(String[] args)
{
try
{
InputStream in = new FileInputStream(new File(
"TestFile.xml"));
OutputStream out = new FileOutputStream(
new File(
"Test.xml"));
System.out.println("Hello");
RFCLookup rfcLookup = new RFCLookup();
rfcLookup.execute(in, out);
}
catch (Exception e)
{
System.out.println("ERROR IS :" + e.getMessage());
}
}
public void execute(InputStream inputStream, OutputStream outputStream)
throws StreamTransformationException
{
MappingTrace importanttrace;
importanttrace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
RfcAccessor accessor = null;
try
{
// 1. Determine a channel (Business system, Communication channel)
Channel channel = LookupService.getChannel("BS_name", "Comm_channel_name");
// 2. Get a RFC accessor for a channel.
accessor = LookupService.getRfcAccessor(channel);
importanttrace.addInfo("Accessor Looked up.");
// 4. Create xml payload from the inputStream
XmlPayload payload = LookupService.getXmlPayload(inputStream);
importanttrace.addInfo("Input stream payload fetched");
// 5. Execute lookup.
Payload result = accessor.call(payload);
importanttrace.addInfo("Called the RFC");
// 6. Get the lookup response in new InputStream
InputStream in = result.getContent();
importanttrace.addInfo("got output");
// 7. Transfer the inputstream into outputstream
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer))
{
outputStream.write(buffer, 0, read);
outputStream.write('\n');
}
outputStream.flush();
}
catch (LookupException e)
{
importanttrace.addWarning("Error while lookup " + e.getMessage());
}
catch (IOException e)
{
importanttrace.addWarning("Error " + e.getMessage() );
}
finally
{
// 8. close the accessor in order to free resources.
if (accessor != null)
{
try
{
accessor.close();
}
catch (LookupException e)
{
importanttrace.addWarning("Error while closing accessor " + e.getMessage() );
}
}
}
}
public void setParameter(Map param)
{
this.param = param;
if (param == null)
{
this.param = new HashMap();
}
}
}
This code works and all you need is the source RFC interface and target RFC interface.
compile this code and import it as java mapping in interface mapping..
now specify some RFC request in the test tab of interface mapping. the o/p will be response from RFC
Dont forget to modify the name of ur comm channel and business system in the code
Channel channel = LookupService.getChannel("BS_name", "Comm_channel_name");
Edited by: Progirl Progirl on Jul 21, 2008 4:25 PM
Hi,
I will explain your scenario like this :-- >
1) Some data will come to XI using SOAP
2) Data will be sent through RFC receiver
3) RFC will provide some data from the SAP system and pass back to XI.
4) Once data is received by XI it should update the database using JDBC.
Please correct if i am wrong in understanding the problem.
You can proceed like this :
1) Map SOAP message to RFC.
2) Use java mapping and use RFC lookup for passing and receiving data to RFC Channel.
3) Map response received from RFC lookup to JDBC receiver statement stucture.
4) Pass it to JDBC receiver.
Kulwinder
Reward if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.