*&---------------------------------------------------------------------* *& Report ZBAPI1 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZBAPI1. DATA PRHEADER TYPE BAPIMEREQHEADER. DATA PRHEADERX TYPE BAPIMEREQHEADERX. PRHEADER-PR_TYPE = 'NB'. PRHEADERX-PR_TYPE = 'X'. "行项目 DATA GT_PRITEM TYPE TABLE OF BAPIMEREQITEMIMP. DATA GS_PRITEM TYPE BAPIMEREQITEMIMP. GS_PRITEM-MATERIAL = 'A01'. GS_PRITEM-PLANT = '8010'. GS_PRITEM-QUANTITY = '999'. APPEND GS_PRITEM TO GT_PRITEM. "行项目X DATA GT_PRITEMX TYPE TABLE OF BAPIMEREQITEMX. DATA GS_PRITEMX TYPE BAPIMEREQITEMX. GS_PRITEMX-MATERIAL = 'X'. GS_PRITEMX-PLANT = 'X'. GS_PRITEMX-QUANTITY = 'X'. APPEND GS_PRITEMX TO GT_PRITEMX. DATA GS_NUMBER TYPE BAPIMEREQHEADER-PREQ_NO."返回采购申请编号 CALL FUNCTION 'BAPI_PR_CREATE' EXPORTING PRHEADER = PRHEADER PRHEADERX = PRHEADERX * TESTRUN = IMPORTING NUMBER = GS_NUMBER * PRHEADEREXP = TABLES * RETURN = PRITEM = GT_PRITEM PRITEMX = GT_PRITEMX * PRITEMEXP = * PRITEMSOURCE = * PRACCOUNT = * PRACCOUNTPROITSEGMENT = * PRACCOUNTX = * PRADDRDELIVERY = * PRITEMTEXT = * PRHEADERTEXT = * EXTENSIONIN = * EXTENSIONOUT = * PRVERSION = * PRVERSIONX = * ALLVERSIONS = * PRCOMPONENTS = * PRCOMPONENTSX = * SERVICEOUTLINE = * SERVICEOUTLINEX = * SERVICELINES = * SERVICELINESX = * SERVICELIMIT = * SERVICELIMITX = * SERVICECONTRACTLIMITS = * SERVICECONTRACTLIMITSX = * SERVICEACCOUNT = * SERVICEACCOUNTX = * SERVICELONGTEXTS = * SERIALNUMBER = * SERIALNUMBERX = . CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X' * IMPORTING * RETURN = . COMMIT WORK AND WAIT. WRITE GS_NUMBER.
标签:PR,PRITEM,BAPI,GT,GS,创建,PRITEMX,DATA,TYPE From: https://www.cnblogs.com/hua900822/p/17520077.html