Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPi BAPI_OBCL_CHANGE is not comitting database

Former Member
0 Likes
754

Hi All,

I am doing some batch characteristics update using the BAPI BAPI_OBCL_CHANGE BAPI Return table is showing success message but the changes are not effecting to the data base Even I have used BAPI_TRansaction_Commit also after calling the BAPI.

PLease throw some idea on this it's very urgent

Thanks&Regards

Mahesh

7 REPLIES 7
Read only

Former Member
0 Likes
676

Hi

I haven't that BAPI in my system, have you tried to set WAIT parameter of BAPI_TRansaction_Commit?

Max

Read only

0 Likes
676

sorry the BAPI name is BAPI_OBJCL_CHANGE

Read only

0 Likes
676

Hey,

I am using this BAPI in my current project as below and its giving thr desired result.

REFRESH return.

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = i_objtable-object

objecttable = 'EQUI'

classnum = i_objtable-classnum

classtype = i_objtable-classtype

TABLES

allocvaluesnumnew = i_allocvaluesnum

allocvaluescharnew = i_allocvalueschar

allocvaluescurrnew = i_allocvaluescurr

return = return.

READ TABLE return WITH KEY type = 'E' BINARY SEARCH.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

ENDIF.

-Kiran

*Please reward useful answers

Read only

0 Likes
676

Hi Kiran,

Still I am getting the same error .

Read only

0 Likes
676

Hi

Perhaps there're some problems on the data you're moving to BAPI, let's know your code for calling BAPI.

Max

Read only

0 Likes
676

The code is as follows

REFRESH return.

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = W_OBJECT

objecttable = 'MARA'

classnum = P_CLASS

classtype = P_KLART

TABLES

allocvaluesnumnew = NUMTAB

allocvaluescharnew = CHATAB

allocvaluescurrnew = CURTAB

return = return.

READ TABLE return WITH KEY type = 'E' BINARY SEARCH.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

ENDIF.

Bapi is returning success message but not updating to the data base.

Read only

Former Member
0 Likes
676

Dear Friend,

You want to Upload the Characteristics Values to the T16FS table.

Just show the Below Code.

call function 'BAPI_OBJCL_CHANGE'

exporting

objectkey = <wa_datatab>-col5

objecttable = 'T16FS'

classnum = so_num-low

classtype = '032'

status = '1'

keydate = sy-datum

no_default_values = ' '

  • IMPORTING

  • CLASSIF_STATUS =

tables

allocvaluesnumnew = jtab

allocvaluescharnew = ist_datatab

allocvaluescurrnew = ztab

return = return.

loop at return assigning <bapiret1>.

case <bapiret1>-type.

when 'S'.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = space.

when 'E'.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = space.

move <bapiret1> to bapiret.

move count to bapiret-number.

append bapiret to return1.

when 'I'.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = space.

move <bapiret1> to bapiret.

append bapiret to return1.

when others.

break <bapiret1>-type.

endcase.

endloop.

delete it_datatab where col5 = <wa_datatab>-col5.

clear: wa1_datatab, ist_datatab[].

endloop.

If its help u plz give marks.