Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

please help - Urgent

Former Member
0 Likes
1,606

hi friends,

I think this is for the third time i'm posting the same thread but i'm not getting the exact answers which i wanted to have.My requiremebt is very clear :

1.I want to send a mail to a person whenever a po is made in the system(ME21N) through Workflows.

2.I used object type BUS2012 in workflows but again it does not have any event like "Create Purchase Order" rather it has got everything except my requirement like change,release,reject,cancel PO.

3.Possible Solution are : to create own object type but how?

4.If object type is created then how to assign event for creation of PO.

Please give me the answers.

Thanks and Regards,

Gaurav

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,570

hi

please post ur query in

this forum

Expert Forums » SAP NetWeaver » BPM and Workflow

Forum: BPM and Workflow

hi friends,

I think this is for the third time i'm posting the same thread but i'm not getting the exact answers which i wanted to have.My requiremebt is very clear :

1.I want to send a mail to a person whenever a po is made in the system(ME21N) through Workflows.

2.I used object type BUS2012 in workflows but again it does not have any event like "Create Purchase Order" rather it has got everything except my requirement like change,release,reject,cancel PO.

3.Possible Solution are : to create own object type but how?

4.If object type is created then how to assign event for creation of PO.

Please give me the answers.

Thanks and Regards,

Gaurav

12 REPLIES 12
Read only

Former Member
0 Likes
1,571

hi

please post ur query in

this forum

Expert Forums » SAP NetWeaver » BPM and Workflow

Forum: BPM and Workflow

Read only

Former Member
0 Likes
1,570

Hi Gaurav,

refer this,

http://www.sapfans.com/forums/viewtopic.php?f=26&t=9921&p=40585

cheers

Mohinder Singh

Read only

Former Member
0 Likes
1,570

HI

Pls refer the below link

u can get complete info..

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/88c71c47-0a01-0010-5dad-ee3df613...

http://saptechnical.com/Tutorials/Workflow/Workflow.htm

You can use the following function modules to trigger the workflow templates, in background.

SWE_EVENT_CREATE can be used to trigger an event statically, (If triggering events are defined for your workflow template. Also check whether the event linkage is active or not)

SAP_WAPI_START_WORKFLOW can be used to trigger the workflow template directly.

This is the sample code, used in one of my objects, for calling the function module SWE_EVENT_CREATE.

REPORT ZTESTING1 .

tables :

ZOPM_OBJKEY.

data :

object key

objectkey type SYSUUID_C,

objkey like sww_contob-objkey.

defining the event container..........................................

data begin of event_container occurs 0.

include structure swcont.

data end of event_container.

workitem list

data :

t_wid like SWOTOBJID occurs 0 with header line.

clear event_container.

refresh event_container.

CALL FUNCTION 'SYSTEM_GET_UNIQUE_ID'

EXPORTING

DCE_COMPATIBLE = 1

IMPORTING

UNIQUE_ID = objectkey.

objkey = objectkey.

clear objectkey.

call function 'SWC_ELEMENT_SET'

exporting

element = 'CONTEXT'

field = 'UAD'

tables

container = event_container

exceptions others = 1.

call function 'SWC_ELEMENT_SET'

exporting

element = 'SUBJECT'

field = '3333'

tables

container = EVENT_CONTAINER

exceptions others = 1.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'ZPSKUMAR'

objkey = objkey

event = 'GENERIC'

CREATOR = ' '

TAKE_WORKITEM_REQUESTER = ' '

START_WITH_DELAY = ' '

START_RECFB_SYNCHRON = ' '

NO_COMMIT_FOR_QUEUE = ' '

DEBUG_FLAG = ' '

NO_LOGGING = ' '

IDENT =

IMPORTING

EVENT_ID =

TABLES

EVENT_CONTAINER = EVENT_CONTAINER

EXCEPTIONS

OBJTYPE_NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF

pls reward me points if usefull

regards,

preet

Read only

Former Member
0 Likes
1,570

Hi Gaurav ,

Creating a object Steps :

1> Go to Transaction SW01 . Create Subtype. Give verything as BUS2012 except object type.

2> Save the object .

3> Select Event node and Click Create .

4> Give event name and description.

5> Release your event .

This is the way you can add the evnt .

After this Go to SWEC ,

Click New Entry.

Give Change doc object as EINKBELEG.

Object type as your z object .

Event as your event name which you created.

Save.

This is the way event is registered .

Now you can use this in your workflow.

For any problems . Reply

Read only

0 Likes
1,570

hi manik,

thanks alot..but when i activate the workflow one message comes that object type zbus2012 is not used in workflow.

Why so??

Thanks,

Gaurab

Read only

0 Likes
1,570

Hi ,

Where you have included the object type .

I hope you have included it in the start events of the workflow.

If not , here is the process.

Click on the basic data (HAT) on the main screen of your Workflow . Then Click on Start event TAb . There Give your z object name and in events give your event name .

Hope this will solve your problem .

Read only

0 Likes
1,570

hi manik,

i have the same thing..

Thanks,

Gaurav

Read only

0 Likes
1,570

hi manik,

i have done the same thing..

Thanks,

Gaurav

Read only

0 Likes
1,570

Hi Gaurav ,

There is a button on left side called Workflow container ,

There you will find the container of your z object name .

Double click on the object . Then in the screen there will be check box called import export .Click both check box . I hope this will solve your problem.

Read only

0 Likes
1,570

Hi manik,

Thanks...Can i print the details of PO line items in mail and How...I have searched the line items in expression list but i didn't found any..pls help..

Thanks,

Gaurav

Read only

0 Likes
1,570

Hi Gaurav ,

I think the PO line item details are not available in the expressions i think.

For this you would have to crerate a new TASK and get the PO item details in a function module which you will be using in this task now use this task in your workflow , then you can get this PO item details also in the expressions provided there is proper binding between methods and Workflow.

Read only

ritesh_dugad2
Active Participant
0 Likes
1,570

You can use a simpler way to send an email to a person whenever a PO is saved.

Just configure output types (messages) in SPRO foloowing this path;

SPRO>Materials Mgmt>Purchasing>Messages>Outout Control>Message Types>Define Message Types for Purchase Order.