Exception '9001' error when triggering workflow in CRM4

Workflow99@aol.com Workflow99 at aol.com
Wed Aug 31 15:24:19 EDT 2005


 
 
Unfortunately neither the Check nor the Generate functions report  any 
warnings or  errors in case of undefined exceptions in the  6.20 release as well. I 
had a notion that it did and paid for it. 
 
 
Regards,
Ramki Maley
Workflow Developer,  USCBP.
248-613-1287 (C)
 

In a message dated 8/31/2005 2:44:23 PM Eastern Standard Time,  
David.Trant at andrew.com writes:

 
Yes, this exception error that has been  one of the biggest thorns in my side 
since becoming the de facto workflow  administrator at my organization.  We 
used to have functional people  build workflows with little or no technical 
involvement, plus the technical  involvement was ill-trained, so the resulting 
methods that were created  continue to spew out dozens of “error 394” messages 
daily.  Here’s the  deal:  someone writes or finds an existing function module 
that performs  some desired functionality.  They then create a corresponding 
method in  the business object that calls said function module.  SAP is real 
nice to  generate all the required code (well, almost as we’ll see) with the 
touch of a  button.  For those not in the know, it seems to work like magic and, 
 indeed, provided the rest of the connections are made properly, bindings 
done  right, etc., the normal scenarios tend to work beautifully.  What people  
here at least failed to notice was that the generated code is but a mere stub  
that still requires some finishing off.  Here’s a living example from one  of 
our workflows: 
BEGIN_METHOD ZBAPIUPDATESOSTATUS CHANGING  CONTAINER.     
DATA:                                                          
SOORDERNO  LIKE  VBAK-OBJNR,                               
STATUS  LIKE  JEST-STAT,                                   
CHNGEIND  LIKE  VBAK-VBTYP,                                
SLSORDERNUMBER LIKE  VBAP-VBELN,                          
SLSORDERITEM LIKE  VBAP-POSNR,                            
SDATE LIKE  VBAP-ERDAT,                                   
USER LIKE  VBAP-ERNAM.                                    
SWC_GET_ELEMENT CONTAINER  'SoOrderNo'  SOORDERNO.             
SWC_GET_ELEMENT CONTAINER 'Status'  STATUS.                   
SWC_GET_ELEMENT CONTAINER  'ChngeInd'  CHNGEIND.               
SWC_GET_ELEMENT CONTAINER  'SlsOrderNumber' SLSORDERNUMBER.  
SWC_GET_ELEMENT CONTAINER  'SlsOrderItem' SLSORDERITEM.       
SWC_GET_ELEMENT CONTAINER 'Sdate'  SDATE.                     
SWC_GET_ELEMENT CONTAINER 'User'  USER.                       
CALL FUNCTION  'Z_BAPI_UPDATE_SO_STATUS'                
EXPORTING                                                  
USER =  USER                                              
SDATE =  SDATE                                            
SLS_ORDER_ITEM = SLSORDERITEM     
SLS_ORDER_NUMBER =  SLSORDERNUMBER                        
CHNGE_IND  =  CHNGEIND                                     
STATUS =  STATUS                                          
SO_ORDER_NO =  SOORDERNO                                  
EXCEPTIONS                                               
FUNC_FAIL  =  9001                                       
READ_FAIL  =  9002                                       
OTHERS =  01.                                           
CASE  SY-SUBRC.                                             
WHEN  0.            "  OK                                  
WHEN  9001.         "  FUNC_FAIL                           
EXIT_RETURN 9001 sy-msgv1 sy-msgv2 sy-msgv3  sy-msgv4. 
WHEN  9002.         "  READ_FAIL                           
EXIT_RETURN 9002 sy-msgv1 sy-msgv2 sy-msgv3  sy-msgv4. 
WHEN  OTHERS.       " to be  implemented                   
ENDCASE.                        
END_METHOD.                                                  
All the above code was automatically  generated.  Note carefully the code at 
the very end where the return code  (SY-SUBRC) is processed.  The code 
generator recognized the two  exceptions from the function module, FUNC_FAIL and 
READ_FAIL, but has no idea  functionally how they should be treated.  It therefore 
essentially  inserts syntactically correct placeholders, with the expectation 
that we will  know to go in and modify it according to our needs.  If, as 
happened  here, nobody knows that there is still more work to be done, and it isn’
t  caught in testing, you will get runtime errors.  These result in notices  
to the workflow administrator with the title “Workflow 35406978 Error WL 394 . 
 Please repair the” and the body 
The following error  occurred in the workflow above: 
Workflow no. 000035406978:  An error occurred in work item 000035865972 ( 
step no. 0000000183) Please  repair the suspended workflow 
Press 'Execute' to display  the workflow that has errors. 
Ironically, one of the reasons I didn’t  know about this for so long was that 
the workflow administrator used to not  get these error messages.  The errors 
were occurring, sure enough, but  nobody knew it.  Then one day we 
implemented a bunch of support packs for  HR and I suddenly got deluged with errors!  It 
took quite a while to  recognize that the errors were not a result of the hot 
packs, but rather the  reporting of them apparently was.  Going forward, one 
of my review steps  is to check each and every method to ensure that complete 
error handling is  implemented.  We’re on 4.6C.  Hopefully in future releases, 
SAP will  pop up some kind of warning or otherwise guide the person pushing 
the  “generate code” button to pay further attention to this section of the  
generated code. 
Hope this  helps, 
David 
 
  
____________________________________
 
From: sap-wug-bounces at mit.edu  [mailto:sap-wug-bounces at mit.edu] On Behalf  Of 
Hofstede, Anke (AU - Sydney)
Sent: Tuesday, August 30, 2005 1:45  AM
To: SAP Workflow Users'  Group
Subject: RE: Exception  '9001' error when triggering workflow in CRM4
Hi Tom T, 
This has to do with the exceptions for  the method. To see the exceptions: 
Go to SWO1 > object  ZBUS200126 
Click on method name to highlight  it 
Click on exceptions  button. 
The method program code should contain  something to trigger the exception 
(exit_return) if needed. 
Did you refresh the buffers after the  transport? SWU_OBUF 
Cheers, 
Anke 
Anke Libeton (was Anke  Hofstede) 
Deloitte Australia 
 
  
____________________________________
 
From: sap-wug-bounces at mit.edu  [mailto:sap-wug-bounces at mit.edu] On Behalf  Of 
PEOU Tom T
Sent: Tuesday, 30 August 2005 3:12  PM
To:  sap-wug at mit.edu
Subject:  Exception '9001' error when triggering workflow in CRM4
Hi fellow Wuggers, 
 
 
 
Can anybody assist with this  error:


Exception '9001' is not defined for method  'ACTIVITYFORPURCHASEORDER' object 
type  'ZBUS200126' 
This is occurring in our QA system when triggering a  workflow to create an 
activity. 
This workflow was transported from our DEV system to  the QA system. However, 
the same workflow completes successfully in our DEV  environment. 
I think the problem is within the Method in the  business object, but I 
cannot see why it would work in DEV and not in our QA  System.  
Has anyone encountered a similar  error? 
Cheers, 
T

_______________________________________________
SAP-WUG  mailing  list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20050831/177cf9df/attachment.htm


More information about the SAP-WUG mailing list