Comparing a range with rang of values
Hi,
Please help me to get a solution for the below, Thank you!!
I have a table which contains values like select options.
Ex: Here table fields are SIGN, OPTION, LOW and HIGH.
i need to select these table entries using the selection screen (this is parameter) input,
where user can give input exact value or '' or somthing (Ex. IN*) or *somthing (Ex. *03).
Or after selecting the entries from the table into internal table, i need to filter the internal table entries with selection screen input.
Here when user inputs with pattren (Ex. IN* or *03) and the table entry is
SIGN OPTION LOW HIGH
I BT IN01 KR01
here if user inputs *03, the above table entriy should come in the output.
as IN03 or JP03 etc...comes under above range.
Can any one suggest any solution for this?
This is quite urgent issue, pleae help me in this regard.
Thanks and regards,
Satish
Message was edited by:
SATISH KOTTE
I have done similar requirement in dialog program and i used find button to get exact field in top line cursor.
Create one internal table where you are finding the data from database table.
See the logic in form routine : FORM find_field USING command.
Below sample program :
*& Module pool ZLWMI151_BAT1
*& Transaction: ZBAT1
*& Programmer: Seshu Maramreddy
*& Date : 05/17/2005
Transport : DV3K919574
*& Description: This program Will Displays the Batch Conversion
*& data in Display mode. Batch conversion
*& table (ZBATCH_CROSS_REF)
PROGRAM ZLWMI151_BAT1 .
INCLUDE ZLWMI151_BAT1_TOP.
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
case ok_code.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave to screen 0.
when 'CANC'.
leave to screen 0.
when 'EXCE'.
perform down_load.
WHEN '%SC'.
perform find_field using ok_code.
endcase.
clear ok_code.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
GUI Status
MODULE
STATUS_0100 OUTPUT.
SET PF-STATUS 'STLI'.
DESCRIBE TABLE T_zbatch LINES G_LINE.
TC1-LINES = TC1-LINES + 18.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form down_load
text
FORM down_load.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
FILENAME = ' '
FILETYPE = 'DAT'
TABLES
DATA_TAB = t_zbatch
EXCEPTIONS
INVALID_FILESIZE = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
CUSTOMER_ERROR = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " down_load
*& Module modify OUTPUT
text
MODULE modify OUTPUT.
select * from zbatch_cross_ref into corresponding fields of table
t_zbatch.
sort t_zbatch by werks werks cmatnr srlno.
ENDMODULE. " modify OUTPUT
*& Form find_field
text
-->P_OK_CODE text
FORM find_field USING command.
data: position like sy-tabix.
data: found(1).
data: find_pos like sy-tabix,
loop_curr like sy-tabix.
select * from zbatch_cross_ref into table t_find.
sort t_find by werks cmatnr srlno.
if command = '%SC'. "Suchen
position = 1.
perform popup_get_value using 'FSTR' ''
changing rsdxx-findstr.
else. "FIWE "Suchen wiederholen
position = loop_first + 1.
if rsdxx-findstr = space.
perform popup_get_value using 'FSTR' ''
changing rsdxx-findstr.
endif.
endif.
if ok_code = 'ABR'.
clear ok_code.
leave screen.
else.
clear found.
loop at t_find from position.
if t_find cs rsdxx-findstr
or t_find cp rsdxx-findstr.
found = 'X'.
find_pos = sy-tabix.
exit.
endif.
endloop.
if found = 'X'.
loop_curr = 1.
tabpos = loop_first = find_pos.
if use_old is initial.
tc1-top_line = find_pos.
set cursor field tc1-top_line.
endif.
else.
message s042(e2) with rsdxx-findstr.
endif.
endif.
ENDFORM. " find_field
FORM POPUP_GET_VALUE USING FCT MODE
CHANGING VALUE.
DATA: ANSWER,
popup_title(35),
TITLE LIKE POPUP_TITLE,
FIELDS LIKE SVAL OCCURS 1 WITH HEADER LINE.
CASE FCT.
WHEN 'FIND'. "Suchen Feld
TITLE = TEXT-TFI.
FIELDS-TABNAME = 'RSEDD0'.
FIELDS-FIELDNAME = 'FIELDNAME'.
FIELDS-NOVALUEHLP = 'X'.
FIELDS-VALUE = VALUE.
APPEND FIELDS.
WHEN 'FSTR'. "Suchen String
TITLE = TEXT-TFS.
FIELDS-TABNAME = 'RSDXX'.
FIELDS-FIELDNAME = 'FINDSTR'.
FIELDS-NOVALUEHLP = 'X'.
FIELDS-VALUE = VALUE.
APPEND FIELDS.
WHEN 'ACCL'. "Aktivierungsart
TITLE = TEXT-TAC.
FIELDS-TABNAME = 'DD02D'.
FIELDS-FIELDNAME = 'AUTHCLASS'.
FIELDS-VALUE = VALUE.
IF MODE = 'S'.
FIELDS-FIELD_ATTR = '02'.
ENDIF.
APPEND FIELDS.
WHEN 'DELC'. "Auslieferungsklasse
TITLE = TEXT-TDC.
FIELDS-TABNAME = 'DD25D'.
FIELDS-FIELDNAME = 'CUSTOMAUTH'.
FIELDS-VALUE = VALUE.
IF MODE = 'S'.
FIELDS-FIELD_ATTR = '02'.
ENDIF.
APPEND FIELDS.
ENDCASE.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
POPUP_TITLE = TITLE
IMPORTING
RETURNCODE = ANSWER
TABLES
FIELDS = FIELDS
EXCEPTIONS
ERROR_IN_FIELDS = 1
OTHERS = 2.
IF SY-SUBRC = 0
AND ANSWER = SPACE.
VALUE = FIELDS-VALUE.
ENDIF.
ENDFORM.
INCLUDE ZLWMI151_BAT1_TOP *
tables : zbatch_cross_ref,
rsdxx.
data t_zbatch like zbatch_cross_ref occurs 0 with header line.
data :ok_code(4) type c,
g_line type sy-index,
loop_first like sy-tabix,
tabpos like sy-tabix,
USE_OLD type char1.
controls tc1 type tableview using screen 0100.
data : begin of t_find occurs 0.
include structure zbatch_cross_ref.
data : end of t_find.
Reward Points if it is useful
Thanks
Seshu
Similar Messages
-
How do I select a range of values in MySQL using a drop down menu
Hi,
I have a database of picture frames that have a value of
frame width. I want to be able to select a range of values (i.e.
.50" to 1") instead of each and every value (i.e. .50", .56", .76",
etc.). I have a drop down menu (mnuWidth) with 5 ranges (see
attached code).
Each selection has a value from 1 to 5 indicating the range I
want to search. In my results page I have let DW set up a recordset
(see attached code)
Can anyone tell me how to get this to choose a range instead
of just the value entered by my menu?
Thanks in advance.
TomI have been growing fond of lookup tables. Your lookup table would have your numbers in one column and the values you want returned in the next.
Lookup table
item
Name
1
a
2
b
3
c
4
d
5
e
6
f
7
g
8
h
9
i
Input table
input
Name
1
a
B2 and copied down:
LOOKUP(A2,lookup::$A$2:$A$11,lookup::$B$2:$B$11)
Caution: Lookup will return the closest value so it it looks for "10" in this example it will return "i"
If you don't want to see the error messages from blank inputs, wrap Lookup in IFERROR.
hope this helps
q -
Check a range of values in the pai section of a dynpro
Hi,
I have a week timetable, and for each day the user has to introduce a range of hours. I need to control that the hours the user introduces is in a correct format (hh:mm).
I've seen that it's possible to set the valid range of values of an element using a field section on the dynpro's PAI (Input checks in the flow logic). Something like this:
chain
field: field1, field2, ...
values between 00:00 to 23:59
endchain
But I don't know how can I use this to set a range of values in the time format.
Is it possible?
thanks in advancesee you can create a module like the coding done inside of the form validate_time this.you can run this code to see if it solves your problem.
Report ZANID_TEST2 Message-ID ZM.
parameters: p_time(5).
start-of-selection.
perform validate_time.
*& Form validate_time
form validate_time.
data: d_hours(2),
d_minutes(2).
data: hours type i,
minutes type i.
split p_time at ':' into d_hours d_minutes.
hours = d_hours.
minutes = d_minutes.
if hours > 24 or hours < 0.
message e307 with 'Invalid Hour'.
endif.
if minutes > 60 or minutes < 0.
message e307 with 'Invalid Minutes'.
endif.
endform. " validate_time -
Switch and case and range of values
How do I program a "case" to be a range of values instead of just one value. for example, I want the code associated with a particular Case to execute if the value of the case falls within 1-10000.
I have about 10 "Cases", like 0-10000, 10001-20000, 20001-30000, etc.
I currently use the "if" condition, but that requires the program to read each "if"; the speed difference is minimal, but I know there must a way to use a range. In Visual Basic, I can use "Case 1 to 10000" etc. -
Can we input range of values in the Function Module CONVERSION_EXIT_MATN1_I
Hi all,
Can we in put range of values in the FM 'CONVERSION_EXIT_MATN1_INPUT'
Like If I am inputting s_matnr which takes range of material number based on selection screen input.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = s_matnr
IMPORTING
OUTPUT = s_matnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
Can this work?
Thanks,
Debrup.hi do like this...
loop at r_matnr .
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = r_matnr
IMPORTING
OUTPUT = v_matnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
itab-matnr = v_matnr .
append itab .
endloop . -
Compare the current value with the previous value in the same column
Hi all,
I have to include a statement in a query which allows to compare the current value of column A with the previous value of column A (same column). from there, I need to add a condition in order to have the expected result.
Let's take an example to illustrate what I want to achieve:
I have the following columns in table called 'Charges':
Ship_id batch_nr Order_nr Price
SID1111 9997 MD5551 50
SID1111 9998 MD5552 50
SID1111 9999 MD5553 50
SID2222 8887 MD6661 80
SID2222 8887 MD6662 80
SID2222 8887 MD6662 80
SID3333 6666 MD7771 90
I want to check if the ship_id of row 2,3 (and more if available) is equal to the ship_id of row 1.
If it is the case, then value 'together with the first batch_nr' in row 2 and 3 under Price column. If not, then keep the original value of Price column
PLease see below the expected result:
Ship_id batch_nr Order_nr Price
SID1111 9997 MD5551 50
SID1111 9998 MD5552 together with 9997
SID1111 9999 MD5553 together with 9997
SID2222 8887 MD6661 80
SID2222 8887 MD6662 together with 8887
SID2222 8887 MD6663 together with 8887
SID3333 6666 MD7771 90
Thanks in advance for your help, it is really urgent.
Imco20030Hi,
user11961002 wrote:
Hi,
Here is the query that I use:
[ select
sl.ship_id,
o.ordnum,
o.reffld_5 "BatchNR",
sum(tc1.chrg_amt) "FreightPRC",
sum(tc2.chrg_amt) "FuelPRC",
sum (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt) "Total Price"
from ord_line ol
join ord o on (ol.ordnum = o.ordnum and ol.client_id = o.client_id)
join shipment_line sl on (ol.ordnum = sl.ordnum and ol.client_id = sl.client_id and ol.ordlin = sl.ordlin)
join adrmst a2 on (o.rt_adr_id = a2.adr_id)
left join tm_chrg tc1 on (tc1.chargetype = 'FREIGHT' and tc1.chrg_role = 'PRICE' and tc1.ship_id = sl.ship_id)
left join tm_chrg tc2 on (tc2.chargetype = 'FUELSURCHARGE'and tc2.chrg_role = 'PRICE' and tc2.ship_id = sl.ship_id)
where sl.ship_id = 'SID0132408'
group by o.client_id, o.ordnum, o.reffld_2, sl.ship_id, a2.adrnam, a2.adrln1, a2.adrpsz, a2.adrcty, a2.ctry_name,
o.reffld_5, ol.early_shpdte
order by ship_id
]That looks like the query you were using before you started this thread.
Modify it, using the analytic fucntions FIRST_VALUE and LAG, like I showed you.
I see that you did simplify the problem quite a bit, and it's good that you did that.
It doesn't matter that your real problem involves joins or GROUP BY. Analytic functions are calculated on the results after all joins and GROUPS BYs are done. Just substitute your real expressions for the simplified ones.
For example, in your simplified problem, there was a column called order_nr, but I see now that's it's really called o.ordnum. Where the solution I posted earlier says "ORDER BY order_nr", you should say "ORDER BY o.ordnum".
Here's a less obvious example: in your simplifed problem, there was a column called price, but I see now that it's really SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt). Where the solution I posted earlier says "TO_CHAR (price)", you should say "TO_CHAR (SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt))". (You can't use an alias, like "Total Price", in the same SELECT clasue where it is defined.)
I removed some columns from the select as they are not relevant for the wanted action like 'adress details or other references'.
Now here is the result:
Shipment ID Order Number WMS Batch Freight Fuel Price Order Total Price
SID0132408 MDK-000014-05602649 04641401 110 10 120
SID0132408 MDK-000014-05602651 04641402 110 10 120
SID0132408 MDK-000014-05602652 04641363 110 10 120
as you can see, the 3 orders have the same shipment ID.
The expected result should be shown under column 'Total Price' as follows:
Shipment ID Order Number WMS Batch Freight Fuel Price Order Total Price
SID0132408 MDK-000014-05602649 04641401 110 10 120
SID0132408 MDK-000014-05602651 04641402 110 10 tog with 04641401
SID0132408 MDK-000014-05602652 04641363 110 10 tog with 04641401Okay, so those are the correct results that I asked for, plus the incorrect results you're getting now. Thanks; extra information doesn't hurt.
But where is the raw data that you're starting with?
It looks like you tried to format the code (but not the results) by typing this 1 character:
before the formatted section and this different character
after the formatted section. To post formatted text on this site, type these 6 characters
before the formatted section, and the exact same 6 characters again after the formatted section. -
Data fetch for range of value inside an assistance class
I want to create an assistance class where I can fetch data for the range of values selected ( basically when I select a range of sales order ).
I was only only successfully in creating parameters, passing single values.
Regards,
Krishna.Hi Krishna,
Logic to fetch the data of range ( implement in the method )
data : lv_matnr TYPE string VALUE 'MATNR',
lr_matnr TYPE REF TO data.
FIELD-SYMBOLS : <lr_matnr> TYPE ANY TABLE.
************ Method to call range of data ************************
CALL METHOD wd_this->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
EXPORTING
I_ID = lv_matnr
RECEIVING
RT_RANGE_TABLE = lr_matnr.
ASSIGN lr_matnr->* to <lr_matnr>.
*************** call the method of the assistance class
wd_assist->GET_DATA( EXPORTING IR_MATNR = <lr_matnr> ).
****************** parameters of the method in the assistance class ********************
Hope this helps you
Thanks & Regards,
Sankar Gelivi -
Compare date ranges in two tables
Hello,
I'm trying to figure out a way of comparing the range of dates between two date columns from a single row in one table, to the range of dates from multiple rows in a related table.
t1 (t1_id, absent_start_date, absent_stop_date)
t2 (t2_id, t1_id, cover_start_date, cover_end_date)
t2 has multiple rows for each row in t1
I need to select rows from t1, in which the set of days for rows in t2 do not match the set of days between absent_start_date and absent_stop_date.
For example, assume this row in t1:
1, '10/08/2007', '15/08/2007'
The set of days would be 10/08/07,11/08/07,12/08/07,13/08/07,14/08/07,15/08/07
and these rows in t2
1, 1, '10/08/2007', '11/08/2007'
2, 1, '12/08/2007', '12/08/2007'
3, 1, '14/08/2007', '15/08/2007'
The set of days would be 10/08/07,11/08/07,12/08/07,14/08/07,15/08/07
In this case, the related rows in t2 do not cover the same date range as the master row in t1, and so I need to select this row from t1 somehow.
Any ideas anyone?
Thanks.I am not sure about the exact output you want, but the next query will give you all gaps in the periods, so the presence of a row in this output may be enough?
SQL> create table t1
2 as
3 select 1 t1_id, date '2007-08-10' absent_start_date, date '2007-08-15' absent_stop_date from dual union all
4 select 2, date '2007-09-01', date '2007-09-10' from dual
5 /
Tabel is aangemaakt.
SQL> create table t2
2 as
3 select 1 t2_id, 1 t1_id, date '2007-08-10' cover_start_date, date '2007-08-11' cover_stop_date from dual union all
4 select 2, 1, date '2007-08-12', date '2007-08-12' from dual union all
5 select 3, 1, date '2007-08-14', date '2007-08-15' from dual union all
6 select 4, 2, date '2007-09-03', date '2007-09-05' from dual union all
7 select 5, 2, date '2007-09-07', date '2007-09-08' from dual
8 /
Tabel is aangemaakt.
SQL> select *
2 from ( select t2.t1_id
3 , lag(t2.end_date+1,1,t1.absent_start_date) over (partition by t2.t1_id order by t2.start_date) gap_start_date
4 , t2.start_date-1 gap_end_date
5 from t1
6 , ( select t1_id
7 , cover_start_date start_date
8 , cover_stop_date end_date
9 from t2
10 union all
11 select t1_id
12 , absent_stop_date+1
13 , absent_stop_date+1
14 from t1
15 ) t2
16 where t1.t1_id = t2.t1_id
17 )
18 where gap_start_date <= gap_end_date
19 order by t1_id
20 , gap_start_date
21 /
T1_ID GAP_START_DATE GAP_END_DATE
1 13-08-2007 00:00:00 13-08-2007 00:00:00
2 01-09-2007 00:00:00 02-09-2007 00:00:00
2 06-09-2007 00:00:00 06-09-2007 00:00:00
2 09-09-2007 00:00:00 10-09-2007 00:00:00
4 rijen zijn geselecteerd.Regards,
Rob. -
Hi,
Is there any simple way to compare two range tables, something like RANGE1 IN RANGE2 ? I need to check if one range table is inside another or not.
Thanks, NunoI don't know if this is correct but a read in a post a time ago that you can compare two internal tables when had the same number of lines and and the same elements you can use
IF RANGE1 = RANGE2.
ENDIF.
if that is not the case then you have to loop to know if the element is inside the range -
Return a Range of Value from Dashboard Prompt
From example, 'Day' column has values from 1 to 365 and I set it as a dashboard prompt. If I want to select a range of value from 'Day', I can use 'is between' operator. Then I can select a range of day value from 1 to 365.
My additional requirement is to return a fixed range of value. For example, the maximum range is 31 days. That means if I select day 1, the result should display 1-31. Also I should be allowed to select a range fewer than 31 days. In short, I need to return result from minimum 1 day to maximum 31 days. Is it possible for dashboard prompt? or there are other solutions?Let's see. To answer your first question, yes, you will end up having two prompts that hold values 1-31. The user will select one value from the first prompt, say 2, and a value from the second prompt, say 31. Since both of these prompt values are stored in presentation variables, you can use them in the filter on the "day column" in your report (i.e., 'Day' greater than or equal to pvStartDay and less than or equal to pvEndDay). This will give you the range on your report.
The reason for the CASE WHEN 1=0 is because you are using the Day column twice in your prompt. OBI only allows you to use a column once in your report. It is also to protect the column from being affected by the prompts.
Check this link for details:
http://oraclebizint.wordpress.com/2008/02/26/oracle-bi-ee-101332-between-prompts-for-date-columns-using-presentation-variables/
Now, based on your second post, it appears your conditions are different. You are selecting actual dates, not a number from 1-31.
TomChan wrote:
Maybe I can describe my case in a simple way. I have a startDate prompt that can select all date values. If I select a date value from startDate prompt, says '20090101'(in yyyymmdd format), the endDate prompt should display maximum 31 values(i.e. 20090101 - 20090131) basing on the selected values of startDate prompt. Then I further select a value in the endDate prompt to filter the report. Is it possible?I am a bit confused. It seems that you want the first prompt to display the first day of the 12 months of the year and once selected, the second prompt would be constrained to show the days of that particular month from which the user would select the "end date"? But then you say "basing [sic] on the selected values of starDate prompt" -- you have "values" as plural. Does this mean the user can select multiple values in the first prompt? -
Hai,
I have a GL Account Range (that is 100000 to 120000) the one the user is entering in the Selection Screen.
I have a requirement to build a range table like the following
r_saknr-low = 100000. r_sign = 'I'. r_option = 'EQ'.
r_saknr-low = 100001. r_sign = 'I'. r_option = 'EQ'.
r_saknr-low = 120000. r_sign = 'I'. r_option = 'EQ'.
Curently i am populating this range using below logic.
v_saknr = v_skanr-low.
do n times (120000-100000) times.
r_saknr-low = v_saknr.
r_saknr-sign = 'i'.
r_skanr-option = 'eq'.
APPEND r_saknr.
clear r_skanr.
v_skanr = v_skanr + 1.
enddo.
It is working fine but slow. I would like to know Are they any standard function module which should take the from and To range and provides the ranges of values.
So that i can increase the performance.
Please suggest me.
GiriHello Giri,
I presume that you are using ordinary fields to get thhe Range on the Selection-Screen, instead of using a select-option.
Could you please elaborate what the requirement is and why you need all the single values instead of just using the BT operator?
Even if you had wanted all the individual values, I'm sure that you do not want to have the numbers which you are not going to find in the database.
I'm sure that there might be a few programmer who would not appreciate hitting the database for a task of this trivial a nature, but I would want you to try out something like this:
tables ska1.
ranges lt_saknr for ska1-saknr.
lt_saknr-sign = 'I'.
lt_saknr-option = 'EQ'.
select distinct saknr
from ska1
into lt_saknr-low
where saknr between <v_saknr_lower_limit> and <v_saknr_upper_limit>
append lt_saknr.
endselect.
The above statement might work really work much faster than your application logic depending on the kind of data you have in your system and the selection values the user enters. Just run a few tests and see which works the best for your case.
Regards,
Anand Mandalika. -
Field in the selection screen as a select option with two default values
Hi All,
can anybody tell me how to put field in the selection screen with two defaul values.
for ex: selection screen the Account Group KNA1-KTOKD as a select option. The defeault value should be Y001 and Y005.
please reply ASAP. Its urgent.
Thanks in advance,
MadhuHi Madhu,
Since Select options are nothing but ranges, you can use the following code to add two distinct values to the select options by default.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
s_ktokd-low = 'Y001'.
append s_ktokd.
s_ktokd-low = 'Y005'.
append s_ktokd.
clear s_ktokd.
However, if you want to mention a range like all the values between these given two values to be considered then u may use,
select-options : s_ktokd for KNA1-KTOKD default 'Y001' to 'Y005'.
or
s_ktokd-sign = 'I'.
s_ktokd-option = 'BT'.
s_ktokd-low = 'Y001'.
s_ktokd-high = 'Y005'.
append s_ktokd.
Reward if helpful. -
Feature NUMAP was called with incorrect parameter value PME15
hi
i am getting following error while running transaction pb10.
Feature NUMAP was called with incorrect parameter value PME15
please help me out.
regards
archanathis might be occur in case there is mismatch of the fields of decision being used in feature maintenance.
check the feature and the return value , wether the return value is correct or not
goto PE03->NUMAP check the return value and check wether the return was configured in number ranges
eg: if the return value is 01 go to your config and check the number range has been set for "01"
you gave return value as "01" and the number range has not been set in configuaration for "01" this kind of error s may occur.
Edited by: Piscian . on Jul 18, 2011 11:54 AM -
Problem with cheking a # value in IF statement
Hi ,
I have to check value of
val_tab = node->get_value( ).
do .
end do .
if my val_tab contains '#' or '##' a DO statement below it shoul not get executed . i tried IF with string operations but
its not working . it does not check it for '#' value . Plz help how can i check it .I told you this is because this # mark only appreas to be so, if you write
data: my_char type string value '#'.
if my_char = value_tab(1).
endif.
and debug the code you would see that it my-char has different hex representation than your val_tab(1) .
It is happening if SAP can't encode this char correctly (as this is one of special character) and presents you with the replacement, which is #. Nevetherless the real value behind it is not what we can see on the screen, it is determined by its hex(binary) representation.
Use my above code replacing
do 31 times.
xstr = x = sy-index. "convert to hex value and then to xstring
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = xstr
IMPORTING
OUT_STRING = out_str. "here you have string representation of # with correct hex value behind it
if out_str = val_tab(1) . "now only compare these two characters
"....here # was found it means it is one of a special character
endif.
enddo.
Regards
Marcin -
Outer join With a constant value
Hi all,
In one of query i have found out that the outer join with a constant value like
to_currency(+)='USD'
to_currency is a column name in a table.can any one please explain this outer join condtn.
Thanks in advance
SenthilHallo,
if you write var (+) = constant
var can be equal constant, and also can be null
Compare these 2 queries
select e.* from scott.emp e, scott.dept d
where e.deptno = d.deptno(+)
and d.deptno(+) = 10EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-Dez-1980 800 20
7499 ALLEN SALESMAN 7698 20-Feb-1981 1600 300 30
7521 WARD SALESMAN 7698 22-Feb-1981 1250 500 30
7566 JONES MANAGER 7839 2-Apr-1981 2975 20
7654 MARTIN SALESMAN 7698 28-Sep-1981 1250 1400 30
7698 BLAKE MANAGER 7839 1-Mai-1981 2850 30
7782 CLARK MANAGER 7839 9-Jun-1981 2450 10
7788 SCOTT ANALYST 7566 19-Apr-1987 3000 20
7839 KING PRESIDENT 17-Nov-1981 5000 10
7844 TURNER SALESMAN 7698 8-Sep-1981 1500 0 30
7876 ADAMS CLERK 7788 23-Mai-1987 1100 20
7900 JAMES CLERK 7698 3-Dez-1981 950 30
7902 FORD ANALYST 7566 3-Dez-1981 3000 20
7934 MILLER CLERK 7782 23-Jan-1982 1300 10
select e.* from scott.emp e, scott.dept d
where e.deptno = d.deptno(+)
and d.deptno = 10 EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 9-Jun-1981 2450 10
7839 KING PRESIDENT 17-Nov-1981 5000 10
7934 MILLER CLERK 7782 23-Jan-1982 1300 10
As you can see, this (+) is very important
Regards
Dmytro -
Not able to compare varchar filed with number
tag3 is varchar filed can have number data
Below works good
comparison with 0 or 1 works also less than or equal operator works
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)<=24
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=0
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=1
>
greater or equal comparison doesn't work
doesn't work
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>=24
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=2
any number beyond 1 doesn't work
Error :ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
Not able to understand the logic of comparing the number with
same is tried with TO_NUMBER as well
works good
select I.* from ob_release_instruction I where to_number(i.tag3) > 0
Not working ( changed the value to more than 0)
select I.* from ob_release_instruction I where to_number(i.tag3) > to_number('24')
Not working
select I.* from ob_release_instruction I where to_number(i.tag3) > 24
Above two query is not working throwing below error
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:Here is the sample
tag3 is varchar filed can have number data
TAG3 VARCHAR2(30 CHAR)
column has few nulll, alpha numeric and number values
I want to check entered number is greater than 24 or not
Below works good
comparison with 0 or 1 works also less than or equal operator works
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)<=24
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=0
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=1
greater or equal comparison doesn't work
doesn't work
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>=24
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=2
select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>2
any number beyond 1 doesn't work
Error :ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
Not able to understand the logic of comparing the number with
same is tried with TO_NUMBER as well
works good
select I.* from ob_release_instruction I where to_number(i.tag3) > 0
Not working ( changed the value to more than 0)
select I.* from ob_release_instruction I where to_number(i.tag3) > to_number('24')
Not working
select I.* from ob_release_instruction I where to_number(i.tag3) > 24
Above two query is not working throwing below error
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
Maybe you are looking for
-
hi to all, i tried to do above type sequence which similar circket over sequence , i tried to do but increament and start with are allowing only integer value.. if anny one know the answer please share with us .... thnaks in advance ....
-
Just got a new Apple TV. I wondered if I really need it as my TV (Samsung 6 series) already got music streaming and internet capabilities. While I succeeded to a) get music played from Itunes, b) viewing photos and b) watching Youtube videos (a + b w
-
ITunes not marking podcasts as listened to
In the past, after synching, iTunes would list a podcast (that was listened to on the iPhone) as Read or listened to. This has been happening for months. It doesn't seem to do that anymore, and I constantly get the "iTunes has stopped updating... bec
-
How to configure edit mode in SAP screen help(F1)
Hi , We want to enable customization option in SAP screen. When i open any screen in SAP , we use F1 option for help, there we will see technical options , application help and all.. In this options we have customization showing in display mode
-
Colour is not right in illustrator cmyk pantone cyan and aqua
I am trying to work with colours in illustrator. I have set my colour mode to CMYK. I am trying to create a light aqua colour and just keep getting "out of gamut" errors. I tried using the colour book for Pantone and even entering the number of a