cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to JDBC scenario

Former Member
0 Kudos

Hi friends,

I have created a RFC to JDBC scenario. I m trying to insert to 2 different tables in the reciever system. I have a RFC with 2 internal tables. I first tried it as a async scenario,but that did not work, and then as a sync scenario and even that is not working. Can anyone please help me with the design of this.

Thanks in advance.

Anjana.

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

You dont need to change the flow from Async to Sync.....just make sure that you have created the JDBC receiver structure as is mentioned in the link given by Michal.....in your case you will have two different StatementName nodes (since you are inserting into two different tables)...with action as Insert....the name of the nodes and action are case-sensitive.

Regards,

Abhishek.

Former Member
0 Kudos

My scenario is working as a perfect sync scenario now. I m able to insert into 2 tables, and get the number of entries inserted as the response. But, now the issue is if i run the program from R/3 with just 1 internal table, it is giving me an error,like it is expecting both tables to be inserted at the same time. Is there a way in mapping I can fix this?

In the java stack i m getting error like this.

FATAL ERROR document format in structure 'INSERT_PERSON': expected 'access' tag(s) not found

But I have given maping to access tag for both tables. This error comes only when 1 internal table is empty.

Please help.

Thanks for the suggestions.

Anjana.

Former Member
0 Kudos

Hi Anjana,

Change the occurence from 1 to 0..1 for both the internal table structures and execute the sceanrio...

Let me know the output.

Thanks & Regards,

Senthil

former_member200962
Active Contributor
0 Kudos

access tabs contain the column names for a particular table....

when you are passing the structure to the DB one of your StatementName's access remains blank/ does not occur.......henc you get the error.....StatementName is occuring but access is not occuring

To avoid the error what you should do is that in your mapping take care to avoid the StatementName for which the data is not send from the RFC table.....no blank instance should be created for the StatemnetName......so when there is call from 1 RFC only one StatementName is present....when call form 2 RFCs then two....and so on....

Regards,

Abhishek.

Former Member
0 Kudos

Hi,

in your JDBC data type structure, change the occurance of header node of both tables to 0..1

then in msg mapping, map the header nodes of these tables with the source internal tables of RFC taking those source fields whose data decides whether target table has to be created.........then using exists and creatif functions map it to target header node of target table.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Thank you so much for your help.

First I just changed the occurance of both table structures to 0..1, but that did not help. Then I gave the mapping of both headers on JDBC side to item(RFC) ->exists->createif->JDBC structureheader, and that worked perfect.

Thanks again.

Anjana.

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>> have a RFC with 2 internal tables. I first tried it as a async scenario,but that did not work, and then as a sync scenario and even that is not working. Can

which step is not working?

did you do the mapping correctly and the jdbc format is like here?

http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

?

do you see any errors in jdbc channel monitoring?

Regards,

Michal Krawczyk