Skip to Content

Where does the parameter gets filled up when event is triggered?

Hello and Happy new year.

I have a question. In MM02 the container variable NewMaterial comes already with a value when the event ZZMMMATERIALCHANGED is triggered. Where does this variable gets populated?

In the same place I need to fill up my new container variable NewPlant from the plant. See attached word document.

Thanks in advance.

Regards.

aWF question.jpg (168.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2014 at 10:57 PM

    If NewPlant is the attribute of the business object ( SWO1 ), then the value for New Plant can be filled in the business object. If you use ABAP Dictionary Proposal, it will create a template for you to modify.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sireesh,

      I solved an error that was deactivating the linkage and now in SWEL I see the green icon left to "SWW_WI_CREATE_VIA_EVENT_IBF", but I still I do not receive any email from MM02. if I test the WF itself from the WF Builder I receive the email with the right plant.

      What I am missing?

      Thanks in advance.

      Primo.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2014 at 03:12 AM

    Create attribute "New plant " in your business object , write your logic to populate it. During the run time once the instance of BO get created all the attributes will get filled. Also the BO attributes will be available in workflow container.

    Cheers,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 05, 2014 at 04:43 AM

    Hi,

    code) or it is triggered through enhancements.

    In case, it is triggered through enhancements, you can directly populate the event containers with the values.
    Otherwise, as Prakash suggested, you can use create a virtual attribute in the BO and populate it through coding.

    Regards,

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2014 at 05:09 AM

    Hi,

    Your event ZZMATERAILCHANGED must be having an event parameter NewMaterial hence it is getting populated when the event triggers.Open your binding (option B) and check NewMaterial Event parameter will be binded to NEwMaterial workflow container.

    Similar to this if you an any event parameter called NewPlant in your ZZMATERIALCHANGED event, then you can get it from event container to workflow container by doing the binding (option B in your screenshot). if there is no event parameter NewPlant in your event, then you have to create it in your event and populate it while triggering your event (maybe with FM SAP_WAPI_CREATE_EVENT) PR you can create an attribute also if cannot pass in event container.

    Regards,

    Ibrahim

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 03, 2014 at 10:29 PM

    Here is where I need to get the value:

    BEGIN_METHOD ZZMMCHECKMATERIAL CHANGING CONTAINER.

    DATA: INMATNR TYPE BAPIMATALL-MATERIAL,

    INPLANT TYPE WERKS_D,

    EVENTNAME type SWETYPECOU-event.

    SWC_GET_ELEMENT CONTAINER 'NewMaterial' INMATNR.

    SWC_GET_ELEMENT CONTAINER 'NewPlant' INPLANT.

    SWC_GET_ELEMENT CONTAINER 'eventName' EVENTNAME.

    CALL FUNCTION 'ZZMM_CHECK_MATERIAL'

    EXPORTING

    MATNR = INMATNR

    EVENTNAME = EVENTNAME

    WERKS = INPLANT

    EXCEPTIONS

    OTHERS = 01.

    CASE SY-SUBRC.

    WHEN 0. " OK

    WHEN OTHERS. " to be implemented

    ENDCASE.

    END_METHOD.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 05:07 PM

    Hi and thanks to everyone for your quick reply and excellent suggestions.

    This is not triggered by enhancement but event linkage has been defined in SWEC and I think it triggers FM SWW_WI_CREATE_VIA_EVENT_IBF.

    Also there are no parameters defined for event ZZMATERAILCHANGED and even if I define the parameter NewPlant for MARC-WERKS cannot use FM SAP_WAPI_CREATE_EVENT.

    Probably my best option is a new attribute toill get the plant number from a parameter id. There is a user-exit where I can set the respective plant with a parameter id when saving in MM02

    I will let you know if works or not.

    Regards,

    Primo.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 04:23 AM

    Hi, this help me to solve the error that was deactivating the linkage and now in SWEL I see the green icon left to "SWW_WI_CREATE_VIA_EVENT_IBF". But I still have the problem that the workflow does not get triggered. Could it be that it fails passing the new attribute parameter &ZZBUS1001.NEWPLANT& towards &INPLANT& ?

    Having in mind that this workflow that I was asked to add the plant from MM02 the BO ZZBUS1001 delegates BUS1001.

    What I am missing?

    Thanks in advance.

    Primo.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.