SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Call instance method from workflow using class

By Rakesh Dhudipala

Scenario:

Below document explains how to call instance Method from Workflow task  

Prerequisites:

ABAP objects  

Step by step Procedure:  

Go to SE24, create a class by name ZCL_TEST_WORKFLOW.  

Implement interface IF_WORKFLOW in the class.  

Create one instance method called GET_RESULT

Define below attributes in the Attributes TAB

Create below methods in the methods tab.

1)     Constructor:

Define with below parameters.

In the 'Constructor' write the below code.

method CONSTRUCTOR.

  m_lpor-INSTID = i_id.
  m_lpor-CATID = 'CL'.
  m_lpor-TYPEID = 'ZCL_TEST_WORKFLOW'.
endmethod.

2)     GET_RESULT:

Method contains below parameters.

 

Write the below code in the GET_RESULT method.

method GET_RESULT.
  p3 = p1 * p2.
endmethod.  

3)     Create:

Create method contains below parameters.

Write the below logic in the CREATE method.

method CREATE.
  CREATE OBJECT e_instance
    TYPE
      zcl_test_workflow
    EXPORTING
      i_id              = i_id.
endmethod.

In BI_PERSISTENT~FIND_BY_LPOR interface method write the below code

method BI_PERSISTENT~FIND_BY_LPOR.
  CREATE OBJECT result
    TYPE
      zcl_test_workflow
    EXPORTING
      i_id              = lpor-instid(10).
endmethod.

In the BI_PERSISTENT~LPOR method write the below code

method BI_PERSISTENT~LPOR.
  result = me->M_Lpor.
endmethod.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image