zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    删除排序链表中的重复元素
    动态规划之爬楼梯问题
    外行小白的modbus惊心之旅
    SSM框架整合
    我与404的不解之缘系列(一)记录一个智障一般的错误
    day 06 作业
    day 06 文件查看查找与上传下载
    linux 防火墙查看firewall
    linux 变量详情
    day05作业练习题
  • 原文地址:https://www.cnblogs.com/chrisrockdl/p/14079206.html
Copyright © 2011-2022 走看看