Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Purpose:

This document explains, "How to implement dynamic check for locks on InfoObject/DSO/InfoCube in Process Chain".

Scenario:

Two process chains has Loading step for same InfoObject/DSO/InfoCube. Process Chain-1 runs data load to InfoObject/DSO/InfoCube and Process Chain-2 runs Attribute Change Run/Activates/Delete Index for the same object.


In this document we have taken example on conflict between Data loading and Activation on the DSO. But this will also be applicable for InfoObject & InfoCube.


Solution:

1. Create Implementation for the standard BAdi RSAR_CONNECTOR.

  • Go to t-code SE19 -> Create Implementation -> Classic BAdi. Give BAdi name as "RSAR_CONNECTOR" and click on "Create Impl" button.

  

  • Provide name of Implementation as “ZCHECK_DSO” and click "OK".

  • This will take you to the definition of the implementation. Provide suitable description to the Implementation.

  • Press the activate button on the toolbar -> provide the package name and then click on continue button to activate the new implementation and its underlying objects.

    

Remember the name of the implementing class from the previous screenshot (ZCL_IM_CHECK_DSO), which we need to use later for adding our new custom methods.

2. Create custom methods i.e. custom formula

  • Go to change mode of the class ZCL_IM_CHECK_DSO from transaction SE24.

             

  • In the "Methods" tab you can implement as many custom methods as you wish. As like below screenshot, 1 custom method C_DSO_CHECK needs to be created with the same settings.

  • C_DSO_CHECK is given as technical name to method. Choose Level as 'Static Method', Visibility as 'Public' and give suitable Description.
  • Once your method has a name and attributes, proceed to defining its parameters by pressing the ‘Parameters’ button.
  • Maintain Importing and Exporting Parameter as shown below. Remember that, you can have importing, exporting or returning parameter, no changing parameter allowed. Most important thing is, you can have only one Exporting parameter.

 

  • Once after maintaining Parameters, click on 'Methods'.
  • Double-click on the Method name (C_DSO_CHECK) to view method code.
  • Paste the below code.

method C_DSO_CHECK.

DATA L_OBJNAME TYPE SEQG3-GARG.
DATA L_SUBRC LIKE SY-SUBRC.
DATA T_ENQ TYPE TABLE OF SEQG3.
 
CLEAR: L_OBJNAME, L_SUBRC, T_ENQ.
CONCATENATE '*' I_OBJNAME '*' INTO L_OBJNAME.

CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
     GCLIENT = SY-MANDT
     * GNAME = ' '
     GARG = L_OBJNAME
     GUNAME = '*'
     * LOCAL = ' '
     * FAST = ' '
IMPORTING
     NUMBER = E_FLAG
     SUBRC = L_SUBRC
TABLES
     ENQ = T_ENQ
EXCEPTIONS
     COMMUNICATION_FAILURE = 1     SYSTEM_FAILURE = 2     OTHERS = 3.

IF L_SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

endmethod.

  • Activate the method by clicking on the activate button from the toolbar.

  • Now go back and double click on the method “IF_EX_RSAR_CONNECTOR~GET” and paste the below code.

method IF_EX_RSAR_CONNECTOR~GET.DATA: L_FUNCTION TYPE SFBEOPRND.  CASE I_KEY.WHEN 'CUSTOM'.
     CLEAR: L_FUNCTION.
     L_FUNCTION-CLASS = 'ZCL_IM_CHECK_DSO'
.
     L_FUNCTION-METHOD = 'C_DSO_CHECK'.
     L_FUNCTION-TECH_NAME = 'C_DSO_CHECK'.
     L_FUNCTION-DESCRIPTN = 'CHECK DSO LOCK'.
     APPEND L_FUNCTION TO C_OPERANDS.
ENDCASE.

endmethod.

  • Activate the method by clicking on the activate button from the toolbar.

3. Add DECISION STEP in Process Chain before DSO activation

  • Go to RSPC Tcode, choose the Process chain and add Decision step as below.

  • Write Formula IS ZBWXXXX Locked as below.

  • In the above formula, the function C_DSO_CHECK has to be chosen as below from the category "CUSTOM User-Defined Functions".

  • Similarly write the Formula IS ZBWXXXX NOT Lock as below.


  • Activation of DSO can be delayed using the "Debug Loop" option if the DSO is locked else DSO can be immediately activated as like below.

4 Comments
Labels in this area