09-03-2008 12:54 PM
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..
09-03-2008 2: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
09-03-2008 12:57 PM
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...)
09-03-2008 1:04 PM
Im inserting new entrins with new co. code.If entries go wrong then i can delete them, but i am not able to find that why insertion is not possible with these two tables only..
09-03-2008 1:06 PM
looks like you have no idea about table keys, no clue about SAP... but you have developer key!
09-03-2008 1:10 PM
if u have understood my question..then atleast please don't create any false impressions ..................
09-03-2008 1:12 PM
I already told what is the problem in my very first reply: "company code is not part of the table key"
09-03-2008 1:18 PM
>
> 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
09-03-2008 1:05 PM
09-03-2008 1:25 PM
use other statements like Modify , update ... if these are not working then your database profile is write protected.
09-03-2008 1:28 PM
09-03-2008 1:31 PM
09-03-2008 1:33 PM
Thank you siva,
It helped, database profile is write protected only.
Regards,
meena
09-03-2008 1:34 PM
09-03-2008 2: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
09-05-2008 7:11 AM
Thanks a lot..your solution has solved my problem......
Regards,
Meena