使用弹窗批量修改数据POPUP_GET_VALUES
转自:https://blog.csdn.net/huanglin6/article/details/81231215
业务场景:在SAP内,有时候需要用户批量维护某些数据,这时候可以使用标准函数POPUP_GET_VALUES可以进行批量的维护。
效果图
参考代码
FORM CALL_CHANGE CHANGING P_L_RETURN_CODE . DATA: BEGIN OF FIELDS OCCURS .
INCLUDE STRUCTURE SVAL.
DATA: END OF FIELDS. DATA: L_RETURN_CODE TYPE C.
DATA: DATE LIKE T5A4A-DLYDY. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTSD_SCXQ_H'.
FIELDS-FIELDNAME = 'WERKS'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'EKORG'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'EKGRP'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'LFA1'.
FIELDS-FIELDNAME = 'LIFNR'.
APPEND FIELDS. *FIELDS-TABNAME = 'LFA1'.
*FIELDS-FIELDNAME = 'NAME1'.
*APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'T001L'.
FIELDS-FIELDNAME = 'LGORT'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTMM_ZMWSKZ'.
FIELDS-FIELDNAME = 'MWSKZ'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'BSART'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTPP_CPDM'.
FIELDS-FIELDNAME = 'ZDM'.
FIELDS-FIELDTEXT = '产品代码'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTPP_SCDM'.
FIELDS-FIELDNAME = 'ZDM'.
FIELDS-FIELDTEXT = '生产代码'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'ZYFK'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTMM_ZTERM'.
FIELDS-FIELDNAME = 'ZTERM'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'BAPIMEPOITEM'.
FIELDS-FIELDNAME = 'UNDER_DLV_TOL'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'BAPIMEPOITEM'.
FIELDS-FIELDNAME = 'OVER_DLV_TOL'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'ZTMM_JYD'.
FIELDS-FIELDNAME = 'ZJYD'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'ZCGXY'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'PINCR'.
FIELDS-FIELDTEXT = '日期加'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'LPONR'.
FIELDS-FIELDTEXT = '日期减'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKPO'.
FIELDS-FIELDNAME = 'NETPR'.
FIELDS-FIELDTEXT = '含税单价'.
APPEND FIELDS. CLEAR:FIELDS.
FIELDS-TABNAME = 'EKKO'.
FIELDS-FIELDNAME = 'WAERS'.
FIELDS-FIELD_ATTR = '' .
APPEND FIELDS. CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
* NO_VALUE_CHECK = ' '
POPUP_TITLE = '批量赋值'
* START_COLUMN = '5'
* START_ROW = '5'
IMPORTING
RETURNCODE = L_RETURN_CODE
TABLES
FIELDS = FIELDS
EXCEPTIONS
ERROR_IN_FIELDS =
OTHERS =
.
IF SY-SUBRC <> .
* Implement suitable error handling here
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'WERKS'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_WERKS.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'EKORG'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_EKORG.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'EKGRP'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_EKGRP.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'LIFNR'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_LIFNR.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'NAME1'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_NAME1.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'LGORT'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_LGORT.
ENDIF. READ TABLE FIELDS INDEX ."WITH KEY FIELDNAME = 'ZDM'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZDM_CP.
ENDIF. READ TABLE FIELDS INDEX ."WITH KEY FIELDNAME = 'ZDM'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZDM_GS.
ENDIF. *G_ZDM_CP LIKE ZTPP_CPDM-ZDM,"产品代码
* LIKE ZTPP_CPDM-ZDM."生产代码
READ TABLE FIELDS WITH KEY FIELDNAME = 'BSART'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_BSART.
ENDIF. READ TABLE FIELDS WITH KEY FIELDNAME = 'MWSKZ'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_MWSKZ.
ENDIF. "是否预付款 ADD BY HANDLH 2018.5.22
READ TABLE FIELDS WITH KEY FIELDNAME = 'ZYFK'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZYFK.
ENDIF. "付款条件 ADD BY HANDLH 2018.5.22
READ TABLE FIELDS WITH KEY FIELDNAME = 'ZTERM'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZTERM.
ENDIF. "交货不足限度 ADD BY HANDLH 2018.5.22
READ TABLE FIELDS WITH KEY FIELDNAME = 'UNDER_DLV_TOL'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_UNTTO.
ENDIF. "过量交货限度 ADD BY HANDLH 2018.5.22
READ TABLE FIELDS WITH KEY FIELDNAME = 'OVER_DLV_TOL'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_UEBTO.
ENDIF. "采购单价
READ TABLE FIELDS WITH KEY FIELDNAME = 'NETPR'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_NETPR.
ENDIF. "检验地点
READ TABLE FIELDS WITH KEY FIELDNAME = 'ZJYD'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZJYD.
ENDIF. "采购协议号
READ TABLE FIELDS WITH KEY FIELDNAME = 'ZCGXY'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_ZCGXY.
ENDIF. "日期加
READ TABLE FIELDS WITH KEY FIELDNAME = 'PINCR'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_DAY_ADD.
ENDIF. "日期减
READ TABLE FIELDS WITH KEY FIELDNAME = 'LPONR'.
IF SY-SUBRC EQ .
MOVE FIELDS-VALUE TO G_DAY_DEC.
ENDIF. IF L_RETURN_CODE NE 'A'."不是取消 .
LOOP AT GT_OUTPUT ASSIGNING FIELD-SYMBOL(<FW_OUTPUT>) WHERE SLBOX EQ 'X'.
IF G_WERKS IS NOT INITIAL.
MOVE G_WERKS TO <FW_OUTPUT>-DWERK.
ENDIF. IF G_EKORG IS NOT INITIAL .
MOVE G_EKORG TO <FW_OUTPUT>-EKORG.
ENDIF. IF G_EKGRP IS NOT INITIAL .
MOVE G_EKGRP TO <FW_OUTPUT>-EKGRP.
ENDIF. IF G_LIFNR IS NOT INITIAL.
MOVE G_LIFNR TO <FW_OUTPUT>-LIFNR.
ENDIF. IF G_NAME1 IS NOT INITIAL .
MOVE G_NAME1 TO <FW_OUTPUT>-NAME1.
ENDIF. IF G_LGORT IS NOT INITIAL.
MOVE G_LGORT TO <FW_OUTPUT>-LGORT.
ENDIF. IF G_MWSKZ IS NOT INITIAL.
MOVE G_MWSKZ TO <FW_OUTPUT>-MWSKZ.
ENDIF. IF G_BSART IS NOT INITIAL .
MOVE G_BSART TO <FW_OUTPUT>-BSART.
ENDIF. IF G_ZDM_CP IS NOT INITIAL.
MOVE G_ZDM_CP TO <FW_OUTPUT>-ZDM_CP.
ENDIF. IF G_ZDM_GS IS NOT INITIAL.
MOVE G_ZDM_GS TO <FW_OUTPUT>-ZDM_GS.
ENDIF. IF G_ZDM_GS IS NOT INITIAL.
MOVE G_ZDM_GS TO <FW_OUTPUT>-ZDM_GS.
ENDIF. IF G_ZYFK IS NOT INITIAL.
MOVE G_ZYFK TO <FW_OUTPUT>-ZYFK.
ENDIF. IF G_ZTERM IS NOT INITIAL.
MOVE G_ZTERM TO <FW_OUTPUT>-ZTERM.
ENDIF. IF G_UNTTO IS NOT INITIAL.
MOVE G_UNTTO TO <FW_OUTPUT>-UNTTO.
ENDIF. IF G_UEBTO IS NOT INITIAL.
MOVE G_UEBTO TO <FW_OUTPUT>-UEBTO.
ENDIF. IF G_MAKTX IS NOT INITIAL.
MOVE G_MAKTX TO <FW_OUTPUT>-MAKTX.
ENDIF. IF G_NETPR IS NOT INITIAL.
MOVE G_NETPR TO <FW_OUTPUT>-NETPR.
ENDIF. IF G_ZJYD IS NOT INITIAL.
MOVE G_ZJYD TO <FW_OUTPUT>-ZJYD.
ENDIF. IF G_ZCGXY IS NOT INITIAL.
MOVE G_ZCGXY TO <FW_OUTPUT>-ZCGXY.
ENDIF. IF G_DAY_ADD IS NOT INITIAL .
MOVE G_DAY_ADD TO DATE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = <FW_OUTPUT>-ZJHRK_DAT
days = DATE "天数加N或者减N 不加也不减 写0
months = "月份加N或者减N 不加也不减 写0
signum = '+' "可以是+或者-
years = "年份加N或者减N 不加也不减 写0
IMPORTING
calc_date = <FW_OUTPUT>-ZDDJQ."得到加减之后的日期
ENDIF. IF G_DAY_DEC IS NOT INITIAL .
MOVE G_DAY_DEC TO DATE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = <FW_OUTPUT>-ZJHRK_DAT
days = DATE "天数加N或者减N 不加也不减 写0
months = "月份加N或者减N 不加也不减 写0
signum = '-' "可以是+或者-
years = "年份加N或者减N 不加也不减 写0
IMPORTING
calc_date = <FW_OUTPUT>-ZDDJQ."得到加减之后的日期
ENDIF. SELECT SINGLE
NAME1
INTO <FW_OUTPUT>-NAME1
FROM LFA1
WHERE LIFNR EQ <FW_OUTPUT>-LIFNR. ENDLOOP.
ENDIF. ENDFORM.
————————————————
版权声明:本文为CSDN博主「SAP-Joker」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/huanglin6/article/details/
使用弹窗批量修改数据POPUP_GET_VALUES的更多相关文章
- 批量修改数据sql
--insert into P_ZPROMOTION_DOC_ITEMS (AKTNR,MATNR,MINGROSS,MCRANK,MCUPRICE,MAXBAKTNR,MAXBPAMONT,MAXB ...
- ArcGIS 批量修改数据名称-arcgis案例实习教程
ArcGIS 批量修改数据名称-arcgis案例实习教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 功能:批量修改数据/文件名称 使用方法: 输入:文件夹(或者 ...
- php 循环从数据库分页取数据批量修改数据
//批量修改email重复 public function getEmail() { $this->model = app::get('shop')->model('manage'); / ...
- .net Core使用sql语句实现批量修改数据状态
上图为查出的所有满足条件的数据,要选中若干条数据将其状态设置为作废 一共选中6条数据,当点击确认后修改数据状态. 前端代码 1.安装NuGet包 [Abp.Dapper]于EFCore中, 2.创建文 ...
- MySQL+MyBatis下批量修改数据的问题
今天处理数据批量的更新,场景是这样子的,web站管理的字典功能,需要添加一个记录的整体描述,以及详细内容的描述.一个字典整体概述只有一组信息,但是其详细内容,会有很多项,不确定. 这个场景,在关系型数 ...
- Spring Boot + LayUI 批量修改数据 数据包含着对象
页面展示 HTML 代码 <blockquote class="layui-elem-quote demoTable"> <div class="lay ...
- 一百一十三、SAP的SCAT录屏操作,类似按键精灵可用于批量修改数据
一.输入事务代码SCAT,输入Z开头的程序名,点击左上角的新建图标 二.输入标题和模块名 三.保存为本地对象 四.包属性修改为CATT,然后保存 五.可以看到我们新建的一条内容,点击小铅笔修改 六.点 ...
- SQL 查找重复项及批量修改数据成固定格式
1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from ...
- Phoenix批量修改数据
很简单的一个东西,查了挺久的,浪费了很多的时间 直接用Upsert Into Select就可以了 例:把tables表中cloumn2列等于bbb的都改成aaa Upsert Into Table ...
随机推荐
- JDBC课程1-实现Driver接口连接mysql数据库、通用的数据库连接方法(使用文件jdbc.properties)
package day_18; import jdk.internal.util.xml.impl.Input; import org.junit.Test; import java.io.Input ...
- C# Get请求携带body
C# get 请求携带body需要用到RestSharp,可以通过NuGet获取,但是只有.NetFramework 4.5+版本支持.通过Postman可以测试并生成C#代码 var client ...
- DT7.0主动推送当天高质量图片数据到熊掌号展现
<?php /* 百度当天主动推送熊掌功能 作者:68喜科技 用于:DT7.0 功能模块:优质内容推送熊掌*出图内容当天推送 */ //引入全局变量函数 defined('IN_DESTOON' ...
- json与java bean对象转换
第一步:引入fastjson的依赖jar包 注:如果引入此版本的依赖,导致项目不能启动(报错:找不到启动类);那么可以换一个版本的fastjson即可. 给出文字版: <!-- fastjson ...
- mybatis-传多个参数
第一种方案:下标传参 DAO层的函数方法 Public User selectUser(String name, String area); 对应的Mapper.xml <select id=& ...
- SpringBoot项目中,Redis的初次使用
1.引入Redis依赖包,在application.yml中配置redis <dependency> <groupId>org.springframework.boot< ...
- fdisk分区命令
fdisk是Linux系统中最常用的分区工具,通过这个命令也可以查看系统中所有可用的分区,但是这个命令只支持MBR的分区表(这句话应该只对某些系统,CentOS7-1810适用,Debian9.5和o ...
- DEA使用git提交代码时,点了commit之后卡死在performing code analysis部分,或者performing code analysis结束后没有进入下一步操作。
把"Perform code analysis" 和 "Check TODO" 复选框前面的勾去掉就好了. 这个可能是因为所分析的目标文件太大了,造成一直分析不 ...
- SpringMVC 捕获参数绑定失败时的异常
SpringMVC配置数据验证(JSR-303)中提到了用String类型的域来绑定Ajax中的非法类型的参数. 这样做的目的是一旦发生一种情况,后端可以返回一个自定类的返回值,而不是返回Spring ...
- redis缓存击穿问题一种思路分享
思路每一个key都有一个附属key1,附属key1可以是key加特定前缀组成,key对应value为真正的缓存数据,附属key1对应的value不重要,可以是随便一个值,附属key1的作用主要是维护缓 ...