zoukankan      html  css  js  c++  java
  • 使用BAPI_MATERIAL_SAVEDATA无法写入扩展字段

    1.目的: 导入MARC增强字段 ZZJYFS, ZZBLBM, ZZBLTXT

     



     2. BAPI结构已经加上了增强字段

     

     3. 程序代码

        IF bapi_te_marc IS NOT INITIAL.
          bapi_te_marc-plant  = plantdata-plant.
          bapi_te_marcx-plant = plantdata-plant.
          CLEAR: extensionin, lv_marc_value.
          lv_marc_value  = bapi_te_marc.
          extensionin-structure  = 'BAPI_TE_MARC'.
          extensionin-valuepart1 = lv_marc_value(240).
          extensionin-valuepart2 = lv_marc_value+240(240).
          extensionin-valuepart3 = lv_marc_value+480(240).
          extensionin-valuepart4 = lv_marc_value+720(240).
          APPEND extensionin.
    
          CLEAR: extensioninx, lv_marc_valuex.
          lv_marc_valuex = bapi_te_marcx.
          extensioninx-structure  = 'BAPI_TE_MARCX'.
          extensioninx-valuepart1 = lv_marc_valuex(240).
          extensioninx-valuepart2 = lv_marc_valuex+240(240).
          extensioninx-valuepart3 = lv_marc_valuex+480(240).
          extensioninx-valuepart4 = lv_marc_valuex+720(240).
          APPEND extensioninx.
        ENDIF.
    
    ***************"执行bapi*************************
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata             = headdata
            clientdata           = clientdata
            clientdatax          = clientdatax
            plantdata            = plantdata
            plantdatax           = plantdatax
            forecastparameters   = forecastparameters
            forecastparametersx  = forecastparametersx
            planningdata         = planningdata
            planningdatax        = planningdatax
            storagelocationdata  = storagelocationdata
            storagelocationdatax = storagelocationdatax
            valuationdata        = valuationdata
            valuationdatax       = valuationdatax
            warehousenumberdata  = warehousenumberdata
            warehousenumberdatax = warehousenumberdatax
            salesdata            = salesdata
            salesdatax           = salesdatax
            storagetypedata      = storagetypedata
            storagetypedatax     = storagetypedatax
            flag_online          = ' '
            flag_cad_call        = ' '
            no_dequeue           = ' '
            no_rollback_work     = ' '
          IMPORTING
            return               = return
          TABLES
            materialdescription  = materialdescription
            unitsofmeasure       = unitsofmeasure
            unitsofmeasurex      = unitsofmeasurex
            internationalartnos  = internationalartnos
            materiallongtext     = materiallongtext
            taxclassifications   = taxclassifications
            returnmessages       = returnmessages
            prtdata              = prtdata
            prtdatax             = prtdatax
            extensionin          = extensionin
            extensioninx         = extensioninx.
        IF return-type = 'S' AND gv_test IS INITIAL."执行成功
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' "提交该BAPI
            EXPORTING
              wait = 'X'.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        ENDIF.

    导入数据:

     值已经写到扩展结构:

     

     

    BAPI执行结果,不会去更新扩展字段值

     

    本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA. 远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!) !!请关注本人技术分享公众号:SAP翔子(可扫头像二维码) 每天分享新知识,博客文章也会陆续整理并迁移至公众号,与您一起共同学习
  • 相关阅读:
    iOS 苹果开发证书失效的解决方案(Failed to locate or generate matching signing assets)
    iOS NSArray数组过滤
    App Store2016年最新审核规则
    iOS 根据字符串数目,自定义Label等控件的高度
    iOS 证书Bug The identity used to sign the executable is no longer valid 解决方案
    Entity FrameWork 增删查改的本质
    EF容器---代理类对象
    Entity FrameWork 延迟加载本质(二)
    Entity FrameWork 延迟加载的本质(一)
    Entity FrameWork 增删查改
  • 原文地址:https://www.cnblogs.com/rainysblog/p/14918063.html
Copyright © 2011-2022 走看看