ABAP OO - OBJECT NOT INSTANTIATED

Florin Wach (gmx) florin.wach at gmx.net
Wed Jan 14 12:33:43 EST 2009


Hi,

1. There's a dataflow missing from wf_container to task_container
z_cl_liv_assets --> _wi_object_id

2. You'll need an instantiation method that you have a class instance before executing the task.
Example
z_cl_liv_assets=>get_instance( importing im_beln, im_bukrs) exporting class instance as instance independent method.
Create a new task step that executes that method. do not use a simple container operation.

The rest looks good.

Yours,
   Florin

  ----- Original Message ----- 
  From: Simon, Tom 
  To: sap-wug at mit.edu 
  Sent: Wednesday, January 14, 2009 3:56 PM
  Subject: ABAP OO - OBJECT NOT INSTANTIATED


  I am using a method in a class(z_cl_liv_assets) that I created for a workflow task.  The object does not get instantiated by the workflow.  I have read all the blogs by Jocelyn Dart and wondered if anyone could look over my structures and provide insight into why it does not work.  When I test the instant constructor and pass in the doc num and company code it works. If I pass the import parameters directly to the method it works.  But if I try to use the instant attributes it does not work created by the constructor it does not work. 
  When I test the task in swus it does not instantiate the object?
  Any help is apprecitated?

  Thank you,

  Tom Simon


  Bindings in the task to class z_cl_liv_assets~retrieve_anek:

  wf container   task container
  docnum         -> im_belnr
  company code   -> im_bukrs
  ex_anek        <- ex_anek
  z_cl_liv_assets <- wi_object_id

  bindings from task to method retrieve_anek.

  im_belnr to im_belnr
  im_bukrs to im_bukrs

  Class: z_cl_liv_assets;
  Attributes:

   BELNR               InstanPubl         Type    ANEK-BELNR         
   BUKRS               InstanPubl         Type    ANEK-BUKRS         
   T_ANEK              InstanPubl         Type    FAA_T_ANEK         
   M_POR               InstanProt         Type    SIBFLPOR           
   GJAHR               InstanPubl         Type    ANEK-GJAHR      

   Methods:

  Parameters: 
  LPOR Importing Type SIBFLPOR
  RESULT Returning Type Ref To BI_PERSISTENT

    METHOD bi_persistent~find_by_lpor.

    DATA: lv_liv_doc TYPE anek-belnr,
          lv_liv_co  TYPE anek-bukrs.

    MOVE lpor-instid(10)     TO lv_liv_doc.
    MOVE lpor-instid+10(4)   TO lv_liv_co.

    CREATE OBJECT result
      TYPE
        z_cl_liv_assets
      EXPORTING
        im_belnr        = lv_liv_doc
        im_bukrs        = lv_liv_co.


  ENDMETHOD. 

    Parameters:RESULT Returning Type SIBFLPOR
     METHOD bi_persistent~lpor.

    DATA: lpor TYPE sibflpor.

    lpor-catid = 'CL'.
    lpor-typeid = 'Z_CL_LIV_ASSETS'.
    CONCATENATE me->belnr me->bukrs INTO lpor-instid.
    result = lpor.
  ENDMETHOD. 

  parameters:
  IM_BELNR Type ANEK-BELNR
  IM_BUKRS Type ANEK-BUKRS
    METHOD constructor.
    me->belnr = im_belnr.
    me->bukrs = im_bukrs.
    me->M_por-catid = 'CL'.
    me->M_por-typeid = 'z_cl_liv_assets'.
    CONCATENATE me->belnr me->bukrs INTO me->M_por-instid.
  *  me->m_por-instid = me->belnr.

  ENDMETHOD. 
  Parameters: 
  EX_ANEK Exporting Type FAA_T_ANEK
  METHOD retrieve_anek.

    CALL FUNCTION 'ANEK_READ_MULITPLE'
      EXPORTING
        i_belnr = me->belnr
        i_bukrs = me->bukrs
      TABLES
        t_anek  = ex_anek.

    IF sy-subrc = 0.
      me->t_anek = ex_anek.
    ENDIF.

  ENDMETHOD. 



------------------------------------------------------------------------------


  _______________________________________________
  SAP-WUG mailing list
  SAP-WUG at mit.edu
  http://mailman.mit.edu/mailman/listinfo/sap-wug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090114/7117f47c/attachment.htm


More information about the SAP-WUG mailing list