cancel
Showing results for 
Search instead for 
Did you mean: 

RFC is not inserting the data

Former Member
0 Kudos

Hi all,

I did File to RFC scenario. My problem is when i send message the message is showen as processed successfully in SXMB_MONI. But RFC is not inserting my data in a specified table. I couldn't found where i am wrong.

my sender strucure is:

<MANDT>

<WORKDATE>

<EMPLOYEENUMBER>

<CATSHOURS>

R3 table name is ZTESTCATSDB

My RFC source code is :

FUNCTION Z_POST_TEST.

*"----


""Local Interface:

*" TABLES

*" CATSRECORDS_IN STRUCTURE ZTESTCATSDB OPTIONAL

*" RETURN STRUCTURE BAPIRET2 OPTIONAL

*"----


data wa_cats like ZTESTCATSDB.

data wa_catdb like ZTESTCATSDB.

data ztab like ZTESTCATSDB OCCURS 0 WITH HEADER LINE.

loop at catsrecords_in into wa_cats.

ztab-WORKDATE = wa_cats-workdate.

ztab-empnum = wa_cats-empnum.

ztab-catshours = wa_cats-catshours.

append ztab.

endloop.

insert ZTESTCATSDB from table ztab.

commit work.

ENDFUNCTION.

Plese tell me any one where i am wrong it is very urgent for me.

Thanks,

Satish.

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

You should always check the system return code (sy-subrc) after any insert and update statement like this:

insert ...
if sy-subrc > 0.
  message E...
else.
  commit work.
endif.

Hope that helps,

Stefan

Former Member
0 Kudos

HI,

Can you execute RFC in R/3 itself and test it that it is inseting record in table.

Thanks,

Tuhin

Former Member
0 Kudos

Hi Tuhin,

I executed RFC itself it is inserting the record.

Thanks,

Satish

Former Member
0 Kudos

satish kumar,

Did u check if "COMMIT WORK" statement is missing?

reg,

Former Member
0 Kudos

Hi,

Go to ur RFC adapter.

select Advanced Mode ->select "send "Confirm transaction"".

Then resend ur message.

thanks.