‎2014 Jun 19 11:59 AM
I have to create an event in the Table Maintenance Generator to compare the "From" and "To" fields of a table.
The "From" value should be lesser than the "To" value. (This part is easy)
But, the values can have '*'(star) also. eg. 2* or 4* or 22*. [which means values starting with 2 or 4 or 22]
How can I compare these values before saving an entry in the custom table?
Also in the Function Module I have an import parameter whose value should lie between this range to populate the exporting parameter.
How can I check that, if the table entries contain '*'(star) values?
‎2014 Jun 19 1:33 PM
I solved it.
You just have to create an event with type "create a new event" and in it you can check if the 'TO' value is LESS THAN 'FROM' value then we can show an ERROR message.
and in the function module we can simply check, if the input paramter value lies between the 'FROM' and 'TO' value.
Anyways! Everyone, Thank you so much.
‎2014 Jun 19 12:07 PM
Hi Prabhat,
try converting the table field values to CHAR type into another variable.
and then we can try using string operands like CS in the CHAR type value.
Can you please clarify the functionality you are expecting, please give us an example so that we can get better understnading on this issue ?
Thanks,
bhaskar
‎2014 Jun 19 12:17 PM
Table has following fields:
* Profit Center From
* Profit Center To
These 2 fields define the range of profit centers
Some possible values for profit centers : 123145, 000001, 2*, 5*.
Now there are 2 tasks.
-- Task 1.
When I am saving the values in the table, i need to check that the 'Profit Center To' values is GE to the 'Profit Center From' value.
-- Task2.
Suppose one row contains values as
Profit Center From Profit Center To ABC_Field
23* 2* xyz
In the function module I have to check if my importing parameter lies in the 'Profit Center Range'.
If it does, then I have to populate my exporting parameter with 'ABC_Field' Value.
I need to know the code, how can I do this check.
‎2014 Jun 19 12:13 PM
Hi,
Please try below technique.
Check if the value contains *, if yes, then shift the value one digcharacter left which will remove *.
Thank You,
Gajendra.
‎2014 Jun 19 12:39 PM
Hello Prabhat,
as I can see, the problem is the criteria to be used to make comparation.
A value 2* is lower or higher than 4*? A value 2* is lower or higher than 22*? These are not values, are ranges of values. Of course, you can establish some rules to allow comparation based in some criteria; for example, taking the highest value possible when an asterisk is found. If the data type is, for example, NUMC(10), you can consider 23* as 2399999999 for comparation.
In fact, I think you have to define a criteria for comparation first and then compare single values.
‎2014 Jun 19 1:33 PM
‎2014 Jun 19 1:33 PM
I solved it.
You just have to create an event with type "create a new event" and in it you can check if the 'TO' value is LESS THAN 'FROM' value then we can show an ERROR message.
and in the function module we can simply check, if the input paramter value lies between the 'FROM' and 'TO' value.
Anyways! Everyone, Thank you so much.