<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>Hi Tom, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>Ok - your basic approach is correct but watch your details....
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>For instance in your constructor method you pass your class name
as a literal in lower case 'z_cl_...' - don't give any opportunity for
confusion. Such a literal should always be in upper case as it refers to a
technical id which is upper case. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>Also in your constructor method you concatenate belnr and bukrs
but in your find_by_lpor method you use a structure to break them down - never
assume that concatenate will maintain correct field placings with multiple
key instances - always use a structure - easiest way to make sure the
same structure is available to all methods is to create a type in your
class or use DDIC element. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>And also read Florin's comments - as explained in the blogs you
must first instantiate the object before using it - just as you did in
BOR. Often of course your object is instantiated by the incoming event, but
if you are not using an event to pass your object instance you need to
instantiate it yourself. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>That is, you must have two steps in your workflow - first step is
a task to instantiate the object and put the instance reference in your
workflow container, then in the second step you call your task that calls your
retrieve anek method - passing in your object instance. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>Usually if methods work directly when called in the class but not
when called from workflow it is because you have a problem in your lpor or
find_by_lpor method - they must agree absolutely on the value of the persistent
object reference as this is the reference workflow uses to navigate to/from
classes. You never see the workflow directly call these methods -
they are "behind the scenes" - but they are absolutely critical to getting the
solution to work. </FONT></SPAN></DIV>
<DIV><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=926161322-14012009><FONT face=Arial color=#0000ff>Hope that
helps. </FONT></SPAN></DIV>
<DIV><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=926161322-14012009><FONT face=Arial color=#0000ff>Jocelyn</DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Simon, Tom<BR><B>Sent:</B>
Thursday, 15 January 2009 1:57 AM<BR><B>To:</B>
sap-wug@mit.edu<BR><B>Subject:</B> [LIKELY JUNK]ABAP OO - OBJECT NOT
INSTANTIATED<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>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. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>When I test the task
in swus it does not instantiate the object?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>Any help is
apprecitated?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>Thank
you,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>Tom
Simon</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>Bindings in the task
to class z_cl_liv_assets~retrieve_anek:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>wf
container task container</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009>docnum
-> im_belnr</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>company
code -> im_bukrs</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009>ex_anek <-
ex_anek</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>z_cl_liv_assets
<- wi_object_id</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>bindings from task
to method <FONT face=Arial>retrieve_anek.</FONT><BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>im_belnr to
im_belnr</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>im_bukrs to
im_bukrs</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>Class:
z_cl_liv_assets;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009>Attributes:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009> BELNR
InstanPubl
Type
ANEK-BELNR
<BR> BUKRS
InstanPubl
Type
ANEK-BUKRS
<BR> T_ANEK
InstanPubl
Type
FAA_T_ANEK
<BR> M_POR
InstanProt
Type
SIBFLPOR
<BR> GJAHR
InstanPubl
Type
ANEK-GJAHR </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009> Methods:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009>Parameters: </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009>LPOR Importing Type SIBFLPOR<BR>RESULT Returning Type
Ref To BI_PERSISTENT<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><!--StartFragment --><FONT size=3><FONT
face="Times New Roman">
<STYLE type=text/css>SPAN {
        FONT-SIZE: 10pt; BACKGROUND: #ffffff; COLOR: #000000; FONT-FAMILY: "Courier New"
}
.L1S32 {
        COLOR: #3399ff
}
.L1S52 {
        COLOR: #0000ff
}
</STYLE>
</FONT></FONT><SPAN><SPAN
class=L1S52>METHOD</SPAN> bi_persistent~find_by_lpor.<BR><BR> <SPAN
class=L1S52>DATA</SPAN>: lv_liv_doc <SPAN
class=L1S52>TYPE</SPAN> anek-belnr,<BR> lv_liv_co <SPAN
class=L1S52>TYPE</SPAN> anek-bukrs.<BR><BR> <SPAN
class=L1S52>MOVE</SPAN> lpor-instid(<SPAN
class=L1S32>10</SPAN>) <SPAN
class=L1S52>TO</SPAN> lv_liv_doc.<BR> <SPAN
class=L1S52>MOVE</SPAN> lpor-instid+<SPAN class=L1S32>10</SPAN>(<SPAN
class=L1S32>4</SPAN>) <SPAN
class=L1S52>TO</SPAN> lv_liv_co.<BR><BR> <SPAN
class=L1S52>CREATE</SPAN> OBJECT result<BR> <SPAN
class=L1S52>TYPE</SPAN><BR> z_cl_liv_assets<BR> <SPAN
class=L1S52>EXPORTING</SPAN><BR> im_belnr = lv_liv_doc<BR> im_bukrs = lv_liv_co.<BR><BR><BR><SPAN
class=L1S52>ENDMETHOD</SPAN>.</SPAN><FONT face="Times New Roman" size=3>
</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=198193014-14012009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT
face=Arial>
Parameters:RESULT Returning Type SIBFLPOR</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><!--StartFragment --><FONT size=3><FONT
face="Times New Roman"> </FONT></FONT></SPAN></FONT><FONT face=Arial
size=2><SPAN class=198193014-14012009><SPAN><FONT size=3><FONT
face="Times New Roman">
<STYLE type=text/css>SPAN {
        FONT-SIZE: 10pt; BACKGROUND: #ffffff; COLOR: #000000; FONT-FAMILY: "Courier New"
}
.L1S33 {
        COLOR: #4da619
}
.L1S52 {
        COLOR: #0000ff
}
</STYLE>
</FONT></FONT><SPAN><SPAN
class=L1S52>METHOD</SPAN> bi_persistent~lpor.<BR><BR> <SPAN
class=L1S52>DATA</SPAN>: lpor <SPAN
class=L1S52>TYPE</SPAN> sibflpor.<BR><BR> lpor-catid = <SPAN
class=L1S33>'CL'</SPAN>.<BR> lpor-typeid = <SPAN
class=L1S33>'Z_CL_LIV_ASSETS'</SPAN>.<BR> <SPAN
class=L1S52>CONCATENATE</SPAN> me->belnr me->bukrs <SPAN
class=L1S52>INTO</SPAN> lpor-instid.<BR> result = lpor.<BR><SPAN
class=L1S52>ENDMETHOD</SPAN>.</SPAN><FONT face="Times New Roman"
size=3> </FONT><BR><FONT face=Arial></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><SPAN><FONT
face=Arial>parameters:</FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT size=3><FONT
face=Arial
size=2>IM_BELNR Type ANEK-BELNR<BR>IM_BUKRS Type ANEK-BUKRS</FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT size=3><FONT
face="Times New Roman">
<STYLE type=text/css>SPAN {
        FONT-SIZE: 10pt; BACKGROUND: #ffffff; COLOR: #000000; FONT-FAMILY: "Courier New"
}
.L1S31 {
        COLOR: #808080; FONT-STYLE: italic
}
.L1S33 {
        COLOR: #4da619
}
.L1S52 {
        COLOR: #0000ff
}
</STYLE>
</FONT></FONT><SPAN><SPAN
class=L1S52>METHOD</SPAN> constructor.<BR> me->belnr = im_belnr.<BR> me->bukrs = im_bukrs.<BR> me->M_por-catid = <SPAN
class=L1S33>'CL'</SPAN>.<BR> me->M_por-typeid = <SPAN
class=L1S33>'z_cl_liv_assets'</SPAN>.<BR> <SPAN
class=L1S52>CONCATENATE</SPAN> me->belnr me->bukrs <SPAN
class=L1S52>INTO</SPAN> me->M_por-instid.<BR><SPAN
class=L1S31>* me->m_por-instid = me->belnr.</SPAN><BR><BR><SPAN
class=L1S52>ENDMETHOD</SPAN>.</SPAN><FONT face="Times New Roman" size=3>
</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT size=3><FONT
face="Times New Roman"><FONT face=Arial
size=2>Parameters:</FONT> </FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009></SPAN></FONT><FONT
face=Arial size=2><SPAN class=198193014-14012009><FONT size=3><FONT face=Arial
size=2>EX_ANEK Exporting Type FAA_T_ANEK</FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT size=3><FONT
face="Times New Roman">
<STYLE type=text/css>SPAN {
        FONT-SIZE: 10pt; BACKGROUND: #ffffff; COLOR: #000000; FONT-FAMILY: "Courier New"
}
.L1S32 {
        COLOR: #3399ff
}
.L1S33 {
        COLOR: #4da619
}
.L1S52 {
        COLOR: #0000ff
}
</STYLE>
</FONT></FONT><SPAN><SPAN
class=L1S52>METHOD</SPAN> retrieve_anek.<BR><BR> <SPAN
class=L1S52>CALL</SPAN> <SPAN class=L1S52>FUNCTION</SPAN> <SPAN
class=L1S33>'ANEK_READ_MULITPLE'</SPAN><BR> <SPAN
class=L1S52>EXPORTING</SPAN><BR> i_belnr = me->belnr<BR> i_bukrs = me->bukrs<BR> <SPAN
class=L1S52>TABLES</SPAN><BR> t_anek = ex_anek.<BR><BR> <SPAN
class=L1S52>IF</SPAN> sy-subrc = <SPAN
class=L1S32>0</SPAN>.<BR> me->t_anek = ex_anek.<BR> <SPAN
class=L1S52>ENDIF</SPAN>.<BR><BR><SPAN class=L1S52>ENDMETHOD</SPAN>.</SPAN><FONT
face="Times New Roman" size=3> </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT
face=Arial></FONT> </DIV></SPAN></FONT></BODY></HTML>