100% found this document useful (1 vote)
2K views19 pages

BAPI - PR - CREATE - Template For Creating Service PR

This document provides templates for creating purchase requisitions (PRs) with service lines or limits using the BAPI_PR_CREATE API in SAP. It includes examples for PRs with single or multiple account assignments, with details on how to fill out the required parameters and tables. Business function LOG_MM_CI_2 must be active for these templates to work properly.

Uploaded by

sergio escamilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views19 pages

BAPI - PR - CREATE - Template For Creating Service PR

This document provides templates for creating purchase requisitions (PRs) with service lines or limits using the BAPI_PR_CREATE API in SAP. It includes examples for PRs with single or multiple account assignments, with details on how to fill out the required parameters and tables. Business function LOG_MM_CI_2 must be active for these templates to work properly.

Uploaded by

sergio escamilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

12/1/23, 18:32 1950319 - BAPI_PR_CREATE: Template for creating service PR

SAP Knowledge Base Article

1950319 - BAPI_PR_CREATE: Template for


creating service PR
Component: MM-SRV-BPI (BAPIs), Version: 11, Released On: 18.10.2021

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.

1. PR with service line + single account assignment


2. PR with service line + multiple account assignment
3. PR with outlines + single account assignment
4. PR with limit data + single account assignment
5. PR with limit data + multiple account assignment
(limit data with multiple account assignment is only supported when using item category D(9), in case of
item category B(1), you cannot use multiple account assignment).
6. Blanket PR(document type FO, item category B) + single account assignment

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. PR with service line + single account assignment

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

  SHORT_TEXT = SERVICE PR SAMPLE

  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

  SHORT_TEXT = SERVICE LINE 10

  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. PR with service line + multiple account assignment.

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    

2.5.1 First entry    

  PREQ_ITEM = 00010

  SERIAL_NO = 01

  GL_ACCOUNT = 400000

  COSTCENTER = 1000

       

2.5.2 Second entry    

  PREQ_ITEM = 00010

  SERIAL_NO = 02

  GL_ACCOUNT = 410000

  COSTCENTER = 2000

       

2.6 PRACCOUNTX    

2.6.1 First entry    

  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

       

2.6.2 Second entry    

  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

  SHORT_TEXT = SERVICE LINE 10

  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    

2.9.1 First entry    

  DOC_ITEM = 00010

  OUTLINE = 0000000001

  SRV_LINE = 0000000010

  SERIAL_NO = 01

  SERIAL_NO_ITEM = 01

  PERCENT = 60,0

       

2.9.2 Second entry    

  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    

2.10.1 First entry    

  DOC_ITEM = 00010

  OUTLINE = 0000000001

  SRV_LINE = 0000000010

  SERIAL_NO = 01

  SERIAL_NO_ITEM = X

  PERCENT = X

       

2.10.2 Second entry    

  DOC_ITEM = 00010

  OUTLINE = 0000000001

  SRV_LINE = 0000000010

  SERIAL_NO = 02

  SERIAL_NO_ITEM = X

  PERCENT = X

       

3. PR with outlines + single account assignment.

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

  SHORT_TEXT = SERVICE LINE 10

  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. PR with limit data + single account assignment.

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. PR with limit data + multiple account assignment.

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

5.5.1 First entry  

  PREQ_ITEM = 00010

  SERIAL_NO = 01

  GL_ACCOUNT = 400000

  COSTCENTER = 1000

5.5.2 Second entry  

  PREQ_ITEM = 00010

  SERIAL_NO = 02

  GL_ACCOUNT = 400000

  COSTCENTER = 2000

5.6 PRACCOUNTX

5.6.1 First entry  

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

5.6.2 Second entry  

  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

5.9.1 First entry  

  DOC_ITEM = 00010

  OUTLINE = 0000000000

  SRV_LINE = 0000000000

  SERIAL_NO = 01

  SERIAL_NO_ITEM = 01

  PERCENT = 40

   

5.9.2 Second entry  

  DOC_ITEM = 00010

  OUTLINE = 0000000000

  SRV_LINE = 0000000000

  SERIAL_NO = 02

  SERIAL_NO_ITEM = 02

  PERCENT = 60

       

5.10 SERVICEACCOUNTX  

5.10.1 First entry  

  DOC_ITEM = 00010

  OUTLINE = 0000000000

  SRV_LINE = 0000000000

  SERIAL_NO = 01

  SERIAL_NO_ITEM = X

  PERCENT = X

   

5.10.2 Second entry  

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

  SHORT_TEXT = Blanket PR SAMPLE

  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 ERP Central Component all versions

SAP ERP all versions

SAP S/4HANA all versions

SAP enhancement package for SAP ERP all versions

SAP enhancement package for SAP ERP, version for SAP HANA all versions

This document refers to


SAP Title
Note/KBA

1944945 Error 06436 when creating/changing a service purchase requisitions through BAPI
(/sap/support/notes/1944945)

This document is referenced by


SAP Note/KBA Title

2114353 BAPI_PO_CREATE1: Template for creating service PO (/sap/support/notes/2114353 )

2719614 Transfer of the SRM Shopping Cart - Guided Answers (/sap/support/notes/2719614 )

2715713 BAPI_PR_CREATE issues SE 402 and 11 254 error messages (/sap/support/notes/2715713 )

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

You might also like