Object-Key retrieval in subtype

Knoske George - NAO Florence Office SAP Analyst George.Knoske at zf.com
Tue Feb 10 12:06:29 EST 2004


Stephan, thanks for pointing me in the right direction.  It's now working
and here is what I learned by looking at the workitem container as you
suggested.
a) the workitem container had the key, but it was in element ABSENCEFORM
b) checked my WFD, step#1, the bindings for the _WI_object_ID had
&ZU1_FORMABSENCE& as the source element.  After doing (a) I knew it needed
to be &ABSENCEFORM& (note: zu1_formabsence was bright green as a binding
option - thought that meant it was good to go so I selected it!!??)
c) In order to get &ABSENCEFORM& as an available element for binding, I
needed to change my TASK definition for Step 1
from:  objecttype=ZU1_FORMAB, method=FORMDETAIL (my custom method)
to:    objectype=FORMABSENC, method=FORMDETAIL.  (perhaps this was my
fundamental mistake: the supertype must be referenced in the task, not the
subytpe)
d) after doing (c), &ABSENCEFORM& was an available element for binding.
 
Ran my test again and the object-key is now populated.  About as clear as
mud for me.<grin>
 
Thanks!
 
 
George Knoske
SAP Analyst
george.knoske at zf.com
859.282.4353 office
 
 
 
-----Original Message-----
From: Becker, Stephan [mailto:stephan_becker.ext at siemens.com]
Sent: Tuesday, February 10, 2004 11:41 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Object-Key retrieval in subtype
 
 
George,
 
Have a look at the container of the workitem before you execute it. It must
have the object key you're looking for in it as the event key.
 
Stephan
 
-----Mensaje original-----
De: Knoske George - NAO Florence Office SAP Analyst
[mailto:George.Knoske at zf.com]
Enviado el: 10 February 2004 17:03
Para: SAP-WUG at MITVMA.MIT.EDU
Asunto: Re: Object-Key retrieval in subtype
 
SAP delivered transaction, SWXF, presents an AbsenceForm for a user to fill
out.  Behind this program an Event is triggered -> EVENT=Created.  As I
delegated object FORMABSENC to my ZU1_FORMAB object, this Event is defined
for my subtype.  My workflow definition (WFD) is linked in SWETYPV.  I
copied my WFD from SAP standard WFD 30000015.  The difference with my WFD is
in the very first step I want the Manager to have the ability to review
employee record data prior to approving the absence.  (this first step in my
WFD being the execution of my custom method).
 
For debug:
I set a breakpoint in my implementation program at the point my method is to
begin.  Then, I go to SWXF and submit the Absence request.  A workitem is
presented in my (the manager) workplace.  When I double-click to act on the
item, I'm taken to my breakpoint.  It is there that I see object-key as
blank.   Note, when I use the SAP delivered WFD 30000015, set a breakpoint
in the FORMABSENC object implementation program, repeat the SWXF form create
step, I can see that the object-key is populated with the formnumber.
 
-George
 
 
 
 
-----Original Message-----
From: Becker, Stephan [mailto:stephan_becker.ext at siemens.com]
Sent: Tuesday, February 10, 2004 10:41 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Object-Key retrieval in subtype
 
 
I feel we need to go back to basics: when you test an object in swo1, you
must first enter the key, otherwise you only have access to
instance-independent attributes and methods.
 
Once you've done that, you have access to object-key, which will be filled
with the object key.
 
What are you doing when you're debugging?
 
Stephan
 
-----Mensaje original-----
De: Knoske George - NAO Florence Office SAP Analyst
[mailto:George.Knoske at zf.com]
Enviado el: 10 February 2004 15:57
Para: SAP-WUG at MITVMA.MIT.EDU
Asunto: Re: Object-Key retrieval in subtype
 
Stephan,
Thanks for your quick response.  However, even when I reference object-key
(as you suggest) the value is blank.  Below is the logic in my subtype
implementation program.    I see object-key-number as blank when running in
debug mode.
 
*****Implementation of object type ZU1_FORMAB
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT.
** only private members may be inserted into structure private
DATA:
  BEGIN OF KEY,
      NUMBER LIKE SWXFORMABS-FORMNUMBER,
  END OF KEY.
END_DATA OBJECT.
*
BEGIN_METHOD FORMDETAIL CHANGING CONTAINER.
DATA:  PERNR LIKE SWXFORMABS-PERNR.
  CALL FUNCTION 'ZU1_SWX_FORMABS_DETAIL'
    EXPORTING
      FORMNUMBER = object-key-number
    IMPORTING
      PERNR = pernr
       .
       .
       .
 
 
thanks for your continued suggestions.
 
George Knoske
SAP Analyst
 
 
 
 
-----Original Message-----
From: Becker, Stephan [mailto:stephan_becker.ext at siemens.com]
Sent: Tuesday, February 10, 2004 9:31 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Object-Key retrieval in subtype
 
 
You don't need to do anything, you always have the object key in
"object-key". The macro you're using is for handling "non-self" objects.
 
Stephan
 
-----Mensaje original-----
De: Knoske George - NAO Florence Office SAP Analyst
[mailto:George.Knoske at zf.com]
Enviado el: 10 February 2004 14:39
Para: SAP-WUG at MITVMA.MIT.EDU
Asunto: Object-Key retrieval in subtype
 
Not sure if my question is specifically delegation related - SuperType to
SubType - but I am unable to access the Object Key within my subtype.  The
key field is empty/blank.
 
I created a subtype, ZU1_FORMAB, from SAP delivered object type FORMABSENC.
Within my subtype I have created a new method.  Within the implementation
program of my subtype I need to reference the FORMNUMBER, which is the key
for the object type FORMABSENCE, and thus, the key for my subtype ZU1_FORMAB
as well.  I need this key value, FORMNUMBER, in order to execute my new
method.  Prior to the call of my new method I have the following statement:
 
SWC_GET_OBJECT_KEY SELF FORMNUMBER.
 
I find that this macro calls function SWO_OBJECT_ID_GET, and returns a
structure, SWOTOBJID.  This structure has the field OBJTYPE filled with
ZU1_FORMAB, but the OBJKEY value returned is empty/blank.  I have made the
necessary delegation entry where FORMABSENC is the object type, and
ZU1_FORMAB is the delegation type.
 
Any suggestions you have as to how to retrieve or find the Object-key would
be much appreciated.
 
 
George Knoske
SAP Analyst
george.knoske at zf.com
 


More information about the SAP-WUG mailing list