首页 > 其他分享 >DEMO:PR 添加新行项目 BAPI_PR_CHANGE

DEMO:PR 添加新行项目 BAPI_PR_CHANGE

时间:2022-09-30 23:32:56浏览次数:60  
标签:PR PRITEM BAPI DEMO PRITEMX BANFN LT LS TYPE

货铺QQ群号:834508274


DEMO:PR 添加新行项目 BAPI_PR_CHANGE_小程序



REPORT ZLM_PR_CHANGE.
PARAMETERS : P_BANFN TYPE VBEP-BANFN OBLIGATORY.
DATA:
LS_PRHEADER LIKE BAPIMEREQHEADER, "
LS_PRHEADERX LIKE BAPIMEREQHEADERX, "
TESTRUN TYPE BAPIFLAG-BAPIFLAG, "


WITH HEADER LINE, "
LT_PRITEM LIKE TABLE OF BAPIMEREQITEM WITH HEADER LINE, "
LIKE TABLE OF BAPIMEREQITEMX WITH HEADER LINE, "
LS_PRITEMX TYPE BAPIMEREQITEMX,


IV_BANFN TYPE EBAN-BANFN. "OK
DATA: LT_PRITEM1 TYPE TABLE OF BAPIMEREQITEMIMP WITH HEADER LINE. "
DATA: LS_PRITEM TYPE BAPIMEREQITEM.
DATA: LV_LINECNT TYPE N.


IV_BANFN = P_BANFN.


CALL FUNCTION 'BAPI_PR_GETDETAIL' EXPORTING NUMBER = IV_BANFN ACCOUNT_ASSIGNMENT = 'X' ITEM_TEXT = 'X' HEADER_TEXT = 'X' DELIVERY_ADDRESS = 'X' VERSION = 'X' "version IMPORTING PRHEADER = LS_PRHEADERTABLES PRITEM = LT_PRITEMRETURNEXCEPTIONS0.
CLEAR
LOOP AT LT_PRITEM INTO
MOVE-CORRESPONDING LS_PRITEM TO
APPEND LT_PRITEM1.
CLEAR
ENDLOOP.
LS_PRHEADERX-PREQ_NO = 'X'.
LS_PRHEADERX-ITEM_INTVL = 'X'.


READ TABLE LT_PRITEM INTO LS_PRITEM INDEX 1.
MOVE-CORRESPONDING LS_PRITEM TO
LT_PRITEM1-PREQ_ITEM = 20.
APPEND LT_PRITEM1.
LS_PRITEMX-PREQ_ITEM = LV_LINECNT + 10.
LS_PRITEMX-PREQ_ITEMX = 'X'.
LS_PRITEMX-MATERIAL = 'X'.
LS_PRITEMX-PLANT = 'X'.
LS_PRITEMX-STORE_LOC = 'X'.
LS_PRITEMX-PUR_GROUP = 'X'.
LS_PRITEMX-QUANTITY = 'X'.
LS_PRITEMX-UNIT = 'X'.
LS_PRITEMX-DEL_DATCAT_EXT = 'X'.
LS_PRITEMX-DELIV_DATE = 'X'.
LS_PRITEMX-FIXED_VEND = 'X'.
LS_PRITEMX-PREQ_PRICE = 'X'.
LS_PRITEMX-PRICE_UNIT = 'X'.
LS_PRITEMX-PURCH_ORG = 'X'.
LS_PRITEMX-VEND_MAT = 'X'.
APPEND LS_PRITEMX TO
CALL FUNCTION 'BAPI_PR_CHANGE' EXPORTINGNUMBER* PRHEADER = ls_PRHEADER* PRHEADERX = ls_PRHEADERX* testrun = testrun*IMPORTING* PRHEADEREXP = ls_PRHEADEREXPTABLES PRITEMX = LT_PRITEMX PRITEM = LT_PRITEM1RETURNEXCEPTIONS01.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTINGWAIT = 'X'.


标签:PR,PRITEM,BAPI,DEMO,PRITEMX,BANFN,LT,LS,TYPE
From: https://blog.51cto.com/u_15680210/5727561

相关文章

  • DEMO: ME51N 创建PR BAPI_REQUISITION_CREATE
    货铺QQ群号:834508274*&---------------------------------------------------------------------**&BAPI_REQUISITION_CREATE和BAPI_PR_CREATE相关问题查看NOTE*&49962......
  • DEMO: ME51N 创建PR BAPI_PR_CREATE
    货铺QQ群号:834508274*&---------------------------------------------------------------------**&BAPI_REQUISITION_CREATE和BAPI_PR_CREATE相关问题查看NOTE*&49962......
  • DEMO:修改外向交货单BAPI_OUTB_DELIVERY_CHANGE
    货铺QQ群号:834508274TABLES:LIKP,LIPS.PARAMETERS:P_VBELNTYPEVBELN_VL.PARAMETERS:P_SERNRTYPEOBJK-SERNR.DATA:LS_HEADER_DATALIKEBAPIOBDLVHDRCHG,LS_HEADER_C......
  • springboot自动配置原理以及手动实现配置类
    springboot自动配置原理以及手动实现配置类1、原理spring有一个思想是“约定大于配置”。配置类自动配置可以帮助开发人员更加专注于业务逻辑开发,springboot在启动的时候......
  • Demo:替代
    货铺QQ群号:834508274下面开始干货:Tcode:OBBH:新建步骤:选择替换字段:设置先决条件:这里demo输入常量:替换:维护出口代码:Tcode:Gcx2:代码由两部分构成:在form get_exit_titles先声明......
  • Demo:校验
    货铺QQ群号:834508274下面开始干货:tcode:GGB0设置先决条件设置检查点这里ZU01对应的代码是需要配置维护的。不然是显示不出来ZU01的。ZU01代码的相关配置维护点:Tcode:GCX2Co......
  • 如何查找BAPI
    干货铺QQ群号:834508274有人问怎么找BAPI的问题,这里说一下。文章最早是发在博客里的,2014年写的,略作调整这里发一下,依然适用:​​http://blog.sina.com.cn/s/blog_c0978c9b0102......
  • XD01创建扩展客户前台以及BAPI测试步骤
    前两天有人在群里问SD_CUSTOMER_MAINTAIN_ALL怎么创建客户。我在demo机上测试XD01创建客户,然后再测试使用BAPI。Demo机是ECC,S4已结不用XD01了,统一使用BP创建客户和供应商等......
  • springboot自动配置原理以及手动实现配置类
    springboot自动配置原理以及手动实现配置类1、原理spring有一个思想是“约定大于配置”。配置类自动配置可以帮助开发人员更加专注于业务逻辑开发,springboot在启动的时......
  • 如何加入linux开源项目-GNOME Project Listing
    GNOMEProjectListing找到项目官网找到项目创始人email联系不过通常都可以通过网站直接去的联系然后提交你的工作成果或者提交bug,提交你的补丁之类。​......