| Home • Tips • Tutorials • Forums • Certification Q's • Interview Q's • Jobs • Testimonials • Contact Us | ||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
Defining Custom Rules for use in SAP WorkflowBy Raghava Vakada, Mouri Tech Solutions “I would like to explain about creating custom rules in SAP
Workflow. The rules can be created or changed using the standard SAP transaction
PFAC. Once the rules are created you can call these rules in any workflow via
the rule container”. “ACTOR_TAB STRUCTURE SWHACTOR” “AC_CONTAINER STRUCTURE SWCONT” Following is the function module code: FUNCTION ZWF_FIND_USERS. *"----------------------------------------------------------- *"*"Local Interface: *" TABLES *" ACTOR_TAB STRUCTURE SWHACTOR *" AC_CONTAINER STRUCTURE SWCONT *" EXCEPTIONS *" NOAGENT_FOUND *"----------------------------------------------------------- INCLUDE <CNTN01>.
DATA : POSITION_ID LIKE ZBUSAREA-OBJID,
LT_HOLDERS TYPE STANDARD TABLE OF SWHACTOR,
LWA_HOLDERS TYPE SWHACTOR,
LWA_USERS TYPE STANDARD TABLE OF HRP1001,
WA_USERS TYPE HRP1001,
NUM_LINES TYPE I.
*Read values assigned to the rule criteria
SWC_GET_ELEMENT AC_CONTAINER 'POSITION_ID' POSITION_ID.
SELECT * FROM HRP1001 INTO table LWA_USERS
WHERE OBJID = POSITION_ID.
IF NOT LWA_USERS IS INITIAL.
REFRESH LT_HOLDERS[].
loop at LWA_USERS into WA_USERS. Condense WA_USERS-SOBID.
LWA_HOLDERS-OTYPE = 'US'.
LWA_HOLDERS-OBJID = WA_USERS-SOBID.
APPEND LWA_HOLDERS TO LT_HOLDERS.
APPEND LINES OF LT_HOLDERS TO ACTOR_TAB.
endloop.
ENDIF.
DESCRIBE TABLE ACTOR_TAB LINES NUM_LINES.
IF NUM_LINES IS INITIAL.
RAISE NOAGENT_FOUND.
ENDIF.
ENDFUNCTION. Creating
a rule using the PFAC Transaction
Go to the "Container Tab" and create a container
element for the “Position id” which will be passed to the function module
Our rule is created now. You can test the rule within the
PFAC transaction by clicking the "Simulation" button on the
application toolbar. Now this rule is ready to be used in any workflow according
to your requirement via the rule container of the workflow.
Enter the Position Id, which is created in (PPOCW)
It displays Asset Analysts (users) in the “Rule resolution
result”
Now you can use this rule in any of your workflow
definitions. |
|
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG. Graphic Design by Round the Bend Wizards |
||