BAPI - PR - CREATE - Template For Creating Service PR
BAPI - PR - CREATE - Template For Creating Service PR
Symptom
This KBA provide you with the sample test records for creating service/limit PR by BAPI_PR_CREATE.
Before using the templates below, please make sure that you are in release 604 or higher, and the business
function LOG_MM_CI_2 has been activated in transaction SFW5. In case this business function is not
activated, even you have filled the BAPI data correctly, you still cannot create service/limit PR by this BAPI.
Environment
Materials Management (MM)
SAP ERP Central Component
SAP ERP
SAP enhancement package for SAP ERP
SAP enhancement package for SAP ERP, version for SAP HANA
SAP S/4HANA
Resolution
Before using the templates below, please make sure the business function LOG_MM_CI_2 is activated in your
system. Without this business function, the templates does not work.
Please fill the parameters and the tables according to the following model.
1.1 PRHEADER
PR_TYPE = NB
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 1/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
1.2 PRHEADERX
PR_TYPE = X
1.3 PRITEM
PREQ_ITEM = 00010
PUR_GROUP = 001
PLANT = 0001
MATL_GROUP = 01
ITEM_CAT = 9
ACCTASSCAT = K
PCKG_NO = 0000000001
1.4 PRITEMX
PREQ_ITEM = 00010
PREQ_ITEMX = X
PUR_GROUP = X
SHORT_TEXT = X
PLANT = X
MATL_GROUP = X
ITEM_CAT = X
ACCTASSCAT = X
PCKG_NO = X
1.5 PRACCOUNT
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 2/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
PREQ_ITEM = 00010
SERIAL_NO = 01
GL_ACCOUNT = 410000
COSTCENTER = 1000
1.6 PRACCOUNTX
PREQ_ITEM = 00010
SERIAL_NO = 01
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
1.7 SERVICELINES
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
QUANTITY = 10.000
UOM = EA
GROSS_PRICE = 10.00
CURRENCY = EUR
1.8 SERVICELINESX
DOC_ITEM = 00010
OUTLINE = 0000000001
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 3/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
SRV_LINE = 0000000010
SHORT_TEXT = X
QUANTITY = X
UOM = X
GROSS_PRICE = X
CURRENCY = X
1.9 SERVICEACCOUNT
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 100
1.10 SERVICEACCOUNTX
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
2.1 PRHEADER
Same as 1.1.
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 4/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
2.2 PRHEADERX
Same as 1.2.
2.3 PRITEM
Same as 1.3.
2.4 PRITEMX
Same as 1.4.
2.5 PRACCOUNT
PREQ_ITEM = 00010
SERIAL_NO = 01
GL_ACCOUNT = 400000
COSTCENTER = 1000
PREQ_ITEM = 00010
SERIAL_NO = 02
GL_ACCOUNT = 410000
COSTCENTER = 2000
2.6 PRACCOUNTX
PREQ_ITEM = 00010
SERIAL_NO = 01
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 5/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
PREQ_ITEM = 00010
SERIAL_NO = 02
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
2.7 SERVICELINES
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
QUANTITY = 10.000
UOM = EA
GROSS_PRICE = 10.00
CURRENCY = EUR
DIST_IND_ACC = 2
2.8 SERVICELINESX
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 6/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SHORT_TEXT = X
QUANTITY = X
UOM = X
GROSS_PRICE = X
CURRENCY = X
DIST_IND_ACC = X
2.9 SERVICEACCOUNT
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 60,0
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 02
SERIAL_NO_ITEM = 02
PERCENT = 40,0
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 7/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
2.10 SERVICEACCOUNTX
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
DOC_ITEM = 00010
OUTLINE = 0000000001
SRV_LINE = 0000000010
SERIAL_NO = 02
SERIAL_NO_ITEM = X
PERCENT = X
3.1 PRHEADER
Same as 1.1.
3.2 PRHEADERX
Same as 1.2.
3.3 PRITEM
Same as 1.3
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 8/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
3.4 PRITEMX
Same as 1.4
3.5 PRACCOUNT
Same as 1.5
3.6 PRACCOUNTX
Same as 1.6
3.7 SERVICEOUTLINE
DOC_ITEM = 00010
OUTLINE = 0000000002
PARENT_OUTLINE = 0000000001
OUTLINE_LEVEL_NAME = 1
SHORT_TEXT = OUTLINE1
3.8 SERVICEOUTLINEX
DOC_ITEM = 00010
OUTLINE = 0000000002
PARENT_OUTLINE = 0000000001
OUTLINE_LEVEL_NAME = X
SHORT_TEXT = X
3.9 SERVICELINES
DOC_ITEM = 00010
OUTLINE = 0000000002
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 9/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
SRV_LINE = 0000000010
QUANTITY = 10,000
UOM = EA
GROSS_PRICE = 10,00
CURRENCY = EUR
3.10 SERVICELINESX
DOC_ITEM = 00010
OUTLINE = 0000000002
SRV_LINE = 0000000010
SHORT_TEXT = X
QUANTITY = X
UOM = X
GROSS_PRICE = X
CURRENCY = X
3.11 SERVICEACCOUNT
DOC_ITEM = 00010
OUTLINE = 0000000002
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 100,0
3.12 SERVICEACCOUNTX
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 10/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
DOC_ITEM = 00010
OUTLINE = 0000000002
SRV_LINE = 0000000010
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
4.1 PRHEADER
Same as 1.1.
4.2 PRHEADERX
Same as 1.2.
4.3 PRITEM
Same as 1.3.
4.4 PRITEMX
Same as 1.4.
4.5 PRACCOUNT
Same as 1.5.
4.6 PRACCOUNTX
Same as 1.6.
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 11/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
4.7 SERVICELIMIT
DOC_ITEM = 00010
OVERALL_LIMIT = 100,00
EXP_VALUE = 100,00
4.8 SERVICELIMITX
DOC_ITEM = 00010
OVERALL_LIMIT = X
EXP_VALUE = X
4.9 SERVICEACCOUNT
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 100,0
4.10 SERVICEACCOUNTX
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 12/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
5.1 PRHEADER
Same as 1.1.
5.2 PRHEADERX
Same as 1.2.
5.3 PRITEM
Same as 1.3.
5.4 PRITEMX
Same as 1.4.
5.5 PRACCOUNT
PREQ_ITEM = 00010
SERIAL_NO = 01
GL_ACCOUNT = 400000
COSTCENTER = 1000
PREQ_ITEM = 00010
SERIAL_NO = 02
GL_ACCOUNT = 400000
COSTCENTER = 2000
5.6 PRACCOUNTX
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 13/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
PREQ_ITEM = 00010
SERIAL_NO = 01
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
PREQ_ITEM = 00010
SERIAL_NO = 02
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
5.7 SERVICELIMIT
DOC_ITEM = 00010
OVERALL_LIMIT = 100,00
EXP_VALUE = 100,00
DISTRIB = 2
5.8 SERVICELIMITX
DOC_ITEM = 00010
OVERALL_LIMIT = X
EXP_VALUE = X
DISTRIB = X
5.9 SERVICEACCOUNT
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 14/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 40
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 02
SERIAL_NO_ITEM = 02
PERCENT = 60
5.10 SERVICEACCOUNTX
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 15/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 02
SERIAL_NO_ITEM = X
PERCENT = X
6. Blanket PR(document type FO, item category B) + single account assignment
6.1 PRHEADER
PR_TYPE = FO
6.2 PRHEADERX
PR_TYPE = X
6.3 PRITEM
PREQ_ITEM = 00010
PUR_GROUP = 001
PLANT = 0001
MATL_GROUP = 01
ITEM_CAT = 1
ACCTASSCAT = K
PCKG_NO = 0000000001
6.4 PRITEMX
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 16/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
PREQ_ITEM = 00010
PREQ_ITEMX = X
PUR_GROUP = X
SHORT_TEXT = X
PLANT = X
MATL_GROUP = X
ITEM_CAT = X
ACCTASSCAT = X
PCKG_NO = X
6.5 PRACCOUNT
PREQ_ITEM = 00010
SERIAL_NO = 01
GL_ACCOUNT = 410000
COSTCENTER = 1000
6.6 PRACCOUNTX
PREQ_ITEM = 00010
SERIAL_NO = 01
PREQ_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
COSTCENTER = X
6.7 SERVICELIMIT
DOC_ITEM = 00010
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 17/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
OVERALL_LIMIT = 100,00
EXP_VALUE = 100,00
6.8 SERVICELIMITX
DOC_ITEM = 00010
OVERALL_LIMIT = X
EXP_VALUE = X
6.9 SERVICEACCOUNT
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = 01
PERCENT = 100,0
6.10 SERVICEACCOUNTX
DOC_ITEM = 00010
OUTLINE = 0000000000
SRV_LINE = 0000000000
SERIAL_NO = 01
SERIAL_NO_ITEM = X
PERCENT = X
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 18/19
12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR
See Also
1944945 (/sap/support/notes/1944945) - Error 06436 when creating/changing a service purchase requisitions
through BAPI
Keywords
sample, template, Specimen, procurement
Products
Products
SAP enhancement package for SAP ERP, version for SAP HANA all versions
1944945 Error 06436 when creating/changing a service purchase requisitions through BAPI
(/sap/support/notes/1944945)
1916765 MM-SRV: BAPI delivers incorrect results for service/limit items (/sap/support/notes/1916765 )
https://userapps.support.sap.com/sap/support/sfm/notes/print/0001950319?language=E&token=6B2047723F0ED2E4527B115E5719DA32 19/19