其他分享
首页 > 其他分享> > BAPI_OBJCL_CHANGE

BAPI_OBJCL_CHANGE

作者:互联网

The following code is working perfectly in my system to update a date characteristic


DATA: okey TYPE bapi1003_key-object,

otable TYPE bapi1003_key-objecttable VALUE 'MCH1',

classnum TYPE bapi1003_key-classnum VALUE 'PF',

classtype TYPE bapi1003_key-classtype VALUE '023'.

DATA: numnews TYPE TABLE OF bapi1003_alloc_values_num,

numnew TYPE bapi1003_alloc_values_num,

charnews TYPE TABLE OF bapi1003_alloc_values_char,

currnews TYPE TABLE OF bapi1003_alloc_values_curr,

bret TYPE TABLE OF bapiret2,

ret TYPE bapiret2.

DATA: atwrt TYPE atwrt.

CHECK ck_test IS INITIAL.

numnew-charact = 'ZDATAUM'.

atwrt = out-budat.

CALL FUNCTION 'CTCV_CONVERT_DATE_TO_FLOAT'

EXPORTING

date = atwrt

IMPORTING

float = numnew-value_from.

APPEND numnew TO numnews.

okey(18) = out-matnr.

okey+18(10) = out-charg.

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = okey

objecttable = otable

classnum = classnum

classtype = classtype

TABLES

allocvaluesnumnew = numnews

allocvaluescharnew = charnews

allocvaluescurrnew = currnews

return = bret.

LOOP AT bret INTO ret WHERE type = 'E' OR type = 'A'.

out-message = ret-message.

EXIT.

ENDLOOP.

IF sy-subrc = 0.

out-status = icon_failure.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

out-status = icon_checked.

out-message = 'Batch classification updated'(001).

ENDIF.

image

标签:FUNCTION,BAPI,bapi1003,OBJCL,numnew,key,TYPE,CHANGE,out
来源: https://www.cnblogs.com/chrisrockdl/p/14079206.html