Replicating names to three different tables
Hi
Hoping someone can help
I have a table with names.
I then have three other tables (for terms 1, 2 and 3 at school).
The term tables cross ref to the names table to obtain student names. In each term table, I have school marks going horizontally for assignments against each name.
If a new student arrives, I add him/her to the names table and then resort the names in the names table.
The problem is that this resort is not replicated in the 3 term tables.
Is there anyway around this? ie ensuring that the term tables mirror the resorted names table, but without of course losing track of the data for each student's assignments?
Any suggestions welcome..
Thanks
Hi
I don't think this works.
I have table 1 as a master list of names. Table 2 replicated the names via INDIRECT, and next to each name in table 2, I have a column showing against each name a mark (ie mark is in same row as a particular name). Thus name A, B, C align with mark 1,2,3.
If I resort in master list (eg descending), the resorted names appear in table 2 OK but the marks do not follow. So I get name C,B,A with marks 1,2,3 (ie not 3,2,1)
Maybe it is not possible.....
Any other suggestions?
Similar Messages
-
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 populate an internal table from three different tables
My requirement is to populate an itab by retrieving data from three diff db tables,
ekko,ekpo and Ekbe.
below is the code for data retrieval .
SELECT EBELN INTO TABLE IT_EKKO FROM EKKO WHERE EBELN IN S_EBELN.
IF NOT IT_EKKO[] IS INITIAL.
SELECT EBELP TXZ01 NETWR BUKRS INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN EQ IT_EKKO-EBELN.
IF NOT IT_EKPO[] IS INITIAL.
SELECT EMATN WAERS WERKS GJAHR BEWTP INTO CORRESPONDING FIELDS OF TABLE IT_EKBE FROM EKBE FOR ALL ENTRIES IN IT_EKPO
WHERE EBELN EQ IT_EKPO-EBELN
AND EBELP EQ IT_EKPO-EBELP
AND BEWTP EQ 'E' OR BEWTP EQ 'Q'.
ENDIF.
ENDIF.
please tell me how to populate data from it_ekko,it_ekpo and it_ekbe into an internal table ITAB.Hi Mayana,
You take one final structure & final internal table, & within that structure take all the fields which is required to be displayed as a final output.
for data fetching from different table, you take three different structures & three internal table for that, because into corresponding fields of table is not good for performance wise. Use into table syntax.
follow the below example:(similarly)
sort it_klah by key fields.
LOOP AT IT_KSSK INTO WA_KSSK.
READ TABLE IT_KLAH INTO WA_KLAH WITH KEY CLINT = WA_KSSK-CLINT
KLART = WA_KSSK-KLART.
IF SY-SUBRC EQ 0.
MOVE: WA_KLAH-OBJEK to WA_final-OBJEK.
Read another table........(2nd one)
IF SY-SUBRC EQ 0.
MOVE: ....................................
APPEND WA_final TO IT_final.
ENDIF.
clear wa_final.
ENDLOOP.
finally display it_final records.
Hope this can solve your problems.
Regards,
Tutun -
To reference three different tables automatically
I have three tables with different structure. but each of these three tables have one field in common, which is idx. I have a final table in which i have data from all these tables (final).
Emp
Sal
INcome
final
idx source
1 Emp
1 sal
2 income
2 emp
3 sal
i wnat to check
select a.idx from final a, emp b where a.idx=b.idx and source='Emp'
for second table i have to change table name, each time
Is there anyway to write a query which should pick the next table automatcially.
Best Regards,
AbidaJust remember that this is a SQL*Plus solution.. and not SQL. Something that the OP may confuse with each other.
Simply put - no it cannot be done in SQL.
If need to be done, then another tool/language needs to be used to create and control the SQL generated. Such as PL/SQL or Java or C# or SQL*Plus - though the latter is so primitive you would have a problem "to pick up" the next table name. SQL*Plus does not support and conditional and loop statements with its primitive macro language. -
How To Create Table View With Same Column name But Different Table?
Hi All,
I have the problem to create a tableview with same column name but in different table.
The Table that i have:-
Table - PAC051MPROFORMA
Column - mrn,visitid
Table - PAC051TPROFORMA
Column - mrn,visitid
Table - PAC052MTRANSBILL
Column - mrn,visitid
Then i want to create a table view to view that table. This is my SQL
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
That SQL Return this error = ORA-00957: duplicate column name
Then I modify that SQL to
CREATE VIEW pacviewproforma (mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
This time this error return = ORA-01730: invalid number of column names specified
What should i do?
Thanks...Hi,
SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
ERROR at line 1:
ORA-00957: duplicate column namePlease give different names to each column.
Something like this..
SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
_visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
View created.
SQL> DESC pacviewproforma;
Name Null? Type
MPROFORMA_MRN NUMBER
MPROFORMA_VISITID NUMBER
TPROFORMA_MRN NUMBER
TPROFORMA_VISITID NUMBER
MTRANSBILL_MRN NUMBER
MTRANSBILL_VISITID NUMBER
ORA-01730: invalid number of column names specifiedThe list of column nmae you specified during the CREATE VIEW should match with the SELECT list of the view.
Twinkle -
How to get only column names from different tables as single table columns
Hi All,
I have one requirement in which we want only column names from different tables.
for example :
I have three tables T1 ,T2, T3 having
col1 clo2 clo3 --> T1 ,
col3 col5 ,clo6 --> T2 ,
Clo6 col8 col9 --> T3
columns i want to get only all Column names from all table as single Resultset not any data from that how can i get that empty resultset
because this empty result i want to bind in datagridview(front end) as Empty resultset
Please tell me anyways to do this
Niraj SevalkarIf I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
SET FMTONLY ON
SELECT Col1, Col2, Col3, ....., Coln
FROM
T1 CROSS JOIN T2 CROSS JOIN T3
SET FMTONLY OFF
Another alternative is to include an imposible contition
SELECT Col1, Col2, Col3, ....., Coln
FROM
T1 CROSS JOIN T2 CROSS JOIN T3
WHERE 1 = 0
If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
"No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena -
I have three different listings for Bob Seger on my iPod (Bob Seger, Bob Seger System and Bob Seger and The Silver Bullet Band) How can I put all 3 in the same artist folder without changing artist name?
Can you just create a new "Playlist", name it Bob Seger and drag what you want into the Playlist.
File/New Playlist -
Errors when browsing same table name in a different schema.
I have two separate schema in a database and each has a table with the same name but different columns. I used the GUI to change the column order while looking at the data on one table. Now I can't see data in the other table and I get the error message ORA-00904: "DAY_DT": invalid identifier. I have tried to clear the persisted settings on both tables and I have disconnected and logged out SQLDeveloper and the problem still persists. How can I fix this.
Edited by: user507794 on Apr 14, 2010 8:51 AMI had another user try to look at data in the table from his account on his PC and he saw the same error. So I looked a little deeper. The situation seems to be this
user_a creates a table and a public synonym of the same name. user_a grants select on the table to user_c
user_b creates a table using the same name as user_a's table with different columns. user_b grants select on the table to user_c
user_c can use the GUI to see the the data in user_a's table.
user_c cannot use the GUI to see user_b's table data. The GUI returns an error ORA-00904: "XXX": invalid identifier where XXX is a column on user_a's table. -
Selecting two different Names using the same table with same field
Hello,
I am trying to display several fields from different tables. Here are some of the fields that I need: The instructor needs to go after the social.
WESL | ENGR-1101-SW1 | Hinojosa | Ashley | Social | Instructor |
I am using a table where they have the social and I need to get both the student and the instructor. How do I select the instructor when the instructor's id is on a different table. example
CLASS PERSON CLASS_ASSIGN
student_id student_id: name facutly_id
Here is the code that I have so far and it works.
rem ----------------
rem Filename: cer.sql
rem Purpose: to get data from banner and put into flat file
rem Date: August 17, 2006 4:51 P.M.
rem Author: Robert Hernandez
rem ---------------
rem Notes: Need to add the Instructor - having problems
rem using the same spriden_id.
rem Also need to have admissions enter the grad date for
rem several students: Procedure is working as is.
declare
l_output utl_file.file_type;
grad_month varchar2(2);
buffer varchar2(1000);
cursor cursor1 is
select ssrmeet_bldg_code,
ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_seq_numb,
spriden_last_name,
spriden_first_name,
spriden_id,
scbcrse_title,
ssbsect_term_code,
sfrstcr_grde_code,
sorhsch_graduation_date,
decode(substr(sorhsch_graduation_date,4,3),'JAN','01',
'FEB','02',
'MAR','03',
'APR','04',
'MAY','05',
'JUN','06',
'JUL','07',
'AUG','08',
'SEP','09',
'OCT','10',
'NOV','11',
'DEC','12') as grad_month,
sorhsch_sbgi_code
from ssbsect,ssrmeet,sfrstcr,spriden,scbcrse,sorhsch
where rownum < 200
and ssbsect_seq_numb like 'S%'
and (ssrmeet_term_code = ssbsect_term_code
and ssrmeet_crn = ssbsect_crn)
and (ssbsect_crn = sfrstcr_crn
and sfrstcr_pidm = spriden_pidm
and length(spriden_id) = 9
and substr(spriden_id,1,1) <> 'A')
and (ssbsect_crse_numb = scbcrse_crse_numb
and ssbsect_subj_code = scbcrse_subj_code)
and spriden_pidm = sorhsch_pidm
and sorhsch_graduation_date is null
order by ssbsect_crse_numb;
begin
l_output := utl_file.fopen('CER','rbfpce.txt','W');
for cur1_rec in cursor1 loop
buffer:= cur1_rec.ssrmeet_bldg_code||'|'||
cur1_rec.ssbsect_subj_code||'-'||
cur1_rec.ssbsect_crse_numb||'-'||
cur1_rec.ssbsect_seq_numb||'|'||
cur1_rec.spriden_last_name||'|'||
cur1_rec.spriden_first_name||'|'||
substr(cur1_rec.spriden_id,1,3)||'-'||
substr(cur1_rec.spriden_id,4,2)||'-'||
substr(cur1_rec.spriden_id,6,4)||'|'||
cur1_rec.scbcrse_title||'|'||
cur1_rec.ssbsect_term_code||'|'||
cur1_rec.sfrstcr_grde_code||'|'||
'20'||SUBSTR(cur1_rec.sorhsch_graduation_date,8,2)||
cur1_rec.grad_month||'|'||
cur1_rec.sorhsch_sbgi_code;
utl_file.put_line(l_output,buffer,false);
end loop;
utl_file.fclose(l_output);
exception
when no_data_found then
utl_file.fclose(l_output);
end;
/Can you be more precise , please :
- which table stores the people identities ? (I call this one Identity)
- which table gives the class where the student works in (I cal l this one Claa_attendees)
- which table gives the instructor of a class (I call this one Class)
If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
Select Stud_iden.name, Instr_iden.name
From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
Where Class.clas_id = class_attendees.class_id
and class.instructor_id = Instr_iden.people_id
and class_attendees.student_id = Stud_iden.people_id
Is this what you need to do ? -
Import table with a different table name!
Dear All,
I have backup all users in my database using exp command.
Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.
Is it possible with exp command? If not what else is the solution.
Thanks, ImranHi..
Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.Is it possible with exp command? If not what else is the solution.
>
Well, its not possible.You can import those two tables in some test database, rename them and then take the export and import in the database you want.
Or,
You can import those 2 tables in some other schema in your database, rename them again take the export and them import it.
Anand -
Retrieving Data from different Tables with same tuple name
Hi,
I am made the following query from different tables. A tuple "name" is appearing in some tables. So when I run the qiery in a Java class, it delivers the same result of c.name, bpl.name and p.name. The result of c.name is correct, but the other 2 names are overwritten. It works perfect in a postgreSql query tool. How can I correct it, plz?
SELECT c.ad_client_id, c.name, o.c_order_id, o.ref_order_id, bp.name, bpl.name, o.dateordered, o.datepromised, od.c_orderline_id,p.m_product_id,p.name, cur.iso_code, od.qtyordered
FROM adempiere.ad_client c, adempiere.c_order o, adempiere.c_orderline od, adempiere.c_bpartner bp, adempiere.m_product p, adempiere.c_bpartner_location bpl, adempiere.c_currency cur
WHERE c.ad_client_id =11 and c.ad_client_id = o.ad_client_id and bp.c_bpartner_id=o.c_bpartner_id and o.c_order_id = od.c_order_id and od.m_product_id = p.m_product_id and o.c_bpartner_location_id =bpl.c_bpartner_location_id and o.c_currency_id=cur.c_currency_id;
CheersHi,
create alias, if u have similar field names as below. Use the alias name (rs.getString("cname") and rs.getString("bpname") and so on ) to retrive data.
SELECT c.ad_client_id, c.name as cname, o.c_order_id, o.ref_order_id, bp.name as bpname, bpl.name as bplname, o.dateordered, o.datepromised, od.c_orderline_id,p.m_product_id,p.name as pname, cur.iso_code, od.qtyordered
FROM adempiere.ad_client c, adempiere.c_order o, adempiere.c_orderline od, adempiere.c_bpartner bp, adempiere.m_product p, adempiere.c_bpartner_location bpl, adempiere.c_currency cur
WHERE c.ad_client_id =11 and c.ad_client_id = o.ad_client_id and bp.c_bpartner_id=o.c_bpartner_id and o.c_order_id = od.c_order_id and od.m_product_id = p.m_product_id and o.c_bpartner_location_id =bpl.c_bpartner_location_id and o.c_currency_id=cur.c_currency_id;Regards,
Ram -
Hi Experts,
what has to be done if you have three different output tables which you would like
display by the ALV. How can you change between those three tables .
If possible I wold like to use the same alv reference.
data ref_alv TYPE REF TO cl_gui_alv_grid.
If this is not possible
please tell me the other way ?
Regards
sashi,
maybe it helps to understand me better!
<outtab2>
<outtab3>
might be also dislayed as like as <outtab>
PROCESS BEFORE OUTPUT.
MODULE alvgrid_out.
PROCESS AFTER INPUT.
MODULE user_command_0600.
MODULE alvgrid_out OUTPUT.
PERFORM init.
ENDMODULE. " ALVGRID_OUT OUTPUT
FORM init.
IF NOT r_nsize IS INITIAL AND NOT r_normes IS INITIAL AND gv_flag IS INITIAL.
PERFORM alv_size.
gv_flag = 'X'.
ENDIF.
IF NOT r_slim IS INITIAL AND NOT r_slimes IS INITIAL AND gv_flag IS INITIAL.
PERFORM alv_slimsize.
gv_flag = 'X'.
ENDIF.
IF NOT r_stocky IS INITIAL AND NOT r_stomes IS INITIAL AND gv_flag IS INITIAL.
PERFORM alv_stockysize.
gv_flag = 'X'.
ENDIF.
IF NOT r_nsize IS INITIAL AND NOT r_normes IS INITIAL AND gv_paiflag EQ 'NO'.
PERFORM alv_size.
ENDIF.
IF NOT r_slim IS INITIAL AND NOT r_slimes IS INITIAL AND gv_paiflag EQ 'SL'.
PERFORM alv_slimsize.
ENDIF.
IF NOT r_stocky IS INITIAL AND NOT r_stomes IS INITIAL AND gv_paiflag EQ 'ST'.
PERFORM alv_stockysize.
ENDIF.
ENDFORM. "init
MODULE user_command_0600 INPUT.
IF NOT r_nsize IS INITIAL AND NOT r_normes IS INITIAL AND sy-ucomm EQ 'NO'.
gv_paiflag = 'NO'.
ENDIF.
IF NOT r_slim IS INITIAL AND NOT r_slimes IS INITIAL AND sy-ucomm EQ 'SL'.
gv_paiflag = 'SL'.
ENDIF.
IF NOT r_stocky IS INITIAL AND NOT r_stomes IS INITIAL AND sy-ucomm EQ 'ST'.
gv_paiflag = 'ST'.
ENDIF.
FREE: ref_alv, ref_container.
ENDMODULE. " USER_COMMAND_0600 INPUT
FORM alv_size .
CHECK ref_alv IS INITIAL.
CREATE OBJECT ref_container
EXPORTING
container_name = 'ALV'.
gv_layout-no_toolbar = 'X'.
CLEAR: gs_fcat, gs_zpd.
READ TABLE lt_sgroup INTO ls_sgr INDEX 1.
gs_fcat-fieldname = 'ORG_SIGN'.
gs_fcat-coltext = ''.
gs_fcat-outputlen = 2.
APPEND gs_fcat TO gt_fcat.
CLEAR gs_fcat.
gs_fcat-fieldname = 'DESCRIPTION'.
gs_fcat-coltext = ls_sgr-sizegroup_name.
gs_fcat-outputlen = 30.
APPEND gs_fcat TO gt_fcat.
CLEAR gs_fcat.
SORT r_nsize BY low.
DELETE ADJACENT DUPLICATES FROM r_nsize.
LOOP AT r_nsize.
CONDENSE r_nsize-low NO-GAPS.
gs_fcat-fieldname = r_nsize-low.
gs_fcat-coltext = r_nsize-low.
gs_fcat-outputlen = 5.
APPEND gs_fcat TO gt_fcat.
ENDLOOP.
CLEAR gs_fcat.
LOOP AT gt_fcat INTO gs_fcat WHERE fieldname NE refer.
gs_fcat-edit = 'X'.
MODIFY gt_fcat FROM gs_fcat TRANSPORTING edit.
ENDLOOP.
CLEAR gs_fcat.
LOOP AT gt_fcat INTO gs_fcat WHERE fieldname EQ 'DESCRIPTION'.
gs_fcat-edit = ' '.
MODIFY gt_fcat FROM gs_fcat TRANSPORTING edit.
ENDLOOP.
CLEAR gs_fcat.
LOOP AT gt_fcat INTO gs_fcat WHERE fieldname EQ 'ORG_SIGN'.
gs_fcat-edit = ' '.
MODIFY gt_fcat FROM gs_fcat TRANSPORTING edit.
ENDLOOP.
FIELD-SYMBOLS: <lt_ss> TYPE table,
<test> TYPE ANY.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fcat
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <outtab>.
CREATE DATA new_line LIKE LINE OF <outtab>.
ASSIGN new_line->* TO <l_line> .
SORT r_normes BY low.
DELETE ADJACENT DUPLICATES FROM r_normes.
LOOP AT r_normes.
ASSIGN COMPONENT 2 OF STRUCTURE <l_line> TO <test>.
<test> = r_normes-low.
APPEND <l_line> TO <outtab>.
ENDLOOP.
CLEAR gs_cpmpon.
REFRESH: gt_compon, gv_comp
PERFORM read_comp
TABLES gv_comp
USING
'zpd'
<l_line>.
CREATE OBJECT ref_alv
EXPORTING
i_parent = ref_container
i_appl_events = 'X'
EXCEPTIONS
OTHERS = 5.
CALL METHOD ref_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CREATE OBJECT ref_alv_events.
SET HANDLER ref_alv_events->handle_data_changed FOR ref_alv.
* <outtab2>
* <outtab3>
* might be also dislayed
CALL METHOD ref_alv->set_table_for_first_display
EXPORTING
is_layout = gv_layout
it_toolbar_excluding = it_toolbar_excluding " TYPE UI_FUNCTIONS
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = <outtab>
EXCEPTIONS
OTHERS = 4.
CALL METHOD cl_gui_cfw=>flush.
ENDFORM. " ALV_SIZE -
How to build Form or Report on different table name
Hi,
I want to know, is it possible to query data from a different tables with same structure.
For example:
I have tables tableA, tableB ....
What I want is to select table name from combo box and
after that to query data for the chosen table.
So is it possible anyway to build a form or report without knowing the table name during the design ?
ThanksHello Boris,
The way you can make this work is like this:
You need to create a view (say vw_2Tables)whose source is like
select "table_A" tableName, col1,col2,... from table_A
union
select "table_B" tableName, col1,col2,... from table_B
Then create the Report based on this view:
select tableName, col1, col2
from vw_2tables
where tableName = :P_tablename;
This will make the Portal create a bind parameter for you.
Create an LOV whose Select statement is
select "table_A" tableName from dual
union
select "table_B" tableName from dual
And add this LOV to the bind parameter source in Report
(in Customization Tab).
You need to run this Report in customize mode
(if your report name is say Rep_1
then this will be http://...../Rep_1.show_parm)
Hope this helps
Madhav -
Hi all,
I have 2 tables:
1) Lookup table- "Names"- which contains ID# and product description (~100 names that can change).
2) Data table- "Data"- which contains a column with sentences and within lies also the description. In addition, there is a quantity column.
Example:
Names table-
ID
Name
1 Glass
2 Paper
3 Alum'
4 Metal for construction
100 Hydro therapy products
And Data table-
Description
Qty
Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
6
Metal for construction is the major component in our system
7
<gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="ba668f16-4de8-41d9-af39-d1b17422d6fe" id="ae5b76e8-6897-46c8-823b-86a382087f83">Kandoo</gs>, Delgado,
Glass 17
Greece needs more paper, 200 ft.
45
*there is no order where the lookup value can be found in the sentence*
My purpose is to import the Data table while performing a calculation, that <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="1941bde7-1595-40eb-9d64-c2e3b9fabdef" id="b60549fc-5b92-46ea-abc6-72cc8c4c093b">checks</gs>
for each row what is the suitable lookup value and then add it to a new column "Name".
Meaning, this table should be the new data after import:
<gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="f5d9da98-3ff6-4022-920d-8965a15730ee" id="580f945f-7822-4035-9b5b-542c74eff605">Description</gs>
Qty
Name
Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
6 Alum'
Metal for construction is the major component in our system
7 Metal for construction
<gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="365dd7f8-7ffc-4ef3-95bf-9bf03421c90d" id="c9ba8515-3dba-4a6b-929e-650510f70844">Kandoo</gs>, Delgado, Glass
17 Glass
Greece needs more Paper, 200 ft.
45 Paper
Appreciate all support!
I lost hope and I want to avoid macros as much as possible.
Thanks!
עמיתHi Amit,
I updated the file. The solution uses the following query formula:
let
Source = Excel.CurrentWorkbook(){[Name="DataTbl"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each IndexTbl),
#"Expand Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Scope"}, {"Scope"}),
#"Filtered Rows" = Table.SelectRows(#"Expand Custom", each Text.Contains([Description], [Scope])),
#"Grouped Rows" = Table.Group(#"Filtered Rows", {"Topic", "Component Code", "Project", "Date", "TotalQty", "TotalQtyActual", "ID", "SOW #", " SOW#(lf)Rev", "Scope Driver", "Scope Source", "Scope Source #", "Cost Code", "Type", "Bdg", "System Code", "IMF Number", "IMF Description", "WG", "C or NC", "C/e", "LLE", "Dwg Ref", "Comments ", "Description", "Size", "Qty", "Unit", "Materials Cost/Unit ", "Sub-Total per Unit €", "Unit Rate ", "Total", "DIV Code", "SYS Code", "HelperForDynfilter"}, {{"Scope", each Text.Combine([Scope], " | "), type text}})
in
#"Grouped Rows"
It is based on two queries. The first is the import from table of "IndexTbl", the second is the import of "DataTbl' which is then extended according to the expression above.
Hope this helps.
Gil -
How to create a foreign key for the table from two different tables?
Hi All,
I have a three table like below. In the below table SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK will be having the primary key for NAME column. The same SAMPLE_CONS3_CHECK table also having the primary key for NAME column and forieign key for SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK tables. See the below code 2
code 1:
CREATE TABLE SAMPLE_CONS_CHECK
(NAME VARCHAR2(10),
SERIES VARCHAR2(5)
CREATE TABLE SAMPLE_CONS2_CHECK
(NAME VARCHAR2(5),
MODEL NUMBER
CREATE TABLE SAMPLE_CONS3_CHECK
(NAME VARCHAR2(5),
MODEL_NO NUMBER
)code 2
alter table SAMPLE_CONS_CHECK
add constraint SAMPLE_CONS_CHECK_pk primary key (NAME)
alter table SAMPLE_CONS2_CHECK
add constraint SAMPLE_CONS2_CHECK_pk primary key (NAME)
alter table SAMPLE_CONS3_CHECK
add constraint SAMPLE_CONS3_CHECK_pk primary key (NAME)
ALTER TABLE SAMPLE_CONS3_CHECK ADD
CONSTRAINT SAMPLE_CONS3_CHECK_FK1 FOREIGN KEY
NAME
) REFERENCES SAMPLE_CONS_CHECK
NAME
) ON DELETE CASCADE;
ALTER TABLE SAMPLE_CONS3_CHECK ADD
CONSTRAINT SAMPLE_CONS3_CHECK_FK2 FOREIGN KEY
NAME
) REFERENCES SAMPLE_CONS2_CHECK
NAME
) ON DELETE CASCADE;From the above schenario i am able to insert the data to SAMPLE_CONS3_CHECK table. But the parent data is already available in the parent table. The problem is here two different constarints from two different tables. While inserting, it is checking from both the tables whether the parent is exist or not.
How can i solve this problem? Can anyone halp me about this?
Thanks
Edited by: orasuriya on Aug 8, 2009 2:02 AMActually the design is completely incorrect.
What you say is
I have
'foo', 'foo series'
'foo','foo model'
'foo',666
By virtue of table3 referring to both table1 and table2.
This means you actually need to have 1 (one) table:
'foo','foo series','foo model', 666
And the 'problem' disappears.
Sybrand Bakker
Senior Oracle DBA
Maybe you are looking for
-
The voice that was on when I first set up my ipad came back on and now I have to double click to get into my apps and can't use my apps because her voice is talking. How do I make the voice stop and my IPAD work again.
-
Cannot connect to DB from a client computer
Hi, I installed 11gR2 last week and can access it from the DB server. However I cannot connect to the DB from my laptop :-( ============================================================== C:\Users\jchen>tnsping jchen_dev TNS Ping Utility for 32-bit Wi
-
CCX 5.0(2) SR2 to SR3 upgrade issue
Good day.I'm going to upgrade our ccx 5.0(2) from SR2 to SR3. As i found out in manual,before upgrade,i should copy wfavvid folder to another location. But there's no any step what i need to do with this directory then. My question: after upgrade,is
-
UCCX "The ID you entered was not found"
I wanted to know can someone tell me how do I add a user to be able to log into the supervior desktop software. He can log into the agent software fine but I was told that I need to add the user to the supervisors group. I've never
-
Please i want to call a HTTPService to populate markers from external .xml file instead of populating it directly in the main.mxml. Thank you! [Embed(source="image/cinemaMarker.png")] protected var MarkerImage:Class; private var srcXML:XML = <