<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Call Object Method from an ABAP (31I)</TITLE>
 
<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>Brian,
</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>In
your program, </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>INCLUDE &lt;CNTN01&gt;. </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>Declare the object reference</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>DATA:
objref TYPE SWC_OBJECT. </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>Then
to instantiate the object use macro</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>SWC_CREATE_OBJECT objref 'ObjectType' objkey. </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>where
ObjectType= your object type and objectkey is your object key
</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>Then
get attribute using macro</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>SWC_GET_PROPERTY objref 'AttributeName' attributevar.</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>where
AttributeName is the technical name of your attribute, and attributevar is the
variable</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff size=2>to
hold the retrieved attribute value. </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>Suggest you look at the workflow macro documentation in the SAP Library
help. </FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002><FONT face=Arial color=#0000ff
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=006362204-14032002>
<DIV style="WIDTH: 374px; HEIGHT: 90px"><FONT size=2>
<TABLE>
  <TBODY>
  <TR>
    <TD></TD></FONT>
    <TD>
      <DIV><FONT size=2><FONT color=#0000ff>Jocelyn Dart</FONT> <BR><FONT
      color=#0000ff>Consultant (EBP, BBP, Ecommerce, Internet Transaction
      Server, Workflow)</FONT> <BR><FONT color=#0000ff>SAP
      Australia</FONT></FONT></DIV>
      <DIV><FONT color=#0000ff><FONT size=2>Email </FONT><A
      href="mailto:jocelyn.dart@sap.com"><FONT
      size=2>jocelyn.dart@sap.com</FONT></A><BR><FONT size=2>Tel: +61<SPAN
      class=153385400-09052000> 412 390 267</SPAN><BR>Fax: +61&nbsp;2 9935
      4880</FONT></FONT></DIV></TD></TR></TBODY></TABLE></DIV></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
  size=2>-----Original Message-----<BR><B>From:</B> Snyder, Brian
  [mailto:BSnyder@wafertech.com]<BR><B>Sent:</B> Thursday, 14 March 2002 6:22
  AM<BR><B>To:</B> SAP-WUG@MITVMA.MIT.EDU<BR><B>Subject:</B> Call Object Method
  from an ABAP (31I)<BR><BR></FONT></DIV>
  <P><FONT face=Arial size=2>I have an ABAP program that I would like to call an
  Object Method from.&nbsp; This would be done from outside of a WF.&nbsp; Can
  anyone provide an example of how to do this?&nbsp; I am guessing that I need
  to first create the Object and then call the Method.&nbsp; </FONT></P>
  <P><FONT face=Arial size=2>Any help would be great!</FONT> </P>
  <P><B><FONT face=Arial color=#000000 size=2>Brian Snyder</FONT></B>
  <BR><B><FONT face=Arial color=#800000 size=1>WaferTech</FONT></B> <BR><B><FONT
  face=Arial color=#800000 size=1>360.817.3141</FONT></B> <BR><B><FONT
  face=Arial color=#800000 size=1>bsnyder@wafertech.com</FONT></B>
</P></BLOCKQUOTE></BODY></HTML>