采购订单确认视图维护
2016-05-25 10:31
519 查看
data: lt_xuekes type table of UEKES,
ls_xuekes type UEKES.
data: lt_ekes type table of ekes,
ls_ekes type ekes.
data op type c.
op = 'U'. "修改
*op = 'D'. "新增
*op = 'I'. "删除
case op.
when 'U'.
*读取确认
CALL FUNCTION 'ZPP142_GET_EKES'
EXPORTING
I_EBELN = '4900177648'
I_EBELP = '00010'
TABLES
T_ekes = lt_ekes.
.
*准备修改现有条目
loop at lt_ekes into ls_ekes.
MOVE-CORRESPONDING ls_ekes to ls_xuekes.
ls_xuekes-eindt = '20180303'.
ls_xuekes-kz = 'U'.
append ls_xuekes to lt_xuekes.
clear: ls_ekes.
endloop.
if lt_xuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
* YEKES =
.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'update ok'.
else.
write 'update not ok'.
endif.
endif.
when 'I'.
*准备添加新条目
clear:ls_xuekes,lt_xuekes.
ls_xuekes-ebeln = '4900177648'.
ls_xuekes-ebelp = '00010'.
sort lt_ekes DESCENDING by ebeln ebelp etens.
read table lt_ekes into ls_ekes index 1.
if sy-subrc = 0.
ls_xuekes-etens = ls_ekes-etens + 1.
else.
ls_xuekes-etens = '0001'.
endif.
ls_xuekes-ebtyp = 'LA'.
ls_xuekes-eindt = '20160707'.
ls_xuekes-lpein = '1'.
ls_xuekes-erdat = sy-datum.
ls_xuekes-ezeit = sy-uzeit.
ls_xuekes-menge = '22.222'.
ls_xuekes-estkz = '1'.
ls_xuekes-kzdis = 'X'.
ls_xuekes-xblnr = 'A-LJC-SB'.
ls_xuekes-kz = 'I'.
append ls_xuekes to lt_xuekes.
BREAK-POINT.
if lt_xuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
* YEKES =
.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'insert ok'.
else.
write 'insert not ok'.
endif.
endif.
when 'D'.
clear:ls_xuekes,lt_xuekes.
data: lt_yuekes type table of UEKES,
ls_yuekes type UEKES.
*读取确认
CALL FUNCTION 'ZPP142_GET_EKES'
EXPORTING
I_EBELN = '4900177648'
I_EBELP = '00010'
TABLES
T_ekes = lt_ekes.
.
*准备删除现有条目
loop at lt_ekes into ls_ekes.
MOVE-CORRESPONDING ls_ekes to ls_yuekes.
ls_yuekes-kz = 'D'.
append ls_yuekes to lt_yuekes.
clear: ls_ekes.
endloop.
if lt_yuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
YEKES = lt_yuekes.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'Delete ok'.
else.
write 'Delete not ok'.
endif.
endif.
endcase.
ls_xuekes type UEKES.
data: lt_ekes type table of ekes,
ls_ekes type ekes.
data op type c.
op = 'U'. "修改
*op = 'D'. "新增
*op = 'I'. "删除
case op.
when 'U'.
*读取确认
CALL FUNCTION 'ZPP142_GET_EKES'
EXPORTING
I_EBELN = '4900177648'
I_EBELP = '00010'
TABLES
T_ekes = lt_ekes.
.
*准备修改现有条目
loop at lt_ekes into ls_ekes.
MOVE-CORRESPONDING ls_ekes to ls_xuekes.
ls_xuekes-eindt = '20180303'.
ls_xuekes-kz = 'U'.
append ls_xuekes to lt_xuekes.
clear: ls_ekes.
endloop.
if lt_xuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
* YEKES =
.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'update ok'.
else.
write 'update not ok'.
endif.
endif.
when 'I'.
*准备添加新条目
clear:ls_xuekes,lt_xuekes.
ls_xuekes-ebeln = '4900177648'.
ls_xuekes-ebelp = '00010'.
sort lt_ekes DESCENDING by ebeln ebelp etens.
read table lt_ekes into ls_ekes index 1.
if sy-subrc = 0.
ls_xuekes-etens = ls_ekes-etens + 1.
else.
ls_xuekes-etens = '0001'.
endif.
ls_xuekes-ebtyp = 'LA'.
ls_xuekes-eindt = '20160707'.
ls_xuekes-lpein = '1'.
ls_xuekes-erdat = sy-datum.
ls_xuekes-ezeit = sy-uzeit.
ls_xuekes-menge = '22.222'.
ls_xuekes-estkz = '1'.
ls_xuekes-kzdis = 'X'.
ls_xuekes-xblnr = 'A-LJC-SB'.
ls_xuekes-kz = 'I'.
append ls_xuekes to lt_xuekes.
BREAK-POINT.
if lt_xuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
* YEKES =
.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'insert ok'.
else.
write 'insert not ok'.
endif.
endif.
when 'D'.
clear:ls_xuekes,lt_xuekes.
data: lt_yuekes type table of UEKES,
ls_yuekes type UEKES.
*读取确认
CALL FUNCTION 'ZPP142_GET_EKES'
EXPORTING
I_EBELN = '4900177648'
I_EBELP = '00010'
TABLES
T_ekes = lt_ekes.
.
*准备删除现有条目
loop at lt_ekes into ls_ekes.
MOVE-CORRESPONDING ls_ekes to ls_yuekes.
ls_yuekes-kz = 'D'.
append ls_yuekes to lt_yuekes.
clear: ls_ekes.
endloop.
if lt_yuekes is not INITIAL.
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = '4900177648'
TABLES
XEKES = lt_xuekes
YEKES = lt_yuekes.
if sy-subrc = 0.
commit WORK AND WAIT.
write 'Delete ok'.
else.
write 'Delete not ok'.
endif.
endif.
endcase.
相关文章推荐
- 用ME_CONFIRMATION_UPDATE处理采购订单行项目确认视图
- Linux下的Backlight子系统(一)【转】
- Apache Maven 入门篇 ( 上 )
- 网易视频云:Hadoop中空间数据的存储(一)
- linux partition
- Linux+qt生成和调用静态库
- Linux/ visual studio 编译使用Poco
- Sqoop的import和export工具的使用几种案例
- Apache 简单实践
- Docker容器2016发展预测
- Linux常用命令
- Tomcat中使用JNDI时需要注意的地方
- apache配置防盗链
- Linux下使用system()函数一定要谨慎
- Linux File System brief intro
- 用canvas做图像遮罩---globalCompositeOperation 属性
- Tomcat装载Servlet的三种情况
- 在线LDD3[linux device driver]
- hadoop fs管理文件权限
- Linux设置时间同步