首页 > 其他分享 >交货单修改 分批拣配

交货单修改 分批拣配

时间:2024-05-16 19:30:42浏览次数:19  
标签:CONTROL ITEM 分批 DELIV DELIVERY 修改 LT 交货单 DATA

*&---------------------------------------------------------------------*
*& REPORT YBO_NOTE06
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT YBO_NOTE06.

DATA:
  LS_LIPS           TYPE LIPS,
  LS_VBKOK          TYPE VBKOK,
  LS_HEADER_DATA    TYPE BAPIOBDLVHDRCHG,
  LS_HEADER_CONTROL TYPE BAPIOBDLVHDRCTRLCHG,
  LV_DELIVERY       TYPE BAPIOBDLVHDRCHG-DELIV_NUMB,
  LS_TECHN_CONTROL  TYPE BAPIDLVCONTROL.

DATA:
  LT_VBPOK           TYPE TABLE OF VBPOK WITH HEADER LINE,
  LT_ITEM_DATA       TYPE TABLE OF BAPIOBDLVITEMCHG WITH HEADER LINE,
  LT_ITEM_CONTROL    TYPE TABLE OF BAPIOBDLVITEMCTRLCHG WITH HEADER LINE,
  LT_ITEM_DATA_BATCH TYPE TABLE OF /SPE/DOCUBATCH_DLV_ITEM_STY WITH HEADER LINE,
  LT_RETURN          TYPE TABLE OF BAPIRET2 WITH HEADER LINE,
  LT_ITEM_DATA_SPL   TYPE TABLE OF /SPE/BAPIOBDLVITEMCHG WITH HEADER LINE.


LV_DELIVERY = '8000000647' .

LS_HEADER_DATA-DELIV_NUMB = LV_DELIVERY.
LS_HEADER_CONTROL-DELIV_NUMB = LV_DELIVERY.

SELECT SINGLE *
 INTO LS_LIPS
 FROM LIPS
 WHERE VBELN = LV_DELIVERY
 .

CLEAR LT_ITEM_DATA.
LT_ITEM_DATA-DELIV_NUMB      = LV_DELIVERY.  "交货
LT_ITEM_DATA-DELIV_ITEM      = '000010'    .  "交货项目
APPEND LT_ITEM_DATA.
*
CLEAR LT_ITEM_CONTROL.
LT_ITEM_CONTROL-DELIV_NUMB   = LV_DELIVERY.  "交货
LT_ITEM_CONTROL-DELIV_ITEM   = '000010'    . "交货项目
LT_ITEM_CONTROL-CHG_DELQTY   = 'X'.
APPEND LT_ITEM_CONTROL.

CLEAR LT_ITEM_DATA_SPL.
LT_ITEM_DATA_SPL-DELIV_NUMB = LV_DELIVERY.  "交货
LT_ITEM_DATA_SPL-DELIV_ITEM = '000010'.            "交货项目
LT_ITEM_DATA_SPL-STGE_LOC = '3010'.
APPEND LT_ITEM_DATA_SPL.

CLEAR LT_ITEM_DATA.
LT_ITEM_DATA-DELIV_NUMB      = LV_DELIVERY.  "交货
LT_ITEM_DATA-DELIV_ITEM      = '900010'.            "交货项目
LT_ITEM_DATA-DLV_QTY         = '1'.       "数量
LT_ITEM_DATA-SALES_UNIT      = 'KG'.
LT_ITEM_DATA-BATCH           = '-1-2'.
LT_ITEM_DATA-FACT_UNIT_NOM   = LS_LIPS-UMVKZ.
LT_ITEM_DATA-FACT_UNIT_DENOM = LS_LIPS-UMVKN.
LT_ITEM_DATA-HIERARITEM      = '000010'.  "项目层次中的高级项目
LT_ITEM_DATA-USEHIERITM      = '1'.                 "使用层次项目(1:批次拆分)
APPEND LT_ITEM_DATA.
CLEAR LT_ITEM_CONTROL.
LT_ITEM_CONTROL-DELIV_NUMB   = LV_DELIVERY. "交货
LT_ITEM_CONTROL-DELIV_ITEM   = '900010'.           "交货项目
LT_ITEM_CONTROL-CHG_DELQTY   = 'X'.
APPEND LT_ITEM_CONTROL.
CLEAR LT_ITEM_DATA_SPL.
LT_ITEM_DATA_SPL-DELIV_NUMB = LV_DELIVERY.  "交货
LT_ITEM_DATA_SPL-DELIV_ITEM = '900010'.            "交货项目
LT_ITEM_DATA_SPL-STGE_LOC = '3010'.
APPEND LT_ITEM_DATA_SPL.


CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
  EXPORTING
    HEADER_DATA    = LS_HEADER_DATA
    HEADER_CONTROL = LS_HEADER_CONTROL
    DELIVERY       = LV_DELIVERY
    TECHN_CONTROL  = LS_TECHN_CONTROL
  TABLES
    ITEM_DATA      = LT_ITEM_DATA
    ITEM_CONTROL   = LT_ITEM_CONTROL
    RETURN         = LT_RETURN
    ITEM_DATA_SPL  = LT_ITEM_DATA_SPL.

LOOP AT LT_RETURN .
  WRITE: /,LT_RETURN-TYPE, LT_RETURN-ID, LT_RETURN-NUMBER, LT_RETURN-MESSAGE .
ENDLOOP.

COMMIT WORK AND WAIT .

LS_VBKOK-VBELN_VL = LV_DELIVERY .


CLEAR: LT_VBPOK.
LT_VBPOK-VBELN_VL   = LV_DELIVERY.
LT_VBPOK-POSNR_VL  = '900010'.
LT_VBPOK-VBELN   = LV_DELIVERY.
LT_VBPOK-POSNN  = '900010'.


LT_VBPOK-PIKMG       = '1'.       "数量
LT_VBPOK-MEINS       = 'M'.
*LT_VBPOK-CHARG      = '-1-2'.                    "批次
*LT_VBPOK-MATNR     = XLIPS-MATNR.                    "物料
APPEND LT_VBPOK.


CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING'
  EXPORTING
    VBKOK_WA  = LS_VBKOK
    SYNCHRON  = 'X'
*   NO_MESSAGES_UPDATE           = ' '
*   NICHT_SPERREN                = ' '
*   AUFRUFER_T                   = ' '
*   IF_ERROR_MESSAGES_SEND       = 'X'
  TABLES
    VBPOK_TAB = LT_VBPOK
*   PROT      =
  .

COMMIT WORK AND WAIT .

 

标签:CONTROL,ITEM,分批,DELIV,DELIVERY,修改,LT,交货单,DATA
From: https://www.cnblogs.com/icebo/p/18196594

相关文章

  • openGauss 执行修改表分区操作时报错
    执行修改表分区操作时报错问题现象执行ALTERTABLEPARTITION时,报错如下。ERROR:startvalueofpartition"XX"NOTEQUALup-boundaryoflastpartition.原因分析在同一条ALTERTABLEPARTITION语句中,既存在DROPPARTITION又存在ADDPARTITION时,无论它们在语句中的顺序是......
  • 使用qemu-system-x86_64和cloud-init修改qcow2镜像密码
    方法来自于:CoretutorialwithQEMU依次执行下面的命令sudoaptinstallqemu-system-x86mkdirtempcdtemp#以此镜像为例wgethttps://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.imgcat<<EOF>user-data#cloud-configpassword:123ch......
  • Harbor怎么修改域名配置
    Harbor修改访问域名配置修改harbor.yml配置文件#/opt/harbor/harboy.yml修改域名设置生效#./install.sh直接修改配置文件在harbor根目录#common/config/core/env#common/config/registry/config.yml重启docker生效#docker-composedown#docker-comp......
  • mysql基于linux环境下修改用户密码
    一、忘记密码的情况下:1、找到数据库配置文件my.cnf,不记得在哪可以全局搜索find/-name‘*my.cnf*’;2、vimy.cnf,在[mysqld]下面添加一行skip-grant-tables取消权限验证,保存退出;3、重启数据库:systemctlrestartmysql,也有可能是servicemysqldrestart;4、找到mysql安装目录,......
  • openGauss 修改索引时只调用索引名提示索引不存在
    修改索引时只调用索引名提示索引不存在问题现象修改索引时只调用索引名提示索引不存在。举例如下。--创建分区表索引HR_staffS_p1_index1,不指定索引分区的名称。CREATEINDEXHR_staffS_p1_index1ONHR.staffS_p1(staff_ID)LOCAL;--创建分区索引HR_staffS_p1_index2,并指......
  • .net DataGirdView 通过列索引修改单元格字体
    场景是这样、我需要DataGirdView某几列数量大于0字体就变成蓝色,某几列超过标准值字体就变成红色具体列名属性voidInitCols(){varcol=_DataGridView.BuildCol<DataGridViewTextBoxColumn>(dgvDetail,"OrderNo","工单号");col.Width=125;......
  • 记录一下在KEIL中修改STM32的栈顶地址
    STM32的启动文件中定义的栈和堆的大小,由于栈是向下生长的。所以我们一般希望将栈顶设置为RAM的最高有效地址。这样就可以最大限度保护栈不会溢出。但是STM32的启动文件居然不是这样的思路。那STM32的启动文件的分配思路是怎么样的呢。它其实是先确定用户使用RAM的情况,然后在未使......
  • deepin20.9启动器修改大圆角为小圆角
    获取源代码:aptsourcedde-launcher修改代码:vimsrc/windowedframe.cpp,623行caseTopRight:path.moveTo(topLeft.x(),topLeft.y());path.lineTo(topRight.x()-m_radius,topRight.y());//path.arcTo(topRight.x()-m_radius*2,topRight.y(),m_radius*......
  • 将bmp文件转换成JPEG(待修改,目前可转换但图片倒转)
    #include<stdio.h>#include<stdlib.h>#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#include<unistd.h>#include<sys/mman.h>/**IncludefileforusersofJPEGlibrary.*Youwillneedtoha......
  • ACCESS 修改按钮上的图片
    需求:我有个按钮,设置了lock图标,想在点击它的时候,图标在lock与unlock之前切换 实现代码:PrivateSubCommand297_Click()IfCommand297.Tag=-1Then'changetounlockCommand297.Picture="unlock"Command297.Tag=0Else......