Help view to get two table entries in search help
Hi,
I have created the help view for join two tables and that help view was called in the selection method for creating search help of the custom table field. since it has show inthe selection screen , it is fetching only one table entries. and the shown entries are displaying but not passing.
Please provide the steps to get the two table entries and the displayed entries should pass.
Thanks in Advance,
siva
Hi sivanag,
1. Try your view with SE16/SE16N to see if it really finds what you expect
2. Use the same data elements in help view as on selection screen
3. read documentation and F1 help on all fields you see in the search help definition - especially only field marked as EXPORT parameter will be put back on screen.
But, sincerely, I don't know what your selection-screen looks like.
Regards,
Clemens
Similar Messages
-
How to CREATE VIEW to merge two tables each of which has CLOB-typed column
I failed in creating a view to merge two tables that have CLOB-type column each.
The details are:
Database: Oracle 9i (9.2.0)
Two tables "test" and "test_bak", each of which has the following structure:
ID Number(10, 0)
DUMMY VARCHAR2(20)
DUMMYCLOB CLOB
The following operation fails:
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test
union
select id, dummy, dummyclob from test_bak;
I was announced:
select test.id, test.dummy, test.dummyclob
ERROR in line 2:
ORA-00932: inconsistent data type: required - , but CLOB presented.
But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
1) one table, with CLOB-typed column
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test;
2) two tables, without CLOB-typed columns
create view dummyview (id, dummy) as
select id, dummy from test
union
select id, dummy from test_bak;
I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
many thanks in advanceDong Wenyu,
No.
But you could do this:
SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
FROM your_table1 tab1, your_table2 tab2, (
SELECT primary_key, ...
FROM your_table1
UNION
SELECT primary_key, ...
FROM your_table2
) source
WHERE source.primary_key = tab1.id (+)
AND source.primary_key = tab2.id (+)
In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
d. -
ORA-01776: I can't insert on a view comprised by two tables
Good morning:
I'm trying to do an insertion on a view comprised by the join of two tables (departments and employees) and it failed.
The view is this one:
CREATE OR REPLACE FORCE VIEW "EMPDPTO" ("EMPLOYEE_ID", "LAST_NAME", "EMAIL", "HIRE_DATE", "JOB_ID", "DEPARTMENT_ID", "DEPARTMENT_NAME") AS
SELECT employee_id, last_name, email, hire_date, job_id, d.department_id, department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
My insertion command
INSERT INTO empdpto
VALUES(743, 'Bermejo', '[email protected]', '12/12/09', 'IT_PROG', 10, 'Administration');
throws a ORA-01776: it's not possible to modify more than one base table through a join union.
On the other side I've seen in documentation that in certain circunstances is possible to do an insertion on a complex view.
Is it possible to do an insertion on a view comprised by two tables?. Under what circunstances?.
ThanksFrom SQL Reference CREATE VIEW section Notes on Updatable Views http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8004.htm#i2065510
>
If you want a join view to be updatable, then all of the following conditions must be true:
The DML statement must affect only one table underlying the join.
For an INSERT statement, the view must not be created WITH CHECK OPTION, and all columns into which values are inserted must come from a key-preserved table. A key-preserved table is one for which every primary key or unique key value in the base table is also unique in the join view.
For an UPDATE statement, the view must not be created WITH CHECK OPTION, and all columns updated must be extracted from a key-preserved table.
>
The first condition is not true for the view you have created.
Edited by: P. Forstmann on 26 janv. 2010 20:17 -
Passing two export parameter from search help exit
hi gurus,
i need your help
i need to import two field from search help exit into two screen field.
eg.
parameters : p1 type p1 matchcode id s1,
p2 type p2,
on f4 for p1 i am displaying two field in search help output, p1 and p2.
i am using search help exit FM to pass value from s1, not using any view or table infact extracting data using other function module. i am filling.
what i want , when i make a selection on f4 for p1, p2 should also be filled from the same search help s1.
i allready tried memory id-export option in my search help exit at RETURN event but that does not fits well.
ASAP reply higly appreciated
will reward point for surethanks a lot it worked out by defining search help for structure which contain these two fields.
what i was missing was interface link.
mandy -
Note 1681589: Missing entry in search help of RPUTMSE0 report
Hola Buena tardes,
Estamos aplicando la Note 1681589: Missing entry in search help of RPUTMSE0 report; En la version 4.7 hace referencia a un valor que no existe.
Table: T52B5
TMS1 RPUTMSE004 TOA C111E0
Puede ser que el valor correcto es: sobra un número "1"
Table: T52B5
TMS1 RPUTMSE004 TOA C11E0
Saludos,
JorogapeHola,
En la vista V_T52B4 la encuentro como:
TOA C111E0 Modelo 111 - Impuesto sobre la renta PF
Saludos,
Carlos. -
Help needed with comparing two tables
Hi
I have two tables which have same column names but different entries in each one of them and some common entries between the two tables.
Table A has all the entries of Table B and some extra ones.. and I need SQL to give me those extra ones that are not in Table B
Table A columns names (col1, col2 col3 ...) and data
col1 col2 col3 col4 col5 col6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
d1 d2 d3 d4 d5 d6
All columns are varchar2
Table B columns names ( col1,col2 ..) and data
col1 col2 col3 col4 col5 col6
a1 a2 a3 a4 a5 a6
c1 c2 c3 c4 c5 c6
All columns are varchar2
So the answer I would like to get is
b1 b2 b3 b4 b5 b6
d1 d2 d3 d4 d5 d6
because these two entries are not in Table B but in Table A
Appreciate if you can help me with this because I have millions of records that I need sort through and get the entries and cannot be done manually..
Thanks in Advance
KrisHere is an example:
SELECT 'X' FROM DUAL UNION SELECT 'Y' FROM DUAL
MINUS
SELECT 'X' FROM DUAL;
Y -
How to get customizing table entries in to dropdown list
Hello All,
I have field in my screen from customizing table. How do i get values in this field when the presses drop down button?
I know that we can do it by entering fixed values to that field and also when we create a check table we will get values.
Is there any other way to get the values?
Can any one help me.
Regards,
Lisa.Hi,
I have 2 solutions for your post, one go for DROP DOWN BOX if you are having fixed input values.
And two go for search help if you want multiple entries has to be displayed in your field form your customized table.
If you want procedure decide your option and revert me i will send you.
Good Luck
Thks -
Please help me in joining two tables?
Hi ..
I am using oracle 11g.
I have two tables with below description
1.esb_v_study_personnel
study_code_alias varchar2,
site_id number ,
role_at_site_level_desc varchar2
2. esb_v_study_site
study_code_alias varchar2
site_id
I am trying to count the role_at_site_level_desc where it is'Field Monitor' or 'Primary Monitor'
so i wrote the below query
select study_code_alias,site_id,
(role_at_site_lvl_desc) no_of_study_monitors
esb_v_study_site_personnel
study_code_alias IN &arg_trial_code
role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
group by study_code_alias,study_site_id
order by study_site_id
by using the above i am getting 1617 rows.
but i want map the resultant site_id
esb_v_study_site having 1647 rows. So i want to get all the site_id's in esb_v_study_site table by mapping to above query.
Can you guide me on this,
I have tried with left outer join but still iam getting 1617 rows.
select study_code_alias,
(role_at_site_lvl_desc) no_of_study_monitors
esb_v_study_site_personnel
study_code_alias IN &arg_trial_code
role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
group by study_code_alias,study_site_id
order by study_site_id) a
LEFT OUTER JOIN
ON a.trial_no=d.trial_no and a.study_site_id=d.study_site_id
where d.study_code_alias in &arg_trial_code
group by d.study_code_alias,d.study_site_id,a.no_of_study_monitors
order by d.study_site_id
Please help me on this???I'm not quite sure, since your query seems missing some smaller parts. It was probably crumbled during some copy&paste to this forum.
I guess that the reason is either that the left join is done after the group by or that the count on the column will not count NULL values that might be created by the outer join.
Maybe you can start with the following query and give us the results and tell us if it is still wrong and what the expected result would be.
example (not syntax tested)
select d.study_code_alias
,d.site_id
, count(a.role_at_site_lvl_desc) no_of_study_monitors
, count(distinct a.role_at_site_lvl_desc) no2
, count(*) no3
from esb_v_study_site d
left join esb_v_study_site_personnel a on a.trial_no=d.trial_no and a.study_site_id=d.study_site_id and a.role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
where d.study_code_alias IN (&arg_trial_code)
group by d.study_code_alias,d.study_site_id
order by d.study_site_id;
btw: If you read the FAQ in the upper right corner, there it says how to post good looking sql code. -
hi,
i have created a view between two tables.
1. i want to know whether will i get the upto date data if i fetch data from the view.?
2. Does view fetch data from table every time when it is used or it stores it in buffer or something like that.? If it fetches every time ,then what is the advantage over accessing tables directly using joins?
pls helpHi Saravanan,
Views are definitely advantageous. And you can use views over joins.
But remember that just like joins, views using 3 or more tables can be slightly slow.
The view doesnt store any data on its own. A view is only a logical join.
And it does make use of the DB buffers already defined.
May be, you need to check if you have defined your view correctly. Check your view join conditions.
Hope this answers ur question. Reward points if it does.
Rgds,
Prashanth.
SAP. -
Can I create a view based on two tables that have the same column name?
I have two tables A and B. Each table has 50+ columns.
I want to create a view that includes all the columns in A and all the columns in B. I created a view with a select statement that says
Select A.*, B.*
From A, B
where A.id = B.id
It returns an error because in each table I have a column that keeps track if a record has been changed called Modified_By. That's where it chokes up on I figure. I would like to write the view without explicitly writing each column name from A and B as part of the select statement. The actual select statement works fine and only bombs when trying to turn the select statement into a view.You will have to type the full column list at least once. You can save a few keystrokes (i.e. alias. on every column) by providing the column names to the CREATE part instead of in the SELECT part. Something like:
SQL> desc t
Name Null? Type
ID NUMBER
NAME VARCHAR2(10)
SQL> desc t1
Name Null? Type
T_ID NUMBER
LOC_ID NUMBER
NAME VARCHAR2(15)
SQL> CREATE VIEW t_v (id, t_name, t_id, loc_id, t1_name) AS
2 SELECT t.*, t1.*
3 FROM t, t1
4 WHERE t.id = t1.t_id;
View created.HTH
John -
Using a view to join two tables
Thank you in advance for any advice you can lend.
I am using this code in my MySQL db to create a view.
select
job.id as job_id,
umr_cost_calculation.plant_name,
max(umr_cost_calculation.id) as max_id
from
job,
umr_cost_calculation
where
job.id = umr_cost_calculation.job_id
group by job.id , umr_cost_calculation.plant_name
I did this so I can join two tables and pull in the most current cost data for a specific plant. The report will, at times, show the wrong (older) data. I can re-run the report, filter to just the one job and see again the wrong data. When I add the max_id to the report, it display the id and updates the report with the correct data. It appears that the view was stale and by adding the ID to the report this fixed the issue.
1) Is this the best way to make this join? I don't see how Crystal supports a subquery to make a join (this is why I used the view).
2) If I leave the max_id on the report, will this force the view to always update?Try:
Select
D1.EmpLoginID,
Count(D1.ID),
Count(D1.AlarmCode),
D1.EmpName,
D1.EmpAddress,
D2.Db2Count
FROM DB1.Data D1
LEFT JOIN (SELECT
empLoginID, Count(*) as Db2Count
FROM DB2.ALL_Database
WHERE site = 'Atlanta'
GROUP BY empLoginID
) D2
ON D1.EmpLoginID = D2.EmpLoginID
GROUP BY D1.empLoginID, D1.EmpName, D2.EmpAddress, D2.Db2Count
Order BY D1.empLoginID ASC
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Hi,
I have following 2 tables
CREATE TABLE a
sr_no INT
CREATE TABLE b
sr_no INT,
startdate DATE,
remark VARCHAR2(30)
One to many mapping relationship exists between the two tables.
for each sr_no in table a ther exists multiple/no record in table b.
If there are multiple entries in table b for a single entry in table a,
then i want remark data which is corresponding to minimum of the startdate in table b
Example data of table b
1 10/15/2009 one
1 10/29/2009 one1
2 10/28/2009 two
3 10/27/2009 three
4 10/26/2009 four
minimum date of the first 2 records is 10/15/2009.so i want remark as "one" when i join the 2 tables.
How do we achieve that ?Something like this?
SELECT SUB.SR_NO
, SUB.STARTDATE
, B.REMARK
FROM
SELECT SR_NO
, MIN(STARTDATE) AS STARTDATE
FROM B
GROUP BY SR_NO
) SUB
JOIN B ON B.SR_NO = SUB.SR_NO AND B.STARTDATE = SUB.STARTDATEThat is one possibility. There are many, many ways to achieve this kind of result. -
Search help value restriction in two tables having same value table
Hi Gurus,
I have two tables containing same field having same domain with value table. My requirement is to restrict the values in the tables. For example the field contains 4 values:
1) A
2) B
3) C
4) D
For table 1, only A and C should be seen in F4 and for table 2, only B and D should be seen. Also if somebody forces B or D
in 1st table should not be allowed and the same for 2nd table ( A & C are not allowed ). How to do this using search help exit . Which event should I use. I don't want to create two separate check tables containing only the required values.
Regards,
DebopriyoHi Gurus,
I have two tables containing same field having same domain with value table. My requirement is to restrict the values in the tables. For example the field contains 4 values:
1) A
2) B
3) C
4) D
For table 1, only A and C should be seen in F4 and for table 2, only B and D should be seen. Also if somebody forces B or D
in 1st table should not be allowed and the same for 2nd table ( A & C are not allowed ). How to do this using search help exit . Which event should I use. I don't want to create two separate check tables containing only the required values.
Regards,
Debopriyo -
Needs to modify entries in search help
Hello friends,
I need to modify some entries in the search help for materials (MATNR). I have found that search help MAT1 is used for materials, and when I go inside then I am not able to get the records in the internal table(RECORD_TAB) that displays in the output.
Also the search help exit is standard, so creating a 'Z' exit and replacing in the search may effect other functionality of standard SAP also. So i need to take care of that as well.
Can anyone help me for finding the entries and where i need to modify them.
Regards,
GroverBut I face a problem because RECORD_TAB doesn't fill and data gets in from some other standard program.
I don't understand 'other standard program' - the elementary search help you are referring to does not have an exit, just a view selection. If you add the exit, then you can stop at the 'DISP' callpoint and analyze the data.
Also in that program internal table that contains entries are in a form of string and not with different fields.
Of course, RECORD_TAB is converted at runtime based on the search help definition. This is why you need to used the F4UT_* helper functions to access the data. Better yet, if you overtake the data selection, you'll have your own internal table that you can analyze before mapping it back to RECORD_TAB. -
Populate and display internal table results using search help exit...
I have copied F4IF_SHLP_EXIT_EXAMPLE and made changes. I want this search help exit to populate and display contents related to 'FIELD1' when the user enters a specific value for it in the search help screen, meaning when the user restricts the search by that value. For field2, field3, field4, field5, field6, field7, and field8 I am using a custom view.
Following is the code:
TYPES: BEGIN OF t_search,
field2 TYPE field2,
field3 TYPE field3,
field4 TYPE field4,
field5 TYPE field5,
field6 TYPE field6,
field7 TYPE field7,
field8 TYPE field8,
field1 TYPE field1,
END OF t_search.
DATA: it_itab TYPE TABLE OF t_search,
wa TYPE t_search,
wa_selopt TYPE ddshselopt,
wa_fielddescr TYPE dfies.
ranges: r_field1 for std_table1-field1
STEP SELECT (Select values)
FREE: r_field1.
**Get the value entered for FIELD1 in search help
LOOP AT shlp-selopt INTO wa_selopt.
CASE wa_selopt-shlpfield.
WHEN 'FIELD1'.
r_field1-sign = wa_selopt-sign.
r_field1-option = wa_selopt-option.
r_field1-low = wa_selopt-low.
r_field1-high = wa_selopt-high.
APPEND r_field1.
CLEAR: r_field1.
ENDCASE.
ENDLOOP.
**Select 'ID' and 'FIELD1' from table into lt_itab
SELECT id field1
INTO TABLE lt_itab
FROM std_table1
WHERE field1 IN r_field1.
IF sy-subrc = 0.
**Now, based on the particular IDs from lt_itab, I need to select other values
from other tables which also have 'ID' as the key.
SELECT std_table2~field2
std_table2~field3
std_table3~field4
std_table3~field5
std_table3~field6
std_table4~field7
std_table4~field8
std_table1~field1
INTO CORRESPONDING FIELDS OF TABLE it_itab
FROM std_table2
INNER JOIN std_table3 ON
std_table3mandt = std_table2mandt AND
std_table3id = std_table2id
INNER JOIN std_table4 ON
std_table4mandt = std_table2mandt AND
std_table4id = std_table2id
INNER JOIN std_table1 ON
std_table1mandt = std_table2mandt AND std_table1id = std_table2id
WHERE
std_table1~field1 IN r_field1.
'id' is common in all the std_tables --> std_table1, std_table2, std_table3, std_table4.
STEP DISP (Display values)
**Then I need to gather all the results in my internal table it_itab and display
in search help results for the value of FIELD1 entered by the user in the search help.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = 'FIELD1'
fieldname = 'FIELD1'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = it_itab
CHANGING
shlp = shlp
callcontrol = callcontrol.
I am not getting all the data in my internal table and wanted to know if there is anyting wrong in my select statement.
Any guidance will be appreciated and awarded appropriate points.
Thanks.the webdynpro fieldname and the search help input parameter name were made same.
Maybe you are looking for
-
I'd be grateful for some advice on the most cost-efficient way to upgrade my iMac. I had thought of replacing it this year but am hoping to stave off that decision for a while. My reason for upgrading is that I use photoshop a lot, with big files (
-
Can you preview an event in Ical, using Lion, by moving your mouse over the event?
I have been trying to fougure out to problems in Ical, using Lion. There does not seem to be anyway to preview an event accept by double clicing the event. I also do not understand why there is not a drop down menu to choose the month of a new even
-
Apple Studio Display 21inch - calibration fails
G'day all, I've reviewed the topics on this display and none seem to fit my problem. Further, I'm convinced that it's not a display problem but an OS Tiger 10.4.11 problem but I reckon that this is the forum that will be best suited to answer. In ess
-
Can anyone help me wid my N70 model
Hi, the problem goes like dis...few days bak...i was transferring a song from my friends mobile....via bluetooth(my cell doesnt have the antivirus).....after that my cell has started functioning absurdly....the problem is dat...it does not stick to o
-
Import Server Configuration?
Hi, I haven't tried working with Import Server yet... I have installed Import Server and using MSSQL Server... Could someone explain me how can I configure Import server to import xml files automatically from a FTP file path? I need to create any fol