Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can BAPI_PR_CREATE be used for Service Requisitions with Limits?

Former Member
0 Kudos
2,260

Hi  - I have a requirement to develop an ABAP Webdynpro to create/change purchase requisitions and it should have features similar to ME51N/ME52N. From some OSS notes and forums, I found that BAPI_PR_CREATE and BAPI_PR_CHANGE are the right BAPI's for my need. We are on ECC6 EhP5.We also have MAA(Multiple Account Assignment) switch turned ON in the system. As a first step I am trying to create a service PReq with Limits from SE37 and I keep on getting below 2 errors. I spent a lot of time in trying various combinations of populating the data in BAPI tables but nothing worked. I found a few blogs about this BAPI for Requisitions with Services but I could not find anything useful for service requisitions with Limits.

Would be really helpful if someone can review my test data and suggest where I am going wrong.

ERRORS:

E BAPI                001 No instance of object type PurchaseRequisition has been created. External reference: # 2

E 06                  436 In case of account assignment, please enter acc. assignment data for item

Test Data used in SE37:

PRHEADER

       PREQ_NO

       PR_TYPE                        SNB

       CTRL_IND

       GENERAL_RELEASE

       CREATE_IND

       ITEM_INTVL                     00010

       LAST_ITEM                      00010

       AUTO_SOURCE

       MEMORY

       HOLD_COMPLETE

       HOLD_UNCOMPLETE

       PARK_COMPLETE

       PARK_UNCOMPLETE

       MEMORYTYPE

PRHEADERX

       PREQ_NO

       PR_TYPE                        X

       CTRL_IND

       GENERAL_RELEASE

       CREATE_IND

       ITEM_INTVL                     X

       LAST_ITEM                      X

       AUTO_SOURCE

       MEMORY

       HOLD_COMPLETE

       HOLD_UNCOMPLETE

       PARK_COMPLETE

       PARK_UNCOMPLETE

       MEMORYTYPE

PRITEM

           PREQ_ITEM                      00010

           CTRL_IND

           DELETE_IND

           PUR_GROUP                      P06

           PREQ_NAME                      JMAGULURI

           SHORT_TEXT                     TEST BAPI

           MATERIAL

           MATERIAL_EXTERNAL

           MATERIAL_GUID

           MATERIAL_VERSION

           PUR_MAT

           PUR_MAT_EXTERNAL

           PUR_MAT_GUID

           PUR_MAT_VERSION

           PLANT                          DS01

           STORE_LOC

           TRACKINGNO                     1234

           MATL_GROUP                     6000004

           SUPPL_PLNT

           QUANTITY                                  1.000

           UNIT                           AU

           PREQ_UNIT_ISO

           PREQ_DATE                      06/11/2012

           DEL_DATCAT_EXT                 1

           DELIV_DATE                     06/20/2012

          REL_DATE

         GR_PR_TIME                       0

         PREQ_PRICE                                            0.000000000

         PRICE_UNIT                         0

         ITEM_CAT                       9

         ACCTASSCAT                     P

         DISTRIB

         PART_INV

        GR_IND

        GR_NON_VAL

        IR_IND

       DES_VENDOR                     105978

       FIXED_VEND

     PURCH_ORG                      DS01

     AGREEMENT

     AGMT_ITEM                      00000

     INFO_REC

      MRP_CTRLER

     BOMEXPL_NO

     VAL_TYPE

     COMMITMENT

     CLOSED

     RESERV_NO                      0000000000

     FIXED

     PO_UNIT

    PO_UNIT_ISO

    REV_LEV

    REV_LEV

   PCKG_NO                        0000000001

   KANBAN_IND

PO_PRICE

INT_OBJ_NO                     000000000000000000

PROMOTION

BATCH

CMMT_ITEM

FUNDS_CTR

FUND

MATL_CAT

ADDRESS2

ADDRESS

CUSTOMER

SUPP_VENDOR

SC_VENDOR

VALUATION_SPEC_STOCK

CURRENCY                       USD

CURRENCY_ISO

VEND_MAT

MANUF_PROF

LANGU

LANGU_ISO

VALIDITY_OBJECT

FW_ORDER

FW_ORDER_ITEM                  00000

PLND_DELRY                       0

DELIV_TIME                     00:00:00

REF_REQ

REF_REQ_ITEM                   00000

GRANT_NBR

FUNC_AREA

REQ_BLOCKED

REASON_BLOCKING

VERSION

PROCURING_PLANT

EXT_PROC_PROF

EXT_PROC_REF_DOC

EXT_PROC_REF_ITEM              00000

FUNDS_RES

RES_ITEM                       000

SUPPL_STLOC

PRIO_URGENCY                   00

PRIO_REQUIREMENT               000

NEW_BOM_EXPLOSION

MINREMLIFE                         0

PERIOD_IND_EXPIRATION_DATE     D

BUDGET_PERIOD

PRITEMX

           PREQ_ITEM                      00010

           PREQ_ITEMX                     X

           CTRL_IND

           DELETE_IND

           PUR_GROUP                      X

           PREQ_NAME                      X

           SHORT_TEXT                     X

           MATERIAL

           MATERIAL_EXTERNAL

           MATERIAL_GUID

           MATERIAL_VERSION

           PUR_MAT

           PUR_MAT_EXTERNAL

           PUR_MAT_GUID

           PUR_MAT_VERSION

           PLANT                          X

           STORE_LOC

           TRACKINGNO                     X

           MATL_GROUP                     X

           SUPPL_PLNT

           QUANTITY                       X

           UNIT                           X

           PREQ_UNIT_ISO                  X

           PREQ_DATE                      X

          DEL_DATCAT_EXT

DELIV_DATE                     X

REL_DATE

GR_PR_TIME

PREQ_PRICE

PRICE_UNIT

ITEM_CAT                       X

ACCTASSCAT                     X

DISTRIB

PART_INV

GR_IND

GR_NON_VAL

IR_IND

DES_VENDOR                     X

FIXED_VEND

PURCH_ORG                      X

AGREEMENT

AGMT_ITEM

INFO_REC

MRP_CTRLER

BOMEXPL_NO

VAL_TYPE

COMMITMENT

CLOSED

RESERV_NO

FIXED

PO_UNIT

PO_UNIT_ISO

PO_UNIT_ISO

REV_LEV

PCKG_NO                        X

KANBAN_IND

PO_PRICE

INT_OBJ_NO

PROMOTION

BATCH

CMMT_ITEM

FUNDS_CTR

FUND

MATL_CAT

ADDRESS2

ADDRESS

CUSTOMER

SUPP_VENDOR

SC_VENDOR

VALUATION_SPEC_STOCK

CURRENCY                       X

CURRENCY_ISO

VEND_MAT

MANUF_PROF

LANGU

LANGU_ISO

VALIDITY_OBJECT

FW_ORDER

FW_ORDER_ITEM

PLND_DELRY

DELIV_TIME

REF_REQ

REF_REQ_ITEM

GRANT_NBR

FUNC_AREA

REQ_BLOCKED

REASON_BLOCKING

VERSION

PROCURING_PLANT

EXT_PROC_PROF

EXT_PROC_REF_DOC

EXT_PROC_REF_ITEM

FUNDS_RES

RES_ITEM

SUPPL_STLOC

PRIO_URGENCY

PRIO_REQUIREMENT

NEW_BOM_EXPLOSION

MINREMLIFE

PERIOD_IND_EXPIRATION_DATE

BUDGET_PERIOD

PRACCOUNT

           PREQ_ITEM                      00010

           SERIAL_NO                      01

           DELETE_IND

           CREAT_DATE                     06/11/2012

           QUANTITY                                  0.000

           DISTR_PERC                      0.0

           NET_VALUE                                             0.000000000

           GL_ACCOUNT                     8333050

           BUS_AREA

           COSTCENTER

           SD_DOC

           ITM_NUMBER                     000010

           SCHED_LINE                     0000

           ASSET_NO

           SUB_NUMBER

           ORDERID

           GR_RCPT

           UNLOAD_PT

           CO_AREA                        DSI

           COSTOBJECT

           PROFIT_CTR

           WBS_ELEMENT                    CHR-ORA-01

           NETWORK

           RL_EST_KEY

           PART_ACCT

CMMT_ITEM

REC_IND

FUNDS_CTR

FUND

FUNC_AREA

REF_DATE

TAX_CODE

TAXJURCODE

NOND_ITAX                                             0.000000000

ACTTYPE

CO_BUSPROC

RES_DOC

RES_ITEM                       000

ACTIVITY

GRANT_NBR

CMMT_ITEM_LONG

FUNC_AREA_LONG

BUDGET_PERIOD

PRACCOUNTX

           PREQ_ITEM                      00010

           SERIAL_NO                      01

           PREQ_ITEMX                     X

           SERIAL_NOX                     X

           DELETE_IND

           CREAT_DATE                     X

           QUANTITY

           DISTR_PERC

           NET_VALUE

           GL_ACCOUNT                     X

           BUS_AREA

           COSTCENTER

           SD_DOC

           ITM_NUMBER                     X

           SCHED_LINE

           ASSET_NO

           SUB_NUMBER

           ORDERID

           GR_RCPT

           UNLOAD_PT

           CO_AREA                        X

           COSTOBJECT

           PROFIT_CTR

           WBS_ELEMENT                    X

           NETWORK

RL_EST_KEY

PART_ACCT

CMMT_ITEM

REC_IND

FUNDS_CTR

FUND

FUNC_AREA

REF_DATE

TAX_CODE

TAXJURCODE

NOND_ITAX

ACTTYPE

CO_BUSPROC

RES_DOC

RES_ITEM

ACTIVITY

GRANT_NBR

CMMT_ITEM_LONG

FUNC_AREA_LONG

BUDGET_PERIOD

SERVICELIMIT

           DOC_ITEM                       00010

           DEL_IND

           OVERALL_LIMIT                         1,000.00

           NO_LIMIT

           EXP_VALUE                             1,000.00

           TOTAL_VALUE                                 0.00

SERVICELIMITX

          DOC_ITEM                       00010

          DEL_IND

          OVERALL_LIMIT                  X

          NO_LIMIT

          EXP_VALUE                      X

          TOTAL_VALUE

SERVICEACCOUNT

           DOC_ITEM                       00010

           OUTLINE                        0000000001

           SRV_LINE                       0000000010

           SERIAL_NO                      01

           SERIAL_NO_ITEM                 01

           DEL_IND

           QUANTITY                                   0.000

           PERCENT                          0.0

           NET_VALUE                                0.00

SERVICEACCOUNTX

           DOC_ITEM                       00010

           OUTLINE                        0000000001

           SRV_LINE                       0000000010

           SERIAL_NO                      10

           SERIAL_NO_ITEM                 X

           DEL_IND

           QUANTITY

           PERCENT

           NET_VALUE

Thanks,

Jhansi

1 ACCEPTED SOLUTION

Former Member
0 Kudos
350

Hi,

You have not populate table SERVICEOUTLINE &  SERVICEOUTLINEX if you really donot need this
table to be populated then do not enter value in field OUTLINE for table
SERVICEACCOUNT & SERVICEACCOUNTX

In your data value for field SERIAL_NO is not same for SERVICEACCOUNT & SERVICEACCOUNTX please make it sure they are same.

you have 01 & 10

I hope this will fix your problem

Good luck

Raj

5 REPLIES 5

former_member222709
Contributor
0 Kudos
350

Hi Jhansi,

The data you've passed seems fine, but, I suggest you can try the following options:

1. Check the date format you've shown above. Use dd.mm.yyyy or yyyymmdd instead of dd/mm/yyyy

2. I believe Package is determined automatically by the system, so you can avoid that.

3. Create a PR manually with Service Limits. Use BAPI 'BAPI_PR_GETDETAIL' and pass similar data to the BAPI 'BAPI_PR_CREATE'.

Regards, Pranav.

0 Kudos
350

Hi Pranav - Thanks for your response. Please see my comments below.

1. Check the date format you've shown above. Use dd.mm.yyyy or yyyymmdd instead of dd/mm/yyyy

This is not an issue as MM/DD/YYYY is my user default format and it should work with this. If the format is wrong, then BAPI will not accept the value in SE37.

2. I believe Package is determined automatically by the system, so you can avoid that.

I think package is what links the line items to services table and if I dont give package, I am getting error as 'Maintain services or limits'

3. Create a PR manually with Service Limits. Use BAPI 'BAPI_PR_GETDETAIL' and pass similar data to the BAPI 'BAPI_PR_CREATE'.

This is how I populated the above test data.

Please let me know if there is anything else that you can suggest.

Thanks,

Jhansi

Former Member
0 Kudos
351

Hi,

You have not populate table SERVICEOUTLINE &  SERVICEOUTLINEX if you really donot need this
table to be populated then do not enter value in field OUTLINE for table
SERVICEACCOUNT & SERVICEACCOUNTX

In your data value for field SERIAL_NO is not same for SERVICEACCOUNT & SERVICEACCOUNTX please make it sure they are same.

you have 01 & 10

I hope this will fix your problem

Good luck

Raj

0 Kudos
350

Hi Raj - Thanks for your response. I found from debugging and from note 499627

that we need to activate  switch MM_SFWS_SC2 in order to use this BAPI for service requisitions. I am now working with our basis team to activate it. Once that is done, details provided by you will help me in correcting my test data and test it. I will update/close the thread if the Switch helps.

Regards,

Jhansi

0 Kudos
350

Hi All - Issue is resolved by activating the business function LOG_MM_CI_2 as mentioned in SAP note 499627.

Thanks,

Jhansi