feh.pdf

17
Forward Error Handling (FEH) for Proxy 24/01/2013 CIAL Saritha Rema SAP [email protected]

Upload: anonymous-ldguu7fg

Post on 03-Dec-2015

260 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: FEH.pdf

Forward Error Handling (FEH) for Proxy

24/01/2013

CIAL

Saritha Rema

SAP

[email protected]

Page 2: FEH.pdf

2

Confidentiality Statement Include the confidentiality statement within the box provided. This has to be legally approved Confidentiality and Non-Disclosure Notice The information contained in this document is confidential and proprietary to TATA Consultancy Services. This information may not be disclosed, duplicated or used for any other purposes. The information contained in this document may not be released in whole or in part outside TCS for any purpose without the express written permission of TATA Consultancy Services.

Tata Code of Conduct We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the Tata Code of Conduct. We request your support in helping us adhere to the Code in letter and spirit. We request that any violation or potential violation of the Code by any person be promptly brought to the notice of the Local Ethics Counselor or the Principal Ethics Counselor or the CEO of TCS. All communication received in this regard will be treated and kept as confidential.

Page 3: FEH.pdf

3

Table of Content

1. Forward Error Handling ....................................................................................................................................... 4

1.1 Configuration ............................................................................................................................................... 4

2. Process Flow ....................................................................................................................................................... 7

2.1 Proxy Class .................................................................................................................................................. 7

3. Action Class ......................................................................................................................................................... 9

3.1 Implementation of Action Class ................................................................................................................... 9

4. Post Processing Office ....................................................................................................................................... 12

4.1 Retry, Confirm and Discard Modes ............................................................................................................. 15

Page 4: FEH.pdf

4

1. Forward Error Handling FEH is a concept to monitor and resolve errors in asynchronous inbound processing on the receivers side for Enterprise Services. Error and Conflict Handler (ECH)

is the error handling tool implementing the concept of FEH. For monitoring purposes it reuses the tool Post Processing Office (PPO) for displaying error handling orders.

1.1 Configuration

Step1: Activate Error and Conflict Handler in TCODE SPRO.

This will activate the ECH at ERP instance level.

Page 5: FEH.pdf

5

Step2: Business Component and Business Process

This configuration is optional and only required for custom objects and is part of the Post Processing Office. TCODE: SM30, View: /SAPPO/VS_BPROC

Step3: Define Process Data This is where the Action Class (from Proxy Class) is assigned to the Business Component and Business Process. TCODE: SM30, TABLE: ECHVC_PROCESSES

Step4: Define Post Processing Assign the ECH Business Component and Business Process to the Post processing Business Component and Business Process. TCODE: SM30, TABLE: ECHVC_PP_PROCESS

Action Class Name

Page 6: FEH.pdf

6

Step5: Proxy Class & Method Assignment This configuration will link the Business Component & Process to the Proxy Class & Method.

Note that the proxy class here is an interface object.

Without this configuration, you will get an ‘Exception is not handled’ error during the runtime, in the RFC Queue.

TCODE: SM30, TABLE: FEHVC_PROXY2CMPR We defined different Business Process for each interface to identify the proxy class and method from Action class. Action class will be generic to all incoming proxy’s.

Page 7: FEH.pdf

7

2. Process Flow

Inbound proxy’s in ERP system normally throws an exception in case something went wrong. FEH process will try to change this behavior and whenever an exception is thrown, the message will be passed to the ECH service in order to be able to process it in Post Processing Office.

2.1 Proxy Class

Proxy Class is auto-generated while implementing the service in the ERP environment via SPROXY.

Steps:

1. Add in ‘Constructor’ and ‘get_instance’ Methods to retrieve the protocol.

No Parameters added. Exceptions defined for constructor as shown below.

SAP ERP

Proxy Framework Inbound Service

Standard Proxy Logic

Proxy Class

(Custom Class, implementing Proxy Interface, Auto-generated) Action Class

(Custom Class, implementing ECH Interface: IF_ECH_ACTION, collecting error messages for FEH)

Standard Proxy Logic, including:

- Persistent (Store the data for Postprocessing)

Page 8: FEH.pdf

8

Implement the constructor and get_instance methods. Define Attributes as below:

2. Implement the method from the Proxy Interface:

Add the Business logic inside Proxy Method. Exceptions and parameters declared as below.

Page 9: FEH.pdf

9

3. Action Class

Action Class is manually created in TCODE SE24, to cater for the processing in Async service.

3.1 Implementation of Action Class

1. Implement the interface IF_ECH_ACTION

Page 10: FEH.pdf

10

2. Create attribute SO_INSTANCE

3. Implement the methods for IF_ECH_ACTION (mandatory for all methods):

IF_ECH_ACTION~S_CREATE: Method use to create the instance of the Action Class.

Implement the Action Class COLLECT_ERROR method. This is the method collects the error and posts in PPO desktop. During the collect, the object type & object key can be passed to the ECH framework. This info will be used to display the available processing methods in Post Processing.

Page 11: FEH.pdf

11

The error messages will have the below status (Transferred to external application) in transaction SXMB_MONI.

In case if there are no errors, the document would be posted successfully and SXMB_MONI will have the message status processed successfully. In TCODE: /n/SAPPO/PPO2 (Edit Postprocessing Order), the screen looks as shown below

Page 12: FEH.pdf

12

4. Post Processing Office

1. /SAPPO/PPO2 – Edit Postprocessing Order

2. /SAPPO/PPO3 – Display Postprocessing Order

If no error exist, we can send out confirmation message in this method, or we can let the application send out the message, e.g. via output type.

“Process” changes Order status from “New” to’ Inprocess”

Page 13: FEH.pdf

13

FEH-PPO Default Resolution Strategy Configuration (ECH_RESOL_COMP)

This configuration will control the FEH-PPO Processing Mode, Retry Mode, etc:

a. [Column Group, Retry Modus] The ‘Automatic Retry’ intervals by assigning to specific group, plus activating batch job via TCode: /SAPPO/RESUBMIT

b. [Column Conf. Mode] This can control whether the object in error can be reprocessed manually or not.

c. [Column Disc. Mode] This can control whether the object in error can be discarded. d. [Column Persistent, Transient] These controls whether the object in error should be reprocess by

system, before it is transfer to the post processing (persistent). Use case: if the object is locked by other user, system will try to reprocess it before it is transfer to postprocessing.

e. [Column Error Category] This has to match the error category raised in the program/proxy class. The program will typically derive the error category based on the error message, error type and error class. The logic to derive this error category depends on the service (typically it picks up the first error or abort message from the processing).

Status change

These action buttons are controlled by the FEH Implemented Interfaces in the Action Class:

1. Repeat = method IF_ECH_ACTION~RETRY 2. Confirm = method IF_ECH_ACTION~FINISH 3. Discard = method IF ECH ACTION~FAIL

The Error Category is determined by the logic in the Action Class (COLLECT_ERROR) and passed into the FEH ‘Collect’ method.

Different service will have different logic to determine the Error Category, and it can be only determined by the Error Type, Error Class & Error ID.

The Mode is determined based on the

configuration in TCODE ECH_RESOL_COMP

Page 14: FEH.pdf

14

FEH Error Category Description DCE.ITE Customizing Error PRE Process Error PRE.AUE Authorization Error PRE.TEE.LRE Lock Error PRE.VAE Value Error

Page 15: FEH.pdf

15

4.1 Retry, Confirm and Discard Modes

1. Method: IF_ECH_ACTION~RETRY When PPO issue ‘Repeat’ action, this method will be called.

We can issue the Success/Error service in this method.

The flow logic: 1. Initialize the FEH class with the retry object id:

cl_feh_registration=>s_retry 2. Fetch the component and Business Process from Order header based on Order ID in PPO. 3. Fetch the Interface and Method mapped to the Business process in PPO configuration to get

the Class name. 4. Get the structure details from Payload tables. 5. Create the structure dynamically and retrieve the Inbound data:

Call method from [FEH Class Instance]->retrieve_data 6. Call the class and method dynamically to reprocess the Business logic. 7. Conclude the retry process:

Call method from [FEH Class Instance]->resolve_retry 8. Note on return parameter: E_EXECUTION_FAILED & E_RETURN_MESSAGE

If the return parameter E_EXECUTION_FAILED is set to ABAP_TRUE, the post processing will be terminated with error message = E_RETURN_MESSAGE and all the processing/validation messages will not be displayed: If it is leave empty ( = ABAP_FALSE ), the processing/validation error messages will be handled by the resolve_retry method, and will be displayed in the post processing:

Note: Upon successful reprocessing, there is no detail message, such as ‘Accounting Document No xxx Created’. It only displays ‘Posting Successful at [date & time]”.

2. Method: IF_ECH_ACTION~FAIL When PPO issue ‘Discard’ action, this method will be called. We can issue the ‘Discard’/Error service in this method. The flow logic: 1. Retrieve the Inbound service data by calling method: cl_feh_registration=>s_retrieve_data. 2. Register the error to ECH/Post processing by calling method: cl_feh_registration=>s_fail.

This is where the error data are written into the database and Post processing is completed.

9. 3. Method: IF_ECH_ACTION~FINISH

Page 16: FEH.pdf

16

When PPO issue ‘Confirm’ action, this method will be called. We can issue the ‘Confirm’/Success service in this method. The flow logic: Conclude the ECH/Post processing by calling method: cl_feh_registration=>s_finish.

Page 17: FEH.pdf

17

Contact

For more information, contact [email protected](Email Id of ISU)

About Tata Consultancy Services (TCS)

Tata Consultancy Services is an IT services, consulting and business solutions organization that delivers real results to global business, ensuring a level of certainty no other firm can match. TCS offers a consulting-led, integrated portfolio of IT and IT-enabled infrastructure, engineering and assurance services. This is delivered through its unique Global Network Delivery ModelTM, recognized as the benchmark of excellence in software development. A part of the Tata Group, India’s largest industrial conglomerate, TCS has a global footprint and is listed on the National Stock Exchange and Bombay Stock Exchange in India.

For more information, visit us at www.tcs.com.

IT Services Business Solutions Outsourcing All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content / information contained here is correct at the time of publishing. No material from here may be copied, modified, reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior written permission from TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited

Thank You