FUNCTION Z_NPIP_PR_CREATE .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(NUMBER) LIKE BAPIMEREQHEADER-PREQ_NO
*" TABLES
*" PRITEM STRUCTURE BAPIMEREQITEMIMP
*" PRHEADERTEXT STRUCTURE BAPIMEREQHEADTEXT OPTIONAL
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
*"----------------------------------------------------------------------
DATA : S_HEADER LIKE BAPIMEREQHEADER OCCURS 0 WITH HEADER LINE.
S_HEADER-PR_TYPE = 'NB'.
* S_HEADER-CTRL_IND = 'X'.
* S_HEADER-GENERAL_RELEASE = 'X'.
* S_HEADER-CREATE_IND = 'X'.
* S_HEADER-ITEM_INTVL = 0000.
* S_HEADER-LAST_ITEM = 0000.
* S_HEADER-AUTO_SOURCE = 'X'.
* S_HEADER-MEMORY = 'X'.
APPEND S_HEADER.
*
DATA : S_HEADERX LIKE BAPIMEREQHEADERX OCCURS 0 WITH HEADER LINE.
S_HEADERX-PR_TYPE = 'X'.
* S_HEADER-CTRL_IND = 'X'.
* S_HEADER-GENERAL_RELEASE = 'X'.
* S_HEADER-CREATE_IND = 'X'.
* S_HEADER-ITEM_INTVL = 'X'.
* S_HEADER-LAST_ITEM = 'X'.
* S_HEADER-AUTO_SOURCE = 'X'.
* S_HEADER-MEMORY = 'X'.
*
*
APPEND S_HEADERX.
DATA : S_ITEMX LIKE BAPIMEREQITEMX OCCURS 0 WITH HEADER LINE.
S_ITEMX-MATERIAL = 'X'.
S_ITEMX-PLANT = 'X'.
S_ITEMX-QUANTITY = 'X'.
S_ITEMX-DELIV_DATE = 'X'.
APPEND S_ITEMX.
DATA : S_ITEMEXP LIKE BAPIMEREQITEM OCCURS 0 WITH HEADER LINE.
S_ITEMEXP-DOC_TYPE = 'NB'.
APPEND S_ITEMEXP.
CALL FUNCTION 'BAPI_PR_CREATE'
EXPORTING
PRHEADER = S_HEADER
PRHEADERX = S_HEADERX
* VERSIONS =
* TESTRUN =
IMPORTING
NUMBER = NUMBER
* PRHEADEREXP =
TABLES
RETURN = RETURN
PRITEM = PRITEM
PRITEMX = S_ITEMX
PRITEMEXP = S_ITEMEXP
* PRITEMSOURCE =
* PRACCOUNT =
* PRACCOUNTPROITSEGMENT =
* PRACCOUNTX =
* PRADDRDELIVERY =
* PRITEMTEXT =
PRHEADERTEXT = PRHEADERTEXT
* EXTENSIONIN =
* EXTENSIONOUT =
* PRVERSION =
* PRVERSIONX =
* ALLVERSIONS =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
ENDFUNCTION.
좋은정보 감사합니다.