Dear Experts,
Please help this workflow NOVICE with the following case. This is my first real Project.
Requirements: From CRF3 Posting, with Document # obtain Credit Card # and retrieve 2 users from card related security role to:
• Create work items in Inbox with users found
• Send email notification to users found
Changes so Far to create work items
• SWE2 create entry FIPP CREATECARD WS50000021 SWW_WI_CREATE_VIA_EVENT
• SWDD standard WS50000021 step 165 TS50000048 Rule 50000011, copied FM FIPP_ACTOR_CCARD into Z version to place custom code and get users from role.
When I test the rule it gets the 2 users I am expecting to see.
When I run CRF3 Posting it does not create work items and posts the document.
SWIA Log says: Status Ready with message “No agents found for this task -> long text.”
How can I debug the custom function? I tried Session and External breakpoints but system does not stop maybe because the posting user is WF-BATCH
Do I need to include ACTOR_TAB in Binding?
Evidently I am missing a step, activation or something in the Agent Assignment area or elsewhere.
Please kindly provide detailed information of the possible solution.
FUNCTION ZCCARD.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(BELNR) LIKE VBKPF-BELNR OPTIONAL
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*" DOCUMENT_NOT_FOUND
*"----------------------------------------------------------------------
INCLUDE WFFIPPDA.
TYPES: begin of ty_all,
uname TYPE agr_users-uname, "User ID
agr_name TYPE agr_users-agr_name, "Role Assigned
text TYPE agr_texts-text, "Role Description
end of ty_all.
DATA:
DOCUMENTNUMBER(10),
NUMBEROFAPPROVER(1),
APPROVERUSERID2(14),
APPROVERUSERID(14),
cardnum TYPE crfilestat-ccnum,
it_agr TYPE TABLE OF ty_all,
wa TYPE ty_all,
role TYPE agr_users-agr_name.
IF BELNR IS INITIAL.
*-----Container lesen
* SWC_CONTAINER_TO_RUNTIME AC_CONTAINER. "/ wenn <cntn01> aktiv
SWC_GET_ELEMENT AC_CONTAINER 'FIPPID' SWC_OBJECT. "Objektid
SWC_GET_OBJECT_KEY SWC_OBJECT WF_ID.
ENDIF.
DOCUMENTNUMBER = belnr.
SELECT ccnum INTO cardnum
FROM crfilestat
WHERE belnr = DOCUMENTNUMBER.
ENDSELECT.
CONCATENATE 'ECC_CARD_Role_' cardnum+6(10) INTO role.
SELECT agr_name uname
INTO CORRESPONDING FIELDS OF TABLE it_agr
FROM agr_users
WHERE agr_name = role.
IF SY-SUBRC <> 0.
SELECT a~agr_name a~uname t~text
INTO CORRESPONDING FIELDS OF TABLE it_agr
FROM agr_users as a
inner join agr_texts as t on a~agr_name = t~agr_name
WHERE t~line = 0
AND t~text LIKE cardnum.
ENDIF.
NUMBEROFAPPROVER = '0'.
LOOP AT it_agr INTO wa.
CASE SY-TABIX.
WHEN 1 OR 2.
ACTOR_TAB-OTYPE = 'US'.
ACTOR_TAB-OBJID = wa-uname.
APPEND ACTOR_TAB.
WHEN OTHERS.
"Do Nothing
ENDCASE.
ENDLOOP.