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

Unable to create a Product using Odata API_PRODUCT_SRV A_Product

former_member825853
Discoverer
0 Kudos
1,939

Hi,

Appreciate your inputs in advance. I am unable to create a product on my fully activated SAP Appliance using API_PRODUCT_SRV A_Product POST. I get the following error:

code":"API_PRD_MSG/009","message":{"lang":"en","value":"Create operation not allowed on entity.

Digging a little deeper, I find this in

 /iwbep/if_mgw_appl_srv_runtime~create_entity
* Create operation not allowed in below entities<br>    IF lv_entity_type_name = cl_api_product_mpc=>gc_a_producttype<br>      OR lv_entity_type_name = cl_api_product_mpc=>gc_a_productmlaccounttype<br>      OR lv_entity_type_name = cl_api_product_mpc=>gc_a_productmlpricestype<br>      OR lv_entity_type_name = cl_api_product_mpc=>gc_a_productvaluationcostingty<br>      OR lv_entity_type_name = cl_api_product_mpc=>gc_a_productvaluationaccountty.
      MESSAGE e009(api_prd_msg) INTO DATA(lv_dummy).<br>      lt_return_messages = VALUE #( ( id = 'API_PRD_MSG'<br>                                      number = '009'<br>                                      type = 'E' ) ).<br>      raise_error( lt_return_messages ).
    ENDIF.

Accepted Solutions (0)

Answers (2)

Answers (2)

augusto28
Discoverer

Hi,

You can use A_Product entity to create via create_deep_entity redefinition. Please use the navigation property to_Description as you need to provide a description in a specific language:

{
"Product": "string",
"ProductType": "stri",
"BaseUnit": "str",
"IndustrySector": "s",
"to_Description": {
"results": [
{
"Product": "string",
"Language": "st",
"ProductDescription": "string"
}
]
}
}
Sandeep369
Discoverer
0 Kudos
this works !
JoergWolf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Anurag,

the question/issue probably isn't specific to CAL or the fully-activated appliance.

Can you please also tag your question with SAP Gateway and oData so that reaches the right forums ?

Thanks,

Joerg

former_member825853
Discoverer
0 Kudos

updated tags. Thanks!