on ā2014 Nov 17 7:45 AM
Dear Consultants,
I am creating a custom workflow , where i am sending work item to all first level approvers at the same time and taking approval of all approvers.
This has been achieved by parallel block profetch. However i am stuck with some scenario -
1. I want to send outlook mail to requestor's outlook ID
2. an outlook mail to all approvers ( With table in item text ,where detail and approver list should appear)
3. an most importantly i want if one of the approver rejects the work item , that work item should go to requestor for edit and resend the item only to the approver who has reected that item, but all the work work item should not go to the all approvers who have already approved the task?
Anyone has any idea?
Thanks
Request clarification before answering.
Hi Sudhanshu
1) Your screen shot is not that clear to know the business process? What is the BO which you are using? Can't you use the code given below to get the PD responsible in SRM (all you need to supply is the Doc Guid and type ... type for example, for SC will be BUS2121, PO, BUS2201....
Use this code in a new method and get the Document responsible (you can additionally concatenate it with preceding 'US' for the user ID. Receive the result in structure of type SWHACTOR. Use this in the email step as 'Expression' and type ID as 'G' - Org Object
It does not matter if it's SRM System, if the SRM Org Structure has communication Infotype 0105 maintained, emails can be picked up from there. But I guess SU01 approach would be better for your case.
2) for the second case, better use only the approver IDs with a leading US and follow the same approach of SU01/SO16/ Type ID G to send the email
3) All the best for this item
Regards,
Modak
here is the code for getting the PD responsible (my code revolves around PO and SC, you can include BUSxxxxx for Confirmation
DATA lo_wf_pdo TYPE REF TO /sapsrm/if_wf_pdo.
DATA lx_pdo_ex TYPE REF TO cx_static_check.
DATA lt_document_responsible TYPE /sapsrm/t_wf_agent_id.
DATA lr_document_responsible TYPE REF TO /sapsrm/wf_agent_id.
*IV_DOCUMENT_TYPE is of type /SAPSRM/WF_DOCUMENT_TYPE
*IV_DOCUMENT_GUID is of type/SAPSRM/WF_DOCUMENT_GUID
* ev_document_responsible is of type /SAPSRM/WF_AGENT_ID
TRY.
* Get shopping cart / PO instance
lo_wf_pdo ?= /sapsrm/cl_wf_pdo_impl_factory=>get_instance(
iv_document_guid = iv_document_guid
iv_document_type = iv_document_type
).
* Get owner of shopping cart / PO
lt_document_responsible = lo_wf_pdo->get_document_responsible( ).
READ TABLE lt_document_responsible REFERENCE INTO lr_document_responsible INDEX 1.
ASSERT ID /sapsrm/wf_cfg CONDITION sy-subrc = 0.
IF sy-subrc NE 0.
RETURN.
ENDIF.
ev_document_responsible = lr_document_responsible->*.
CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_ex.
RETURN.
CATCH /sapsrm/cx_pdo_error INTO lx_pdo_ex.
RETURN.
ENDTRY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Modak,
This is a SRM system and i working on custom requirement . Which has nothing to do with SC, PO and GRN.
Business process is like this -
There is one custom web dynpro screen , where user will enter some data and based on cost center it will go for the approval .and at the end it will update one table.
Almost there...
Regards,
Modak
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.