0% found this document useful (0 votes)
387 views

Cash Flow Webservice PDF

This document describes the process for generating, regenerating, and deleting ABAP proxies from either the Enterprise Services Repository (ESR) or an external Web Service Description Language (WSDL) file. It involves selecting the objects to call or implement, and then generating and activating the proxies. Prerequisites include having the necessary roles assigned and modeling all objects in the ESR or providing external WSDL descriptions. The package structure in the ABAP system must also be defined to determine where proxies and services will reside.

Uploaded by

Vaskar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
387 views

Cash Flow Webservice PDF

This document describes the process for generating, regenerating, and deleting ABAP proxies from either the Enterprise Services Repository (ESR) or an external Web Service Description Language (WSDL) file. It involves selecting the objects to call or implement, and then generating and activating the proxies. Prerequisites include having the necessary roles assigned and modeling all objects in the ESR or providing external WSDL descriptions. The package structure in the ABAP system must also be defined to determine where proxies and services will reside.

Uploaded by

Vaskar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Cash Flow – Create, Update, Delete, Erase

Technical name: CASHFLOW_IN


Cash flows are fundamental in cash management.
This service enables you to create cash flows through an API call from a source system outside SAP
S/4HANA system.
Furthermore, the service enables you to read, update, delete and erase existing cash flow data from the
SAP S/4HANA system.
The following operations for cash flows are available:
 Create
The information is sent in the request as a payload, except for the schedule line information which is
created by default by the system. All information is utilized when creating a cash flow, including
appropriate checks for restricted values and authorizations. Once the cash flow is created successfully, the
cash flow key is sent in response along with the data that is contained in the cash flow. If there was an
issue when creating the cash flow, an error message is displayed in the response.
 Update
All information is sent in the request as a payload via batch call and is updated to the existing cash flow
with appropriate checks in place for restricted value and authorizations. The request is a batch call which
comprises of one or more change sets. Each change set contains information related to one cash flow. In
each change set, use PATCH to update an existing service node and POST to create a new service node.
Once the batch is submitted, the success response is status 200 or 202 with individual change set
response with the message cash flow has been updated, or failure response with self-explanatory
messages with status 400.
 Delete
Deletion in cash flow is not a hard deletion of the object in the database. Instead, a deletion flag is set on
the service node. Deletion is handled as part of the update operation in a batch call.
 Erase
Cash flows are erased based on two mandatory parameters of the request: company code and original
system. Flows with the two parameters are filtered and then erased regardless of all the other
parameters. In order to fulfill the service requirement, you need to manually import dummy values for the
parameters in your payload of CertaintyLevel, TransactionDate and AmountInTransactionCurrency (and
its attribute currency). The dummy values will not be taken into account to select the flows to be erased.
Note
Only forecast cash flows can be erased.
The service is based on SAOP, and can be consumed by external systems and user interfaces.
Service Structure
Service Message Header
The service message header contains information on the service, the involved sender and receiver as well
as date and time.
Service Nodes
The service nodes contain the business data of the service.
Service Node Description Cardinality Link to details
CashFlowRequestContent Node item that contains the 1..unbounded CashFlowRequestContent
request information of cash
flows.
RemoteOperationMode Node item that contains the 1 There are no parameters in
remote operation mode of this service node.
creation, update and deletion of
cash flows.
Service Response
Parameter Description
StandardMessageFault Fault message that contains information on the fault text, fault detail and fault
detail.

CashFlowRequestContent
Parameters
You can find the request information of cash flows.
Parameter Description Cardinality Necessity
CompanyCode Company Code 1 Mandatory
AmountInTransactionCurrency Amount In Transaction Currency 1 Mandatory
It also contains currency
code as a sub node, which is
also mandatory.
AmountInCompanyCodeCurrency Amount In Company Code 0..1 Optional
Currency It also contains currency
code as a sub node.
TransactionDate Transaction Date 1 Mandatory
BankCountry Bank Country 0..1 Optional
BankKey Bank Key 0..1 Optional
BankAccount Bank Account 0..1 Optional
IBAN International Bank Account 0..1 Optional
Number
GLAccount G/L Account Number 0..1 Optional
OriginSystem Origin System 1 Mandatory
OriginDocument Business Document in Origin 0..1 Optional
System
OriginTransaction Transaction in Origin System 0..1 Optional
OriginCashFlow Cash Flow in Origin System 0..1 Optional
OriginTransactionQualifier Transaction Qualifier in Origin 0..1 Optional
System
CertaintyLevel Certainty Level 1 Mandatory
Customer Customer 0..1 Optional
Supplier Supplier 0..1 Optional
BusinessPartner Business Partner 0..1 Optional
Material Material 0..1 Optional
BusinessArea Business Area 0..1 Optional
ProfitCenter Profit Center 0..1 Optional
WBSElementInternalID WBS Element 0..1 Optional
CostCenter Cost Center 0..1 Optional
PartnerCompany Partner Company 0..1 Optional
LiquidityItem Liquidity Item 0..1 Optional
Segment Segment 0..1 Optional
PlanningLevel Planning Level 0..1 Optional
CashPlanningGroup Planning Group 0..1 Optional
SourceCompanyCode Company Code of the source 0..1 Optional
document in scenarios such as
payment-on-behalf
GenericKey Key field for serialization in SAP 0..1 Optional
Application Interface Framework
Note
To display more information about the service node, select the operation. This works best in Mozilla Firefox
or Google Chrome.

Create Proxy class using WSDL


Download WSDL
Go to CCI system in SPROXY tcde
Create object using the WSDL document downloaded using the wizard as object type 'service consumer'
Web Service Cnfig- ABAP Proxy Generation - General
Procedure
ABAP Proxy Generation - General Procedure
Use
This section outlines the general procedure for generating, regenerating, and deleting ABAP proxies
with generation source ESR or external WSDL. Additional information for generating specific proxy
types is provided in separate sections.
The procedure to generate ABAP proxies is essentially the same for each different type of proxy. There
are two main steps:
 Select the objects to be called or implemented.
 Generate and activate the proxies.
Prerequisites
To work with ABAP proxies, you need the SAP_XI_DEVELOPER_ABAP role, which is included in the
composite role SAP_XI_DEVELOPER. Use the profile generator (transaction PFCG) to assign roles.
Depending on the proxy type, the following tasks must be done before you generate a proxy:
 All objects must be modeled in the ES Repository - or be made available as external WSDL descriptions.
Some objects in the ESR are combinations of other objects. For example, a service interface contains
data types and message types. Therefore, a proxy (a Web service provider or a Web service consumer)
can only be generated when all referenced types are generated as well. When a proxy that is modeled in
the ES Repository is generated for an object that references another object in the same namespace, the
proxy for the referenced object will be generated automatically. For example, a proxy could be
generated for a service interface that references a specific data type. If a referenced object is in a
different namespace, you need to generate the proxy for the referenced object separately.
When a proxy is generated from an external WSDL document, all of its objects are generated.
 The package structure in the ABAP back-end system must be defined.
The package structure defines where the proxies will be created, where the service provider will be, and
how the packages will fit into the overall application structure. Note that for proxies from external
WSDLs, the package is part of the external name and objects that reference other objects use the
external names for these references. If the package of some of these objects is changed after proxy
generation, these references get lost. Therefore, the package should not be changed after proxy
generation.
 Prefixes for the ABAP objects can be defined.
When generating proxies, many different objects are created. All external objects have a rather long
qualified name consisting of name and namespace. The ABAP objects only have a 30-character ABAP
name. The ABAP name is derived from the external name (without namespace) and, if a prefix is set, it is
set in front. Therefore, it is recommended that you define prefixes as they allow you to ensure that ABAP
objects in the back-end system are assigned unique and consistent names and name collisions are
avoided. In many ABAP projects, you need to use an ABAP namespace. You can define this using a prefix.
Because of the reduction to 30 characters, it is possible that generated names are not descriptive. It is
therefore recommended to check all generated names manually and adapt them accordingly.
Procedure
Generating a Proxy
You need to be working in the system in which you want to generate the proxy. Proxies are generated in
the ABAP back-end system, in which the object will subsequently be provided.
 Start the Enterprise Service Browser.
Use transaction code SPROXY.
 Select an object. In the Enterprise Service Browser, you can locate an object according to different
criteria, such as the generation source, the package, or the object type.
 To generate the proxy, open the context menu and choose Create proxy.
 Specify a package and a prefix, and choose Enter.
Valid ABAP names are proposed. You can change the proposed names as required.
The prefix you specified is displayed as part of the ABAP name in the Properties tab and also in the
Structure tab.
 Activate the proxy.
The ABAP objects, such as DDIC types, classes, and interfaces, are created or changed only when the
proxies are activated. When generating, regenerating, and editing, or saving the proxies, the ABAP
objects are not touched. When saving a proxy, an inactive version of the metadata is created. To change
the ABAP objects that are used at runtime, an active version is necessary.
 Release the transport request.
Note that the proxy (SPRX object) and the generates (CLAS, INTF, TAB, DTEL) are transported together.
 Create a runtime configuration for the proxies.
In the system that consumes the Web service, create a logical port for the Web service consumer. In the
provider system, create an endpoint for the service definition. For more information,
 Generating Proxies with Industry-Specific Enhancements
To activate industry classifications, you need to select an industry when you generate proxies for Web
services delivered with an Enhancement Package. Perform the following steps:
 Log on to the back-end system in English.
 Start transaction SM30.
 Choose the SVW_INDUSTRY view.
 Select your industries.
Regenerating a Proxy
If an object is changed in the Enterprise Services Repository (ES Repository) after it has been generated,
the changes will not automatically be reflected in the proxy in the ABAP back-end system. If an object in
the ES Repository is changed, you will need to regenerate the corresponding proxy manually.
Note
In the ES Repository Browser as well as in the Enterprise Service Browser, an icon with a red triangle
indicates a version of an ES Repository entity that is different from its proxy version in the ABAP back-
end system.
 In the Enterprise Services Repository Browser, locate the object whose proxy you want to regenerate.
 Open the context menu and choose Regenerate proxy
This function will only be available if a proxy has already been generated.
Only the proxy interfaces, datatypes, and classes will be overwritten. ABAP names and types will remain
intact if possible. If, for example, a datatype has been changed in a way that its ABAP type is no longer
valid, it is adapted.
 Reactivate the proxy.
From the context menu, choose Activate Proxy.
You can choose between the options Activate, Activate Main, and Activate All, depending on wheter you
want the underlying objects to be activated as well.
Deleting a Proxy
 In the ES Repository Browser, select an object.
 From the menu, choose Proxy Delete.
Note
The implementing class will not be deleted, but you will have to delete it manually. Only the generated
data will be deleted.
Result
When proxy objects are activated, one or more of the following ABAP objects are created:
 ABAP Dictionary types
ABAP Dictionary types represent the global data types in the ES Repository. The system also generates
the data types that will be used as method parameters.
 ABAP interface
An ABAP interface comprises interface types and constants.
 A template of an ABAP class (proxy class or implementing class) for provider or consumer proxies, if not
already existent
You have to manually adapt and activate ths template. If you want to create a new one, you have to
delete the implementing class or change its name.
The ABAP class of a service provider contains the implementation of the service provider methods, and
uses an ABAP interface. A service provider class has one method for each operation modeled in the ES
Repository. For a proxy to be used by an application, the methods will need to be filled with application
coding.

WEB Service configuration - Service consumer

How to configure a Service Consumer


To configure a consumer to access a particular service, you need to create and configure one or
more logical ports.
A logical port is created for a specific consumer proxy to access one particular binding on the
provider system.
You can create more than one logical port for the same consumer proxy. However, each logical port
can point to only one binding.

Concept
The logical port is based on the WSDL document generated for a binding. The WSDL document
describes how to access the binding, and includes the URLs for all the bindings defined for a
service.

Prerequisites
You can create a logical port based on a WSDL document or manually.
To use the WSDL based configuration the binding WSDL has to be used, not the design time WSDL.
The binding WSDL can only be generated after a binding was created for the provider in
transaction SOAMANAGER.
Depending on the way you choose to create a logical port, you need the following information:

Method to Create a Logical Port What You Need to Know

 The URL that points to the WSDL document for the


Based on the WSDL document for a
service.
service
This is the URL for the binding that was generated for
the Web service provider.
 The access parameters for the WSDL document
(Alternatively, you have the WSDL document stored as a
file.)

 The URL of the binding


Manually
 The configuration settings that the provider expects
If a WSDL document is not
available, you need to create a
logical port manually.

Procedure
 From the main screen of SOA Manager, go to the Service Administration tab.
 Select Web Service Configuration.
 In the Search by menu, choose Consumer Proxy.
 In the Search Pattern field, specify a consumer proxy or a search string.
Here, we will use CO_SRT_TEST_PROVIDER.

 Select the row with the consumer proxy and choose Apply Selection.
Design-time information about the consumer proxy is displayed.
 Go to the Configurations tab.
An overview of logical ports is displayed if any have been created.

7. To create a new logical port, choose Create.


A dialog box is displayed.
8. Specify the following information for the new logical port.
Here, we will use the name CO_SRT_TEST_PROVIDER2.
9. Select the configuration type WSDL-Based Configuration.
For WSDL-Based Configuration, the system extracts the binding URL from the WSDL document for
the service.
10. Specify the WSDL access settings.
Here, use Via HTTP access. Additionally, you need to specify the path to the WSDL document and a
user and password.
The user for WSDL Access needs to be authorized to access the WSDL in the system you are
working in.

For URL for WSDL Access, you need the URL for the binding generated for the Web service provider.
11. Choose Apply Settings.
A dialog box displays overview of bindings that could be used for this logical port.
12. Select the appropriate binding for your logical port.
13. Choose Apply Settings.
The logical port is now created in memory.
14. If an authentication method is used, go to the Consumer Security tab and specify a user and a
password.
The user must have runtime access and application authorization.
15. Save.
The new logical port with the default settings is created and displayed in the overview.
16. Optionally, you can check whether the logical port can access the binding by selecting the
consumer proxy and choose Ping Web Service.

Result
You now have created a logical port which can be used in your application to send a SOAP message
to the respective Web Service Provider.
Example Application Code Snippet
To invoke a Web Service you could use the following code snippet as an example:
data lr_consumer_proxy type ref to co_my_consumer_proxy.
" instantiate consumer proxy
CREATE OBJECT lr_consumer_proxy
EXPORTING
logical_port_name = 'MY_LOGICAL_PORT_NAME'.
" invoke WebService operation
lr_consumer_proxy->my_webservice_operation( ... ).
Quick Testing
It's also possible to test the Consumer Proxy without creating a program, using transaction SE80.
Follow these steps to trigger a test-call:
1. Go to transaction SE80 and display the Consumer Proxy object (Edit Object > Enhanced Options >
Enterprise Services > Client Proxy).
2. Click on the Test (F8) button.
3. On the selection screen specify the Logical Port and select the Method.
4. Click on Execute (F8).
5. With the XML Editor (Ctrl+F2) you can edit the input values of the request XML.
6. To trigger the call, click on Execute (F8).

ALE settings
Distribution model created in the requesting system

Sending system shall use the LS as own system <sysID>/<client>

Receiving system can be any logical system but the partner profile shall be created with the correct port
and the message type

The distribution model shall be created with the cash management request Idoc CMREQU

Error RQ401 "Component FDIS is not active in Table TRWCA

You might also like