Skip to Content
avatar image
Former Member

unable to insert records in PRPS and PROJ tables.

I want to insert entries in PROJ and PRPS tables with new company code.

I am selecting entries with existing company code and changing old co. code to new co. code in work area.

Then I am using insert PRPS from work area in the same way inserting in PROJ.

Please help, why insert statement is not working with these tables..

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 03, 2008 at 01:56 PM

    I hope you are in a sandbox system.

    The internal and primary key is PSPNR, and this key is associated with an internal range number. If you don't want to use program, you have to get yourself the next number for PROJ and each PRPS, then you MUST insure that related objects like OBJNR the CO object number is adjusted (PR or PD + internal number/) else you will incur severe problem with your database. You MUST insure that other unique indexes are respected PSPID, etc.

    *The correct way is reached via BAPI or Batch Input/Call Transaction*

    For BTC or call transaction just record via [SHDB|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=shdb&adv=false&sortby=cm_rnd_rankvalue] a single run with [CJ2D transaction|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cj2d+transaction&adv=false&sortby=cm_rnd_rankvalue].

    BAPI suitable are :

    - [BAPI_PS_INITIALIZATION|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_ps_initialization&adv=false&sortby=cm_rnd_rankvalue] to start the job

    - to read the model use BAPIs like [BAPI_PROJECTDEF_GETDETAIL|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_projectdef_getdetail&adv=false&sortby=cm_rnd_rankvalue]

    - to create the new project use BAPIs like [BAPI_PROJECTDEF_CREATE|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_projectdef_create&adv=false&sortby=cm_rnd_rankvalue]

    - [BAPI_PS_PRECOMMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_ps_precommit&adv=false&sortby=cm_rnd_rankvalue] and then BAPI_TRANSACTION_COMMIT or ROLLBACK to end.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 03, 2008 at 12:25 PM

    use other statements like Modify , update ... if these are not working then your database profile is write protected.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 03, 2008 at 11:57 AM

    do you mean that you update SAP tables directly? better to create a Z... table for practicing!

    anyway, company code is not part of the table key, so that is the reason it does not work (your good fortune...)

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > if u have understood my question..then atleast please don't create any false impressions ..................

      Eric is Exactly right.

      Insert only work, when key is different or not exist in table either.

      in your case you are checking only PBUKR VBUKR(Co code)

      values which seem not suffcient to update this table

      PSPNR is the key of both table so you need to use Update statement instead of Insert.

      Cheers

  • avatar image
    Former Member
    Sep 03, 2008 at 12:05 PM

    Hi ,

    Use Commit work .

    Best Regards,

    Siva Reddy

    Add comment
    10|10000 characters needed characters exceeded