Skip to Content
Product Information
Author's profile photo Shirley Wu

How to Use Public API Service for Condition Records – Part 2

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.

Following the guide of part 1: 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 0000202628
CONDITIONRATEVALUE 444
CONDITIONRATEVALUEUNIT EUR (same as original)

 

CT_CONDITION_VALIDITY

CONDITIONRECORD 0000202628
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 0000202628

 

CT_CONDITION_SUPPLEMENT

CONDITIONRECORD 0000202628
CONDITIONSEQUENTIALNUMBER 03

CT_CONDITION_SCALE

CONDITIONRECORD 0000202628
CONDITIONSEQUENTIALNUMBER 01
CONDITIONSCALELINE 0001

 

2. Execute

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

For example, delete one scale:

4.png5.png

2. Example for Calling the Sales 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 sales API, for example mo_sls_api

The constructor of this object like this:

mo_sls_api type ref to IF_SLSPRCG_CNDNRECD_API:

mo_sls_api ?= cl_prcg_cndnrecord_api_factory=>get_instance( )->get_sales_api_instance( ).

Then you can call the function, like the following:

(the importing parameters examples 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 sales in part 1 and part 2, which for teaching you to use CREATE, GET, UPDATE and DELETE for sales.

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

 

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sai Giridhar Kasturi
      Sai Giridhar Kasturi

      Thanks for sharing