How to join this two tables
Hi
have a two login in forms not in oracle... i have two tables first the
Master secodn the Employees.. my prob is i have two button for this two tables to login.. any solution on how i can join this two in one button that if i connect using from master tables or from employess it will login
FirstTAble:::
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Master
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;
SEcodnTAble
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;
use a union on the 2 select statements.
Similar Messages
-
Hi to all.. i have this two table , the problem is i dunno how to join this two table into one, becoz in the forms i have two button "BUTTON A IS FOR TABLE A WHICH IS THE EMPLOYEE.. AND BUTTON B IS FOR ADMIN... WHAT I WANT IS TO MAKE THIS TWO BUTTON INTO ONE BUTTON.. i;m using form6i and run in client server..
Guys any one here know plz help how to do this..
TABLE 1
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;
TABLE 2
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;like i told you before in this posting How to join this two tables
use a union
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname
union
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname; -
Hi all,
i have these two query .
SELECT A.DATENUM,A.ATT_STATE,B.OT_MINUTES FROM WEB_HR.HR_ATTENDANCE A,WEB_HR.HR_OVERTIME B
WHERE A.MONTH_ID=2 AND A.ATT_YEAR=2009 AND A.EMP_ID=1 AND A.EMP_ID=B.EMP_ID
AND A.COMPANYCODE=1 AND A.DATENUM<=16 ORDER BY a.DATENUM;
SELECT A.DATENUM AS VDATENUM,A.ATT_STATE AS VATT_STATE,B.OT_MINUTES AS VOT_MINUTES FROM WEB_HR.HR_ATTENDANCE A,WEB_HR.HR_OVERTIME B
WHERE A.MONTH_ID=2 AND A.ATT_YEAR=2009 AND A.EMP_ID=1 AND A.EMP_ID=B.EMP_ID
AND A.COMPANYCODE=1 AND A.DATENUM >16 ORDER BY a.DATENUM;
actually from these two query each query returning 3 column each .
so what i need is i want mearge these two in such way that it return 6 column at a time..
can i get this??You can do that by just joining them. Let's assume your two queries are Q1 and Q2, both with columns c1-3, then just:
select q1.c1, q1.c2, q1.c3, q2.c1, q2.c2, q2.c3
from (Q1) q1
,(Q2) q2But this will result in a cartesian product of the two resultsets (from Q1 and Q2).
The big question is how do you want to combine the rows that come out of Q1 with the rows that come out of Q2. For instance if DATENUM is unique in both resultsets, and you want to combine rows that have matching values on DATENUM (c1, below), then:
select q1.c1, q1.c2, q1.c3, q2.c1, q2.c2, q2.c3
from (Q1) q1
,(Q2) q2
where q1.c1 = q2.c1Toon -
Subject: How to do join between two tables using something like SE16
SE16, SE11 provide form based interface query information from a single table. Is there a way to do join between two tables without creating an infoset erc? I am looking for something similar to sql join but in SAP BI 7.0
Thanks.Hi
Pls look into below links. Hope this helps you.
1. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45bf455611d189710000e8322d00/content.htm
2. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45a5455611d189710000e8322d00/content.htm
Regards
Sirigiri -
Prcedure to joining of two tables and pls explore the primary & foriegn key
Dear All,
Am new to this forum looking forward to have some discussions and guidance reg ABAP.
<b>My query is</b>
what is the prcedure to joining of two tables and pls explore the primary & foriegn key relationships.
Your kind help is required in this query .
Thanks n regards
Carol PHi Carol,
Joining two tables fetch data from tables that has relevent entry based on the keys. like LIKP and LIPS these are delivery tables. if the business requirement is fetching delivery data that are exists in both two tables. here LIKP will conatins a single entry against a condition and LIPS may contains several entry because one delivery may has multiple line items. so, fetch the data joining the two tables on vbeln that is delivrey number. this is used to increase the performance of the program except for all entries.
Foreign key is poiting twowards primary key; it may be 1:1 , 1:many and many:many. if field1 of table a is pointing towards field1 of table b. then based on these condition at the time of entry SAP will check how many entry can be entred in field1 of table a.
regards
Krishnendu -
Doubt on creating join between two tables
Hi friends,
I have two tables , ekes and eine
my requirement is if Ekes-ebtyp = 'X1'.
then Ekes-ebtyp = EKES-EINDT + Eine-j_3alitra.
the doubt is there is no primary key common between this table . actually in my whole program for purchase order i used EBELN for extracting details when two tables are involved . in this two tables no two primary keys are common to extract data ...is there any ways please suggest..
the code i wrote is
loop at li_ekes assigning <fl_ekes>.
read table li_eine assigning <fl_eine> with table key (here i need to give some unique fields to join these two fields please guide me which field i can use.).
<fl_ekes>-ebtyp = <fl_ekes>-EINDT + <fl_eine>-j_3alitra.Hi,
Both tables have field EBELN in common.
You can use it to extract data from both.
Hope this helps.
reward if helpful.
Regards,
Sipra -
Join on two tables using "LIKE"
Hi all,
I need make join on two tables (QMEL and STXL) using keys for connection:
- field for join of first table is (QMEL-QMNUM - Notif. number - Char 12)
- field for join of second table is (STXL-TDNAME - Char 70)
If it is connection based on EQ, I think, it's no problem but I need to connect it on base of 'LIKE'.
Example:
QMEL-QMNUM = '100100698075'
I would like get all rows from STXL which contain or even better start with notif. number.
Examples I would like connect with QMEL-QMNUM:
STXL-TDNAME = '100100698075'
STXL-TDNAME = '1001006980750001'
STXL-TDNAME = '10010069807500010001'
STXL-TDNAME = '10010069807500010002'
etc..
Am I able to manage that with select which join these two tables this way?
Thanks for any solution
Vaclav Hosek.Hi,
Write 2 separate selects for this.
select * from QMEL
where......
if sy-subrc = 0.
loop at i_qmel into wa.
r_tdname-option = 'CP'.
r_tdname-sign = 'I'
concatenate wa-qnum '*' into r_tdname-low.
append r_tdname.
endloop.
select *
from STL
where tdname in r_tdname.
endif. -
Hi,
I have this problem, How can query a two table?
Table A -> Table B
id table-a_id
name table_b_name
the relationship is one-to-many
How can I get the result?
Hope my question make sense
cheers.
thanks a lot.I bet you have more luck looking for an answer in a SQL forum.
-
Can we implement the custom sql query in CR for joining the two tables
Hi All,
Is there anyway to implement the custom sql query in CR for joining the two tables?
My requirement here is I need to write sql logics for joining the two tables...
Thanks,
GanaIn the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
Log on to your data source if necessary.
Under your data source, double-click the Add Command node.
In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
For example:
SELECT
Customer.`Customer ID`,
Customer.`Customer Name`,
Customer.`Last Year's Sales`,
Customer.`Region`,
Customer.`Country`,
Orders.`Order Amount`,
Orders.`Customer ID`,
Orders.`Order Date`
FROM
Customer Customer INNER JOIN Orders Orders ON
Customer.`Customer ID` = Orders.`Customer ID`
WHERE
(Customer.`Country` = 'USA' OR
Customer.`Country` = 'Canada') AND
Customer.`Last Year's Sales` < 10000.
ORDER BY
Customer.`Country` ASC,
Customer.`Region` ASC
Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
For more information about creating parameters, see To create a parameter for a command object.
Click OK.
You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
Note:
To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
By default, your command is called Command. You can change its alias by selecting it and pressing F2. -
Region
location
Dept
Budget Available
Allot Budget
Unused Budget
Decision for unused budget
US
200$
User Input
NY
100$
User Input
CA
100$
User Input
HR
50$
User Input
IT
50$
User Input
---------30$--------
20$
LOV
Add to Location
Use for Future Project
Add to Region
Spend as Bonus
How to achieve this tree table ?
My client wants that they should also be able to manage budge at Location or region level not only at the leaf(Dept) level.
I did a lot of research and finally found out that the details can only printed at the leaf(Dept) level.......
We can not hard code Region, locations and departments in table rows. When table tree is displayed we will only show all the regions... (US, UK, SA, IND, AUS, CAN,RUS, JPN.... etc..)
For Example:
Locations for US (NY, CA, OKH, WC...... etc.)
Locaitons for UK (SC, ENG, WL..... etc) and so on......
Departments for CA (HR, IT, ADMIN, FIN, TRVL, OPRN........ etc. ..)
Thanks in advance... It will be really great help if I get some breakthrough...
-RahulHi,
what if you add a transient attribute to those view objects? This way you don't need to change the table structure.
Frank -
In ER DIagram using toad( how can i link two tables)
Hi,
Any Toad expert can guide me that how can i link two tables in Toad in ER Diagram to show the relationship between two tables.
ThanksHi,
I hope there is foreign key relationship in tables, if so then you can click on "Find table dependencies" icon which will draw lines between them.
~Vinod -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa -
How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version
How to add the clearing document no. & payment method in FBL3 tcode. Can any one explain me step by step process how to add that two fields. This is ABAP 3.1 version. It's urgent requirement.
Moderator Message: Duplicate thread locked. Please carry on with this thread: How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version
Message was edited by: Suhas SahaDid you read the note provided in How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version ?
Regards,
Raymond -
This Custom Table is create in Custom Schema and Refers to Seeded Table in APPS schema
1 create table test_dff (test_id number(15) primary key,
2* invoice_id number(15) constraint ap_test_fk REFERENCES ap_invoices_all(invoice_id) ON DELETE CASCADE)
SQL> /
invoice_id number(15) constraint ap_test_fk REFERENCES ap_invoices_all(invoice_id) ON DELETE CASCADE
ERROR at line 2:
ORA-02270: no matching unique or primary key for this column-list
How to create this Custom Table on Custom Schema
thanks in advancehi prashant
sorry for replying late, i have checked your query and it gives me no rows, but if i check for user_cons_columns it gives me no rows either in APPS Schema, but in AP schema it gives me
SQL> SELECT * FROM user_cons_columns WHERE table_name = 'AP_INVOICES_ALL';
OWNER CONSTRAINT_NAME TABLE_NAME
COLUMN_NAME
POSITION
AP SYS_C008177 AP_INVOICES_ALL
INVOICE_ID
SQL> SELECT constraint_name, constraint_type FROM user_constraints WHERE table_name = 'AP_INVOICES_A
LL';
CONSTRAINT_NAME C
SYS_C008177 C
SYS_C008178 C
SYS_C008179 C
SYS_C008180 C
SYS_C008181 C
SYS_C008182 C
SYS_C008183 C
SYS_C008184 C
SYS_C008185 C
SYS_C008187 C
SYS_C008189 C
SYS_C008191 C
and since this is a combination of Unique and Not Null Constraints , i am getting the same issue. do u have any solution to make the Detail table records to delete without using Alerts/DB Triggers?
thanks for your time .
abdul rahman -
Sql join on two tables where column like another column
hi all,
been trying to get the results from a join between two tables where one column is like another one.
table1 (nameA) examples: black2, green1
table2 (nameB) example: black2.location.uk.com, green1.location.uk.com
so for example I want to match all those in table1 with black2 to the column in table2 that begins with black2 and so on if you see what im trying to get at!
my sql so far:
select * from schema.table1 a
join schema.table2 b
on a.nameA like concat('%', b.nameB, '%'); but it errors:
ORA-00909: invalid number of arguments
00909. 00000 - "invalid number of arguments"
Any help or advice would be greatly appreciated, thankyou!Either of these should do it...
select * from schema.table1 a
join schema.table2 b on a.nameA like '%'||b.nameB||'%';or
select * from schema.table1 a
join schema.table2 b on instr(b.nameB,a.nameA) > 0
Maybe you are looking for
-
Hi, When I execute Incremental or Full Crawl I get 17000 error and only 1 success. The error is: Error while crawling LOB contents. ( Access denied by Business Data Connectivity. ) I went to Central Admin > Security > Specify Web application Policy >
-
Hello, I have a problem reading GoPro Hero Black 4 files (1080p 120 fps) on my iMac with Adobe Premiere Elements : the file is read but the quality is quite bad. When I watch it with other software like VLC or MPC, the quality is perfect but the vide
-
Hi, I have a problem with collecting messages and sending them together. I'm trying to work out a simple correlation example. Its a File -> XI -> File scenario. I followed the blog /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection
-
LMS 4.2 Compliance check extended access-list
Hi, I would like to check of our router has one specific line in an extended access-list. I have tried to use the 'baseline compliance' to get the output, but can't get the syntax right. I would like to avoid checking on the line number in the access
-
Quicktime 6 works with iLumina bible, fails with itunes & opposite in QT 7
I have two pieces of software that need different versions of Quicktime. iLumina bible needs Quicktime 6 & updates itunes needs Quicktime 7 But iLumina virtual tours malfunctions in Quicktime 7 - screen hangs in loading (for ever) (QTVR files with ex