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

How to Create And Add Custom Fields to SAP S/4HANA Cloud OData API Entities

EricChang
Explorer
0 Kudos
1,567

Hi All, 

How to Create And Add Custom Fields to SAP S/4HANA Cloud OData API Entities?

API: Condition Record for Pricing in Sales
  • Sales: Pricing Communication Head (SD_PRICECOMHEAD)
  • Sales: Pricing Communication Item (SD_PRICECOMITEM)

    I use "Custom Fields"  to create and publish a new custom filed in SD_PRICECOMITEM, and use "Adapt UI" to add it in "Manage Price - Sales" .1.png2.png3.png4.png

    When I maintain this field and save this step in UI, I couldn't see any value in custom filed on  "API_SLSPRICINGCONDITIONRECORD_SRV".

     

     What's the next step I should do?

    I don't know how to map this custom field to the correct target table if I need to add a bapi or other method.

     

     

     

     

    Thanks,

    Eric

Accepted Solutions (0)

Answers (3)

Answers (3)

Zhehui_Xia
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

In the screenshot, you have enabled usage for CDS Views I_SLSPRCGCNDNRECDTEMPLATE and I_SLSPRCGCNDNRECDVALIDITYTP_2, so I think you can use these CDS Views to search in Customer Data Browser and check custom field's value.

Best Regards,

Zhehui

EricChang
Explorer
0 Kudos

Hi Zhehui,

I couldn't find these CDS Views in Customer Data Browser...

Could you help me what's next step I should do?

圖片_20240827103748.png

Best regards,

Eric

Sijin_Chandran
Active Contributor
0 Kudos

Hello,

Can you give BADIs as part of Enhancement Spot 'ES_PIQ_SDPRICELIST_API' a Try ?

Since, its related to Pricing Structure I guess BADIs as part of Enhancement Spot 'ES_SD_SLS_EXTEND' won't help.

Thanks,

Sijin

EricChang
Explorer
0 Kudos

Hi Sijin,

I couldn't find this enhancement in eclipse.

Could you help me to find this enhancement and teach me how to modify it?

圖片_20240827094127.png

Thanks

Eric

 

 

Zhehui_Xia
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Can you get other fields' value correctly via this API? Also I suggest that you can use the APP - Customer Data Browser, search for relevant CDS View and check the custom field's value with this APP.

Best Regards,

Zhehui

EricChang
Explorer
0 Kudos

ZhehuiI,

I can get other fields' value via this API.

How to find the custom fields in "custom data browser"?

I don't know what's the key words to find this data view. 

Best regards,

Eric

Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Eric, Not all CDS views are added to the customer data browser - you might need to create a custom CDSView based on the view you enabled the custom field for. It is difficult to tell from your postman screen shot which object you are retrieving - could you put the URL in the thread here? thank you Jerry
EricChang
Explorer
0 Kudos

Hi Jerry,

I found the bug in this custom field.

If I try the same step to create custom field, it can be correct to save.

However, I create custom field in "Manage Price - Sales", it couldn't be correct to save.

Steps:

First, I maintain the custom field and save it.

( I already add custom fields and enable all cds views / odata service.)

When I refresh this page, It can't be save in table.

EricChang_1-1724807514822.png

EricChang_2-1724807523858.png

 

When I try to create custom field in other app like 'Supplier Quotation', it can be enable and save.

EricChang_0-1724807495859.png

I already check all the steps have been followed, and I adapt UI to create.

Thanks,

Eric