Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection formula pased on parameter-field in SAP

Status
Not open for further replies.

gufalcon

Programmer
Apr 15, 2002
2
0
0
AT
Server-side-select --- Client-side-select

I use a parameter-field (PF) named {?Og} to enable the user to select an 8-digit number (the datatype of the corresponding SAP-DB-field is 8-digit) (a.e. "50237309").
The parameter-field looks like:

content description
5023709 Ansfelden
50236441 Braunau
5023708 Tragwein
...

The database contains a field {IL BB_INFOSET.PA9155-OGRU} containing the number (as a string) as mentioned above.

The selection-Expert contains following formula:
{IL BB_INFOSET.PA9155-OGRU} = {?Og}

Although the parameter-field {?Og} is multi-select (the user may select one or more than one value (and I really don't care what happens if he enters nothing at all at this point =) ) it works fine!
Everything is alright and the select-statement runs on the server (instead of the client) which is fine, because personally I would rather evaluate 4.000.000 Datasets on the server-side than on the client-side ;-)
until...

The parameter-field HAS TO look like this (and no workaround here, I'm afraid):


content descr. (is always empty)

Ansfelden [5sd4f53dsf] [5023709]
Baunau [5544sd5f4sd] [50236441]
Tragwein [5hn5cv4bcvbcvb] [5023708]
...


The ogru-number is now located between the second pair of brackets <[]>

So I made up the following formula:

#################################################################
//make an array containing the numbers from the parameter-field

stringVar array ogru;
//count for the parameter-field
numberVar l := Count ( {?Og} );
//counter variable
numberVar i;

//loop to copy the array...
for i := 1 to l step 1 do (
//redim destination-array
redim preserve ogru[ i ];
//cut and copy into my array
ogru[ i ] := Mid( {?Og}[ i ], InStr ( {?Og}[ i ], &quot;]&quot; ) + 3, 8 );
);

//select-statement
{IL BB_INFOSET.PA9155-OGRU} = ogru;
#################################################################

This formula is working as tested in a formula field (because I never ever trust myself :) )
According to the staff at Crystal Reports (CR) a parameter-field IS an array.
So why is example 1 executed on the server-side while example 2 is executed on the client-side (very bad!)?
Is there a way to do this on the server-side as well?
We use SAP R/3 which is why I can't use stored procedures.

help me please.


SAP R/3 4.6c
CR 8.5
CE 8.0
 
I think CR always executes formulas on client-side if they contain variables or that's what we experienced.
In fact, we had to make use of this behaviour in order to troubleshoot another bug ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top