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: 

Change document created_by to be BP Number

0 Kudos

Hi,

I am still relatively new but we have a requirement that documents that are attached to an order have the created_by field set to a user's BP Number. Previously this has been set to a user's Partner External number which worked without an issue.
Unfortunately the Partner External number has changed for a user and we have had to go and change all of these files created_by field that was against the old Partner External to the new Partner External to maintain compatibility with our code.
To prevent needing to do this in the future we thought that changing the created_by field to BP Number would be ideal in the case that the Partner External changes again in the future.

There are other ways to solve this problem, sure, but this is the least work required.

I have tried setting sy-uname to the BP number, running a direct 'update crmorderphio', and the FM 'SDOK_PHIO_PROPERTIES_SET'.
What happens is that there is a record created in crmorderphio with the BP set in CREA_USER field, when a commit work is done it then is deleted and a new record with the CREA_USER field blank is created, it is a new record because the PHIO_ID changes.

I have debugged down into the depths of the FM 'CRM_KW_DOC_CREATE_WITH_TABLE' code but I believe in the end an event is raised for the actual create and I wasn't sure how to get into that to see what is happening.

Is there a restriction against creating a record with the BP number in the created_by field?

I have a vague recollection that it may have had something to do with creating an internet user or central person, is that right?

0 REPLIES 0