cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to JDBC Asynchronous scenario on scheduled basis

former_member460664
Participant
0 Kudos

Dear All,

I have a requirement from SAP to JDBC on scheduled basis. I have to update or Insert the database master tables of SQL server.  One BAPI structure contains

1) Both INSERT and UPDATE records

2) Only INSERT record

3)Only UPDATE record

For this can I create one receiver JDBC structure for all above 3 cases? If possible then how to create? OR shall I create 3 different scenarios? I dont have to get back any thing from SQL. Please suggest?

Regards,

Ashok.

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Ashok,

If you check the SAP documentation;

1) Both INSERT and UPDATE records

Use statement1 structure with action UPDATE_INSERT

2) Only INSERT record

Use statement2 structure

3)Only UPDATE record

Use statement1 structure with action UPDATE

If you will work with the same DB for all actions, you can do only one scenario if you construct the corresponding receiving structure with the three statements and in runtime you will only generate one structure. I haven't tested to make differents actions together in one call but i doubt that  it will work because for example in a sync scenario i dont know how the response would be.

The receiving structure could be:

root

     Statement_a

          <dbTableName action= “UPDATE_INSERT”>

          ...

     /Statement_a

     Statement_b

      <dbTableName action=”UPDATE”>

       ...

     /Statementb

     Statement_c

     <dbTableName action=”INSERT”>

      ..

     /StatementC

/root

Regards.

former_member460664
Participant
0 Kudos

My scenario is Only Asynchronous (RFC to JDBC).

.....runtime you will only generate one structure.....

For sometimes BAPI having both the data INSERT and UPDATE. What to do for inserting and updating data at same time?

iaki_vila
Active Contributor
0 Kudos

Hi Ashok,

For sometimes BAPI having both the data INSERT and UPDATE.

You can use the statement for the action UPDATE_INSERT:

The statement has the same format as for the UPDATE action. Initially, the same action is executed as for UPDATE. If no update to the database table can be made for this action (the condition does not apply to any table entry), values of the table described in the <access> element are inserted in accordance with the description of the action INSERT. <key> elements are ignored in this case.

Regards.

naveen_chichili
Active Contributor
0 Kudos

Hi Ashok,

you can do it with one Receiver structure and use appropriate update or insert or update_insert for the same structure.

if you want to do in different cases you can use individual mappings.

Regards,

Naveen

former_member460664
Participant
0 Kudos

Thank you Naveen. I want to do this in One scenario. But, receiver Jdbc structure having only one action element. We give our SQL Statement to action. In my case how do I maintain 3 statements under one action element? How to do this by using individual mappings?

Regards,

Ashok.