Crosstab - Comparing value with other fields
Post Author: Micho
CA Forum: General
Hi , I'm using CRXI Standard (eclipse plugin) and I have
some trouble to customize my crosstab.
Here is a simple example of what I'd like to doStructure of my resultset:ColumnsPARTNUMBERSECTOR_NAMEQUANTITYORDER_LATE_FLAG My crosstab looks like thisRows=partnumbercolumns=sector_namecalculated fields=sum(quantity) | sector_name1 | sector_name1 |----
partnumber | sum(quantity) | sum(quantity) | | | | What I need to do is that I want to display a "*" before the total quantity if a partnumber has it's ORDER_LATE_FLG set to true
if ({ORDERS.ORDER_LATE_FLAG} = "Y") then "*"+
ToText(CurrentFieldValue)
else ToText(CurrentFieldValue)The problem is that {ORDERS.ORDER_LATE_FLAG} always refer to the first record, and not always to the value of the Current record beeing processed.Is there's a solution to that ?? Thanks
Phil
Post Author: V361
CA Forum: General
you can try adding
whileprintingrecords;
before the formula.
Similar Messages
-
Get max value with other fields
Hi All,
I have a table as below
Name Value
A1 5
A3 10
A2 7
A2 9
A1 10
What I would like to get is the max(Value) and with grouping of its name
Name Value
A2 16
Thanks
Alex
Edited by: user8606416 on 01-Jun-2011 10:17
Edited by: user8606416 on 01-Jun-2011 10:26Depending on how you feel about ties one of:
SELECT name, value
FROM (SELECT name, SUM(value)
FROM table
GROUP BY name
ORDER BY 2 DESC)
WHERE rownum = 1
SELECT name, SUM(value)
FROM table
GROUP BY name
HAVING SUM(value) >= ALL (SELECT SUM(value)
FROM table
GROUP BY name)among many other methods. The first will pick a single arbitrary record in case of a tie, the seond will show all of the tied records.
John -
I got my iPhone 4S and I think I have a problem with it. Sound when locking and unlocking is quiet compared with other iPhone 4S. I compared it with others and really is a little quiet. Other people have confirmed it too. Other sounds may be better. No problem tones, watching videos. This problem or is it something normal?
I have this problem too, but it is intermittent. Sometimes the lock/unlock volume will drop to barely-audible, even though in settings the volume slider hasn't changed. If I then move the volume slider, it fixes the problem and the lock sounds jump back to normal, but then later on the problem will happen again.
-
How to modify field symbol of type Index Table with other field symbol of type any.
Hello Experts,
How is it possible to update an filed symbol table of type Index table with other filed symbol table.
e.g.
Field symbol : <lt_table1> type Index table.
Field symbol : <lt_table2> type Index table.
after some code...at run time these table filled like following.
<lt_tabel1 > has value fore column like c11 , c12 , c13
<lt_table2> has value for column like C11 , C12 , C13 , C14 , C15 . some extra values from <lt_table1>
Now I want to be modify <table1> one entires like C12 with <table2 > col C12.
how I can achieve this.
Regards,
Chetan.Hi,
did you try ASSIGN COMPONENT xx OF STRUCTURE <IT_TABEL1> TO <IT_TABLE2>.
xx will contain the number of the column
or maybe, if you have the description with a field catalog or other, that will be easier ..
regards
Fred -
Populate f4 values of a field based on value of other field
Hi,
I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
How will i achceive this requirement.
I got a link about the same but that is not using WDR_SELECT_OPTIONS
http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
I got another link
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
which I am going to try
Thanks
Bala Duvvuri
Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AMHi,
Using OVS you can achieve this., In OVS Event Handler read the value based on which you want to display F4 for other field and populate the values based on the first field.
this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
hope this helps u.,
Thanks & Regards,
Kiran -
How to populate value in other field after entering in one field?
hi everyone.
when i enter value in one field , automatically some xyz value should be populated in second field. How would this be possible without any enter? I mean i don want to perform any action like press enter or like that.Hello manumb6 ,
You coud also use "TimedTrigger" UI element for the same and you can specify the "delay" value in seconds.
Suppose if you enter x value.
After X seconds it will trigger the particular action associated to UI element.
My suggestion would be that you generate this UI element Dynamically when you expect end user to enter the value in the input field and system would keep invoking the method and as soon as your objective is met, Delete the UI element .
Hope this would help.
Regards
Anurag Chopra -
How can I make a dropdown box populate with values from other fields?
I am trying to create a NCAA bracket where they select teams from a dropdown menu. For example, they choose which teams win in game 1 and 2 through a dropdown box. The winner of games 1 and 2 then play each other, so how can I populate the dropbox with their selections for game 1 and 2?
Game 1 winner --
(game 9) |--- Game 9 winner
Game 2 winner --
Game 9 winner needs to populate with their selections from game 1 winner and game 2 winner.I would look at using the setItems Acrobat JavaScript method.
Have you considered using a Mouse Up action for "Game 1" and "Game 2" to fill "Game 9" -
How to insert or update comparing values with two or more table
Hai All
I have three or four table in my database.
Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
Table 2 acclempbarcode the fields are
emplcode number ,barcode number ....etc
so now my data is in text format and i have broke the date like this
0011221100112200100320100815
First 16 is barcode and next 8 is date and 4 is time and i have created a temp table and store the date and move to main table
My problem is the main table dailattend has no barcode so when i am going to insert or update i need to check whether the barcode is match with the emplcode in the main table
How can i write insert or update statement
The data is like this
00110022 is barcode,10-03-2010 is my date and 0815 is time so i need to insert into dailattend table so now i have emplcode in dailattend table so i need to compare the barcode belong the emplcode in the another table and i need to insert in the dailattend table
Pls give me some solution with example
Regards
Srikkanth.Mtry somthing like this
create table t1
as
select '0011221100112200' barcode,to_date('100320100815','ddmmyyyyhh24mi') dt
from dual
create table barcodetbl
emplcode varchar2(2000)
barcode varchar2(2000)
datetime date
merge into barcodetbl bc
using( select * from t1) x
on
(bc.barcode = x.barcode)
when matched
then update
set datetime = x.dt
when not matched
then
insert (emplcode,barcode,datetime)
values(1,x.barcode,x.dt)
/didn't realize that barcode is not in the main table.
something along the lines
Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
Table 2 acclempbarcode the fields are
emplcode number ,barcode number ....etc
merge into dailattend bc
using( select * from t1, acclempbarcode ac where t1.barcode = ac.barcode) x
on
(bc.emplcode = x.emplcode)
when matched
then update
set datetime = x.dt
when not matched
then
insert (emplcode,datetime)
values(1,x.dt)
/Alvinder
Edited by: alvinder on Mar 23, 2010 3:50 PM -
F4 help based on the Value in other field
Hello
I have a requirement in which there are two fields say field1 and field 2 in an ALV grid (in which new data can be entered). The F4 help of field 2 should be based on the value the user enters on field1.I have checked out the BC_ALV* programs but there are no clear help .
I have tried setting the parameter id of the first field value and then get that parameter id on_f4 event of the second field.But where can i set the parameter id of the first field . on_f4 of first field does not have its value and there is no event after_f4 . There is a parameter e_afterf4 in data change event but to tirgger that there shud be some event right.
Moreover If at all i get the first field value , i can use FM F4_int_table_value_request to show the refined f4 in field 2 . But I am passing the a field symbol table in my grids set table for first display . what can i pass as parameters here to the FM F4_int_table_value_request?hello Kallu ,
gt_f4_wa-getbefore = 'X'. --->refreshing layout before F4
gt_f4_wa-chngeafter = 'X'--> refreshing layout after f4.
see the sample code of F4...no need to pass dynpro details.....
*---locals.
data: lt_return type table of ddshretval,
ls_return type ddshretval,
begin of lt_kostl occurs 0,
kokrs type kokrs,
datbi type datbi,
bukrs type bukrs,
prctr type prctr,
end of lt_kostl,
ls_f4 type lvc_s_modi.
field-symbols: <ls_wa> type any,
<t_f4> type lvc_t_modi.
*---get defalut values.
refresh lt_kostl.
select kokrs
kostl as prctr
datbi
bukrs
from csks
into corresponding fields of table lt_kostl
where kokrs eq g_kokrs
and datbi ge sy-datum
and bukrs eq yfit_00049-bukrs.
*---call fm to display int values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'YFIT_00050-PRCTR'
window_title = 'Profit Center list'
value_org = 'S'
display = space
tables
value_tab = lt_kostl
return_tab = lt_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
read table lt_return into ls_return
with key fieldname = 'F0004'.
if sy-subrc eq 0.
assign er_event_data->m_data->* to <t_f4>.
ls_f4-fieldname = e_fieldname.
ls_f4-row_id = es_row_no-row_id.
ls_f4-value = ls_return-fieldval.
ls_f4-error = space.
ls_f4-tabix = space.
ls_f4-style = space.
ls_f4-style2 = space.
ls_f4-style3 = space.
ls_f4-style4 = space.
append ls_f4 to <t_f4>.
endif.
endif.
er_event_data->m_event_handled = 'X'.
regards
Prabhu -
SQL: comparing date with datetime field
I'm having a brain fart as I assume this is really simple.
Given that I have the date in the format of yyyy/mm/dd, how
do I put that
into a sql query that compares that to the datetime field?
It appears the datetime field, by default, uses this format:
m/d/yyyy
hh:mm:ss am
-DarrelIf your date formats are different you will have to use CAST
or CONVERT
functions as you state you already have. If this works then
stick with it.
You may also need to use a SET DATEFORMAT command. See below:
http://msdn2.microsoft.com/en-us/library/ms189491.aspx
Dates in SQL Server can be a bit of a pain to work with. It
is usually best
practice to store your DateTime data in raw format and use
CAST or CONVERT
functions in your Stored Procs to get the correct results.
Pat.
"darrel" <[email protected]> wrote in message
news:ftloim$jv4$[email protected]..
>
>> What dbms?
>
> t-sql (MSSQL)
>
> For now, via string functions, I rearrange the date/time
format manually,
> and then use the CAST statement in the SQL query. Not
pretty, but seems to
> work.
>
> -Darrel
> -
How to compare value in input field to value in database?
Hi all. I need to clear up if the value in the input field (e.g. input_field) is equal to at least one record in the field (e.g. name) in database table (e.g. customers), or not. The code should be like this:
IF...
message001. "(there's such a record in database)
ELSEIF...
message002. "(there's no such record in database)
ENDIF.
thanks all.Hi,
I think u r asking about validating the selction screen and displaying a mess if that input is not in the DB right?
AT SELECTION-SCREEN ON s_matnr.
*Validate material no details
PERFORM validate_matno.
FORM validate_matno.
SELECT SINGLE matnr INTO v_matnr
FROM mara
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE i128.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM.
Make sure that u are validating against the header table.
say eg if u wnat t validate matnr in marc, then do as below.
SELECT-OPTIONS: s_matnr FOR marc-matnr. "Material No
AT SELECTION-SCREEN ON s_matnr.
*Validate material no details
PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
SELECT SINGLE matnr INTO v_matnr
FROM <b>mara</b>
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE i128.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM.
Dont select from marc.
Hope this is clear. -
hii
How i can get the in single table Idoc number with BELNR feild data .
I need get the data like this in single transaction code . can some body help in this ??
Thankshii
I have approximately 10,000 IDOCs .. Its not possible to open individually the and get the field data for IDOCS.
So how i can acheive this in single shot or there is any table ..
Thanks -
Show Field Values if other Field Value Different
Hey,
I am using TOAD for Oracle 10.5. There is a select statement that is not populating requested results.
Data:
JOB SAL
PRESIDENT 5000
MANAGER 2850
MANAGER 2450
MANAGER 2975
ANALYST 3000
ANALYST 3000
CLERK 800
CLERK 1100
CLERK 950
CLERK 1300
SALESMAN 1600
SALESMAN 1250
SALESMAN 1250
SALESMAN 1500Select Statement
SELECT JOB, SAL
FROM EMP
WHERE JOB IN (
SELECT JOB
FROM EMP
GROUP BY JOB
HAVING COUNT(*) > 1)
ORDER BY JOB;Once select statement executed only JOB = PRESIDENT record is removed, not results needed.
JOB SAL
MANAGER 2850
MANAGER 2450
MANAGER 2975
ANALYST 3000
ANALYST 3000
CLERK 800
CLERK 1100
CLERK 950
CLERK 1300
SALESMAN 1600
SALESMAN 1250
SALESMAN 1250
SALESMAN 1500Correct Data, JOB values PRESIDENT and ANALYST records should not appear.
PRESIDENT does not appear but the ANALYST value shows because the statement
is producing duplicate JOB values. I would like to show records only if the JOB values have
different SAL values, not duplicate JOB values. Only if the SAL value is different based on JOB.
JOB SAL
MANAGER 2850
MANAGER 2450
MANAGER 2975
CLERK 800
CLERK 1100
CLERK 950
CLERK 1300
SALESMAN 1600
SALESMAN 1250
SALESMAN 1250
SALESMAN 1500I hope someone can help me out on this one.Hi,
COUNT (*) tells how many rows are in a group. It has nothing to do with any values in any columns.
I think you want COUNT (DISTINCT sal) in this case. It will tell you how many different values of sal are in the group.
SELECT JOB, SAL
FROM EMP
WHERE JOB IN (
SELECT JOB
FROM EMP
GROUP BY JOB
HAVING COUNT (DISTINCT sal) > 1 -- Changed
ORDER BY JOB;Edited by: Frank Kulash on Dec 9, 2010 10:34 AM
Added example. -
Compare values of one field and populate another field
Hi,
I have a requirement something like this:
Taking example of carrid and connid fields of table sflight.
lets say carrid has values like AABB, CCDD etc in sflight table.
Now i would like to read the first two characters of carrid's values(only AA of AABB or CC of CCDD) and based on this i want to populate connid. Any suggestions please?hi,
if carrid + 0( 2 ) = 'AA' ( first two letters..)
try to use offset function....
rgds,
raj -
How to replace the string of column value with other column value in same table
I have a temp table which contains
Id Name CTC Address Content
1 Ross $200 6th block Dear #Name your CTC is #CTC and your address is #address
2 Jhon $300 1oth cross Dear #Name your CTC is #CTC and your address is #address
Now i want to select content so that it should get replace with the respective columns and final output should come like this
Dear Ross your CTC is 200 and your address is 6th block
Dear Jhon your CTC is 300 and your address is 10th cross
Kindly suggestI think RSingh suggestion is ok ... what do you mean by another way? ...maybe something more generic?
maybe build a table whith the list of col you need to "replace" and dinamically build the replace query ...
declare @colList table(colName varchar(100))
insert into @colList
select 'name'
union all select 'ctc'
union all select 'address'
declare @cmd varchar(2000)
select @cmd='select '+ (select 'replace(' from @colList for xml path('') +' content '+
(select ',''#'+ colName +''', '+ colName +')' from @colList for xml path(''))
+' from YOURTABLENAME '
exec (@cmd)
or your request was different ?
Maybe you are looking for
-
Error while invoking database stored procedure while mapping to varchar,int
Hi I am using Oracle SOA 11g 11.1.1.4 In that i am calling db procedure.The procedure is taking input parameters int and varchar and nillable is true for both cases.Its a sybase data base. I am calling this db proc through db adater.Here I am mapping
-
Printer Model: HP Officejet Pro 8500 A910 Operating System: MS Windows XP, windows 7 Connection Method: Wireless via AT&T netgear router Problem Description: i got error "unable to communicate with printer".i checked several ways.but it i
-
ZFS root filesystem & slice 7 for metadb (SUNWjet)
Hi, I'm planning to use ZFS root filesystem in Sun Cluster 3.3 environment, as written in documentation when we will use UFS share diskset then we need to create small slice for metadb on slice 7. In standar installation we can't create slice 7 when
-
Itunes freezes if iphone is connected multiple times?
One of the many annoyances of my phone. Currently running windows vista with iso4 and the lastest version of itunes. For some reason I've found that when my computer first starts up my iphone connects to itunes fine, will sync, stay connected, everyt
-
Can you combine ('glue') parts of one song together
There are many artist who cut their songs in more parts. Those parts are separate files, so when you play shuffle mode, you first hear one part of that specific song, than other songs, then another part of the song, then other songs, then again a par