cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to JDBC synchronous

Former Member
0 Kudos

Hello All,

I am pushing some data to oracle using XML INSERT , in the response i get INSERT_COUNT.

the payload shows the INSERT_COUNT or the RFC response mapped field as the number of records inserted.

I have some code in the same RFC to execute if the count is greater than 0, but this code never triggers, or am i missing something?

Any help is appreciated.

Regards,

Kinshuk

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi kinshuk,

Just check , if you are sending Record Count back to RFC.

Test the RFC in debug mode by manually entering the record count.

ALso, test the steps manually,

1)JDBC to RFC mapping.

2)CC monitoring of RFC.

Former Member
0 Kudos

Hi Santosh,

JDBC to RFC mapping is fine, please check the payload in above message.

CC monitoring of RFC, i see that Processing started but there is no end message (successful), where could the problem be?

Regards,

Kinshuk

Former Member
0 Kudos

in reponse you must have map your JDBC reponse to RFC response field..then check in where you are getting that value in export parameter.. I mean your RFC response field..

if as you mentioed that your response is working fine then you should get that in your RFC response field..

Thanks,

Bhupesh

Former Member
0 Kudos

Hi Bhupesh,

I updated the export field of RFC with count mapping from JDBC.

here is the payload

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:Z_TEST_STAGE_1.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
  <COUNT>1</COUNT> 
- <IT_COUNT>
- <item>
  <UPDATE_COUNT>1</UPDATE_COUNT> 
  </item>
  </IT_COUNT>
  <IT_HR_STAGE /> 
  </ns1:Z_TEST_STAGE_1.Response>

The COUNT is the RFC exporting parameter, but when control comes back from RFC, the count is Zero. even the tables parameter IT_COUNT has no entry but the payload shows otherwise.

Thanks for looking.

Regards,

Kinshuk

Former Member
0 Kudos

make sure that RFC metadata is right..

I mean if you have change anything you can reimport it in PI and use it.. this should not be the problem .. but just check once..

other than that if you are able to see this response in response payload after response mapping.. then you should get this in RFC when it comes back to R/3..

get response payload and test it in response mapping and see if it is working fine and as expected..

Thanks,

Bhupesh..

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

The RFC won't get executed because you are mapping it in an exporting parameter. There are two things you can do:

1.) You can instead use a synch ABAP proxy and then pass the RFC output to the proxy request message and then pass the JDBC Response to your proxy response message type and use ABAP to call the RFC.

2.) You can use RFC Accessor to execute the function module from your response message mapping.

/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

The cleanest would be approach 1.

Hope this helps,

Mark

martin_dejl2
Participant
0 Kudos

Hi Kinshuk,

As you said: "The COUNT is the RFC exporting parameter, but when control comes back from RFC, the count is Zero. even the tables parameter IT_COUNT has no entry but the payload shows otherwise."

From my experiance this means, that RFC Adapter metadata is not updated. Try to deactivate your RFC Communication Channel and then again activate it. You should do this always when you change the RFC interface(parameter lenght, type or name).

Martin

Former Member
0 Kudos

Thanks Mark,

I will try the approach as suggested by you. .

Former Member
0 Kudos

Excellent! It did the trick for me.

Thanks Martin, Full points to you.

Answers (1)

Answers (1)

martin_dejl2
Participant
0 Kudos

Hi,

If I understand, you are sending data to PI by calling RFC righ? Then you cannot have the code right in the RFC but you have to call the RFC from some another ABAP code. Then the result will be in "IMPORTING" parameters of your "CALL FUNCTION" statement for that RFC. After that CALL you can decide what to do with response data.

Cheers

Martin

Former Member
0 Kudos

Hi Martin,

Yes i have a program which calls the RFC with all entries to insert in oracle in tables parameter.

The transfer goes fine, during response, the JDBC returns INSERT_COUNT which i mapped to another table parameter of the same RFC.

My question was, is this the right way, because even though the same RFC is mapped in response, and i assume the COUNT table structure with one field INSERT_COUNT is GT 0 and still the code inside the RFC during response never triggers.

here is th payload of response

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:Z_TEST_STAGE_1.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
- <IT_COUNT>
- <item>
  <UPDATE_COUNT>1</UPDATE_COUNT> 
  </item>
  </IT_COUNT>
  </ns1:Z_TEST_STAGE_1.Response>

I also tried to put the response parameter in IMPORTING parameter of RFC but it never shows that parameter in response mapping.

Regards,

Kinshuk