cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow for PO release

former_member696081
Participant
0 Kudos

Hi All,

I am new to workflow. Now I am working for PO release.

whenever PO got released I need to send a mail to vendor.

I got the standard workflow WS20000075 for this. But the problem is when I test this workflow I am encountering with an error container element is missing.

what are the settings that I have to do before triggering this workflow?

I dont have functional support here. So please help me to complete the settings first.

Accepted Solutions (0)

Answers (2)

Answers (2)

imthiaz_ahmed
Active Contributor
0 Kudos

First of all, you have to find a way to trigger the WF first and release strategy is there to help you in that. If you use the FM, then you need to write a program, schedule and all other junks. The error you are getting is due to the incorrect entry in Trx SWEC. Bcoz, the release strategy triggers the WF as well the entry in this Trx also, leading to the error.

Regards, IA

former_member184495
Active Contributor
0 Kudos

Hi RN,

so u developing WF for just sending mail to Vendor after PO is released ? or WF for PO released and sending mail to Vendor ?

if its the first one then use a userexit with FM SO_NEW_*_API1 to send mail to vendor, as in this case no need for WF.

if its the second one then use Release Strategy and std.WF templates, but for vendor mail u need to add an extra step in the template.

Hope it helps.

Aditya

P.S Since u new to WF, best way to understand process is type MM WorkFlow Scenario in help.sap.com

former_member696081
Participant
0 Kudos

Hi Adithya,

thank you.

my requirement is the first one.

when ever a PO is released just I need to send a mail to vendor.

with your reference mail I got one FM SO_NEW_DOCUMENT_ATT_SEND_API1 is this correct one?

where I have to specify the vendor email ID in this??

Former Member
0 Kudos

Hi,

You can refer the following code.

  • Prepare the body of the mail

DOC_CHNG-OBJ_NAME = 'INB_DELIV'.

CONCATENATE 'Goods Receipt' L_MKPF-MBLNR INTO DESCR SEPARATED BY

SPACE.

DOC_CHNG-OBJ_DESCR = DESCR.

OBJTXT = 'Hi,'.

APPEND OBJTXT.

CLEAR OBJTXT.

APPEND OBJTXT.

CONCATENATE 'Goods Receipt' L_MKPF-MBLNR 'has been posted for'

'Inbound Delivery' DEL_NUM INTO OBJTXT SEPARATED BY SPACE.

APPEND OBJTXT.

CLEAR OBJTXT.

APPEND OBJTXT.

OBJTXT = 'Best Regards,'.

APPEND OBJTXT.

OBJTXT = 'Workflow System.'.

APPEND OBJTXT.

  • ENTERING NAMES IN THE DISTRIBUTION LIST

RECLIST-RECEIVER = 'ENTER MAIL ID HERE'.

RECLIST-REC_TYPE = 'U'.

APPEND RECLIST.

RECLIST-RECEIVER = 'ENTER MAIL ID HERE'.

RECLIST-REC_TYPE = 'U'.

APPEND RECLIST.

DESCRIBE TABLE OBJTXT LINES TAB_LINES.

READ TABLE OBJTXT INDEX TAB_LINES.

DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).

  • Creating the entry for the compressed document

CLEAR OBJPACK-TRANSF_BIN.

OBJPACK-HEAD_START = 1.

OBJPACK-HEAD_NUM = 0.

OBJPACK-BODY_START = 1.

OBJPACK-BODY_NUM = TAB_LINES.

OBJPACK-DOC_TYPE = 'RAW'.

APPEND OBJPACK.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

DOCUMENT_DATA = DOC_CHNG

PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

TABLES

PACKING_LIST = OBJPACK

OBJECT_HEADER = OBJHEAD

CONTENTS_BIN = OBJBIN

CONTENTS_TXT = OBJTXT

RECEIVERS = RECLIST

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

OPERATION_NO_AUTHORIZATION = 4

OTHERS = 99.

Thanks

Yogesh Sharma

Edited by: Yogesh Sharma on Jul 11, 2008 7:07 AM

Edited by: Yogesh Sharma on Jul 11, 2008 7:07 AM

former_member184495
Active Contributor
0 Kudos

Hi RN,

do u need to send any attachment to the vendor, if yes then the FM u mentioned is right.

if not, if its just a mesage, then its SO_NEW_DOCUMENT_SEND_API1.

Hope it helps.

Aditya

former_member696081
Participant
0 Kudos

Thank you very much Adithya.

finally one doubt is, the basis team has to do any customization for this, to send mail??

or automatically when we execute the program the mail will be dispatched to the vendor?

Thanks.

Ranganadh

former_member184495
Active Contributor
0 Kudos

Hi RN,

ask your BASIS, if they have configured SMTP settings in SCOT and activated services to send external mail (since ur case Vendor would be external).

If thats done, then everything should work.

Hope it helps.

Aditya

Edited by: Aditya Varrier on Jul 11, 2008 11:24 AM

former_member696081
Participant
0 Kudos

Hi Adithya,

I couldn't found exits which triggers after releasing a PO. Do you know any enhancements for this?

And also with that mail I need to send an attachment. Can I send the PO output along with that mail??

Please its urgent requirement for me.

Thanks.

Former Member
0 Kudos

I think when the PO is released the RELEASED event of BUS2012 business Object gets triggered. Please check this from SWEL. Even if this is not getting triggered I am sure the CHANGE event will be triggered and by checking through the change docuemnt using CDHDR and CDPOS table entries you can figure out whether the event was triggered due to Release of PO.

Thanks

Arghadip