cancel
Showing results for 
Search instead for 
Did you mean: 

To trigger a workflow when a Transport request is created

Former Member
0 Kudos

Hi Friends,

I have a requirement to trigger a workflow after creating a transport request. Standard transport workflow is not suitable for my requirement.

I tried to find exits or badis or enchancement. But, could not find any relevat.

Anyway I have to create a custom workflow by enchancing standard BO 'CTREQUEST' (Events and methods).

Main problem is how to trigger it ??

Your ideas a highly appreciated.

Thanks in advance.

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member193382
Active Contributor
0 Kudos

Hi SR,

Check out the Tcode SM62/SM64.

You can Create a Event in the SM62

but you need to raise this event in a program using the function BP_RAISE_EVENT

The following example may help:

eventid = 'ZYPAYEVNT'.(name of the event)

eventparm = 'SUCCESS'.(identification of the event)

FORM RAISE_EVNT.

CALL FUNCTION 'BP_EVENT_RAISE'

EXPORTING

EVENTID = EVENTID

EVENTPARM = EVENTPARM

TARGET_INSTANCE = ' '

EXCEPTIONS

BAD_EVENTID = 1.

ENDFORM. " RAISE_EVNT

I hope this will help you.

regards,

Raj

Former Member
0 Kudos
former_member185879
Active Contributor
0 Kudos

Hi,

You can start any custom workflow by using the FM

"SAP_WAPI_START_WORKFLOW".

or by using your own event you can trigger the workflow.

Regards

SM Nizamudeen

Former Member
0 Kudos

Hi friends,

Thanks for you quick response. But, my problem is not in writing a piece of code to trigger workflow or creating a business Objects / Events. Since I could not find any enhancement or BADI to trigger my workflow is there any other way of triggering ??

Thanks in advance

former_member193382
Active Contributor
0 Kudos

Hi SR,

Try using Enhancement Spots to trigger the workflow. Whenever the user creates a request and presses the OK icon a code is executed. try to customize that code with the FM SAP_WAPI_CREATE_EVENT.

Regards,

Raj

Former Member
0 Kudos

Hello SR,

As, I looked at the Transport program there are no Enhancement Spots existing. But, you can try digging into it.

My suggestion, is to trigger it using SWEC. All the transport entries are stored in E070 & E070A Tables.

E070 has the status change and you can use it as change document to trigger the custom event of BO CTREQUEST .

Thanks,

Sudhir.

former_member193382
Active Contributor
0 Kudos

Hi SR,

I guess this one should help you solve your problem

CTS_REQUEST_CHECK -> request checks.

Regards,

Raj

Former Member
0 Kudos

Hi,

BADI Request check is before creating the Transport request.

Thanks

former_member193382
Active Contributor
0 Kudos

Check the other Badis.

I hope either of them will definitely solve your problem.

Regards,

Raj

former_member193382
Active Contributor
0 Kudos

Hi,

try the following BADi and user-exits.

CTS_EXPORT_FEEDBACK -> feedback after export of a transport request.

CTS_IMPORT_FEEDBACK -> feedback after import of a transport request.

CTS_INT_REQUEST_CHECK -> internal: request checks.

CTS_REQUEST_CHECK -> request checks.

CTS_TASKDOC_TEMPLATE -> determine template for the task documentation.

let me know if it works.

Regards,

Raj

Former Member
0 Kudos

Hi there are no standard events in the BO

former_member193382
Active Contributor
0 Kudos

Create a custom event in the BO. then try to trigger that event using the BADI.

Use FM SAP_WAPI_CREATE_EVENT to trigger the workflow from your BADi.

Let me know if you have any queries.

Regards,

Raj

former_member193382
Active Contributor
0 Kudos

Check out this sample code below.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

EXPORTING

objtype = 'CTREQUEST'

objkey = swe_objkey

event = 'ZCREATED'

  • CREATOR = ' '

  • TAKE_WORKITEM_REQUESTER = ' '

  • START_WITH_DELAY = ' '

  • START_RECFB_SYNCHRON = ' '

  • IMPORTING

  • EVENT_ID =

  • TABLES

  • EVENT_CONTAINER =

*

*EXCEPTIONS

*objtype_not_found = 1

*OTHERS = 2.

*ENDIF.

ENDFUNCTION.

Write this code within the badi.

This should work

francisco_asensio
Participant
0 Kudos

Hello,

You can create your object copy as delegated of the standard one, so you can use the standar event that is sent normally in the creation to start your workflow.

Hope it helps,.

Regards.