AW: Created Task/Method is not working

Ulrich Mende wug at mende-edv-beratung.de
Wed Mar 20 04:57:51 EST 2002


Hi Simone / Weidong,
I fully agree with Simone, that one should be carefully about correct
names of container variables in the SWC-macros. But: they are not case
sensitive. Somewhere deep down in the FMs called by macro
swc_get_element there is a statement "translate element to upper case".
 
But I just wanted to add one comment to your problem, Weidong:
It seams to me, that you need a string as a funtion of the material type
of a material.
Why not use a virtual property instead a method for that?
Your objecttype BUS1001006 has a database property "MaterialType" which
is inherited by your subtype and can be used to get the MatType of your
material.
The code of the virtual property could look something like this:
 
GET_PROPERTY ADDRESS CHANGING CONTAINER.
  data: mattype like mara-mtart.
  SWC_GET_PROPERTY SELF 'MaterialType' mattype.
  if mattype = 'ZERP'.
    OBJECT-ADDRESS = 'SHIPMAT'.
  elseif mattype = 'ZERB'.
    OBJECT-ADDRESS = 'PRODCAT'.
  endif.
  SWC_SET_ELEMENT CONTAINER 'address' OBJECT-ADDRESS.
END_PROPERTY.
 
Doing so you would not need a task at all, you could get the
adress-string in a simple container assignment like
           address-variable = materialref.address
or use it directly somewhere in the binding of your send mail task.
 
Best regards Uli
 
"Wahl, Simone" <Simone.Wahl at Suedpack.com> schrieb am 20.03.2002,
09:05:38:
> Hello Weidong,
>
> you must be aware that Capitalization and use of small letters is important
> when you use the SWC_GET_ELEMENT and SWC_SET_ELEMENT - Macros. You must
> write the names of the elements in the same form, when you define them and
> when you use them in the macros.
> Perhaps you can solve your problem with my hint.
>
> Kind regards,
> Simone.
>
> -----Urspr|ngliche Nachricht-----
> Von: Weidong Yang [mailto:weidong4sap at hotmail.com]
> Gesendet: Dienstag, 19. Mdrz 2002 21:11
> An: SAP-WUG at MITVMA.MIT.EDU
> Betreff: Created Task/Method is not working
>
>
> Dear WF expert,
>
> I got following issue:
>
> 1) I created an object type which is subtype of BUS1001006
> 2) I added a method to it. The method is instance independent. I added
> follwoing codes
> BEGIN_METHOD ZMM_ASSIGN_DLI CHANGING CONTAINER.
> DATA:
>       plant   like marc-werks,
>       mattype like mara-mtart,
>       address like sood-objnam,
>       ZMM_ASSIGN_DLI(255).
>
> SWC_GET_ELEMENT CONTAINER 'Plant' PLANT.
> SWC_GET_ELEMENT CONTAINER 'MatType' MatType.
>
>   if mattype = 'ZERP'.
>      address = 'SHIPMAT'.
>   elseif mattype = 'ZERB'.
>      address = 'PRODCAT'.
>   endif.
>
>   SWC_SET_ELEMENT CONTAINER 'ADDRESSNAME' ADDRESS.
>   SWC_SET_ELEMENT CONTAINER RESULT ZMM_ASSIGN_DLI.
> END_METHOD.
>
> 3) I created 3 containers for this task: MATTYPE, PLANT, ADDRESSNAME
>
> 4) I created a workflow udsing this task and a send email task after this
> task.
>
> I want to use this task to assign the distribution list to the receipient's
> name and then using send email function to send emails to the distribution
> list.
>
> I am using Event trigger to trigger my workflow.
>
> The result looks like that the Method I created was not working at all.
> What's wrong?
>
> I will greatly appreciated, if anyone of you can give me some hits.
>
>
> Regards,
>
>
> Weidong
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
 


More information about the SAP-WUG mailing list