Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member624832
Participant

Background


Using public API service, you can create, read, update, and delete condition records for pricing. The service contains entities for condition record, validity of condition record, pricing scale, and condition supplement.

We provide users public API service for sales and purchase. This public API class is: CL_PRCG_CNDNRECORD_API_FACTORY.

This guide is following the guide of part 3: Link

1. Example of CURD mandatory input


1. UPDATE_CONDITION_RECORD


Importing parameters:

Ø CT_CONDITION_RECORD

Ø CT_CONDITION_VALIDITY

Ø CT_CONDITION_SUPPLEMENT

Ø CT_CONDITION_SCALE

Update example: if you want to update the changeable fields for condition records, do the following steps.

1. Prepare basic parameters

CT_CONDITION_RECORD















CONDITIONRECORD 0000202633
CONDITIONRATEVALUE 444
CONDITIONRATEVALUEUNIT EUR (this value cannot be changed)

 

CT_CONDITION_VALIDITY















CONDITIONRECORD 0000202633
CONDITIONVALIDITYENDDATE 20.08.2019
CONDITIONVALIDITYSTARTDATE 20.08.2018

 

CT_CONDITION_SUPPLEMENT



















CONDITIONRECORD 0000202628
CONDITIONSEQUENTIALNUMBER 03
CONDITIONRATEVALUE 666
CONDITIONRATEVALUEUNIT EUR (same as original)

 

CT_CONDITION_SCALE



























CONDITIONRECORD 0000202628
CONDITIONSEQUENTIALNUMBER 03
CONDITIONRATEVALUE 666
CONDITIONRATEVALUEUNIT EUR (same as original)
CONDITIONSCALEQUANTITY 12
CONDITIONSCALEQUANTITYUNIT EA (same as original)

 

2. Execute successfully

If execute success, you can check he export parameters, and you will find that the value of reference fields is changed.

2. DELETE_CONDITION_RECORD


Importing parameters:

Ø CT_CONDITION_RECORD

Ø CT_CONDITION_SUPPLEMENT

Ø CT_CONDITION_SCALE

Delete example: if you want to delete condition records, we provide you the Delete function to do so, the procedure as following.

1. Import parameters

CT_CONDITION_RECORD







CONDITIONRECORD 0000202633

 

CT_CONDITION_SUPPLEMENT











CONDITIONRECORD 0000202633
CONDITIONSEQUENTIALNUMBER 03

 

CT_CONDITION_SCALE















CONDITIONRECORD 0000202633
CONDITIONSEQUENTIALNUMBER 01
CONDITIONSCALELINE 0001

 

2. Execute

If execute success, the changing parameter will receive the deleted condition records information:

For example, delete one condition record:



2. Example for Calling Purchase API


If you want to call public API in your own project. Here is an example for the calling:

If you want to Call CREATE_CONDITION_RECORD (other CURD methods are called nearly the same steps) to create condition records.

You need firstly declare an object for purchasing API, for example mo_purg_api

The constructor of this object like this:

mo_purg_api type ref to IF_PURGPRCG_CNDNRECD_API



Then you can call the function, like the following:

(the importing parameters have been provided example before)


3. Mapping


In our Public API, importing parameters are all using global field name. However, when you do some more development based on our API, maybe you will use the technical name of these fields.

So, we provide you the mapping excel of it.

EXT_FIELDNAME: Using as global field name, it can be used in importing parameter.

INT_FIELDNAME: Technical name.

Conclusion


Now you finish the guide of using public API for purchase in part 3 and part 4, which for teaching you to use CREATE, GET, UPDATE and DELETE for purchasing. Please try to begin your first test about this guide, and following you can get more guide for public API.

Continue to learn about public API


Part 1: Sales -- CREATE & GET

Part 2: Sales -- UPDATE & DELETE

Part 3: Purchase -- CREATE & GET

Part 4: Purchase -- UPDATE & DELETE

Download document:

How to use Public API Service for Condition Records.pdf

Mapping for Public API.xlsx

 
1 Comment