cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Deep creation of Product via I_PRODUCTTP_2 does not work

AndreasGraeber
Explorer
0 Kudos
820

Hi All,

I want to create a new, basic product via the RAP-BO I_PRODUCTTP_2.
I filled all reqired fields and, as the desciption i a required field, too, I tried to create deep the description, using the association _productdescription.

In no constellation the modify / commit is successful.
Now I get the error:
Property PRODUCT is a key and cannot be initial CMD_PROD_RAP(003)
But: I provided the root entity with this content and I cannot provide it to the sub-node as it is inherited from the root node.
Is there a way to get beyound this?

I'm using an OnPrem 758 system SAP S/4HANA 2023 SP01 (02/2024) FPS system
-----------------------------------------------------------------------
DATA(productid) = '000000000053009920'.

MODIFY ENTITIES OF i_producttp_2
ENTITY product
CREATE FIELDS ( product baseunit productgroup laboratoryordesignoffice crossplantstatus
weightunit producttype industrysector ) WITH VALUE #( ( %cid = 'prd1'
product = productid
baseunit = 'KG'
productgroup = '5121'
laboratoryordesignoffice = 'AS1'
crossplantstatus = 'E0'
weightunit = 'KG'
producttype = 'HALB'
industrysector = 'M' ) )
CREATE BY \_productdescription
FIELDS ( productdescription language )
WITH VALUE #( ( %cid_ref = 'prd1'
%target = VALUE #( ( %cid = 'prddescr1'
product = productid
productdescription = 'My Description'
language = 'E' ) ) ) )
FAILED FINAL(failed) ##NEEDED
REPORTED FINAL(reported) ##NEEDED.

 

 

Accepted Solutions (1)

Accepted Solutions (1)

AndreasGraeber
Explorer

Hi All,

via debugging of the exeption and the stack, startin with cm_cmd_prod_message->new and above I came to the solution.

It was as simple as:
CREATE BY \_productdescription
FIELDS ( productdescription language )
WITH VALUE #( ( %cid_ref = 'prd1'
                             Product = productid  "THIS LINE IS REALLY IMPORTANT
                             %target = VALUE #( ( %cid = 'prddescr1'
                                                                product = productid

Even if it works now, the call of the EML is really tricky.
Even if is syntactically correct, the successs of the command is absolutely not guaranteed.


Best regards 

Andreas

 

 

 

 

yuanhuiqiang
Explorer
How to handle automatic numbering?

Answers (0)