‎2009 Jun 01 4:33 PM
Hi All,
I am trying to update the database table CRMPARNR using the function module 'BUPA_MAP_CONT_SAVE', however I am not successfull!
The problem is when i am trying to change an existing record...it gives me a dump stating that duplicate entries are encountered when inserting into database table.
However, when i am passing the data to the function module...I am passing an already existing data (i.e. CONTACT_NO is same as in database, but ORG Guid and PERSON Guid are different) ...so that update should take place...but everytime it is taking it as insert...and hence the short dump.
Can anyone suggest what might be the solution to this?
‎2009 Jun 22 12:09 PM
Hi Vin,
Yes you are using the right function module...
It's better to create a new function module which will do the same job...as per your logic...even we had the same requirement.
The logic for the function module should be...
1. Pass the data to be updated into the XCRMPARNR internal table.
2. Pass the old data into the YCRMPARNR internal table.
3.Call the function module u2018CHANGEDOCUMENT_PREPARE_TABLESu2019 which will update the KZ flag (Will indicate whether to update, insert or delete the record from the database table).
4. Call the function module BUPA_MAP_SAVE_CONT_TABS in Update task to update the database table CRMPARNR.
Vin...the logic is same as there in the function module BUPA_MAP_CONT_SAVE with the only difference in filling of XCRMPARNR and YCRMPARNR...which has caused this issue..
Let me know if it is not clear..
‎2009 Jun 02 6:39 AM
Am I using the right function module to update CRMPARNR database table?
‎2009 Jun 22 12:09 PM
Hi Vin,
Yes you are using the right function module...
It's better to create a new function module which will do the same job...as per your logic...even we had the same requirement.
The logic for the function module should be...
1. Pass the data to be updated into the XCRMPARNR internal table.
2. Pass the old data into the YCRMPARNR internal table.
3.Call the function module u2018CHANGEDOCUMENT_PREPARE_TABLESu2019 which will update the KZ flag (Will indicate whether to update, insert or delete the record from the database table).
4. Call the function module BUPA_MAP_SAVE_CONT_TABS in Update task to update the database table CRMPARNR.
Vin...the logic is same as there in the function module BUPA_MAP_CONT_SAVE with the only difference in filling of XCRMPARNR and YCRMPARNR...which has caused this issue..
Let me know if it is not clear..
‎2009 Jun 22 12:28 PM
Sneha...Thanks for the reply....
Anyways...what you have suggested has already been implemented...
What you have said is right!
Thanks for the answer.