BAdI Enhancements

There are two BAdI's related to the collector. The most important one is the /APPS/ONE_BADI. Since this allows you to enhace the data, which is retrieved by default from the workflow with more relevant information, which is maybe needed beside the standard workflow information. The /APPS/ONE_SEND_BADI is currently implemented in the way, that the outgoing communcation goes through a webservice call to the Hub.

/APPS/ONE_BADI

The BAdI /APPS/OS_BADI is implemented using enhancement spot /APPS/ONE_ENH_SPOT. This BAdI is used for general functions related to data retrieval. This BAdI can have multiple active implementations. To make sure the correct implementation is used the BAdI will be instantiated using a Filtervalue the value is equal to the instance name defined in customizing (customizing table /APPS/ONE). There is a fallback implementation available which will be used in case no implementation is found for the instance name. This BAdI enables the customer to influence the data determination and creation of the XML structure. The available methods are described below. The BAdI is implemented in a way that it behaves like a persistent object. Lifetime starts with DETERMINE_ITEMS and ends after PROCESS_ITEMS. So it is possible to store information in BAdI class (custom implementation) for later use in lifetime of object.

CHANGE_ITEMS

This method is implemented in method DETERMINE_ITEMS of class /APPS/CL_ONE after the standard data evaluation. The following parameters are available:
 

Name

Type

Description

IS_CUSTOMIZING

Importing

contains the customizing entry for current instance

IV_FROM

Importing

contains timestamp for begin of evaluation period for workitems

IV_TO

Importing

contains timestamp for end of evaluation period for workitems

IV_TASK

Importing

contains tasks which were considered for data evaluation

CT_ITEMS

Changing

contains items which were determined


The data determination timestamp stored in run history and used by the collecotr to evaluate items will not be changed that means a long runtime may lead to a time gap. This is in the responsibility of a custom own implementation to consider this. The easiest way is to use the delivered timeframe (IV_FROM – IV_TO) instead of the current time for additional data evaluation to make sure that items not in this frame are considered at next runtime.

CHANGE_USERDETAILS

This method is implemented in method is implemented in method GET_USER_DETAILS of class /APPS/CL_ONE and will be called for each work item and its evaluated receivers. 
 

Name

Type

Description

IS_CUSTOMIZING

Importing

contains the customizing entry for current instance

IS_WI_HEAD

Importing

contains work item head data the user information are related to

CT_USERDETAILS

Changing

Contains the information for each user related to current workitem


It can be used to change, delete or add information. In case the mail address for user is not stored in user detail data the method can be used to add this information as it is needed for sending the notification. Another example is the language. At the moment only the mail address and the language (field langu_p and langup_iso in user details) are used.

CHANGE_DATA

This method is implemented in method PROCESS_ITEM of class /APPS/CL_ONE_SYNC. It is called after the evaluation of receivers and the basic data. The following parameters are available:
 

Name

Type

Description

IS_CUSTOMIZING

Importing

contains the customizing entry for current instance

IS_WI_HEAD

Importing

contains work item head data the notifications are based on

CT_NOTIF

Changing

contains the determined notifications to be send


This method will be called once for each WI determined. Remember that the BAdI class is “persistent” so it is possible to store data if a custom own implementation is created to minimize evaluation effort. The data is still available on next call as long it happens in the same run of instance. 

CREATE_XML

This method is implemented in method PROCESS_ITEM after data determination and is responsible for XML creation. The program itself does not contain a XML conversion. The standard fallback class contains an implementation which can be copied in case a custom own implementation is used. Without copying no XML is created.
 

Name

Type

Description

IT_DATA

Importing

Contains the evaluated data

RV_XML

Returning

Contains the data as XML rawstring


The XML will be created by using the transformation XSLT /APPS/ONE_DATA.

/APPS/ONE_SEND_BADI

BAdI /APPS/ONE_SEND_BADI is implemented using enhancement spot /APPS/ONE_ENH_SEND_SPOT. This BAdI enables the customer to influence how the data is send. In standard the information is send by mail. The BAdI will be instantiated by using a filter. This Filter is the value of the related connection type (defined in /APPS/ONE_CON_TY and related to an instance by /APPS/ONE). Currently only W (Web Service) is supported. There is no fallback available. The BAdI is implemented in a way that it behaves like a persistent object. Lifetime starts with at the beginning of PROCESS_ITEMS and ends at the end of PROCESS_ITEMS. So it will be possible to store information in BAdI class for multiple uses in lifetime of the object. This BAdI can have more than one active implementation so it is possible to send the gathered information to more than one system or in more than one way. As the customizing is not designed to consider this and the order of execution of each is unknown the history data for work items may contain invalid data and may affect the run history information as well. It is in the responsibility of custom implementation to take care of this.

SEND_MESSAGE

 

Name

Type

Description

IS_CUSTOMIZING

Importing

contains the customizing entry for current instance

IS_CONNECTION

Importing

contains the customizing entry for connection information related to current instance

IS_WI_HEAD

Importing

contains work item head data the notifications are based on

IV_TEST

Importing

A flag indicating if program runs in test mode

IV_SENDER

Importing

Contains the name of the user which is used for sending the data mail

CS_XML

Changing

Contains content and information, in standard the time stamp for sending is changed and the success flag will be erased in case an error occurs

Share this page
X
Tell your colleagues and friends about Sitrion. Choose a social channel below to share this page.