cancel
Showing results for 
Search instead for 
Did you mean: 

RFC & JDBC Scenario question

Former Member
0 Kudos

Hi all,

We are trying a scenario SAP (sender rfc )->XI->DB (receiver JDBC) with out BPM.

Is this a valid scenario?

If any of you tried this scenario can you send us the configuration example.

Thanks for the help.

Accepted Solutions (0)

Answers (4)

Answers (4)

michael_spindler
Participant
0 Kudos

Hi Dhiraj,

we are facing a similar problem and I wonder how you would get the parameter for the rfc and how to invoke the rfc call. Do you have any idea for that?

Former Member
0 Kudos

Could U plz explain better?

In this scenario there is a "call" from SAP to XI using the RFC/BAPI Adapter.

From SAP point of view, in your program you "call" a function as usual, but the function is not executed in SAP: instead, the execution is carried on in XI where you get the Input Fields of the function. At the end of the execution in XI you return to SAP the Output fields of the function.

When you import in XI your BAPI definition you get also 2 message type: <BAPI_NAME> for the input message and <BAPI_NAME>_response for the Output message.

HTH, let me know if you need more detail

michael_spindler
Participant
0 Kudos

o.k. maybe I have misunderstood the scenario.

In our case we would call a rfc with some parameter like customerno from XI to SAP R3 4.6c and get as result some materials, descriptions and prices. This result should be written via the jdbc Adapter in a SQL-DB. The rfc should be called certain times for different input parameters on a specific time. For this I have to configure a RFC-Sender Adapter and a jdbc Receiver Adapter or? But what´s with the different parameters and how can I invoke the rfc on a scheduled time?

Regards

Michael

Former Member
0 Kudos

1) You must define two RECEIVER channels for both JDBC and RFC communication. Keep in mind that the "direction" of the adapter is always from the point of view of the system talking with XI (that is: SAP "receives" the call from XI, and so does the DB server)

2) You cannot schedule time-based action on XI. The simplest way to accomplish what you want is to schedule a job in SAP that "triggers" the XI execution flow using an empty BAPI (in this case you'll need a SENDER channel because SAP "sends" the call to XI)

3)Once you have your RFC function, you import the definition in XI and you have available for mapping the Input and Output structures

HTH

michael_spindler
Participant
0 Kudos

Thanks Alessandro,

now it is more clear to me.

Former Member
0 Kudos

Hi Alessandro,

We have a scenario, where data needs to passed from SAP->XI->MS-SQL using JDBC adapter. Here the requirement is, we need to schedule a job in XI that needs to trigger RFC adapter, to pick data from SAP which is finally passed to MS-SQL Server using mapping program created in IR.

Can U Please explain in detail how can we schedule a job in XI to trigger RFC adapter which picks up the data from SAP.

Thanks in advance..

Sumanth.

Former Member
0 Kudos

1) define a RFC function with the INPUT Parameters that you want to pass to XI. If you need also a response from XI you need to define this parameters as OUTPUT for the RFC

2) In your main program you call the RFC function as remote using the destination XI (see how to configure RFC channels weblogs). In the call you pass the input params and receive the output params after XI finish the process

3) Schedule the program with the desired frequency

4) In XI, import the RFC definition and build your scenario

HTH

Former Member
0 Kudos

Hi Alessandro,

I'm doing the same scenario but the response of the RFC function is comming blank.

SAP <> (RFC)XI(JDBC)<> DB

i made all the structures that the help.sap.com define for Stored Procedured and the 2 mapping.

but still with return on blank.

any idea?

thanks

Former Member
0 Kudos

Maybe you should give some more info:

- are you sure that your message arrive on the DB?

- DOes the operation is OK on the DB?

- Have you checked on the mdt tool if the messages are exchanged correctly between the adapters?

- Does the mapping of the response work?

Former Member
0 Kudos

- are you sure that your message arrive on the DB?ç

yes

- DOes the operation is OK on the DB?

yes

- Have you checked on the mdt tool if the messages are exchanged correctly between the adapters?

yes

- Does the mapping of the response work?

if i make an wrong mapping to get the response on the monitoring i see it,then i put that structure of the response on the mapping source and the value of the export variable of the rfc function still blank.

Former Member
0 Kudos

1) You should set the LOGGING_SYNCH parameter to log also the synchronous messages also when not in error

2) just to be sure: the RFC interface is correctly defined with Input and output parameters? Which parameters are present on the response structure?

3) Anyway, if you see the transaction end on the R/3 side, definetly you got a RFC response from XI, otherwise you got a timeout error.

So i would look better within the mapping structure: please double check the namespace of the data returned by the Stored procedure and the Namespace expected in the response mapping. Do they match or not?

Former Member
0 Kudos

1) ok, i'll look that

2)

RFC FUNCTION

FUNCTION ZSAP_XI_BPCS_CONSULTAR_LOTE.

*"----


""Interfase local

*" EXPORTING

*" VALUE(TI_RESULT) LIKE ZTSAPXI STRUCTURE ZTSAPXI

*" TABLES

*" TI_DATOS STRUCTURE ZTSAPXI

*" EXCEPTIONS

*" CONECTION_ERROR

*"----


ENDFUNCTION.

3)

SOURCE SCHEMA

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema targetNamespace="http://gsk.com/xi/DemoRFCToJDBC"

xmlns="http://gsk.com/xi/DemoRFCToJDBC"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="empleados_sp_MT_response"

type="empleados_sp_MT_response" /><xsd:complexType

name="empleados_sp_MT_response"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">54682670521a11da9345000bdb8f8963</xsd:appinfo></xsd:annotation><xsd:sequence><xsd:element

name="stored_procedure_response"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">19e435f04ff111da8e0bc482a6476d0b</xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element

name="response_1"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">19e435f14ff111da8da3c482a6476d0b</xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element

name="row"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">19e435f24ff111da9af0c482a6476d0b</xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element

name="PRODUCTO" type="xsd:string"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">19e435f34ff111dacd9cc482a6476d0b</xsd:appinfo></xsd:annotation></xsd:element><xsd:element

name="LOTE" type="xsd:string"><xsd:annotation><xsd:appinfo

source="http://sap.com/xi/TextID">37a0e6d0521a11da9600f40da6476d0b</xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:schema>

TARGET SCHEMA

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions"

xmlns="urn:sap-com:document:sap:rfc:functions"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element

name="ZSAP_XI_BPCS_CONSULTAR_LOTE.Response"><xsd:complexType><xsd:all><xsd:element

name="TI_RESULT" type="ZTSAPXI" minOccurs="0"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element

name="TI_DATOS"><xsd:complexType><xsd:sequence><xsd:element name="item" type="ZTSAPXI"

minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"

/></xsd:sequence></xsd:complexType></xsd:element></xsd:all></xsd:complexType></xsd:element><xsd:complexType

name="ZTSAPXI"><xsd:sequence><xsd:element name="PRODUCTO"

minOccurs="0"><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength

value="18" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="LOTE"

minOccurs="0"><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength

value="10"

/></xsd:restriction></xsd:simpleType></xsd:element></xsd:sequence></xsd:complexType></xsd:schema>

Former Member
0 Kudos

Alessandro,

i have this situation,

i get the response of the DB and i made a mapping interface with the RFC. Response, when i get the response on the R/3 is empty, but if i change the mapping interface and insted of the response-value of the DB i set a text-constant i get the value.

any idea?

thanks

Former Member
0 Kudos

I understand your problem.

What i think is that in the xml stream of the response there is some incoungrence (namespace, name of the structure...) with what you have declared in your mapping.

1) in the MDT tool, look at the response data

2) cut and paste the response data and use the mapping test tool to check

3) Double check for any incongruence with the declared message

Hope this helps

Former Member
0 Kudos

1) on the MDT tool says "content delete to save memory" but on the sxmb_moni i see it, i guess that is the same right?

this are my structures, looks like the same,the only difference that i can see is on the Test desing have <ns0:em... and on the Source Monitoring have <ns1:em.. but thats generating automaticly.

source Test Desing

<?xml version="1.0" encoding="UTF-8"?>

<ns0:empleados_sp_MT_response xmlns:ns0="http://gsk.com/xi/DemoRFCToJDBC">

<stored_procedure_response>

<response_1>

<row>

<CANTIDAD>1</CANTIDAD>

<MUNEG>1</MUNEG>

<RETURNCODE>1</RETURNCODE>

<RNEG>1</RNEG>

</row>

</response_1>

</stored_procedure_response>

</ns0:empleados_sp_MT_response>

Source Monitoring

<?xml version="1.0" encoding="utf-8" ?>

<ns1:empleados_sp_MT_response xmlns:ns1="http://gsk.com/xi/DemoFileToJDBC">

<stored_procedure_response>

<response_1>

<row>

<CANTIDAD>0</CANTIDAD>

<MUNEG>0</MUNEG>

<RETURNCODE>0</RETURNCODE>

<RNEG>0</RNEG>

</row>

</response_1>

</stored_procedure_response>

</ns1:empleados_sp_MT_response>

RFC Target

<?xml version="1.0" encoding="UTF-8"?>

<ns1:ZQM_BPCS_CANTIDAD_DEV.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<CANTIDAD>1</CANTIDAD>

<MUNEG>1</MUNEG>

<RETURNCODE>1</RETURNCODE>

<RNEG>1</RNEG>

<TI_DATOS></TI_DATOS>

<TI_ERRORES></TI_ERRORES>

<TI_HEADER></TI_HEADER>

</ns1:ZQM_BPCS_CANTIDAD_DEV.Response>

thank yo for your time,

Former Member
0 Kudos

I Have it:

The namespace is different!

1) http://gsk.com/xi/DemoFileToJDBC

2) http://gsk.com/xi/DemoRFCToJDBC

The mapping program cannot recognize the structure. You should align all the namespaces.

Former Member
0 Kudos

Thank you very much it was that, i don't know why, but i clear every thing and then i do every thing again and works!

now i have the circuit completed RFC to JDBC sync.

thanks

Former Member
0 Kudos

hi

can some one explain me how to jdbc -- rfc

i configured all the required steps but i didn't see any message in monitoring.

thanks sri

Former Member
0 Kudos

Do you configure everything on the TCODE sxmb_adm?

Former Member
0 Kudos

hi Lionel

could you please tell me what steps to do in sxmb_adm

this is urgent iam doing since 2 days.

thanks

sri

Former Member
0 Kudos

you must add the values on the option Integration Engine Configuration

1)Category : RUNTIME

2)Press F9

3)add this 4 values

a.Cat : Runtime, Parameters: Engine_Type, CV : HUB

b.Cat : Runtime, Parameters: IS_URL ,CV :

c.Cat : Runtime, Parameters: LOGGING_SYNC, CV : 1

d.Cat : Runtime, Parameters: Trace_Level, CV : 3

this will be generate all kind of information on your monitoring TCODE sxmb_moni when you make an action.

tell me if this help you

Lionel

Former Member
0 Kudos

Hi Lionel,

thanks for the info actually iam doing jdbc --> Rfc sync/

the problem occurs when data is posting to database. everything is correct.

exception caught by adapter framework:database error accessing key table

thanks

sri

Former Member
0 Kudos

sri,

please send me the xml request and response, it's look like you are missing the field key to make the correct SQL statement.

did you try the SQL stmt on the Query Analayzer?

send me the SQL stmt.

see this

http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm

Former Member
0 Kudos

Lionel,

iam using RM_RS_UPLOAD. there are 4 records coming from SQL mapped to FM. the process shows it was processed successfully, but nothing posting in sap viceversa.

actually i took the data from sql used test mapping iam getting the output only the four RFC table no item data. i feel some thing wrong with the mapping.

thaks

sri

Former Member
0 Kudos

sri,

please send me the xml structure and the SQL statement.

thanks

lionel

Former Member
0 Kudos

Message was edited by: sri rao

Message was edited by: sri rao

Former Member
0 Kudos

i dont know your scenario, but the update statement it should be use to update rows after you send the data to XI.

Former Member
0 Kudos

is the above data is enough, structure is same as sql statement

Former Member
0 Kudos

send me the header of your rfc function, how you define it?

is remote call enabled?

Former Member
0 Kudos

its the standard RFC function module. I dont know that, how to enable the remore call?

mappind to sbbde table

thanks

sri

Message was edited by: sri rao

Former Member
0 Kudos

Lionel,

could u pls give me the possible solutions.

why message mapping is not generating the target fields?

its simple one 2 one mapping

resultset

--row

--row

resultset

row mapped to item under I_SBBDE

I_SBBDE mapped to constant

thanks in advance

sri

Former Member
0 Kudos

thera are to many reasons, the most common is because the structures of the xml are not the same us the SQL or the RFC are waiting.

Did you see something on the sxmb_moni now?

Former Member
0 Kudos

thanks Lionel,

my project manager helped me solving this. i did document name incorrectly. everything is running fine.

thanks for your help.

sri

Former Member
0 Kudos

Hi all,

Thanks for the quick reply in validating the scenario.

Siva .. yes this is a synchronous scenario, we are querying database to get the values.

Sudhir thanks for the RFC link, we already configured the JDBC and RFC channels.

So far we created the following config objects

two messeage interfaces

EPQPRGM_RFC_MI - out bound Synch

EPQPRGM_JDBC_MI – inbound Synch

two msg mappings

RFC - -> JDBC

JDBC - - > RFC

Two interface mappings

RFC -- mapping – JDBC key

JDBC – mapping – RFC response

Two communication channels

RFC – Sender

JDBC- Reciver

Reciver determination and sender determination -- is one reciver and sendr det is enough?

plz suggest whether these objects are enough?

Thanks

Former Member
0 Kudos

Hi,

<b>>>We are trying a scenario SAP (sender rfc )->XI->DB >>receiver JDBC) with out BPM.

>>Is this a valid scenario?</b>

YES. This is a valid Scenario.

I also like to know if this is a synchronous scenario...?

Will DB return somedata back to the calling RFC..?

In such a case u require synchorus DB interface to do this. ( Mapping b/n Synchronous Interfaces will be involved).

Hope this helps

Cheers,

Siva Maranani.

Former Member
0 Kudos

Why not. Using BPM or not depends on requirements and for the simple interfaces it is better not to use BPM. This is because BPM has performance issues with large data volumes.

regards

SKM