首页 > 编程语言 >BAPI_PR_CREATE-BAPI程序创建采购申请单

BAPI_PR_CREATE-BAPI程序创建采购申请单

时间:2023-05-08 15:46:34浏览次数:51  
标签:PR BAPI GS 申请单 DATA TYPE

FUNCTION ZPR2.
    DATA GS_HEADER  TYPE  BAPIMEREQHEADER.   "ME51N采购申请凭证抬头
    DATA GS_HEADERX TYPE  BAPIMEREQHEADERX.
    GS_HEADER-PR_TYPE  = 'NB'.  GS_HEADERX-PR_TYPE = 'X'."采购凭证类型
    DATA GT_ITEM   TYPE TABLE OF  BAPIMEREQITEMIMP."ME51N采购申请单行项目
    DATA GT_ITEMX  TYPE TABLE OF  BAPIMEREQITEMX.
    DATA GS_ITEM   TYPE  BAPIMEREQITEMIMP.
    DATA GS_ITEMX  TYPE  BAPIMEREQITEMX.
    DATA I TYPE I VALUE 0.
    WHILE I <= 10.
      CLEAR  GS_ITEM.
      GS_ITEM-MATERIAL = 'A01'.   "物料号
      GS_ITEM-PLANT    = '8010'.  "工厂
      GS_ITEM-QUANTITY = '10'.    "采购数量
      APPEND GS_ITEM TO GT_ITEM.
      CLEAR GS_ITEMX.
      GS_ITEMX-MATERIAL = 'X'.   "物料号
      GS_ITEMX-PLANT    = 'X'.  "工厂
      GS_ITEMX-QUANTITY = 'X'.  "采购数量
      APPEND GS_ITEMX TO  GT_ITEMX.
      I = I + 1.
    ENDWHILE.
    CALL FUNCTION 'BAPI_PR_CREATE'  "BAPI ==>创建采购申请单
     EXPORTING
       PRHEADER                     = GS_HEADER
       PRHEADERX                    = GS_HEADERX
     IMPORTING
        NUMBER                       = R_NUMBER "BAPI执行成功返回:采购申请单 如 1000032
      TABLES
        PRITEM                       = GT_ITEM   "行项目
        PRITEMX                      = GT_ITEMX.
    IF SY-SUBRC = 0 AND R_NUMBER IS NOT INITIAL.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         WAIT          = 'X'.
      COMMIT WORK AND WAIT.
    ENDIF.
ENDFUNCTION.

 

标签:PR,BAPI,GS,申请单,DATA,TYPE
From: https://www.cnblogs.com/hua900822/p/17381939.html

相关文章

  • SpringBoot全局异常处理
    @ControllerAdvice:使用该注解表示开启了全局异常的捕获; 参考链接[1]https://www.cnblogs.com/xuwujing/p/10933082.html[2]https://gitee.com/bruce6213/global-exception-handler......
  • MFC-GetProcAddress获取动态链接库中函数的地址
     HMODULEhmodule=::GetModuleHandle(_T("kernel32.dll"));//获取动态链接库的模块句柄typedefDWORD(*p)(void);//声明函数指针数据类型charch[]="GetCurrentThreadId";//【特别注意:这个函数名必须是ANSI的char类型】pf=(p):......
  • spring 配置https
    生成jks证书(请安装jdk)keytool-keystoremykeys.jks-genkey-aliasmyAlias-keyalgRSA自己生成的口令要记住,后面配置需要用到 然后把生成的jks文件复制到项目目录下,在spring配置文件(application.yml/application.properties)下进行对应ssl配置 ssl配置说明:......
  • spring3 mvc 效验例子
    Theapplicationwillpresentsimpleuserregistrationformtotheuser.Formwillhavethefollowingfields:1.UserName2.Age3.PasswordThevalidatorframeworkwillvalidatetheuserinput.Ifthereisanyvalidationerrorapplicationwilldisplayt......
  • How to use Linux command to find out the background process All In One
    HowtouseLinuxcommandtofindoutthebackgroundprocessAllInOneLinuxcommandcheckbackgroundprocessjobs$jobs[1]+运行中sudopython3/home/pi/OLED_Stats/stats.py&bg$bg%1$pi@raspberrypi:~$bg--helpbg:bg[任务声明.......
  • JavaScript: XMLHTTPRequest
     XMLHttpRequest(javascript.info)<body><script>//CreateanewXMLHTTPRequestobjectletxhr=newXMLHttpRequest()xhr.timeout=5000//timeoutinmsleturl=newURL('https://cursive.winch.io/......
  • SpringBoot常用注解
    @SpringBootApplication@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Documented@Inherited@Configuration@EnableAutoConfiguration@ComponentScanpublic@interfaceSpringBootApplication{ /** *Excludespecificauto-configurationclas......
  • 解决eclipse+myeclipse的Processing Dirty Regions错误
    http://www.javaeye.com/topic/192152我的Eclipse3.3.2+MyEclipse6.0.1在打开JSP文件时出现以下错误:Aninternalerroroccurredduring:"ProcessingDirtyRegions".org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidationHelperAninternalerro......
  • 《java接力》springboot篇——注解
    注解后续补充常用注解aspect参考链接:https://zhuanlan.zhihu.com/p/351468451需要依赖:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId></dependency>......
  • Grafana 系列-统一展示-3-Prometheus 仪表板
    系列文章Grafana系列文章知识储备PrometheusTemplateVariables你可以使用变量来代替硬编码的细节,如server、app和pod_name在metric查询中。Grafana在仪表盘顶部的下拉选择框中列出这些变量,帮助你改变仪表盘中显示的数据。Grafana将这类变量称为模板变量。Query......