REPORT z_example_bapi_material_savedata.
* Data Declarations
DATA: clidainp LIKE bapi_mara_ga,
clidaout LIKE bapi_mara,
clidaoutx LIKE bapi_marax,
valuationinp LIKE bapi_mbew_ga,
valuationout LIKE bapi_mbew,
valuationoutx LIKE bapi_mbewx,
headdata LIKE bapimathead,
return LIKE bapiret2,
returnmes LIKE bapi_matreturn2 OCCURS 0 WITH HEADER LINE.
* Get Material Number to be processed
PARAMETERS: material LIKE bapi_mara_ga-material.
* Read Material Data
CALL FUNCTION 'BAPI_MATERIAL_GET_ALL'
EXPORTING
material = material
IMPORTING
"clientdata = clidainp
valuationdata = valuationinp
TABLES
return = returnmes.
* Header Data: Material and View to maintain
headdata-material = material.
"headdata-basic_view = 'X'.
headdata-cost_view = 'X'.
* Detail Data: Field Value, and 'X'-Structure to mark the field for maintenance
*clidaout-net_weight = clidainp-net_weight * 2.
*clidaoutx-net_weight = 'X'.
valuationout-val_area = '6000'. "一定设置评估范围
valuationoutx-val_area = '6000'. "一定设置评估范围
valuationout-std_price = '300.00'.
valuationoutx-std_price = 'X'.
valuationout-price_unit = '1' .
valuationoutx-price_unit = 'X'.
valuationout-plndprice1 = '90.7'.
valuationoutx-plndprice1 = 'X'.
valuationout-plndprdate1 = sy-datum.
valuationoutx-plndprdate1 = 'X'.
* Call the BAPI
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = headdata
* clientdata = clidaout
* clientdatax = clidaoutx
valuationdata = valuationout
valuationdatax = valuationoutx
IMPORTING
return = return
TABLES
returnmessages = returnmes.
* Commit to release the locks
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
* RETURN-TYPE is 'E' in case of error, else 'S'.
IF return-type = 'E'.
LOOP AT returnmes.
WRITE: / returnmes-message.
ENDLOOP.
ELSEIF return-type = 'S'..
WRITE: / 'Weight of material ', material, 'Sucessfully doubled'.
ENDIF.
BAPI_MATERIAL_SAVEDATA 更改物料主数据 提示CURRENCY 初始值
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 工具菜单----选项----Designers(设计器)----阻止保存要求重新创建表的更改 取消勾选即可。
- 关原之战的主战场以西军大败收场。而全国各地的分战场,也陆续接到了西军战败的消息。先说东北方面,一开始作为关原之战...
- 声明:这篇文章主要面向python/Flask/web后端初级开发者,文章主要讲解了如何搭建一个基于Flask的纯...