comp 110

25
COMP110 Error Handling and Monitoring Framework for Interfaces With SAP NetWeaver PI and SAP NetWeaver XI Krishnakumar Ramamoorthy, Deloitte Consulting

Upload: koizak

Post on 20-Jan-2016

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comp 110

COMP110

Error Handling and Monitoring Framework for Interfaces With SAP NetWeaver PI and SAP NetWeaver XI

Krishnakumar Ramamoorthy, Deloitte Consulting

Page 2: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 2

1. Need for error handling strategy

2. Challenges in Out of the box solution

3. Custom solution3.1. ABAP Proxy & IDOC Combined approach

3.2. CCMS notifications

4. Summary

5. Q&A Forum

Agenda

Page 3: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 3

Need for an Error Handling Strategy

Errors are inevitable in any interface architecture

No strategy; often results in additional development effort

Impacts the underlying business processes

Out-of-the box tools may not always meet specific business requirements

Page 4: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 4

PIECC

Points of Failure and Error Categories

ISIS

System ErrorsSystem Errors

MessageMessage

Out-bindingOut-binding

AdaptersAdapters

CacheCache

Rcv. DeterminationRcv. Determination

Intf. DeterminationIntf. Determination

MappingMapping

Internal/UnknownInternal/Unknown

Blocked qRFCsBlocked qRFCsEO queuesEO queues

EOIO queuesEOIO queues

Runtime ErrorsRuntime Errors

BPMBPM

DeadlineDeadline

Process EngineProcess Engine

Process SchedulingProcess Scheduling

EventingEventing

Tracking/DB tablesTracking/DB tables

Others/UnknownOthers/Unknown

Process instancesProcess instances

PE adapter PE adapter

AEAE

System ErrorsSystem Errors

Adapter frameworkAdapter framework

AdapterAdapter

MessageMessage

Message queuesMessage queues

CacheCache

AgreementAgreement

ABAP runtimeABAP runtime

IEIE

System ErrorsSystem Errors

ABAP runtimeABAP runtime

ParserParser

Internal/UnknownInternal/Unknown

Blocked qRFCsBlocked qRFCsEO queuesEO queues

EOIO queuesEOIO queues

App. ErrorsApp. Errors

Proxy faultProxy fault

IDOC errorsIDOC errors

Module exceptionsModule exceptions

Page 5: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 5

Out of the Box Error Handling and Monitoring Capabilities

PI

ISIS

System ErrorsSystem Errors

SXI_MONITORSXI_MONITOR

IDX5IDX5

SXI_CACHESXI_CACHE

Blocked qRFCsBlocked qRFCsSMQ1SMQ1

SMQ2SMQ2

Runtime ErrorsRuntime Errors

BPMBPM

RZ20RZ20

SXMB_MONI_BPESXMB_MONI_BPE

SWELSWEL

SXI_MONITORSXI_MONITOR

……

AEAE

System ErrorsSystem Errors

Comp. MonitoringComp. Monitoring

Msg. MonitoringMsg. Monitoring

Cache MonitoringCache Monitoring

Engine statusEngine status

E2E MonitoringE2E Monitoring

RZ20RZ20

ECC

IEIE

System ErrorsSystem Errors

RZ20RZ20

SXI_MONITORSXI_MONITOR

SMICM LogsSMICM Logs

Blocked qRFCsBlocked qRFCs

App. ErrorsApp. Errors

SXI_MONITORSXI_MONITOR

BD87BD87

SLG1SLG1

SMQ3SMQ3

SM58SM58

SMICM LogsSMICM Logs

CC MonitoringCC Monitoring

Tracing/LoggingTracing/Logging

Alert configurationAlert configuration

SMQ1SMQ1

SMQ2SMQ2

SMQ3SMQ3

SM58SM58

……

……

Page 6: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 6

Challenges

Out of the box tools need to be enhanced to build a robust error handling architecture

Such an architecture should answer the following questions How to capture an error? Who should be notified and how? How to fix it?

Should provide a way for fixing both system and application errors Application errors

– Often dependent on a specific interface– Fixing the issue might mean altering the payload– Pose a special challenge as fixing the errors involves business users

System errors– Not because of a specific interface; often caused by issues in other system

components– Fix the main cause and resend the message if needed– Often fixed by technical support team

Page 7: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 7

Application Errors in ABAP Proxy - Out of the Box Error Handling Approach

Receive inbound message

For each LUW

Post data (BAPI)

Error?

Raise application fault

Success in SXI_MONITOR

For each LUW

Error in SXI_MONITOR

Y

N

Page 8: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 8

Application Errors in ABAP Proxy - Out of the Box Error Handling Approach

Receive inbound message

For each LUW

Post data (BAPI)

Error?

Raise application fault

Success in SXI_MONITOR

For each LUW

Error in SXI_MONITOR

Y

N

Cannot change payload ‘Retry’ will post all LUWs

Page 9: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 9

Application Errors in ABAP Proxy - Custom Error Handling Approach

For each LUW

Post data using BAPI (aRFC)

Error?

Create an IDOC

For each LUW

Fix using BD87

Receive inbound message

Success in SXI_MONITOR

Raise Alerts

Y

N

Page 10: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 10

Application Errors in ABAP Proxy - Custom Error Handling Approach

For each LUW

Post data using BAPI (aRFC)

Error?

Create an IDOC

For each LUW

Fix using BD87

Receive inbound message

Success in SXI_MONITOR

Raise Alerts

Y

N

Can change payload Can fix errors and repost Inbuilt auditing and authorization control

Page 11: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 11

Design Template

Determine interface details

For each LUW

Post data using BAPI (aRFC)

Error?

Frame IDOC

Use CL_PROXY_ACCESS to access proxy runtime

From proxy runtime, get the header details of message

Based on header details, get the IDOC type and message type from a custom control table

Start spool for control report

End spool for control report

For each LUW

Post IDOCs

Based on BAPI structure, frame IDOC data dynamically

Use runtime type services for generating dynamic structures

Close spool object. Convert the spool object to PDF and save to file system

Trigger an alert to the business user about the status of the interface run

Post the collected IDOCs asynchronously

Y

N

Page 12: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 12

Interface Error Handler Control Table

Page 13: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 13

Code Sample – Dynamic IDOC Creation in Provider Proxy for Error LUWs

data: lo_err type ref to zdel_interface_error_handler.create object lo_err.

* Get the interface detailslo_err-> get_interface_header( )....

* For each LUW, call the BAPI function module. In case of errors,* frame IDOC data and post IDOCs

v_docnum = v_docnum + 1.if lv_error eq abap_true.

lo_err->frame_idoc_segment( in_data = param1 ).lo_err->frame_idoc_segment( in_data = param2 ).lo_err->frame_idoc_segment( in_data = table1 ).

endif.

...* Post IDOCs synchronouslylo_err->post_idocs( ).

Page 14: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 14

CCMS Architecture

OthersOthersXIXIDBDBOSOS

Data SuppliersData Suppliers

OS dataOS data App dataApp data Other dataOther dataDB dataDB data

MonitoringObject

MonitoringObject

MonitoringObject

MonitoringObject

MonitoringObject

MonitoringObject

MonitoringObject

MonitoringObject

Data ConsumersData Consumers

APIsAPIs MonitorMonitor Alert MonitorAlert Monitor

Monitoring Architecture

Image derived from www.help.sap.com

Page 15: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 15

CCMS Monitoring Objects – Custom Methods

Page 16: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 16

CCMS Monitoring Objects – Custom Methods cont’d

Page 17: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 17

Code Sample – Message Based Alert Category

Function ZSALO_SEND_ALERT_TO_ALM_V2…

loop at mt_tool_info. move-corresponding mt_tool_info to w_aid.

append w_aid to t_aid.endloop.

call function 'SALR_AL_READ_ALERT_BY_AID' tables aid = t_aid

alerts_salr = t_ccms_alerts.call function 'TRFC_QIN_OVERVIEW' tables qview = t_qview.loop at t_ccms_alerts into w_ccms_alerts where msg cs w_qview-qname.

valid_q = 'X'. exit. endloop.…

call function 'TRFC_GET_QIN_INFO_DETAILS‘ exporting qname = w_qview-qname tables qtable = t_qtab.

loop at t_qtab into w_qtab.move-corresponding w_qtab to lv_tid.

call function 'QRFC_TID_RESOLUTION‘ exporting tid = lv_tid func = 'SXMS_ASYNC_EXEC'param = 'MSGGUID'

importing param_val = lv_dataw_msgids = lv_data. append w_msgids to t_msgids.

…endloop.call function 'SXMB_SELECT_MESSAGES' exporting im_msgguid_tab = lt_msgids

importing ex_msgtab = lt_msgtab.

Page 18: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 18

Code Sample – Reassign LUW from Inbound Queue

Function ZSALO_SEND_ALERT_TO_ALM_V2…

loop at mt_tool_info. move-corresponding mt_tool_info to w_aid.

append w_aid to t_aid.endloop.

call function 'SALR_AL_READ_ALERT_BY_AID' tables aid = t_aid

alerts_salr = t_ccms_alerts.call function 'TRFC_QIN_OVERVIEW' tables qview = t_qview.loop at t_ccms_alerts into w_ccms_alerts where msg cs w_qview-qname.

valid_q = 'X'. exit. endloop.…

call function ‘TRFC_QIN_GET_FIRST_LUW’ exporting qname = w_qview-qname importing tid = w_tid.

…* Move the TRFC to SMQ3 only if the queue name is allowed for this action

submit RSTRFCDK and return with tid = w_tid.

* Activate the queue to process other LUWscall function 'QIWK_SCHEDULER_ACTIVATE' exporting qname = w_qview-qname.

…* Send alert using function module SALRT_CREATE_API

Page 19: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 19

Summary

SAP NetWeaver XI/PI has many out-of-the box tools for comprehensive error handling and monitoring

ABAP proxy combined with the power of IDOCs provides an opportunity for the business users to proactively fix errors

Central monitoring using CCMS and notifications using alert framework offer a solid yet flexible architecture for error handling

With options for enhancements; ABAP proxy framework and CCMS provide a way to fine tune error handling architecture for specific business requirements

Page 20: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 20

Questions?

Q & A

Page 21: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 21

Purchase the SAP NetWeaver, Development Subscription today at the SAP Community Clubhouse, or online at https://

www.sdn.sap.com/irj/sdn/devsub

Visit us at the Community Clubhouse, show us you are a subscriber, and get a gift!

The SDN Subscriptions Program introduces the SAP NetWeaver, Development Subscription for individual developers. Available for purchase in Germany and the United States.

Subscription gives you one year access to … SAP NetWeaver platform software, patches, and updates Development license for SAP NetWeaver to evaluate, develop and test Standard software maintenance Online sessions from SAP TechEd Access to SAP Enterprise Services Workplace for testing Premium presence in forums

SDN Subscriptions Program

Page 22: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 22

Fuel your Career with SAP Certification

Take advantage of the enhanced, expanded and multi tier certifications from SAP today!

What the industry is saying “Teams with certified architects and

developers deliver projects on specification, on time, and on budget more often than other teams.”2008 IDC Certification Analysis

“82% of hiring managers use certification as a hiring criteria.”2008 SAP Client Survey

“SAP Certified Application Professional status is proof of quality, and that’s what matters most to customers.”*Conny Dahlgren, SAP Certified Professional

Page 23: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 23

Further Information

Related SAP Education and Certification Opportunitieshttp://www.sap.com/education/

SAP Public WebSAP Developer Network (SDN): www.sdn.sap.com

Business Process Expert (BPX) Community: www.bpx.sap.com

Related DocumentationCCMS Monitoring Architecture: http://help.sap.com/saphelp_nw70/helpdata/EN/c4/3a7da1505211d189550000e829fbbd/frameset.htm

ABAP Proxy Runtime: http://help.sap.com/saphelp_nw70/helpdata/en/02/265c3cf311070ae10000000a114084/frameset.htm

BAPI ALE Interface:http://help.sap.com/saphelp_nw70/helpdata/EN/78/2173f551ce11d189570000e829fbbd/frameset.htm

Page 24: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 24

Thank you!

Page 25: Comp 110

© SAP 2008 / SAP TechEd 08 / COMP110 Page 25

Please complete your session evaluation.

Be courteous — deposit your trash, and do not take the handouts for the following session.

Thank You !

Feedback