cancel
Showing results for 
Search instead for 
Did you mean: 

problem adding data to backend server from MI client

Former Member
0 Kudos

Hi,

I am creating an AWT application using smart sync.

I have a backend server.. where i have creating a Table called ZPatient

There is just one table with foru attributes .

I have put some entries in the backend table.

I have written a Bapi wrapper for getList().

and I am able to get the details in my Mobile client.

I have also written a Bapi wrapper for create

When I add from the mobile client and then sync..... I am able to see the new entry in the MI Client but that entry is not showing in the backend server table. instead a entry is added whose id is 0 and all other entries are empty....

My inbound worklist is also not showing any data.

am i doing anything wrong..

please help!!

regards,

Sougata.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi all,

thanks every one for ur reply....

I solved the problem ...

I had not mapped the syncBO with create() wrapper in the MI SERVER (merep_sbuilder).

mapping the fields solved the problem.

regards.

Sougata.

AjithC
Employee
Employee
0 Kudos

Hi Sougata,

Also in the create bapi, make sure that the entry is created in the backend by checking the sy-subrc value after insert. In case of failure, fill the bapiret2 and sent back an error message.

Regards

Ajith

Former Member
0 Kudos

hi Ajith,

sy-subrc value is 4 after insert......

i dont know how to fill the bapiret2 and sent back the error message.

pls can u explain it in detail...cause i am new to MI

Thnks .

regards

Sougata

AjithC
Employee
Employee
0 Kudos

Hi Sougata,

SY-SUBRC value 4 means the record is not created. Check the data you are trying to insert.

So I think the problem you are facing is just because the data is not properly created in the backend..

For filling bapiret..

If the return parameter (BAPIRET2) is an export parameter, the code should be something like this..

if sy-subrc is not initial. "Error

RETURN-TYPE = 'E'.

RETURN-MESSAGE = 'Your error message".

else. "sucess

RETURN-TYPE = 'S'.

RETURN-MESSAGE = "Sucess".

endif.

If return is a table, declare a local workarea and append it to the return table..

If you use a message class instead of hard coding the message, use the function module BALW_BAPIRETURN_GET2 fill the bapiret structure..

CALL FUNCTION 'BALW_BAPIRETURN_GET2'

EXPORTING

TYPE = " E or S

CL = "message class name

NUMBER = "message number

  • PAR1 = ' ' "parameter if any

  • PAR2 = ' ' "parameter if any

  • PAR3 = ' ' "parameter if any

  • PAR4 = ' ' "parameter if any

  • LOG_NO = ' '

  • LOG_MSG_NO = ' '

  • PARAMETER = ' '

  • ROW = 0

  • FIELD = ' '

  • IMPORTING

  • RETURN =

.

Hope this helps....

Regards

Ajith Chandran

raghavendra_sn
Explorer
0 Kudos

Could you let me know the bapi wrappers present for this synbo.

do u have getdetail bapi wrapper

Former Member
0 Kudos

hi Raghavendra,

thnks for the reply

I have defined all the bapi wrappers for the syncBo zpatient ...

i have coded only for getList() and create() . I havent implemented getDetails() since I have only one table ZPATIENT in the backend.

this is the code that i have written in create()

e_patientid = i_top-patientId.

INSERT INTO ZPATIENT VALUES I_TOP.

where, I-TOP is the import parameter and e_patientid is the export parameter.

raghavendra_sn
Explorer
0 Kudos

Could you implement GETDETAIL . We call getdetail after CREATE just for confirming whether CREATE is successful or not.

Even though you have GETDETAIL bapi wrapper, it has to return atleast the created header with the new generated R3KEY.

Former Member
0 Kudos

HI, Raghavendra

I have also implemented the GETDETAILS ...

But the same problem persists

I tried printing the values after the insert statement in create.

write: / i_top-FIRSTNAME, i_top-patientId.

the values are empty..... i.e. i_top-patientid is 0 where as i had put 36

is there any problem in the MI server ??