Problem with parameter passing from method to task

Michael Pokraka wug.replies at workflowconnections.com
Wed Apr 20 09:22:22 EDT 2005


Hi Mikko, 
Some of your scenarios will convert the account assignment category into it's
language-dependent code (three letters) and others will use the internal two
letter abbreviation as per table TBO01.  Make sure to define all fields as
COBRB-KONTY and you should be OK. 
Thus 
"WRITE COBRB-KONTY." will perform the conversion exit to output the 3 digit
char
"lv_mystring = COBRB-KONTY" will assign the internal 2 digit code 

Cheers
Mike

--- mikko.maki-rahkola at accenture.com wrote:
> Hi everyone,
> hope some of you can help me out with a problem I'm facing...
>  
> We're running a PR item approval workflow on 4.6c and determining the
> approver agent with a responsibility rule. One element in the responsibility
> rule container is settlement rule category (COBRB-KONTY) which is filled from
> the maintenance order assigned to the PR item.
>  
> Ok, I have created an instance-dependent custom method in the subtype of the
> PR item object BUS2009 which picks up the assigned maintenance order details
> and returns among others the settlement rule category. The export param
> SettlRuleCategory is of type COBRB-KONTY (2-char type). Here's the relevant
> method code:
>  
> BEGIN_METHOD GETORDERDETAILS CHANGING CONTAINER.
> DATA:
> ...
>     ordernumber LIKE aufk-aufnr,
>     settlrulecat LIKE cobrb-konty,
>     wa_cobrb LIKE cobrb,
> ...
>   SWC_GET_PROPERTY self 'Order' ordernumber. "Order attribute contains the
> order number
> ...
>    IF NOT ordernumber IS INITIAL AND ordercategory = 30. " 30 stands for
> maintenance orders
>      SWC_CREATE_OBJECT maintorder 'BUS2007' ordernumber.
>    ENDIF.                                               
> ...
>   SELECT SINGLE * FROM aufk INTO wa_aufk WHERE aufnr = ordernumber.
>   IF sy-subrc = 0.
>     orderobjnr = wa_aufk-objnr. 
> ...
>   ENDIF.
> ...
>   SELECT SINGLE * FROM cobrb INTO wa_cobrb WHERE objnr = orderobjnr.
>   IF sy-subrc = 0.
>     settlrulecat = wa_cobrb-konty.
> ...
>   ENDIF.
> ...
>   SWC_SET_ELEMENT CONTAINER 'SettlRuleCategory' settlrulecat.
> ...
>  
> What's strange is that after executing the method with valid data, I see a
> three-character value (e.g. 'ORD') in my export parameter although
> cobrb-konty only has two chars(!). Not getting confused about this, I
> included the method in a new task and binded the parameter value to the task
> container element (of type COBRB-KONTY as well). Starting the task with a
> valid input PR item, the third character is suddenly dropped and my task
> container element has a result only a two character value (= 'OR'). 
>  
> Defining the task container element to be a three-char type does not help,
> the third character is dropped here too. I also tried changing the method
> export parameter and code variable types to three-char types, but the third
> character is dropped in the same way. As a temporary solution, I'm currently
> passing the two char value to the responsibility rule.
>  
> The other weird thing about this is that the value entry of the resp rule
> container element (type cobrb-konty) in OOCU_RESP/PFAC is quite difficult. It
> accepts e.g. 'ORD', but after pressing enter cuts the third character (=>
> 'OR') and second time pressing for 'OR' does not accept it. So I have to
> enter ORD and then immediately go out of the change mode. This way I get to
> keep 'OR' in the cont element even though the system doesn't properly accept
> it.
>  
> Have any of you bumped into a similar peculiarity or have I just missed
> something or do I need to go straight to OSS on this? 
>  
> Thanks for your help!
> -Mikko
> 
> 
> This message is for the designated recipient only and may contain privileged,
> proprietary, or otherwise private information.  If you have received it in
> error, please notify the sender immediately and delete the original.  Any
> other use of the email by you is prohibited.
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 

Michael Pokraka
Workflow Connections Ltd.
Tel.: +44 (0)7786 910 855


More information about the SAP-WUG mailing list