cancel
Showing results for 
Search instead for 
Did you mean: 

Use of FM SAP_WAPI_CREATE_EVENT

Former Member
0 Kudos

Hi Guys,

Can we trigger workflow from 'Z' program by using FM SAP_WAPI_CREATE_EVENT without doing anything in SWDD tcode.

I know this FM is used mainly for creating the Event but not sure wether it will trigger Workflow with an email sending to the concerned person given in the Selection screen of Custom Program.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member201532
Participant
0 Kudos

Hi,

did you create any custom  workflow which will trigger for BO 'ZFI_ALERT' and EVENT 'FailedIDOC'  and also with event parameters  binding in workflow   ?

if you create workflow then that workflow will be triggred and you can see that container values in Workflow log .

Thanks,

Phani

Former Member
0 Kudos

Hi Guys,

From a custom program I am passing container lt_cotainer from FM SAP_WAPI_CREATE_EVENT to the custom Business Object.

I created event in the Business Object and also created parameters for this event which are same with the container.

This is my code in custom program

ls_container-element = 'IDOCNUMBER'.

   ls_container-value = objkey.

   append ls_container to lt_container.

   ls_container-element = 'MESSAGETYPE'.

   ls_container-value = P_MESTYP.

   append ls_container to lt_container.

   ls_container-element = 'CREATEDDATE'.

   ls_container-value = P_CREDAT.

   append ls_container to lt_container.

   ls_container-element = 'CRETIM'.

   ls_container-value = ls_edidc-CRETIM.

   append ls_container to lt_container.

   ls_container-element = 'MSGTXT'.

   ls_container-value = ls_t100-TEXT.

   append ls_container to lt_container.

   ls_container-element = 'EMAILID'.

   ls_container-value = P_E_ADDR .

   append ls_container to lt_container.

   "FM for Triggering the Triggering the Event and Workflow

   CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

     EXPORTING

       OBJECT_TYPE             = 'ZFI_ALERT'

       OBJECT_KEY              = objkey

       EVENT                   = 'FailedIDOC'

*     COMMIT_WORK             = 'X'

*     EVENT_LANGUAGE          = SY-LANGU

*     LANGUAGE                = SY-LANGU

*     USER                    = SY-UNAME

*     IFS_XML_CONTAINER       =

*   IMPORTING

*     RETURN_CODE             =

*     EVENT_ID                =

    TABLES

      INPUT_CONTAINER         = lt_container

      MESSAGE_LINES           = lt_msglines

*     MESSAGE_STRUCT          =

.

My question is how we can see the this lt_container table in business object Program because i am not able to get some values in my INBOX.

what is the process to check this lt_container?

former_member201532
Participant
0 Kudos

Hi,

when you create a custom Business Object we need to mention program name and Application details.

you can give any Z program name as per your standards it will automatically implement program for  BO methods.

for Application select application-specific which these BO belongs to like SD, MM, FI.

then create Event in BO.

Once BO is created  you can call that BO and Event using FM  from SE38 program or enhancement based on your requirement.

Thanks,

Phani


Former Member
0 Kudos

Hi Phani,

My only concern is whatever container i am populating from FM SAP_WAPI_CREATE_EVENT  in my Program not able to see it in my Business object Program.

How to see this table(Container) in Business object....i searched in internet but none of them is direct.

If we are not able to see this table in business object then what is the need for uing this Function Module

former_member201532
Participant
0 Kudos

Hi,

1. create Workflow using Tcode SWDD and in WF Start Events use (Business Object / Class ) and       EventsTo trigger Workflow.

2.Use FM SAP_WAPI_CREATE_EVENT to raise (Event of Business Object /class )  using Z program.

3. By using the above FM we can Pass data from program to Workflow using Event Container.

Thanks,

Phani

Former Member
0 Kudos

Hi Phani,

Thank You for your reply.

In my scenario i need to create a Custom Business Object but whenever i am creating custom Business object its asking for Program name and other attributes.

Former Member
0 Kudos

Hi VR,

I think you write logic in Custom BO itself in methods as per requirement.

You can go through this link for custom BO related WF.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70e08382-2fac-2c10-758b-97f46c3c9...

Thanks,

Ravi

Former Member
0 Kudos

Hello VR

Yes, you can trigger workflow with this FM.

From the event log (SWEL) you should be able to view the workflow log.

And make sure that the event monitor is turned on in SWELS.

I hope you help.

Former Member
0 Kudos

Hi Pau,

Thank You for your response.

So first i need to create Workflow using SWDD tcode and use event created in Business Object

Then i have to trigger this Workflow using the FM SAP_WAPI_CREATE_EVENT

Please correct if i am wrong

Former Member
0 Kudos

Hi,

Correct.

First create WF using SWDD and event in PFTC.

Then use FM to trigger WF event.

Regards