前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP MR21批量修改价格

SAP MR21批量修改价格

作者头像
matinal
发布2020-11-27 11:35:22
1K0
发布2020-11-27 11:35:22
举报
文章被收录于专栏:SAP Technical

前两天吃中饭时同事说MR21修改价格用LSMW导入,每次只能导入一条商品价格,而每一个商品价格的修改都会产生一个凭证,问是否能批量导入。先去找了下BAPI,看了下BAPI_MATVAL_PRICE_CHANGE和BAPI_M_REVAL_CREATEPRICECHANGE两个BAPI,发现前一个每次只能修改一个商品价格,后一个根本就跑不起来,不知道咋回事,只能回头用SHDB解决问题。

REPORT zmr21 NO STANDARD PAGE HEADING LINE-SIZE 255. INCLUDE bdcrecx1. PARAMETERS: dataset(132) LOWER CASE. *** DO NOT CHANGE - the generated data section - DO NOT CHANGE *** * * If it is nessesary to change the data section use the rules: * 1.) Each definition of a field exists of two lines * 2.) The first line shows exactly the comment * '* data element: ' followed with the data element * which describes the field. * If you don't have a data element use the * comment without a data element name * 3.) The second line shows the fieldname of the * structure, the fieldname must consist of * a fieldname and optional the character '_' and * three numbers and the field length in brackets * 4.) Each field must be type C. * *** Generated data section with specific formatting - DO NOT CHANGE *** DATA: BEGIN OF record OCCURS 0, * data element: BUDAT budat_001(010), * data element: BUKRS bukrs_002(004), * data element: WERKS_D werks_003(004), * data element: SCREEN_VARIANT screen_variant_004(030), * data element: SCREEN_VARIANT screen_variant_005(030), * data element: MATNR matnr_01_006(018), * data element: VALPR newvalpr_01_007(015), END OF record. *** End generated data section *** START-OF-SELECTION. * PERFORM open_dataset USING dataset. PERFORM of_getexcel. PERFORM open_group. PERFORM of_processdata. PERFORM close_group. * PERFORM close_dataset USING dataset. FORM of_processdata. DATA: li_cur TYPE i VALUE 0, li_mod TYPE i, ls_fname(30) TYPE c, ls_temp(2) TYPE c, li_len TYPE i, li_inex TYPE i VALUE 0. li_mod = LINES( record ). break ypcheng. LOOP AT record. li_cur = li_cur + 1. li_inex = li_inex + 1. IF li_inex = 1. PERFORM bdc_dynpro USING 'SAPRCKM_MR21' '0201'. PERFORM bdc_field USING 'BDC_CURSOR' 'MR21HEAD-WERKS'. PERFORM bdc_field USING 'MR21HEAD-BUDAT' record-budat_001. PERFORM bdc_field USING 'MR21HEAD-BUKRS' record-bukrs_002.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/01/02 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档