<!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>&nbsp;</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>&nbsp;</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_...'&nbsp; - don't give any opportunity for 
confusion.&nbsp; Such a literal should always be in upper case as it refers to a 
technical id which is upper case.&nbsp; </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial 
color=#0000ff></FONT></SPAN>&nbsp;</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&nbsp;instances&nbsp;- always use a structure - easiest way to make sure the 
same structure is available to all methods&nbsp;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>&nbsp;</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.&nbsp;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&nbsp;yourself.&nbsp;&nbsp; </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial 
color=#0000ff></FONT></SPAN>&nbsp;</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&nbsp;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>&nbsp;</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.&nbsp;&nbsp;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>&nbsp;</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>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=926161322-14012009><FONT face=Arial 
color=#0000ff></FONT></SPAN>&nbsp;</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.&nbsp; The object 
does not get instantiated by the workflow.&nbsp; 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.&nbsp; 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.&nbsp;&nbsp;But if I try to use the instant 
attributes it does not work created by the constructor it does not 
work.&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009></SPAN></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>wf 
container&nbsp;&nbsp; task container</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>docnum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-&gt; im_belnr</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>company 
code&nbsp;&nbsp; -&gt; im_bukrs</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>ex_anek&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;- 
ex_anek</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009>z_cl_liv_assets 
&lt;- wi_object_id</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009></SPAN></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>&nbsp;BELNR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
InstanPubl&nbsp;&nbsp;&nb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R&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>&nbsp;Methods:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>Parameters:&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=198193014-14012009>LPOR&nbsp;Importing&nbsp;Type&nbsp;SIBFLPOR<BR>RESULT&nbsp;Returning&nbsp;Type 
Ref To&nbsp;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">&nbsp; 
<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>&nbsp;bi_persistent~find_by_lpor.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>DATA</SPAN>:&nbsp;lv_liv_doc&nbsp;<SPAN 
class=L1S52>TYPE</SPAN>&nbsp;anek-belnr,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lv_liv_co&nbsp;&nbsp;<SPAN 
class=L1S52>TYPE</SPAN>&nbsp;anek-bukrs.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>MOVE</SPAN>&nbsp;lpor-instid(<SPAN 
class=L1S32>10</SPAN>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>TO</SPAN>&nbsp;lv_liv_doc.<BR>&nbsp;&nbsp;<SPAN 
class=L1S52>MOVE</SPAN>&nbsp;lpor-instid+<SPAN class=L1S32>10</SPAN>(<SPAN 
class=L1S32>4</SPAN>)&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>TO</SPAN>&nbsp;lv_liv_co.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>CREATE</SPAN>&nbsp;OBJECT&nbsp;result<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>TYPE</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z_cl_liv_assets<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>EXPORTING</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;im_belnr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;lv_liv_doc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;im_bukrs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><FONT 
face=Arial>&nbsp; 
Parameters:RESULT&nbsp;Returning&nbsp;Type&nbsp;SIBFLPOR</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=198193014-14012009><!--StartFragment --><FONT size=3><FONT 
face="Times New Roman">&nbsp;</FONT></FONT></SPAN></FONT><FONT face=Arial 
size=2><SPAN class=198193014-14012009><SPAN><FONT size=3><FONT 
face="Times New Roman">&nbsp; 
<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>&nbsp;bi_persistent~lpor.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>DATA</SPAN>:&nbsp;lpor&nbsp;<SPAN 
class=L1S52>TYPE</SPAN>&nbsp;sibflpor.<BR><BR>&nbsp;&nbsp;lpor-catid&nbsp;=&nbsp;<SPAN 
class=L1S33>'CL'</SPAN>.<BR>&nbsp;&nbsp;lpor-typeid&nbsp;=&nbsp;<SPAN 
class=L1S33>'Z_CL_LIV_ASSETS'</SPAN>.<BR>&nbsp;&nbsp;<SPAN 
class=L1S52>CONCATENATE</SPAN>&nbsp;me-&gt;belnr&nbsp;me-&gt;bukrs&nbsp;<SPAN 
class=L1S52>INTO</SPAN>&nbsp;lpor-instid.<BR>&nbsp;&nbsp;result&nbsp;=&nbsp;lpor.<BR><SPAN 
class=L1S52>ENDMETHOD</SPAN>.</SPAN><FONT face="Times New Roman" 
size=3>&nbsp;</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&nbsp;Type&nbsp;ANEK-BELNR<BR>IM_BUKRS&nbsp;Type&nbsp;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">&nbsp; 
<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>&nbsp;constructor.<BR>&nbsp;&nbsp;me-&gt;belnr&nbsp;=&nbsp;im_belnr.<BR>&nbsp;&nbsp;me-&gt;bukrs&nbsp;=&nbsp;im_bukrs.<BR>&nbsp;&nbsp;me-&gt;M_por-catid&nbsp;=&nbsp;<SPAN 
class=L1S33>'CL'</SPAN>.<BR>&nbsp;&nbsp;me-&gt;M_por-typeid&nbsp;=&nbsp;<SPAN 
class=L1S33>'z_cl_liv_assets'</SPAN>.<BR>&nbsp;&nbsp;<SPAN 
class=L1S52>CONCATENATE</SPAN>&nbsp;me-&gt;belnr&nbsp;me-&gt;bukrs&nbsp;<SPAN 
class=L1S52>INTO</SPAN>&nbsp;me-&gt;M_por-instid.<BR><SPAN 
class=L1S31>*&nbsp;&nbsp;me-&gt;m_por-instid&nbsp;=&nbsp;me-&gt;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>&nbsp;</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&nbsp;Exporting&nbsp;Type&nbsp;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>&nbsp;retrieve_anek.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>CALL</SPAN>&nbsp;<SPAN class=L1S52>FUNCTION</SPAN>&nbsp;<SPAN 
class=L1S33>'ANEK_READ_MULITPLE'</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>EXPORTING</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i_belnr&nbsp;=&nbsp;me-&gt;belnr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i_bukrs&nbsp;=&nbsp;me-&gt;bukrs<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN 
class=L1S52>TABLES</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_anek&nbsp;&nbsp;=&nbsp;ex_anek.<BR><BR>&nbsp;&nbsp;<SPAN 
class=L1S52>IF</SPAN>&nbsp;sy-subrc&nbsp;=&nbsp;<SPAN 
class=L1S32>0</SPAN>.<BR>&nbsp;&nbsp;&nbsp;&nbsp;me-&gt;t_anek&nbsp;=&nbsp;ex_anek.<BR>&nbsp;&nbsp;<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>&nbsp;</DIV></SPAN></FONT></BODY></HTML>