Skip to Content
0

How to know if an IndividualProduct already exists in SAP ByDesign?

Jan 16 at 02:47 PM

86

avatar image

Hello experts,

I'm working on an application (developped by using SAP Cloud Applications Studio) that creates IndividualProduct objects into SAP ByDesign. From what I could see until now, creating an IndividualProduct that already exists will raise no errors, because SAP ByDesign already controls duplicate entries. Apparently, the SerialID is checked for that. However, I would like to implement a specific notification if such a thing happens.

When I create an IndividualProduct in my code, I perform the following steps:

- I create an InstallationPoint

- I create an InstalledObject from that InstallationPoint

- I create an IndividualProduct with its details (ServiceProcessInformation...)

- I activate the InstallationPoint

- I activate the IndividualProduct

I know that somewhere after creating the IndividualProduct, there's something raising that this IndividualProduct already exists. I can see the following message being displayed in the application and tracable in the debug mode: "09:19:09 [1:I] Trace LOG :: ERROR > The product registered (100280986)7P85122901 for the serial 7SP022856 already exists!"

So my question is, is there any variables/properties/attributes that can be used to assess that the IndividualProduct already exists and perform an action? I don't even know how to retrieve the LOG ERROR message above.

Any helps would be greately appreciated.

Thank you in advance.

Regards,

Frédéric

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Schaude
Jan 17 at 12:17 PM
0

Hello Frédéric,

Do you have any other identification for the IndividualProduct you want to create?
Something which can be used to query or even direct retrieve an existing instance?

Bye,
. Horst

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hello Horst,

Thank you for your answer. For my IndividualProduct, I use the following identifications:

- ReferencedProductKey.ProductID (it's like the identification of the modele of that product, common for all instances)

- ServiceProcessInformation.SerialID (that is the serial ID, unique for each instance)

Before, I used the ProductKey.ProductID (or even the ProductInternalID, that seems to be made from the ProductKey.ProductID). Both are unique. However, due to that issue: https://answers.sap.com/questions/385045/cloud-application-studioabsl-unable-to-assign-a-va.html, I cannot rely on a ProductInternalID at the time.

Nevertheless, I used queryIndividualProduct to retrieve all the ProductKey.ProductID of a given ReferencedProductKey.ProductID. Then, for each line, I called IndividualProduct.QueryByDescription on the given ProductKey.ProductID. If that last one returned me at least one line as a result, I compared the Serial ID within the line with the Serial ID I wanted to check. If both equals, I know my IndividualProduct already exists in SAP ByDesign. Unfortunately, this solution cannot be used anymore, because raising timeout.

Hence my question on alternative to know that an IndividualProduct already exists.

Best regards,

Frédéric

0
Frédéric Hoffert

Hello Frédéric,

If it is only the SerialID then you should raise an incident in which you describe your business case and request to have a query which support this ServiceProcessInformation.SerialID as PSM released entity.

Bye,
. Horst

1

Thank you for your answer. I will do what I can.

Best regards,

Frédéric

0