Problem with parameter passing from method to task

mikko.maki-rahkola@accenture.com mikko.maki-rahkola at accenture.com
Thu Apr 21 03:05:20 EDT 2005


Hi Mike,
thank you for the good explanation, this makes the scenario a lot more clear.
 
I found out though that the responsibility rule elements don't work very well with these converted values. If I use the cobrb-konty type as the element type, only the three-char predefined conversion results are valid inputs. The problem is that once they're entered, they are converted back to their two-char representation and don't work.
 
If I put in e.g. 'CTR'=cost center and press enter, the value is converted to 'KS' and is no longer a valid input value. I'd have to enter 'CTR' and then save immediately without pressing enter to make it work. As a result, 'KS' is shown as the value. Entering an asterisk to the field is in addition impossible and makes the rule not an option for our client. 
 
So what I did as a solution was just to use another 2-char data type (EBKN-RECID) without any conversions as the resp rule container element type. This way I get to enter asterisks and value ranges from OR to KS etc. The task bindings also with this.
 
Thanks for your help, just let me know if you have any extra comments,
-Mikko

________________________________

From: sap-wug-bounces at mit.edu on behalf of Michael Pokraka
Sent: Wed 20/04/2005 16:22
To: SAP Workflow Users' Group
Subject: Re: Problem with parameter passing from method to task



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
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug




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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 9259 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20050421/2ca3f0ed/attachment.bin


More information about the SAP-WUG mailing list