SAP 销售订单审批状态(查询/修改)

销售订单审批状态启用后,前端显示界面如下图

销售订单审批状态读取:STATUS_READ

销售订单审批状态修改:I_CHANGE_STATUS

销售订单审批状态读取

代码样例如下:

DATA: lv_objnr   TYPE vbak-objnr,lv_objnr_t TYPE jsto-objnr,lv_obtyp   TYPE jsto-obtyp,lv_stsma   TYPE jsto-stsma,lv_stonr   TYPE tj30-stonr,lt_status  TYPE TABLE OF jstat,ls_status  TYPE jstat.
SELECT SINGLE objnr INTO lv_objnrFROM vbakWHERE vbeln = i_vbeln.IF lv_objnr IS NOT INITIAL.lv_objnr_t = lv_objnr.CALL FUNCTION 'STATUS_READ'EXPORTING
*       CLIENT           = SY-MANDTobjnr            = lv_objnr_t
*       ONLY_ACTIVE      = ' 'IMPORTINGobtyp            = lv_obtypstsma            = lv_stsmastonr            = lv_stonrTABLESstatus           = lt_statusEXCEPTIONSobject_not_found = 1OTHERS           = 2.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat2inact = ''.IF sy-subrc = 0.ENDIF.
ENDIF.

销售订单审批状态修改

具体代码样例如下:

FUNCTION zjkdms003.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  IMPORTING
*"     VALUE(I_VBELN) TYPE  VBELN_VA OPTIONAL
*"     VALUE(I_ESTAT) TYPE  J_ESTAT OPTIONAL
*"     VALUE(I_APPROVER) TYPE  TEXT30 OPTIONAL
*"     VALUE(I_NAME) TYPE  TEXT30 OPTIONAL
*"  EXPORTING
*"     VALUE(E_MSG) TYPE  BAPIRET2
*"----------------------------------------------------------------------DATA: lv_objnr   TYPE vbak-objnr,lv_objnr_t TYPE jsto-objnr,lv_obtyp   TYPE jsto-obtyp,lv_stsma   TYPE jsto-stsma,lv_stonr   TYPE tj30-stonr,lt_status  TYPE TABLE OF jstat,ls_status  TYPE jstat,lt_tj30    TYPE TABLE OF tj30,ls_tj30    TYPE tj30,lv_estat1  TYPE tj30-estat,lv_estat2  TYPE tj30-estat,lv_estat3  TYPE tj30-estat,ieinfo     TYPE einfo,lt_003     TYPE TABLE OF ztjkdms003,ls_003     TYPE ztjkdms003.CLEAR: lv_objnr,lv_objnr_t,lv_obtyp,lv_stsma,lv_stonr,lt_status,ls_status,lt_tj30,ls_tj30,lv_estat1,lv_estat2,lv_estat3,ieinfo,lt_003,ls_003.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'EXPORTINGinput  = i_vbelnIMPORTINGoutput = i_vbeln.SELECT SINGLE objnr INTO lv_objnrFROM vbakWHERE vbeln = i_vbeln.IF lv_objnr IS NOT INITIAL.lv_objnr_t = lv_objnr.CALL FUNCTION 'STATUS_READ'EXPORTING
*       CLIENT           = SY-MANDTobjnr            = lv_objnr_t
*       ONLY_ACTIVE      = ' 'IMPORTINGobtyp            = lv_obtypstsma            = lv_stsmastonr            = lv_stonrTABLESstatus           = lt_statusEXCEPTIONSobject_not_found = 1OTHERS           = 2.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.IF lt_status IS NOT INITIAL.SELECT * INTO TABLE lt_tj30FROM tj30WHERE stsma = lv_stsma.SORT lt_tj30 BY estat.CLEAR: ls_tj30.READ TABLE lt_tj30 INTO ls_tj30 INDEX 1.IF sy-subrc = 0.lv_estat1 = ls_tj30-estat.ENDIF.CLEAR: ls_tj30.READ TABLE lt_tj30 INTO ls_tj30 INDEX 2.IF sy-subrc = 0.lv_estat2 = ls_tj30-estat.ENDIF.CLEAR: ls_tj30.READ TABLE lt_tj30 INTO ls_tj30 INDEX 3.IF sy-subrc = 0.lv_estat3 = ls_tj30-estat.ENDIF.IF i_estat = lv_estat1.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat2inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat2estat_active   = lv_estat1stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat3inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat3estat_active   = lv_estat1stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.IF sy-msgty = 'E' OR sy-msgty = 'A'.e_msg-type = sy-msgty.e_msg-id = sy-msgid.e_msg-number = sy-msgno.ieinfo-msgid = sy-msgid.ieinfo-msgty = sy-msgty.ieinfo-msgno = sy-msgno.CALL FUNCTION 'MESSAGE_GET_TEXT'EXPORTINGieinfo        = ieinfoilangu        = '1'IMPORTINGetext         = e_msg-messageEXCEPTIONSno_t100_found = 1OTHERS        = 2.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.ELSE.e_msg-type = 'S'.e_msg-message = '审批成功'.ENDIF.ENDIF.IF i_estat = lv_estat2.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat1inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat1estat_active   = lv_estat2stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat3inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat3estat_active   = lv_estat2stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.IF sy-msgty = 'E' OR sy-msgty = 'A'.e_msg-type = sy-msgty.e_msg-id = sy-msgid.e_msg-number = sy-msgno.ieinfo-msgid = sy-msgid.ieinfo-msgty = sy-msgty.ieinfo-msgno = sy-msgno.CALL FUNCTION 'MESSAGE_GET_TEXT'EXPORTINGieinfo        = ieinfoilangu        = '1'IMPORTINGetext         = e_msg-messageEXCEPTIONSno_t100_found = 1OTHERS        = 2.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.ELSE.e_msg-type = 'S'.e_msg-message = '审批成功'.ENDIF.ENDIF.IF i_estat = lv_estat3.IF lv_estat3 IS NOT INITIAL.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat2inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat2estat_active   = lv_estat3stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.READ TABLE lt_status INTO ls_status WITH KEY stat = lv_estat1inact = ''.IF sy-subrc = 0.CALL FUNCTION 'I_CHANGE_STATUS'EXPORTINGobjnr          = lv_objnr_testat_inactive = lv_estat1estat_active   = lv_estat3stsma          = lv_stsmaEXCEPTIONScannot_update  = 1OTHERS         = 2.ENDIF.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.IF sy-msgty = 'E' OR sy-msgty = 'A'.e_msg-type = sy-msgty.e_msg-id = sy-msgid.e_msg-number = sy-msgno.ieinfo-msgid = sy-msgid.ieinfo-msgty = sy-msgty.ieinfo-msgno = sy-msgno.CALL FUNCTION 'MESSAGE_GET_TEXT'EXPORTINGieinfo        = ieinfoilangu        = '1'IMPORTINGetext         = e_msg-messageEXCEPTIONSno_t100_found = 1OTHERS        = 2.IF sy-subrc <> 0.
* Implement suitable error handling hereENDIF.ELSE.e_msg-type = 'S'.e_msg-message = '审批成功'.ENDIF.ENDIF.ENDIF.IF i_estat IS INITIAL.e_msg-type = 'E'.e_msg-message = '请指定审批节点'.ENDIF.ENDIF.ENDIF.IF e_msg-type = 'S'. "当状态更新成功后,记录当前审批人信息ls_003-vbeln = i_vbeln.ls_003-estat = i_estat.ls_003-approver = i_approver.ls_003-name = i_name.ls_003-erdat = sy-datum.ls_003-erzet = sy-uzeit.COLLECT ls_003 INTO lt_003.CLEAR: ls_003.IF lt_003 IS NOT INITIAL.MODIFY ztjkdms003 FROM TABLE lt_003.IF sy-subrc = 0.COMMIT WORK AND WAIT.ELSE.ROLLBACK WORK.ENDIF.ENDIF.ENDIF.ENDFUNCTION.

销售订单审批状态更新日志表

表:JCDS

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/416867.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Qt 5.15.2 (MSVC 2019)编译 QWT 6.2.0 : 编译MingW或MSVC遇到的坑

MingW下编译QWt 6.2.0 下载qwt最新版本&#xff0c;用git工具 git clone下载源码 git clone https://git.code.sf.net/p/qwt/git qwt-git 或者使用我下载的 qwt 2.6.0 链接&#xff1a;https://pan.baidu.com/s/1KZI-L10N90TJobeqqPYBqw?pwdpq1o 提取码&#xff1a;pq1o 下载…

CodeWave智能开发平台--03--目标:应用创建--10初级采购管理系统总结

摘要 本文是网易数帆CodeWave智能开发平台系列的第14篇&#xff0c;主要介绍了基于CodeWave平台文档的新手入门进行学习&#xff0c;实现一个完整的应用&#xff0c;本文主要完成10初级采购管理系统总结 CodeWave智能开发平台的14次接触 CodeWave参考资源 网易数帆CodeWave…

muduo网络库剖析——通道Channel类

muduo网络库剖析——通道Channel类 前情从muduo到my_muduo 概要事件种类channel 框架与细节成员函数细节实现使用方法 源码结尾 前情 从muduo到my_muduo 作为一个宏大的、功能健全的muduo库&#xff0c;考虑的肯定是众多情况是否可以高效满足&#xff1b;而作为学习者&#x…

tui.calender日历创建、删除、编辑事件、自定义样式

全是坑&#x1f573;&#xff01;全是坑&#x1f573;&#xff01;全是坑&#x1f573;&#xff01;能不用就不用&#xff01; 官方文档&#xff1a;https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/calendar.md 实例的一些方法&#xff0c;比如创建、删除、修改、…

大数据平台的硬件规划、网络调优、架构设计、节点规划

1.大数据平台硬件选型 要对Hadoop大数据平台进行硬件选型,首先需要了解Hadoop的运行架构以及每个角色的功能。在一个典型的Hadoop架构中,通常有5个角色,分别是NameNode、Standby NameNode、ResourceManager、NodeManager、DataNode以及外围机。 其中 NameNode 负责协调集群…

用git bash调用md5sum进行批量MD5计算

对于非常大的文件或者很重要的文件&#xff0c;在不稳定的网络环境下&#xff0c;可能文件的某些字节会损坏。此时&#xff0c;对文件计算MD5即可以校验其完整性。比如本次的 OpenStreetMap 导出包&#xff0c;我的学弟反馈通过网盘下载无法解压&#xff0c;并建议我增加每个文…

HashMap 的底层实现#JDK1.8 之前

最近很多同学问我有没有java学习资料&#xff0c;我根据我从小白到架构师多年的学习经验整理出来了一份50W字面试解析文档、简历模板、学习路线图、java必看学习书籍 、 需要的小伙伴 可以关注我公众号&#xff1a;“ Tom聊架构 ”&#xff0c; 回复暗号&#xff1a;“ 578”即…

HCIA——18实验:NAT

学习目标&#xff1a; NAT 学习内容&#xff1a; NAT 1.要求——基本的 2.模型 3.IP分配、规划、优化 1&#xff09;思路 R2为ISP路由器&#xff0c;其上只能配置ip地址&#xff0c;不得冉进行其他的任何配置—ospf配置 认证 、汇总、沉默接口、加快收敛、缺省路由 PC1-PC2…

AIGC:人工智能驱动的数据分析新时代

AIGC&#xff1a;人工智能驱动的数据分析新时代 随着人工智能技术的迅猛发展&#xff0c;我们正迎来数据分析的新时代&#xff0c;其中AIGC&#xff08;Artificial Intelligence with Generative Capabilities&#xff09;的应用成为引领潮流的重要方向。本文将深入探讨几个关…

git中合并分支时出现了代码冲突怎么办

目录 第一章、Git代码冲突介绍1.1&#xff09;什么是Git代码冲突①git merge命令介绍②代码冲突原因 1.2&#xff09;提示代码冲突的两种情况①本地不同分支的文件有差异时&#xff1a;②本地仓库和git远程仓库的文件有差异时&#xff1a; 1.3&#xff09;解决合并时的代码冲突…

搜索经典题——填充 9*9矩阵

题目&#xff1a;给定一个九行九列矩阵&#xff0c;填充矩阵元素&#xff0c;要求&#xff1a; 1、每一行每一列&#xff0c;每个小九宫格&#xff08;图片画粗的地方就是&#xff09;不能包含相同元素 2、每一行&#xff0c;每一列&#xff0c;每个小九宫格均会完整出现1-9的数…

LeetCode.2788. 按分隔符拆分字符串

题目 题目链接 分析 题目的意思是给我们一个字符串数组和一个分隔符&#xff0c;让我们按照分隔符把字符串数组分割成新的字符串数组。 看到这个描述&#xff0c;这不就是直接就是利用 按照分隔符分割字符串的系统库函数split()&#xff0c;这个函数的意思就是 把一个字符串…