Validate field with value range
Hello,
I need to validate a field. This field's domain is defined in the Dictionary as a Value Range (i. e. 'A', 'B', etc.).
How can I do it generically, that is, when I update the domain, my code will still validate correctly the values?
Thank you!
hi,
Write a select on DD07L table by passing DOMNAME and get DOMVALUE_L & DOMVALUE_H which has the domain values and validate accordingly ... You can get the domain name of a data element from DD04L table where pass the data element name in ROLLNAME and get DOMNAME ...
Regards,
Santosh
Similar Messages
-
Search help on a field with value range
Hi,
I have a z-table. One of its fields has a z-data element with z-domain which has a value range. I have a requirement to add a search help on selection screen field which is parameter for mentioned field of my z-table. How can I do that?
Tnx in advance,
NatiHi,
Where you want to add the search help, i mean in report or in screen painter.
In Screen painter, you can take the reference of Z-Data Element by Dictionary option in Screen layout.
If it is report, you can use F4 function module(F4IF_INT_TABLE_VALUE_REQUES) or can creat the elementary search help in DDIC and give it as MATCHCODE OBJECT in PARAMETER statement.
Regards,
Chandu -
A function instead of UNBOUNDED PRECEDING (like "Last field with value=0")
Hello,
I have a table with many rows. The attributes of the table are code, month and value.
For each code there are 12 months and 12 values.
No I want to add the gaps between the months...
Is it possible to count the following gaps between the different rows...?
For example:
Original table1:_
code, month, value
1,1,20
1,2,0
1,3,30
1,4,0
1,5,40
1,6,0
1,7,0
1,8,20
1,9,0
1,10,10
1,11,0
1,12,0
5,1,0
5,2,20
5,3,10
description:*
january value = 20
february value = 0 (=>count this gap => new value 1 )
march value = 30
april value = 0 (=>count this gap => new value 1 )
may value = 40
june value = 0
july value = 0 (=>count this two following gaps => new value 2 )
agust value = 20
september value = 0 (=>count this gap => new value 1 )
october value = 10
november value = 0
december value = 0 (=>count this two following gaps => new value 2 )
New target table:_
code, month, value
1,1,20
1,2,*1*
1,3,30
1,4,*1*
1,5,40
1,6,0
1,7,*2*
1,8,20
1,9,*1*
1,10,10
1,11,0
1,12,*2*
5,1,*1*
5,2,20
5,3,10
I tried this code:
select code, month
sum(value) over (
order by month
rows between unbounded preceding and current row
*) as final_value*
from table1 order by month;
This adds all following fields cumulative from beginning to current_row. But I need this adding only for the following gaps... then start with countin by 0.
I need only the following like in the example on top. Maybe is there an other function like decode to count only the following gaps...!?
A function instead of unbounded preceding....like "*Last field with value=0*" or something... ?
Best regards,
TimTimB83 wrote:
I have a table with many rows. The attributes of the table are code, month and value.
For each code there are 12 months and 12 values.
No I want to add the gaps between the months...
Is it possible to count the following gaps between the different rows...?
For example:
Original table1:_
code, month, value
1,1,20
1,2,0
1,3,30
1,4,0
1,5,40
1,6,0
1,7,0
1,8,20
1,9,0
1,10,10
1,11,0
1,12,0
5,1,0
5,2,20
5,3,10
description:*
january value = 20
february value = 0 (=>count this gap => new value 1 )
march value = 30
april value = 0 (=>count this gap => new value 1 )
may value = 40
june value = 0
july value = 0 (=>count this two following gaps => new value 2 )
agust value = 20
september value = 0 (=>count this gap => new value 1 )
october value = 10
november value = 0
december value = 0 (=>count this two following gaps => new value 2 )
New target table:_
code, month, value
1,1,20
1,2,*1*
1,3,30
1,4,*1*
1,5,40
1,6,0
1,7,*2*
1,8,20
1,9,*1*
1,10,10
1,11,0
1,12,*2*
5,1,*1*
5,2,20
5,3,10
...Tim,
you should post this question on the "SQL and PL/SQL" forum since it's a typical SQL question.
There are probably much better ways to accomplish this and the guys over there will tell you, but here are two examples that might get you started:
1. Pre-10g without MODEL clause
with t as (
select 1 as code, 1 as month, 20 as value from dual union all
select 1 as code, 2 as month, 0 as value from dual union all
select 1 as code, 3 as month, 30 as value from dual union all
select 1 as code, 4 as month, 0 as value from dual union all
select 1 as code, 5 as month, 40 as value from dual union all
select 1 as code, 6 as month, 0 as value from dual union all
select 1 as code, 7 as month, 0 as value from dual union all
select 1 as code, 8 as month, 20 as value from dual union all
select 1 as code, 9 as month, 0 as value from dual union all
select 1 as code, 10 as month, 10 as value from dual union all
select 1 as code, 11 as month, 0 as value from dual union all
select 1 as code, 12 as month, 0 as value from dual union all
select 5 as code, 1 as month, 0 as value from dual union all
select 5 as code, 2 as month, 20 as value from dual union all
select 5 as code, 3 as month, 10 as value from dual
r1 as (
select
case
when value = 0
then 1
else 0
end as is_gap
, case
when value != 0
then rownum
else null
end as grp_info
, code
, month
, value
from
t
r2 as (
select
last_value(grp_info ignore nulls) over (partition by code order by month) as grp
, is_gap
, code
, month
, value
from
r1
select
code
, month
, case
when value = 0
and (lead(value) over (partition by code order by month) != 0 or
lead(value) over (partition by code order by month) is null)
then sum(is_gap) over (partition by code, grp)
else value
end as value
from r2;2. 10g and later with MODEL clause
with t as (
select 1 as code, 1 as month, 20 as value from dual union all
select 1 as code, 2 as month, 0 as value from dual union all
select 1 as code, 3 as month, 30 as value from dual union all
select 1 as code, 4 as month, 0 as value from dual union all
select 1 as code, 5 as month, 40 as value from dual union all
select 1 as code, 6 as month, 0 as value from dual union all
select 1 as code, 7 as month, 0 as value from dual union all
select 1 as code, 8 as month, 20 as value from dual union all
select 1 as code, 9 as month, 0 as value from dual union all
select 1 as code, 10 as month, 10 as value from dual union all
select 1 as code, 11 as month, 0 as value from dual union all
select 1 as code, 12 as month, 0 as value from dual union all
select 5 as code, 1 as month, 0 as value from dual union all
select 5 as code, 2 as month, 20 as value from dual union all
select 5 as code, 3 as month, 10 as value from dual
select
code
, month
, value
from
t
model
partition by (code)
dimension by (month)
measures (value, 0 as gap_cnt)
rules (
gap_cnt[any] order by month =
case
when value[cv() - 1] = 0
then gap_cnt[cv() - 1] + 1
else 0
end,
value[any] order by month =
case
when value[cv()] = 0 and presentv(value[cv() + 1], value[cv() + 1], 1) != 0
then presentv(gap_cnt[cv() + 1], gap_cnt[cv() + 1], gap_cnt[cv()] + 1)
else value[cv()]
end
);Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Custom field in SRM as a dropdown field with values stored in R/3
Hi all,
I need help with custom drop-down field in SRM 5.0 shopping cart. We need to create custom field called Location in SRM goods receipt transaction. And this location field will be a drop-down field that will be filled with values from locations stored in R/3. I would really appreciate if someone can help me achieve this.
Regds,
KimHi,
Just attach a custom search help to this field and then in the search help EXIT(RFC enabled Function module) write the logic to reterive the values from R/3.
BR,
Disha.
Pls reward points for useful answers. -
Can't initialise dialog screen fields with values
Hi.
I have a dialog screen with 10 fields named
TXT_FILEDESC1, TXT_FILEDESC2, ...TXT_FILEDESC10.
I tried to initialise these 10 fields with the following codes, but I got an error message:
DATA: TXT_FILENAME TYPE ZDM_OF-FILE_NAME,
TXT_FILEDESC TYPE ZDM_OF-FILE_DESC.
FIELD-SYMBOLS: <FS_TXT_FILENAME>, <FS_TXT_FILEDESC>.
MODULE PBO_9000 OUTPUT.
SET PF-STATUS 'STATUS_9000'.
SELECT FILE_NAME FILE_DESC FROM ZSCSDM_OF INTO TABLE SCREEN_INIT.
LOOP AT SCREEN_INIT INTO SCREEN_INIT_LINE.
SCREEN_INIT_NO = SY-TABIX.
CONCATENATE 'TXT_FILEDESC' SCREEN_INIT_NO INTO TXT_FILEDESC.
ASSIGN (TXT_FILEDESC) TO <FS_TXT_FILEDESC>.
MESSAGE E002(ZMSGGARY) WITH TXT_FILENAME.
<FS_TXT_FILEDESC> = SCREEN_INIT_FILEDESC.
ENDLOOP.
ENDMODULE. "PBO_9000 OUTPUT
Runtime Error - A new value is to be assigned to the field "<FS_TXT_FIELDDESC>", although this field is entirely or partly protected against changes...
Could anyone share why I got the above error message when i try to run the program (Execute --> In A New Window)? Thanks.
nullI got the reason for the error. It's because I did not clear the contents of TXT_FILENAME before the next loop.
LOOP AT SCREEN_INIT INTO SCREEN_INIT_LINE.
<b>TXT_FILENAME = ''. ==> This solves the problem.</b>
CONCATENATE 'TXT_FILEDESC' SCREEN_INIT_NO INTO TXT_FILEDESC.
ENDMODULE. "PBO_9000 OUTPUT -
Is it possible to prefix a field with value in search layout in CRMOnDemand
Hi Folks,
We have a requirment where customer wants to prefix Service Request No field with "489124-" in the search layout,so that the agent can type in the remaining part of the SR number in the search layout w/o having to type "489124" every time as it is same for every SR that is created in the system.
Any help/ thoughts / ideas are appreciated.
Cheers!!!
Deepak Veearavalli.
Edited by: Deepak Veeravalli on Nov 30, 2010 1:34 PMHi,
Thank you for your response. Am sorry I couldn't get what exactly you meant. I Would be greatful if you could provide/elaborate in detail as how it needs to be done. Also please provide an example as how to do that.
Cheers!!!
Deepak. -
Auto populate field with value same as one in a previous existing field
Hi,
Suppose I have only two fields in an acrobat form, one is name A and aonther is B. I want A and B has the same value.
If I input a date value into field A like November 20, 2010, is that possible the field B can be auto filled with the same value as that in the A field?
How about other type of data such as number?
What should I write in validation or calculation area in the field properties of B?
Thanks and looking forward to getting help from the PDF expert.
wayneThe attached demonstrates global data binding and populating text, numeric and date fields on exit and calculate events.
The file Population-and-binding.xml used in the preview to demonstrate global data binding looks like this.
Steve -
CRM Survey Suite - Validate fields with custom Java Function
Hi all,
Does anybody now how to validate the survey fields when pressing a custom button and before submitting it to the CRM database?
If I add a custom field, it appears in the html as:
<a onMouseOver='return true;' href="javascript:void(0)" onClick="return htmlbSL(this,2,'SUBMIT:SUBMIT')" class="sapBtnStd" id="CHECK_VALUES"><nobr>CheckValues</nobr></a>
Which makes impossible to handle the event with a client side function defined in java script in the html code.
I've tried to setup the EXAMPLE_DYNAMIC_SURVEY, but I wasn't successful.
Any tips?
CRM5.0
Regards,
DoraFYI
Note 945112 "Addition of Javascript validation to onSubmit event" was created. -
Table with a dropdown field with values.....
Friends, I opened this new thread with my good explanation whatim looking for . sorry for this.
I have a table:
col1 col2 col3
row1 r1c1 r1c2 r1c3
row2 r2c1 r2c2 r2c3
row3 r3c1 r3c2 r3c3.
I need col2 to be dropdown. Here when doinit default data is being passed to this table. Now when the WDA loads, i want col2 to be dropdown, but with only one value. whatever i have in backend.Here intially i want to disable col2. User should not hcange it.
But when i hit ADDNEWROW button, it shoudl create row4, with some (i m writing a query to fetch col2 values) values in the dropdown. User should be able to select any value here.
The r1c2 and r2c2, r3c2, should not change on ADDNEWROW. they should remain the same.
Hope this time i explained you correctly, and im expecting ur replies friends...
Kindly respondg back to me. thanks to all in advance,
NirajaHi Niraja,
Please refer the code below for filling drop down in table.... this is hard coding i.e. i m filling value directly with out using database table .now wht u have to do is that you have to create an internal table with two column one key and one value. select data from database into internal table. thn just replace hard coding with the value and key column of internal table
Please note SAP doesnt recommend usage of select query in WD abap. use any FM instead.
DATA LR_NODE_INFO TYPE REF TO if_wd_context_node_info.
data ls_value type wdy_key_value.
data lt_value_set type wdy_key_value_table.
ls_value-key = 'a'.
ls_value-value = 'APPLE'.
append ls_value to lt_value_set.
ls_value-key = 'b'.
ls_value-value = 'BANANA'.
append ls_value to lt_value_set.
ls_value-key = 'c'.
ls_value-value = 'GRAPES'.
append ls_value to lt_value_set.
ls_value-key = 'd'.
ls_value-value = 'MANGO'.
append ls_value to lt_value_set.
lr_node_info = wd_context->get_node_info( ).
lr_node_info = lr_node_info->get_child_node( 'CN_UITABLE' ).
lr_node_info->set_attribute_value_set( name = 'CA_COLUMN2' value_set = lt_value_set ).
As suggested by Stefan you can make the read only field by using enable property.
regards Pranav
Edited by: Pranav Nagpal on Nov 21, 2008 5:55 AM -
Infosource Fields with values from multiple Data Sources
Hi Experts,
My question is:
i have to load values of only few fields of 0LIS_11_VAHDR and few fields of 0LIS_11_VAITM into one infocube.
If i just create one infosource with those fields only in communication structure, but then i can assign only one data source at time, how to load values from another datasources at same time?
Can i do it using single infosurce? and if yes any guideline....
Thanks......My dear, the problem is that even for the first solution (only one infosource) you have to manage two separate dataloads, since linking several datasources to one infosource means only that you can manage a unique communication structure, but different transfer rules/structures and, avove all, two different infopackages !
So, you have anyway to face the automation issue of your dataloading.
My suggestion has been more functional and conceptual than technical (for which I gave the same answer, that is, "you can do it"): you are not loading a master data source (the same object 0MATERIAL) with attributes, texts and hierarchies (and in this case it's obvious that you have to use one infosource); here you want to use the infosource dedicated to the header flow to load item info too (and you will have to use the same and unique update rules).
Again, no problem from a technical point of view, but I guess that someone who will look into your architecture, probably, will have something to say with this kind of choice !!!
Bye,
Roberto -
Display a generated query in a text field with values
Hello, I generate a query based on pl/sql. This works fine, but how can I display the query with the values from an item?
i.e. in my query i have select * from a_table where name = :p1_name
if i want to display the query in the correct way " select * from a_table where name = 'JOHN'.
When i try this i only display select * from a_table where name = :p1_name, not the value i have applied to the item.
Hope someone can help..htp.p('select * from a_table where name = ' || :P1_ENAME);
Scott -
To populate another alv grid's field with value selected from search help
Hi,
I have two fields in alv grid, first column holds code and the second one holds code's description. Also I have a search help includes these two fields. The search help is attached to the first column. The requirement is, when I select a code from the search help, second column should be populated with selected code's description.
Any help will be appreciated. Thanks..Hi,
have a look into Report: BCALV_EDIT_03.
Regards, Dieter -
Validate field value is number or varchar
Hi All,
I want to validate field's value is number/varchar by single line query. is it possible?
e.g.
select is_number(fieldval, 'Number','Varchar') from dual;
Thanks in advance.
- Hiren ModiHi,
If you cannot use regexps (due to your DB-version perhaps) you could do something like:
MHO%xe> create table t as (
2 select 'YES' col from dual union all
3 select 'NO' from dual union all
4 select '1' from dual union all
5 select '2' from dual union all
6 select '3' from dual union all
7 select '4' from dual union all
8 select '5' from dual union all
9 select '6' from dual union all
10 select '7' from dual union all
11 select 'NO' from dual union all
12 select 'YES' from dual union all
13 select 'ABCED' from dual union all
14 select '33' from dual union all
15 select '5699' from dual union all
16 select 'KPKHIH' from dual union all
17 select 'ASDFSDAFSD' from dual union all
18 select 'ASDFASDFSDFSDFSDAFASD' from dual union all
19 select '212121' from dual union all
20 select '9689898' from dual union all
21 select '6545454' from dual union all
22 select '212121' from dual union all
23 select '5745757' from dual union all
24 select '9857441969*' from dual
25 );
Tabel is aangemaakt.
MHO%xe> create or replace function is_number( p_string in varchar2 )
2 return varchar2
3 deterministic
4 as
5 l_num number;
6 begin
7 l_num := p_string;
8 return 'Number';
9 exception
10 when others then return 'Varchar2';
11 end;
12 /
Functie is aangemaakt.
MHO%xe> select col, is_number(col) dtype from t;
COL DTYPE
YES Varchar2
NO Varchar2
1 Number
2 Number
3 Number
4 Number
5 Number
6 Number
7 Number
NO Varchar2
YES Varchar2
ABCED Varchar2
33 Number
5699 Number
KPKHIH Varchar2
ASDFSDAFSD Varchar2
ASDFASDFSDFSDFS Varchar2
DAFASD
212121 Number
9689898 Number
6545454 Number
212121 Number
5745757 Number
9857441969* Varchar2You could index is_number as well.
See: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:15767849694647 -
hi
i am changing the table field domain value range. after changing i am getting the warning msg like below. if i ignore it and transport odes it affect anyways.
and also does anyone tell me when we transport only the structure get transported or even the values get transported?
<b>The key length, i.e. the sum of the field lengths of all the key fields of the table,
is more than 120 bytes.
Note the following restricted fuctionality for this table:
- Table contents cannot be transported by specifying key values, at
best by specifying generic key values with a maximum length of 120
bytes.
- The table may not be used as the base table of a lock object.</b>Hi ,
Instead of changing the domain value range ,
create a Z Domain group say copy it from the existing one and increase the range .
This will reflect on the field name in the Ztable . Do activate and adjust database from SE14 on the table .
Remember that the new range of values will be overlapped to the existing version in the target system .
for this what u have to do is for the existing domain field where used list see the tables in which it is to be used .
and then if its not causing any inconsistencies u can transport or else the dependent tables which are referring to the domain group have to be modified .
regards,
Vijay -
How to attach value range table to dropdown list box
Hi there,
could u please explain me how to attach a value range table to dropdown list box (i.e I/O box with dropdown attribute as list with key).
if possible please explain me with a sample code.
Thanks in advance.
-Tulasi.hi ...if the associated domain of the field that u are using as i.o field has value range the same will come as drop down list...u u select the list box option and click from dictionary check box on the attributes...
To check if the domain has it or not...go to the domain..click on value range..u can see thr,...if values are not thr u can giv the same...
Or if u are not refering to dictionary type then use fm VRM_SET_VALUes
reward if the abv is helpful..
Maybe you are looking for
-
Professional way to call that frame on button click?
Hi Nice to get new look and feel for forum :) Wel my question is I have a frame which has many buttons textfields labels and other components too. On clicking one of the button I am opening a frame which is like calculator(display is same as calculat
-
Hi Can you help me to understand what is the mechanism behind deletion/removal of shopping cart lines from sourcing cockpit once a PO is successfully created.What triggers the removal of lines? We are in Classic Scenario. Regards Sathya
-
When I restore my iPhone 3g with iTunes and it is finished there is a advice with the error 17. I don't know the problem. Can anyone help me?
-
Hi Can anyone tell me how I can disable the HTTP OPTIONS method in Sun One Web Server 6.0 SP4. Thanks
-
OSD Logs not getting written to SLShare
We have the SLShare defined in the CustomSettings.ini as.. SLShare=\\<servername>\Logs$ SLShareDynamicLogging=\\<servername>\OSDLogs$ Logs used to get written to both locations with no issue. Over the past couple of months, no logs get written to ei