Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The...

16
AP 7.00 Stateless Pricing Remote API VERSION V1.1 – 21 OCTOBER 2014 - © SAP AG 2014

Transcript of Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The...

Page 1: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

AP 7.00

Stateless Pricing

Remote API

VERSION V1.1 – 21 OCTOBER 2014 - © SAP AG 2014

Page 2: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

2

CHANGE LOG

Version Date Modification

1.00 19-APR-2013 First release

1.1 21-OCT-2014 Enhancement regarding pricing conditions

© Copyright 2013 SAP AG. All rights reserved.

No part of this publication may be reproduced or

transmitted in any form or for any purpose without the

express permission of SAP AG. The information

contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its

distributors contain proprietary software components

of other software vendors.

Microsoft®, WINDOWS

®, NT

®, EXCEL

®, Word

®,

PowerPoint®

and SQL Server®

are registered

trademarks of Microsoft Corporation.

IBM®, DB2

®, DB2 Universal Database, OS/2

®,

Parallel Sysplex®, MVS/ESA, AIX

®, S/390

®, AS/400

®,

OS/390®, OS/400

®, iSeries, pSeries, xSeries, zSeries,

z/OS, AFP, Intelligent Miner, WebSphere®, Netfinity

®,

Tivoli®, Informix and Informix

® Dynamic Server

TM

are

trademarks of IBM Corporation in USA and/or other

countries.

ORACLE® is a registered trademark of ORACLE

Corporation.

UNIX®, X/Open

®, OSF/1

®, and Motif

® are registered

trademarks of the Open Group.

Citrix®, the Citrix logo, ICA

®, Program

Neighborhood®, MetaFrame

®, WinFrame

®,

VideoFrame®, MultiWin

® and other Citrix product

names referenced herein are trademarks of Citrix

Systems, Inc.

HTML, DHTML, XML, XHTML are trademarks or

registered trademarks of W3C®, World Wide Web

Consortium, Massachusetts Institute of Technology.

JAVA®

is a registered trademark of Sun Microsystems,

Inc.

JAVASCRIPT® is a registered trademark of Sun

Microsystems, Inc., used under license for technology

invented and implemented by Netscape.

MarketSet and Enterprise Buyer are jointly owned

trademarks of SAP AG and Commerce One.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, and

other SAP products and services mentioned herein as

well as their respective logos are trademarks or

registered trademarks of SAP AG in Germany and in

several other countries all over the world. All other

product and service names mentioned are the

trademarks of their respective companies.

Page 3: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

3

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

CONTENTS

Change Log ........................................................................................................................ 2

Contents ............................................................................................................................. 3

1 Overview ......................................................................................................................... 5

1.1 Introduction ............................................................................................................................. 5

1.2 Prerequisites ........................................................................................................................... 5

1.3 Known Functional restrictions ................................................................................................. 5

1.4 Further Information ................................................................................................................. 6

2 Development .................................................................................................................. 7

2.1 Description of the API ............................................................................................................. 7

2.2 Example how to call Stateless Pricing API ............................................................................ 13

A FAQ/TROUBLE SHOOTING ......................................................................................... 16

B TIPS............................................................................................................................... 16

Page 4: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to
Page 5: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

5

1 OVERVIEW

1.1 Introduction

This document is about the new Stateless Pricing Remote API of the IPC Pricing Engine that is available from

Support Package 29 of the Software component SAP_AP.

This document only helps to implement the Stateless Pricing Remote API. It provides the name of the interface,

a description of the technical parameters and an example for a code implementation.

The high level use case is to deliver price information about one or several items to an external caller using SAP

CRM master data and customizing settings. For example this can be used within the context of a Third party web

shop catalog. The caller requesting a price calculation needs to provide the full pricing context to the pricing

engine, i.e. no customizing determination is done. As the name of the API reflects, the pricing engine will not

retain the calculated pricing result. So no pricing document is available on the IPC the once remote call has been

processed (= stateless processing / API).

Please consider the following things when implementing the API:

1. Performance

We cannot make any general statements about expected performance (runtime, data quantities, sizing, and so on)

for custom specific scenarios. Comprehensive performance analysis in the implementation project at an early

stage is highly recommended.

Since the remote call to the API is stateless, we recommend to limit the number of calls and items to be

calculated to an absolute minimum.

Since there is no chance to trigger pricing complete in a separate request, stateless API will perform full pricing

(e.g. document level calculation) before sending the result back to the caller. This is to make sure that consistent

pricing result is returned to the caller. So if you have use case where document level calculation (e.g. group

condition processing) is not necessary then pricing procedure customization should be done accordingly.

Basically stateless API will do full calculation as per the pricing procedure customization set up.

2. Implementation and Support

SAP has not pre-defined any business scenarios for the new pricing API.

Support is only provided for the SAP Standard code processing starting at the pricing interface.

It is in the responsibility of the customer / user to provide SAP access, credentials, test data and a reproducible

example to analyze and debug the API.

The API can be easily invoked by using the RFC protocol (for example using SAP Java Connector from Java

environment).

1.2 Prerequisites

The Stateless Pricing Remote API is available in software component SAP_AP 7.0 from support package level

29 or higher.

1.3 Known Functional restrictions

Tax determination via the TTE (Tax Transaction Engine) is currently not supported

Pricing results are not persisted at engine side

Page 6: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

6

Loading of existing pricing document and its modification is not supported

1.4 Further Information

There are several additional information available elaborating different topics more detailed.

Source Description

Note 844817 Technical Information

Note 844816 Information for Upgrade

Note 867428 Adapt buffer refresh times

SAP Help SAP Virtual Machine Container

http://help.sap.com/saphelp_nwpi711/helpdata/en/a9/26ae3c95164695accbf2483a14281e/frameset.

htm

1077727 SAP JCo 3.0 release and support strategy

1672418 Downloading the SAP JCO

636912 Frequent installation problems with SAP Java Connector

856863 SAP NCo Release and Support Strategy (.Net Connector)

Page 7: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

7

2 DEVELOPMENT

2.1 Description of the API

With Support Package SP29 of SAP_AP onwards, the new Remote Function Call (RFC)

SPE_CALCULATE_PRICE is available. This is Java Function Module that can be called via SAP Java

Connector (SAP JCo). It allows executing pricing (price determination and price calculation) with only one call.

Below you can see the signature of the Java module. The documentation of the ABAP structures and fields are

available in your backend system where the RFC SPE_CALCULATE_PRICE is located.

In the next chapter you can see an example how to call it for better understanding.

FUNCTION SPE_CALCULATE_PRICE.

*"----------------------------------------------------------------------

*"*"Local Interface:

*" IMPORTING

*" VALUE(IS_HEADER_INPUT) TYPE PRIT_HEADER_INPUT

*" VALUE(IT_ITEM_ADDNL_INPUT) TYPE PRIT_ITEM_ADDNL_INPUT_T

*" OPTIONAL

*" EXPORTING

*" VALUE(ES_HEADER_RESULT) TYPE PRIT_HEAD_RET

*" VALUE(ET_ITEM_CALC_ADDNL_RESULT) TYPE PRIT_ITEM_ADDNL_RESULT_T

*" VALUE(ET_TRACE) TYPE PRIT_ITEM_TRACE_T

*" TABLES

*" IT_ITEM_MAIN_INPUT TYPE PRIT_ITEM_MAIN_INPUT_T

*" IT_ITEM_ATTRIB_INPUT TYPE PRIT_ITEM_ATTRIBUTE_T

*" IT_ITEM_TIMESTMP_INPUT TYPE PRIT_ITEM_TIMESTAMP_T

*" IT_MANUAL_COND_INPUT TYPE PRIT_COND_INPUT_T OPTIONAL

*" ET_ITEM_CALC_MAIN_RESLT TYPE PRIT_ITEM_MAIN_RESULT_T OPTIONAL

*" ET_COND_ADDNL_RESULT TYPE PRIT_COND_ADDNL_RESULT_T OPTIONAL

*" ET_MESSAGES TYPE PRIT_MESSAGE_T OPTIONAL

*"----------------------------------------------------------------------

ENDFUNCTION.

Technical input parameters are listed under IMPORTING and TABLES parameter sections. Similarly output

parameters also listed under EXPORTING and TABLES parameter sections. Below are the details of each

parameter. You will later see the individual component description too.

SPE_CALCULATE_PRICE

PARAMETER NAME PARAMETER

TYPE

MANDATORY RFC

PRAMETER

TYPE

DESCRIPTIO

N

IS_HEADER_INPUT INPUT YES IMPORTING Pricing header

input data

IT_ITEM_MAIN_INPUT INPUT YES TABLES Pricing items

input data

IT_ITEM_ADDNL_INPUT INPUT NO IMPORTING Pricing items

additional input

data

Page 8: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

8

IT_ITEM_ATTRIB_INPUT INPUT YES TABLES Pricing

dynamic

attribute set

which is

required for

condition

finding and

user exit

executions. It is

based on

pricing

procedure

customization.

IT_ITEM_TIMESTMP_INP

UT

INPUT YES TABLES Pricing

timestamps

which is

required for

condition

finding

IT_MANUAL_COND_INPU

T

INPUT NO TABLES Manual

conditions to be

added

ES_HEADER_RESULT OUTPUT NO EXPORTING Pricing header

level result

(e.g. net value)

ET_ITEM_CALC_MAIN_R

ESLT

OUTPUT NO TABLES Pricing items

level main

results (e.g. net

value, net price,

gross value

etc.)

ET_ITEM_CALC_ADDNL_

RESLT

OUTPUT NO EXPORTING Pricing items

level additional

results (e.g.

subtotals,

condition

function etc.)

ET_COND_ADDNL_RESU

LT

OUTPUT NO TABLES Item pricing

conditions as

well header

pricing

conditions

including

subtotals

ET_TRACE OUTPUT NO EXPORTING Price condition

access trace in

xml format

ET_MESSAGES OUTPUT NO TABLES Messages (e.g.

error, warning

etc.) from

pricing

Page 9: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

9

Below you can see their important components. Here focus is mainly on INPUT parameters. You can set them

with appropriate values as per your scenario.

IS_HEADER_INPUT

IS_HEADER_INPUT is used for supplying header level input parameters those are required for price

calculation

Component Name Mandatory Purpose

DOCUMENT_ID No Header identifier

APPLICATION Yes Condition technique application name

which corresponds to pricing procedure set

up (e.g. CRM)

PRC_PROCEDURE_NAME Yes Pricing procedure name

DOCUMENT_CURRENCY_UNIT Yes Document currency unit

LOCAL_CURRENCY_UNIT No Local currency unit. If it is not then it will

be defaulted with document currency

SIMULATION_MODE No To do condition finding in simulation mode

where conditions are released for simulation

ATTRIBUTES No Document level dynamic attributes. It

depends on pricing procedure customization

(e.g. header fields used in relevant access

sequences)

PERFORM_TRACE No For activating price condition access trace

IT_ITEM_MAIN_INPUT

IT_ITEM_MAIN_INPUT is used for supplying item level attributes those are needed for price calculation

Component Name Mandatory Purpose

ITEM_ID Yes Item identifier

ITEM_ID_EXT No External human readable identifier

PARENT_ITEM_ID No Parent item identifier

PRODUCT_ID Yes This is mandatory if the system is based on

CRM or SRM data model. Basically product

data is present in comm_product table. If this is

used then you don’t have to fill

PRODUCT_ERP component

PRODUCT_ERP Yes This is mandatory if the system is based on

ERP data model. Basically product information

is present in MARA table. If this is filled then

you don’t have to use PRODUCT_ID

component

EXCH_RATE_TYPE No Exchange rate type used for exchange rate

determination. If it is not set then exchange rate

type ‘M’ will be used.

EXCH_RATE_DATE No Date based on which exchange rate for currency

conversion need to be determined. If it is not

set then current date will be used

Page 10: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

10

EXCH_RATE_EXTERNAL No Externally supplied exchange rate

QUANTITY Yes Item quantity

QUANTITY_UNIT Yes Item quantity unit

NUMERATOR No Needed if item quantity unit is different from

base quantity unit. This is numerator factor

from item quantity unit to base quantity unit

DENOMINATOR No Needed if item quantity unit is different from

base quantity unit. This is denominator factor

from item quantity unit to base quantity unit

EXPONENT No Needed if item quantity unit is different from

base quantity unit

GROSS_WEIGHT No Required if the pricing procedure contains gross

weight based condition type. In such cases

gross weight amount corresponds to item

quantity need to be set over here

NET_WEIGHT No Required if the pricing procedure contains net

weight based condition type. In such cases net

weight amount corresponds to item quantity

need to be set over here

WEIGHT_UNIT No Weight unit. Required if the pricing procedure

contains weight based condition type

VOLUME No Required if the pricing procedure contains

volume based condition type. In such cases

volume amount corresponds to item quantity

need to be set over here

VOLUME_UNIT No Volume unit. Required if the pricing procedure

contains volume based condition type

POINTS No Required if the pricing procedure contains

points based condition type.

POINTS_UNIT No Point unit. Required if the pricing procedure

contains point based condition type

DATE_FROM_BASE No Start date for deriving time factors

(days/weeks/months/years). This is required if

pricing procedure contains time based condition

types. Basically for period based calculation. If

you want to set days per month, days per year,

holidays for influencing the period calculation

you can set it using importing parameter

IT_ITEM_ADDNL_INPUT

DATE_TO_BASE No End date for deriving time factors

(days/weeks/months/years). This is required if

pricing procedure contains time based condition

types. Basically for period based calculation

NUM_OF_DAYS_BASE No Number of days. If you are supplying

DATE_FROM_BASE and DATE_TO_BASE

you don’t have to supply this. System will

calculate number of days. If you supply it,

system will use passed value for calculation

NUM_OF_WEEKS_BASE No Number of weeks. If you are supplying

DATE_FROM_BASE and DATE_TO_BASE

Page 11: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

11

you don’t have to supply this. System will

calculate number of weeks. If you supply it,

system will use passed value for calculation

NUM_OF_MONTHS_BASE No Number of months. If you are supplying

DATE_FROM_BASE and DATE_TO_BASE

you don’t have to supply this. System will

calculate number of months. If you supply it,

system will use passed value for calculation

NUM_OF_YEARS_BASE No Number of years. If you are supplying

DATE_FROM_BASE and DATE_TO_BASE

you don’t have to supply this. System will

calculate number of years. If you supply it,

system will use passed value for calculation

DATE_FROM_SCALE No Start date for deriving time factors

(days/weeks/months/years) for time based scale

base calculation. This is required if pricing

procedure contains condition types with time

based scale base type. If you want to set days

per month, days per year, holidays for

influencing the period calculation you can set it

using importing parameter

IT_ITEM_ADDNL_INPUT

DATE_TO_SCALE No End date for deriving time factors

(days/weeks/months/years) for time based scale

base calculation. This is required if pricing

procedure contains condition types with time

based scale base type

NUM_OF_DAYS_SCALE No Number of days. If you are supplying

DATE_FROM_SCALE and

DATE_TO_SCALE you don’t have to supply

this. System will calculate number of days. If

you supply it, system will use passed value for

calculation

NUM_OF_WEEKS_SCALE No Number of weeks. If you are supplying

DATE_FROM_SCALE and

DATE_TO_SCALE you don’t have to supply

this. System will calculate number of weeks. If

you supply it, system will use passed value for

calculation

NUM_OF_MONTHS_SCALE No Number of months. If you are supplying

DATE_FROM_SCALE and

DATE_TO_SCALE you don’t have to supply

this. System will calculate number of months. If

you supply it, system will use passed value for

calculation

NUM_OF_YEARS_SCALE No Number of years. If you are supplying

DATE_FROM_SCALE and

DATE_TO_SCALE you don’t have to supply

this. System will calculate number of years. If

you supply it, system will use passed value for

calculation

Page 12: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

12

IT_ITEM_ADDNL_INPUT

IT_ITEM_ADDNL_INPUT is used for supplying item level additional attributes those are rarely (depending on

use cases) needed for price calculation. While filling entries into this parameter table you need to make sure

that it’s indexing should be matching with an entry in IT_ITEM_MAIN_INPUT. For example your first entry

in IT_ITEM_ADDNL_INPUT should correspond to first entry in IT_ITEM_MAIN_DATA. This is because

internally indexing is used while fetching entries from this table since index based read is faster.

Component Name Mandatory Purpose

ITEM_ID Yes Item identifier

DAYS_PER_MONTH No Needed only if you want to influence time based period factor

calculation. Indicates the number of days a month should be

accounted with.

DAYS_PER_YEAR No Needed only if you want to influence time based period factor

calculation Indicates the number of days a year should be

accounted with.

HOLIDAYS No Needed only if you want to influence time based period factor

calculation. Can be filled with individual days to reduce the

calculated values

VARIANT_CONDITIONS No For calculating conditions based on variant keys and factors

IT_ITEM_ATTRIB_INPUT

IT_ITEM_ATTRIB_INPUT is used for supplying pricing dynamic attribute set which is required for condition

finding and user exit executions. It is based on pricing procedure customization. You can retrieve this

customization information using RFC SPC_GET_PRICING_PROCEDURE_INFO. While filling entries into

this parameter table you need to make sure that it’s indexing should be matching with an entry in

IT_ITEM_MAIN_INPUT. For example your first entry in IT_ITEM_ATTRIB_INPUT should correspond to

first entry in IT_ITEM_MAIN_DATA. This is because internally indexing is used while fetching entries from

this table. Because index based read is faster.

Component Name Mandatory Purpose

ITEM_ID Yes Item identifier

FIELDNAME Yes Attribute name

FIELDVALUE Yes Attribute value

Page 13: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

13

IT_ITEM_TIMESTMP_INPUT

IT_ITEM_TIMESTMP_INPUT is used for supplying timestamps which is required for condition finding. It is

based on pricing procedure customization. You can retrieve this customization information using RFC

SPC_GET_PRICING_PROCEDURE_INFO. While filling entries into this parameter table you need to make

sure that it’s indexing should be matching with an entry in IT_ITEM_MAIN_INPUT. For example your first

entry in IT_ITEM_TIMESTMP_INPUT should correspond to first entry in IT_ITEM_MAIN_DATA. This is

because internally indexing is used while fetching entries from this table. Because index based read is faster.

Component Name Mandatory Purpose

ITEM_ID Yes Item identifier

FIELDNAME Yes Timestamp name

TIMESTAMP Yes Timestamp value

IT_MANUAL_COND_INPUT

IT_MANUAL_COND_INPUT is used for supplying manual conditions.

Component Name Mandatory Purpose

ITEM_ID Yes Item identifier. For adding condition at header level set it with

initial GUID

COND_TYPE Yes Condition type

COND_RATE Yes Condition rate

COND_CURRENCY Yes Condition currency

COND_UNIT_VALUE No Condition pricing unit value. Mandatory for non –percentage

and non-fixed amount condition

COND_UNIT No Condition unit. Mandatory for non –percentage and non-fixed

amount condition

CALC_TYPE No Calculation type. If calculation type need to be changed while

adding the manual condition. It will be allowed if and only if

condition type customization is setting is done in that way

2.2 Example how to call Stateless Pricing API

Here is an example which shows how you can invoke stateless pricing remote API using SAP JCo (Java

Connector) client from Java environment

Example call of Pricing Stateless Pricing API

public class ExampleStatelessPricingAPI { public static void main(String[] args) { System.out.println("--- START ---"); // connect to SAP system JCO.Client client = null; try { client = JCO.createClient( "100", // SAP client "myUser", // User ID "mypassword", // Password "EN", // Language

Page 14: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

14

"myhost", // Host "01"); // System client.connect(); System.out.println("Connection OK\n"); } catch (Exception ex) { System.out.println(ex); return; } // print RFC attributes System.out.println(client.getAttributes()); // create JCo repository JCO.Repository repository = new JCO.Repository("Test123", client); // Function Module SPE_CALCULATE_PRICE IFunctionTemplate ft = repository.getFunctionTemplate("SPE_CALCULATE_PRICE"); JCO.Function function = null; try { function = ft.getFunction(); } catch (Exception ex) { System.out.println(ex); return; } // header data ParameterList importParameterList = function.getImportParameterList(); Structure structureHeaderInput = importParameterList.getStructure("IS_HEADER_INPUT"); structureHeaderInput.setValue("PRT", "APPLICATION"); structureHeaderInput.setValue("0PRT01", "PRC_PROCEDURE_NAME"); structureHeaderInput.setValue("EUR", "DOCUMENT_CURRENCY_UNIT"); structureHeaderInput.setValue("EUR", "LOCAL_CURRENCY_UNIT"); importParameterList.setValue(structureHeaderInput, "IS_HEADER_INPUT"); // item data String itemGuid = "6B28CB5091CE8C33E10000000A4233D1"; ParameterList tableParameterList = function.getTableParameterList(); Table tableItems = tableParameterList.getTable("IT_ITEM_MAIN_INPUT"); tableItems.appendRows(1); tableItems.setValue(itemGuid, "ITEM_ID"); tableItems.setValue("E212CC425DFF4625E10000000A422065", "PRODUCT_ID"); tableItems.setValue("M", "EXCH_RATE_TYPE"); tableItems.setValue("3", "QUANTITY"); tableItems.setValue("PAL", "QUANTITY_UNIT"); // item attributes Table tableItemAttributes = tableParameterList.getTable("IT_ITEM_ATTRIB_INPUT"); tableItemAttributes.appendRows(4); tableItemAttributes.setValue(itemGuid, "ITEM_ID"); tableItemAttributes.setValue("PRODUCT", "FIELDNAME"); tableItemAttributes.setValue("E212CC425DFF4625E10000000A422065", "FIELDVALUE"); tableItemAttributes.nextRow(); tableItemAttributes.setValue(itemGuid, "ITEM_ID"); tableItemAttributes.setValue("PRT_PARTNER", "FIELDNAME"); tableItemAttributes.setValue("7CF0CD505FF21975E10000000A448B72", "FIELDVALUE"); tableItemAttributes.nextRow(); tableItemAttributes.setValue(itemGuid, "ITEM_ID"); tableItemAttributes.setValue("PRT_PRICINGRELEVANT", "FIELDNAME"); tableItemAttributes.setValue("X", "FIELDVALUE"); tableItemAttributes.nextRow(); tableItemAttributes.setValue(itemGuid, "ITEM_ID"); tableItemAttributes.setValue("PRT_PRODUCT_GRP", "FIELDNAME"); tableItemAttributes.setValue("03", "FIELDVALUE"); // timestamps Table tableTimestamps = tableParameterList.getTable("IT_ITEM_TIMESTMP_INPUT"); tableTimestamps.appendRows(2); tableTimestamps.setValue(itemGuid, "ITEM_ID"); tableTimestamps.setValue("PRT_DELIVERYDATE", "FIELDNAME");

Page 15: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

STATELESS PRICING REMOTE API

PRODUCT INNOVATION LIFECYCLE

B

PRODUCT INNOVATION LIFECYCLE

A

15

tableTimestamps.setValue("20041021000000", "TIMESTAMP"); tableTimestamps.nextRow(); tableTimestamps.setValue(itemGuid, "ITEM_ID"); tableTimestamps.setValue("PRT_ORDERDATE", "FIELDNAME"); tableTimestamps.setValue("20041021000000", "TIMESTAMP"); // execute function module try { client.execute(function); } catch (Exception ex) { System.out.println(ex); return; } // check result JCO.Structure structureHeaderResult = function.getExportParameterList().getStructure("ES_HEADER_RESULT"); System.out.println("Header Net Value: " + structureHeaderResult.getValue("NET_VALUE")); // disconnect from SAP system client.disconnect(); System.out.println("--- END ---"); } }

Page 16: Remote Pricing Stateless API - PBworkspavelgk.pbworks.com/w/file/fetch/93664553/Remote... · The high level use case is to deliver price information about one or several items to

Version 1.1 – 21 OCT 2014 – © SAP AG 2014–Note 1849765

16

A FAQ/TROUBLE SHOOTING

Please refer to the note 1746584 "FAQ support note for Pricing, Condition Technique and Tax" that provides many

helpful hints and refers to many further helpful notes.

B TIPS

If you are not using optional parameters, then you can set them inactive explicitly. That will give some performance

improvement. SAP Java Connector ( JCo) will avoid processing of these parameters.

Example code snippet

function.getImportParameterList().setActive("IT_ITEM_ADDNL_INPUT", false);

function.getExportParameterList().setActive("ET_ITEM_CALC_ADDNL_RESULT", false);