on 2011 Aug 15 3:00 PM
Hi Guys,
I created a workflow based on BO BUS2901 to send approval notification to an approver and I am having an issue with the agent determination. I am using the cost centre owner from the PR associated with the PO for the service entry as the approver.
I am using the following code in the FM of the rule I created for determining the agent:
FUNCTION ZME_REL_GET_RESPONSIBLE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----------------------------------------------------------------------
INCLUDE <cntain>.
TABLES: eban, essr_rel, essr, ekpo, ebkn, csks.
DATA: object TYPE swc_object.
DATA: BEGIN OF essrkey,
lblni LIKE essr-lblni,
ebeln LIKE essr-ebeln,
END OF essrkey.
DATA: verak_user TYPE csks-verak_user, kostl TYPE ebkn-kostl.
REFRESH actor_tab.
CLEAR actor_tab.
swc_get_element ac_container 'ServiceEntry' object.
IF sy-subrc EQ space.
essrkey-lblni = object-objkey(10).
essrkey-ebeln = object-objkey+10(10).
select * from ekpo where ebeln = essrkey-ebeln.
select single * from ebkn where banfn = ekpo-banfn.
kostl = ebkn-kostl.
endselect.
select * from csks where kostl = kostl.
verak_user = csks-verak_user.
endselect.
actor_tab-otype = 'US'.
actor_tab-objid = verak_user.
APPEND actor_tab.
endif.
ENDFUNCTION.
When I debug, sy-subrc = 8 at swc_get_element ac_container 'ServiceEntry' object.
What could be the problem?
Thanks
Regards
Hi Darlington,
You need to fill in the AC_CONTAINER structure with the value of your Service Entry sheet key. Do this in the FM test bed, and to save yourself pain in the future, save the test data. You will need to enter the element name (exactly as defined), the Tab_In (sequential index, so a 000001 should suffice) and the Element Length, as well as the element value (your 20 char Service Entry sheet number).
Hope this helps,
Sue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh, T
This thread was already answered some time ago. Please open a new Discussion marked as a question. If the thread you originally posted to has material related to your question, include a link. Your content is attached below to make it easy for you to simply paste it into the new Discussion. It is recommended to read the Rules of Engagement and other documents in the Getting Started link at the top right. If you have any questions, feel free to respond to this DM (Direct Message) and I will be happy to try to assist.
Rgds,
Jocelyn (SCN moderator)
User | Count |
---|---|
72 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.