HR Tables Join Condition
Hello,
My requirment to extract data from the below HR Tables to BW.
Fot that purpose i am developing a VIEW based on these tables...
what are fields that are present in all tables as i can use them in by join condition
HR Tables
HRP1000
HRP1001
HRP1007
HRP1011
HRP1005
Thanks
Hi Suresh,
Thanks for the info provided.
I didn't understand exactly what your saying with regards to
'Why don't you simply dump these into soam staging Tables on your BW system & then build your Views/Cubes off the staging tables'
Could you please explain me in a bit details.
Actually my reporting requirments is to have the following fields
Field Name - Table Name
OBJID -HRP1000
OTYPE-HRP1000
STATUS-HRP1007
MOAVG- HRP1011
SOBID-HRP1001
TRFGI -HRP1005
BEGDA-HRP1000
tHANKS
Similar Messages
-
INVENTORY & ORDER MANAGEMENT Tables join conditions required
Hi All,
I have to create one view, it has to display item_number, item_description,quantity_in_warehouse and pendingquantity_in_salesorder.
query is based on INVENTORY & ORDER MANAGEMENT Tables. i have written below query, it is not giving expected output. Kindly go through once and rectify me if i did any thing wrong while writing the join conditions.
SELECT mtlb.segment1 Item_Number,
mtlb.description Item_Description,
mtld.transaction_quantity Quantity_in_Wearhouse,
oel.ordered_quantity PendingQuantity_in_SalesOrder
FROM mtl_system_items_b mtlb,
mtl_onhand_quantities_detail mtld,
oe_order_headers_all oeh,
oe_order_lines_all oel
WHERE mtlb.inventory_item_id = mtld.inventory_item_id
AND mtlb.organization_id ; = mtld.organization_id
AND mtlb.inventory_item_id ; = oel.inventory_item_id
AND oeh.header_id ; = oel.header_id
AND oeh.org_id ; = oel.org_id
AND oeh.ship_from_org_id ; = mtlb.organization_id
AND oel.ship_from_org_id ; = mtlb.organization_id
AND mtld.subinventory_code LIKE 'Warehouse'
AND oel.flow_status_code LIKE 'AWAITING_SHIPPING'
ORDER BY mtlb.segment1;
it is bit urgent. please help me to resolve this issue.
Thanks.
Edited by: user627525 on Jul 19, 2010 4:35 AMHi Jonny,
Thanks for your reply. it is very useful for me. need small clarification.
i have execute the query that u have given. please find the following output.
segment1 order_number line_number shipment_number on_hand
210020004000011 10005 1 1 139150
210020004000011 10006 1 1 139150
210020004000013 10005 2 1 27675
210020004000013 10006 2 1 27675
i have modified the query and added column ordered_quantity from oe_order_lines_all table.
SELECT
mtlb.segment1 ; as Item_Number,
mtlb.description as Item_Description,
sum(mtld.primary_transaction_quantity) as Quantity_in_Whouse,
oel.ordered_quantity as PQuantity_in_SOrder
FROM oe_order_headers_all oeh,
oe_order_lines_all oel,
mtl_system_items_b mtlb,
mtl_onhand_quantities_detail mtld
WHERE oel.header_id = oeh.header_id
AND oel.inventory_item_id = mtlb.inventory_item_id
AND oel.ship_from_org_id = mtlb.organization_id
AND oel.inventory_item_id = mtld.inventory_item_id
AND oel.ship_from_org_id = mtld.organization_id
AND oel.flow_status_code = 'AWAITING_SHIPPING'
AND mtld.subinventory_code = 'Warehouse'
GROUP By mtlb.segment1,mtlb.description,oel.ordered_quantity
ORDER BY mtlb.segment1;
i have executed the above query. Quantity_in_Whouse is showing double the actual available quantity.
item_number item_description Quantity_in_Whouse PQuantity_in_SOrder
210020004000011 item1 278300 100
210020004000013 item3 55350 125
when i executed the below query, Quantity_in_Whouse is showing 139050 and 27550 respectively.
SELECT mtlb.segment1 Item_Number,
mtlb.description,
sum(mtld.primary_transaction_quantity) Quantity_in_Whouse
FROM mtl_system_items_b mtlb,
mtl_onhand_quantities_detail mtld
WHERE mtlb.inventory_item_id = mtld.inventory_item_id
AND mtlb.organization_id ; = mtld.organization_id
AND mtld.subinventory_code LIKE 'Warehouse'
and mtlb.segment1 in ('210020004000011','210020004000013')
group by mtlb.segment1, mtlb.description
ORDER BY mtlb.segment1;
item_number item_description Quantity_in_Whouse
210020004000011 item1 139050
210020004000013 item3 27550
please give some solution so that i can display Quantity_in_Whouse as 139050 and 27550 .
if i am any thing wrong please rectify me.
Thanks in advance.
Edited by: user627525 on Jul 19, 2010 7:54 AM
Edited by: user627525 on Jul 19, 2010 7:56 AM
Edited by: user627525 on Jul 19, 2010 9:39 AM -
Reg: Join Conditions for Tables to create a View for Generic Extraction
Hi Experts,
Am trying to extract the data from Solman, for this purpose am creating a Generic Extractor based on three tables. So, can anyone please help me out by providing the join conditions to create a view based upon the following three tables,
1. CRM_ORDERM_H
2. DNOD_NOTIF
3. DNOD_NOTIF_S
Anyways i require the following fields in the extractor finally:
CRM CHANGED AT
GUID
SAP COMPONENT
RELEASE
REPORTED BY
These are the some of the major fields that i require in the final extractior. Please help me out ASAP with the table join conditions..
Will Assign Points for the helpfull answer...
Thanks,
Gattu.Hi,
I don't know the table CRM_ORDERM_H however you can link DNOD_NOTIF and DNOD_NOTIF_S
DNOD_NOTIF_S-CLIENT = DNOD_NOTIF-CLIENT
DNOD_NOTIF_S-GUIDS = DNOD_NOTIF-GUIDS
For the third table could you please paste here its definition like the hereunder?
Transp. table DNOD_NOTIF Active
Short Text Notification Header
Field KeyInitData element Data TyLengthDecimaShort Text
CLIENT X X MANDT CLNT 3 0Client
GUIDH X X DNOT_GUIDH RAW 16 0GUID Notification
.INCLUDE DNOS_NOTIF_INT STRU 0 0Notifications (Header, Internal Fields)
OBJNR DNOT_OBJNR CHAR 22 0Status Management Object Number
STATUS DNOT_STATUS CHAR 1 0Notification Status
DELETED DNOT_DELE_N CHAR 1 0Deletion Indicator Notification
PROCESSOR DNOT_PROC CHAR 12 0Current Processor
TYPE_PROC DNOT_TYPE_PRC CHAR 2 0Type of Processor
REPORTER DNOT_REPORTER CHAR 12 0Reported By
TYPE_REPO DNOT_TYPE_REP CHAR 2 0Type of Notification Creator
CREA_TSTMP DNOT_CREA_TSTMP DEC 15 0Entry Time Stamp
CHNG_TSTMP DNOT_CHNG_TSTMP DEC 15 0Time of Last Change
START_TSTMP DNOT_START_TSTMPDEC 15 0Initial Response Time - Time Stamp
END_TSTMP DNOT_END_TSTMP DEC 15 0Requested End of Processing - Time Stamp
CLO_TSTMP DNOT_CLO_TSTMP DEC 15 0Completion Time Stamp
.INCLUDE DNOS_NOTIF_EXT STRU 0 0Notifications (Header, External Fields)
NUMB DNOT_NUM CHAR 12 0Notification Number (External)
REFNUM DNOT_REFNUM CHAR 20 0External Reference Number
TYPE_NOTIF DNOT_TYPE_N CHAR 6 0Message category
CATEGORY DNOT_CATEGORY CHAR 12 0Topic, Area
SUBJECT DNOT_SUBJECT CHAR 60 0Re:
PRIORITY DNOT_PRIORITY CHAR 1 0Notification priority
LANGUAGE DNOT_LANG_N LANG 1 0Notification Language
hope this helps...
Olivier. -
Mismatch in the datatypes in join conditions of the views
Hi guys,
For creating a view I am trying to join 2 tables( EUIINSTLN & EUFASS).
I have selected 4 fields in first table(EUIINSTLN) and 3 fields in the second table(EUFASS).
The join condition is in such a way that the first table field(EUIINSTLN-ANLAGE) is input to second table primary field(EUFASS-OBJKEY).
The first table field(EUIINSTLN-ANLAGE) is of 10 char length and the input field(EUFASS-OBJKEY) in the second table primary field(EUFASS-OBJKEY) is 70 characters in length.
When we take the value in the first table field(EUIINSTLN-ANLAGE) individually and give input( to EUFASS-OBJKEY) in the second table((EUFASS) it works fine even though there is mismatch in the datatypes. I.e., it works individually.
But when this data is viewed using the DDIC view it doens't show any records, since the field length condition is not met. i.e., mismatch in the datatypes takes place. The below is the condition I have given in the view - table/join condition.
EUIINSTLN MANDT = EUFASS MANDT
EUIINSTLN ANLAGE = EUFASS OBJKEY.
Some persons have said that I can delimit the 70 char field(EUFASS-OBJKEY) to 10 char.
How can I delimit the length of 70 characters field(EUFASS-OBJKEY) to 10 char in the join conditions of the view.
Appreciate if any one give any solution on this.
Regards
Mac> EUIINSTLN MANDT = EUFASS MANDT
> EUIINSTLN ANLAGE = EUFASS OBJKEY.
Hi Mac,
You can limit the number of char in OBJKEY to 10.
Join Condition
EUIINSTLN-MANDT = EUFASS-MANDT
EUIINSTLN-ANLAGE = EUFASS-OBJKEY(10).
Best regards,
Shahid Malayil -
More than one join condition for 2 tables in obiee
Hello,
I am using obiee 11g.
There are 2 tables tableA and tableB where the join condition is like (tableA.col1=tableB.col1) or (tableA.col1 is null and tableB.col1 is null)
where should i do these type of joins.
I tried putting in physcial layer->f(x) but giving error like here only columns an d opertaors are allowed.
Thanksok here it goes.
I have a tableA with columns col1(pk),col2 and other columns
I have tableB with columns col1(pk),col2..Only these 2 columns.
Now distinct tableA.col2 values are put in tableB.col2. For those distinct values i have put the tableB.col1 values.
Now tableA.col2 as well as tableB.col2 can be null beacuse there may be null values in tableA.col2.
Now in tableB i have added one more row which has col1 as value and col2 as null.
Now when in physical layer when i do tableA.col2=tableB.col2 i dont get the null values.
What i want is whenever the tableA.col2 and tableB.col2 is null then take tableB.col1 for those vales.
So when i query i do
select * from tableA,tableB where
((tableA.col2=tableB.col2) or (tableA.col2 is null and tableB.col2 is null))
What i want is when i do a join i should be able to give this OR condition in rpd thats it.
because when i do in where clause of content tab it goes like a AND condition and not OR.
Thanks
Edited by: user123 on Jul 5, 2011 1:57 PM -
Inner Join Condition For Database Tables in JDBC Adapter
Hi
Is there any restriction for Number of database tables to Write Inner join Condition in JDBC.
ThanksVenkat,
No there is no restriction in Inner join. If your query executes perfectly in target Database then the same query will exceute perfectly while calling through XI.
Best regards,
raj. -
How to make the join condition in a view with this tables LFBK LFA1 TIBAN?
Hi gurus,
how can I make the join conditions for those 4 tables LFBK LFA1 TIBAN and BNKA ?
thanx
Moderator message: please (re)search and try yourself first.
Edited by: Thomas Zloch on Nov 22, 2010 4:44 PMWell, use
LFA1-LIFNR EQ LFBK-LIFNR
LFBK-BANKS EQ BNKA-BANKS
LFBK-BANKK EQ BNKA-BANKK
LFBK-BANKS EQ TIBAN-BANKS
LFBK-BANKK EQ TIBAN-BANKK
LFBK-BANKN EQ TIBAN-BANKN
LFBK-BKONT EQ TIBAN-BKONT
Not very hard...
Regards,
Raymond -
Identify join condition between any two table.
Hi,
I have set of tables. I don't know whether these tables are interlinked or not. I need to identify the underlying join condition in. As per my knowledge if my datasource is based upon infoset query , then I can go to SQ02 and find the underlying join condition. But in this case, I have only table names. How do i find whether they are interlinked or not.
Thanks in advance
Regards
SnehasishHi ,
Go to SE11 t-code
select VIEW radio button
give view name start with Z.select create button
select databseview radiobutton. select copy button.
it opens a view creation window.
give table names in leftside .
select RELATIONSHIP button. -
Hi all,
Is it possible to propose a join condition (using SQ02) between two fields of two tables other than what is proposed by the system?
Thanks
SandeepHi Sandeep,
You can very much match other fields of two tables in SQ02.
1. Goto SQ02
2. Give the infoset name
3. Goto change mode
4. Press the Join button, it will display the join conditions between the two tables.
5. Press Join Conditions, it will propose the system generated join conditions
with key fields
6. If you want to match your own fields other than the key fields you can just
point the mouse pointer on the field of the first table and just drag it to the field
of the second table. It will create a join condition.
7. Save the infoset.
Regards,
Jayaram... -
hello all,
can anyone help me write an outer join b/n the two tables below. The joining condition has if's and or's.
table 1 has 2 million rows, table 2 is very small
TABLE1
CUSTOMER_ID
CITY
STATE
1
SKOKIE
IL
2
CHICAGO
IL
3
CARY
NC
ERIE
PA
PHILLY
PA
CHARLOTE
NC
2 MILLION
CITYXY
STATEX
TABLE2
CITY
STATE
CONTACT
IL
OJO
ERIE
BRITT
PA
MIKE
PITTSBURG
PA
HILTON
N043
TAT
affi
B
affi
R
b0b
Q
b0b
CHARLOTE
NC
b0b
problem :: for all the data in table1, I need to find out the CONTACT from table 2 And the join condition would be as below
1. either both TABLE1.CITY=TABLE2.CITY AND TABLE1.STATE=TABLE2.STATE and get CONTACT
OR
2. TABLE1.CITY=TABLE2.CITY AND TABLE2.STATE IS NULL and get the value of CONTACT
OR
3. TABLE1.STATE=TABLE2.STATE AND TABLE2.CITY is null and get the value of CONTACT
I need a query like this
SELECT A.CUSTOMER_ID, A.CITY, A.STATE, B.CONTACT
FROM TABLE1 A, TABLE2 B
WHERE (join condition fitting in the 3 condition mentioned above)Dear OP,
Do you want something like this?
> with t1 as
-- Start of SAMPLE DATA
(select 1 CUSTOMER_ID, 'SKOKIE' CITY, 'IL' STATE from dual union
select 2, 'CHICAGO', 'IL' from dual union
select 3, 'CARY', 'NC' from dual union
select 4, 'ERIE', 'PA' from dual union
select 5, 'PHILLY', 'PA' from dual union
select 6, 'CHARLOTE', 'NC' from dual)
t2 as
(select null CITY, 'IL' STATE, 'OJO' CONTACT from dual union
select 'ERIE', null, 'BRITT' from dual union
select null, 'PA', 'MIKE' from dual union
select 'PITTSBURG', 'PA', 'HILTON' from dual union
select 'N043', 'TAT', 'affi' from dual union
select null,'B', 'affi' from dual union
select null,'R', 'b0b' from dual union
select null,'Q', 'b0b' from dual union
select 'CHARLOTE', 'NC', 'b0b' from dual
--- END IF SAMPLE Data
select * from t1 full outer join t2
on ( nvl(t1.city,t2.city) = nvl(t2.city,t1.city)
and nvl(t1.state,t2.state) = nvl(t2.state,t1.state) )
order by 1,2,3,4
CUSTOMER_ID CITY STATE CITY STATE CONTACT
1 SKOKIE IL IL OJO
2 CHICAGO IL IL OJO
3 CARY NC
4 ERIE PA ERIE BRITT
4 ERIE PA PA MIKE
5 PHILLY PA PA MIKE
6 CHARLOTE NC CHARLOTE NC b0b
N043 TAT affi
PITTSBURG PA HILTON
B affi
Q b0b
R b0b
12 rows selected
Elapsed: 00:00:00.112
Hope this is helpful. If not please let us know what is you desired result (sample) if your data was like above?
vr,
Sudhakar -
Join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS
Hi,
Could anyone tell me what is the join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS?
I joined these two tables by WF_NOTIFICATIONS.ITEM_KEY = PO_REQUISITION_HEADERS_ALL .WF_ITEM_KEY.But I cannot found some approved requisitions item key in WF_NOTIFICATIONS table.
Please help.
I paste my query below:
SELECT PRH.ORG_ID ORG_ID,
WF.ITEM_KEY,
WF.FROM_ROLE,
PRH.WF_ITEM_KEY,
WF.RECIPIENT_ROLE APPROVERS_NAME,
TRUNC(NVL(PRH.APPROVED_DATE, '')) DATE_APPROVED,
WF.SUBJECT SUBJECT,
PRH.DESCRIPTION REQ_DESC,
PRH.SEGMENT1,
(SUM(NVL(PRL.AMOUNT, 0)) +
SUM(NVL(PRL.UNIT_PRICE, 0) * NVL(PRL.QUANTITY, 0))) REQ_AMT,
GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
GL.SEGMENT7 || '.' || GL.SEGMENT8 CHARGE_ACCT
FROM APPS.WF_NOTIFICATIONS WF,
APPS.PO_REQUISITION_HEADERS_ALL PRH,
APPS.PO_REQUISITION_LINES_ALL PRL,
APPS.PO_REQ_DISTRIBUTIONS_ALL PRD,
APPS.GL_CODE_COMBINATIONS GL
WHERE WF.FROM_ROLE IN ('GHAWKINS', 'GHALVERSON', 'NCERNOTTA', 'DCOLLOPY', 'RHAY')
AND BEGIN_DATE > SYSDATE - 60
AND WF.MESSAGE_TYPE = 'REQAPPRV'
AND WF.ITEM_KEY = PRH.WF_ITEM_KEY --added
AND PRH.AUTHORIZATION_STATUS = 'APPROVED'
AND PRL.REQUISITION_HEADER_ID = PRH.REQUISITION_HEADER_ID
AND PRD.REQUISITION_LINE_ID = PRL.REQUISITION_LINE_ID
AND PRD.CODE_COMBINATION_ID = GL.CODE_COMBINATION_ID
GROUP BY PRH.ORG_ID,
WF.ITEM_KEY,
WF.FROM_ROLE,
PRH.WF_ITEM_KEY,
WF.BEGIN_DATE,
WF.SUBJECT,
WF.RECIPIENT_ROLE,
PRH.APPROVED_DATE,
PRH.DESCRIPTION,
PRH.SEGMENT1,
PRL.REQUISITION_HEADER_ID,
GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
GL.SEGMENT7 || '.' || GL.SEGMENT8Pl see if these MOS Docs can help -
603232.1 - How to Diagnose Purchasing Document Approval Routing
579522.1 - Forward Document Form FAQ
431767.1 - How To View Requisition From The Email Notifications For Which Workflow Data Is Purged
HTH
Srini -
How to use outer join condition in my below query.
Hi All,
How to use outer join condition in my below query.
In the table APPS_JP.GEDIS_OFFER_HEADER goh I have more records
in the table APPS_JP.GEDIS_ORDER_BUILDS gob I have less number of records.
I want all the records from APPS_JP.GEDIS_OFFER_HEADER goh
including other conditions.
I have tried goh.OFFER_NO=gob.OFFER_NO(+) but same result.
[code]SELECT GOH.ORIG_SYSTEM,
gsp.USER_NAME,
goh.ORDER_NO,
goh.OMEGA_ORDER_NUMBER,
goh.ORDER_TYPE,
gc.CUSTOMER_ID,
gc.OMEGA_CUSTOMER_NUMBER,
CASE WHEN gc.PRIVATE = 'N' THEN gc.CUSTOMER_NAME ELSE '' END
AS COMPANY_NAME,
goh.ORDER_STATUS,
goh.TOTAL_SELLING_PRICE,
goh.TOTAL_MARGIN,
ga1.ADDRESS1
|| ','
|| ga1.ADDRESS2
|| ','
|| ga1.ADDRESS3
|| ','
|| ga1.POSTAL_CODE
|| ','
|| ga1.CITY
AS SHIPPING_ADDRESS,
ga2.ADDRESS1
|| ','
|| ga2.ADDRESS2
|| ','
|| ga2.ADDRESS3
|| ','
|| ga2.POSTAL_CODE
|| ','
|| ga2.CITY
AS BILLING_ADDRESS,
ga.ADDRESS_ID,
gol.DESCRIPTION,
APPS_JP.TZ.to_local_date (goh.OFFER_DATE, goh.OFFER_DATE_UTC)
AS OFFER_DATE,
gc.LEVEL_8,
goh.NO_OF_BUILDS,
gob.SFDC_ID,
goh.PURCHASE_ORDER_NO AS PO,
gc1.CUSTOMER_NAME AS END_USAGE,
gol.LOB,
goh.TOTAL_MARGIN_PCT,
goh.TOTAL_DISCOUNT,
goh.TOTAL_DISCOUNT_PCT
FROM APPS_JP.GEDIS_OFFER_HEADER goh,
APPS_JP.GEDIS_ORDER_BUILDS gob,
APPS_JP.GEDIS_ORDER_LINES gol,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER gorc,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER ship,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER bill,
APPS_JP.GEDIS_CUSTOMER gc,
APPS_JP.GEDIS_CUSTOMER gc1,
APPS_JP.GEDIS_CONTACT gct,
APPS_JP.GEDIS_ADDRESS ga,
APPS_JP.GEDIS_ADDRESS_NORM ga1,
APPS_JP.GEDIS_ADDRESS_NORM ga2,
(SELECT DISTINCT SALESPERSON_ID, USER_NAME
FROM APPS_JP.GEDIS_SALESPERSON
WHERE SALESPERSON_ID IN
(SELECT TO_NUMBER (COLUMN_VALUE) AS SALESPERSON_ID
FROM TABLE (APPS_GLOBAL.SplitString ('337309'))))
gsp
WHERE goh.ORDER_NO <> 0
AND goh.OFFER_NO <> 0
AND goh.OFFER_NO=gol.OFFER_NO
AND gol.BUILD_NO = 1
AND gol.LINE_NO = 1
AND goh.OFFER_NO=gob.OFFER_NO
AND gob.BUILD_NO = 1
AND goh.OFFER_NO = gorc.OFFER_NO
AND gct.CONTACT_ID = gorc.CONTACT_ID
AND ga.CUSTOMER_ID = gc.CUSTOMER_ID
AND ga.PRIMARY = 'Y'
AND goh.LEAD_SALESPERSON=gsp.SALESPERSON_ID
AND goh.OFFER_NO = ship.OFFER_NO
AND ship.RELATION_TYPE = 'SHIP'
AND ga1.ADDRESS_ID = ship.ADDRESS_ID
AND ga1.CUSTOMER_ID = gc1.CUSTOMER_ID
AND goh.OFFER_NO = bill.OFFER_NO
AND bill.RELATION_TYPE = 'BILL'
AND ga2.ADDRESS_ID = bill.ADDRESS_ID
AND goh.OFFER_DATE BETWEEN APPS_JP.TZ.LOCAL_TO_DB_DATE (
SYSDATE - 30
AND APPS_JP.TZ.LOCAL_TO_DB_DATE (SYSDATE)
AND gorc.RELATION_TYPE = 'BASE'
AND gorc.CUSTOMER_ID = gc.CUSTOMER_ID
AND goh.SALES_CHANNEL = gc.SALES_CHANNEL
AND gc.SALES_CHANNEL = 'SMB'
AND goh.LEAD_SALESPERSON IN (goh.CREATED_BY, goh.LEAD_SALESPERSON)
ORDER BY goh.OFFER_NO;[/code]
Please help me how to use this outer join condition.
Thanks in advance.Hi,
If you want all the rows from goh, then you don't want any conditions like goh.OFFER_NO <> 0.
Make all the joins to goh outer joins, and make all conditions that apply to any tables joined to goh (or to tables joined to them) part of the join condition, like this:
FROM APPS_JP.GEDIS_OFFER_HEADER goh
LEFT OUTER JOIN APPS_JP.GEDIS_ORDER_BUILDS gob ON gob.OFFER_NO = goh.OFFER_NO
AND gob.BUILD_NO = 1
LEFT OUTER JOIN APPS_JP.GEDIS_ORDER_LINES gol ON gol.OFFER_NO = goh.OFFER_NO
AND gol.BUILD_NO = 1
AND gol.LINE_NO = 1
LEFT OUTER JOIN APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER
gorc ...
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Simplify the problem as much as possible. For example, do you really need all those tables to show what the problem is? Of course, you need them in tyour real query, but if you understand a solution that only involves 4 or 5 tables, you'll know how to apply it to any number of tables.
Explain, using specific examples, how you get those results from that data.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ https://forums.oracle.com/message/9362002#9362002 -
In-different behaviour of join condition
My query is of in-different behaviour of join condition with join between a varchar2 column and a number column. I am using the following join condition :-
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
where CM.UPDATED_BY is a varchar2 column and LM.LOGIN_ID is a number column. Now, CM.UPDATED_BY also has number only but some previous & old data is having varchar2 data. So, for that reason, i put the to_char before LM.LOGIN_ID, otherwise, only
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
would having been okay. Now, my real question is that the query with the condition,
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
works fine as long as there is no 'character' data in 'CM.UPDATED_BY'. If i put the condition:
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
then, the query is taking too long and the output is also not coming. Please help in solving my doubt as i need it resolved urgently.1) Did you intend for all 4 join conditions to be identical? From the text of your question, it sounds like some of the conditions should be different.
2) How do you compare the running time when CM.UPDATED_BY has non-numerica data and when it has numeric data? If you are altering the data in the table, are you reanalyzing the table between runs? Is there a difference in the query plan in the two cases?
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com/askDDBC -
How to add join conditions in ABAP Query.
Hi,
I need a help on "ABAP Query".
How to add join conditions in ABAP Query.
Thanks in advance.
Thanks & Regards,
RamanaHi,
See below code,
*& Report ZRNP_ALV_SO
REPORT zrnp_alv_so MESSAGE-ID z7rnp .
INCLUDE zrnp_include .
*SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-004 .
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln ,
s_auart FOR v_auart ,
s_vkorg FOR v_vkorg ,
s_spart FOR v_spart ,
s_kunnr FOR v_kunnr ,
s_matnr FOR v_matnr .
SELECTION-SCREEN END OF BLOCK blk1 .
*AT SELECTION SCREEN *
AT SELECTION-SCREEN.
SELECT SINGLE vbeln
FROM vbak INTO vbak-vbeln
WHERE vbeln IN s_vbeln.
IF sy-subrc <> 0.
MESSAGE e202.
ENDIF.
*START OF SELECTION *
START-OF-SELECTION .
PERFORM data_select.
PERFORM t_sort USING i_sort .
PERFORM event_cat USING i_event .
PERFORM fld_cat USING i_fldcat[] .
PERFORM t_layout USING i_layout .
PERFORM fld_cat2 USING i_fldcat2[] .
PERFORM call_alv.
* DATA SELECT *
*& Form DATA_SELECT
* text
* --> p1 text
* <-- p2 text
FORM data_select .
REFRESH: it_vbfa, it_so1, it_del_ful ,it_del1 .
BREAK-POINT.
*SELECT*
*a~vbeln*
*a~auart*
*a~vkorg*
*a~spart*
*a~kunnr*
*b~posnr*
*b~matnr*
*c~maktx*
*b~kwmeng*
*b~vrkme*
*INTO TABLE it_so1 FROM vbak AS a*
*INNER JOIN vbap AS b ON b~vbeln = a~vbeln*
*INNER JOIN makt AS c ON c~matnr = b~matnr*
*AND c~spras = sy-langu*
*WHERE a~vbeln IN s_vbeln .*
IF sy-subrc = 0.
SORT it_so1 BY vbeln.
DELETE ADJACENT DUPLICATES FROM it_so1.
ENDIF.
* COLURING DISPLAY *
DATA: ld_color(1) TYPE c .
* LOOP AT it_so1 INTO wa_so.
* Populate color variable with colour properties
* Char 1 = C (This is a color property)
* Char 2 = 3 (Color codes: 1 - 7)
* Char 3 = Intensified on/off ( 1 or 0 )
* Char 4 = Inverse display on/off ( 1 or 0 )
* i.e. wa_ekko-line_color = 'C410'
* ld_color = ld_color + 1.
* Only 7 colours so need to reset color value
* IF ld_color = 8.
* ld_color = 1.
* ENDIF.
* CONCATENATE 'C' ld_color '10' INTO wa_so-line_color.
** wa_ekko-line_color = 'C410'.
* MODIFY it_so1 FROM wa_so.
* ENDLOOP .
* IF sy-subrc = 0.
IF NOT it_so1[] IS INITIAL.
SELECT vbelv
posnv
vbeln
posnn
vbtyp_n
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_so1
WHERE vbelv = it_so1-vbeln
AND posnn = it_so1-posnr
AND vbtyp_n ='J' .
IF sy-subrc = 0.
SELECT vbeln
posnr
matnr
werks
lgort
charg
lfimg
vrkme
FROM lips INTO TABLE it_del_ful
FOR ALL ENTRIES IN it_vbfa
WHERE vbeln = it_vbfa-vbeln
AND posnr = it_vbfa-posnn.
ENDIF.
ENDIF.
ENDFORM. " DATA_SELECT
**************** EVENT CATALOG ****************************************
*& Form EVENT_CAT
* text
* -->P_I_EVENT text
FORM event_cat USING p_i_event TYPE slis_t_event .
REFRESH p_i_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
* EXPORTING
* I_LIST_TYPE = 0
IMPORTING
et_events = p_i_event
* EXCEPTIONS
* LIST_TYPE_WRONG = 1
* OTHERS = 2
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
READ TABLE p_i_event WITH KEY name = slis_ev_top_of_page INTO t_event.
IF sy-subrc = 0.
MOVE 'TOP_OF_PAGE' TO t_event-form.
MODIFY p_i_event FROM t_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
CLEAR t_event .
ENDFORM. " EVENT_CAT
**********FORM FOR EVENT TOP_OF_PAGE**********************************
FORM top_of_page .
REFRESH i_listheader.
DATA: t_header TYPE slis_listheader.
DATA: v_text(50).
WRITE sy-datum TO v_text.
CLEAR t_header.
t_header-typ = 'S'.
t_header-key = "Date".
t_header-info = v_text.
APPEND t_header TO i_listheader.
CLEAR t_header.
CLEAR v_text.
WRITE: 'SALES ORDER & DELIVERY DETAILS REPORT ' TO v_text .
t_header-typ = 'S'.
t_header-key = 'TITLE'.
t_header-info = v_text.
APPEND t_header TO i_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader.
* I_LOGO = 'ALV_BACKGROUND'.
* I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
******** FIRST ALV GRID DISPLAY ***************************************
FORM call_alv .
* FORM TO MAKE THE CELL CONTENTS INVISIBLE.
* PERFORM INVISIBLE_CELL_CONTENTS. *
*EXCLUDE-DECLARATION.
CLEAR wa_exclude.
wa_exclude-fcode = '&VEXCEL'.
APPEND wa_exclude TO i_exclude.
*& Form CALL_ALV
* text
* --> p1 text
* <-- p2 text
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_background_id = 'ALV_BACKGROUND'
is_layout = i_layout
it_fieldcat = i_fldcat[]
it_excluding = i_exclude
it_sort = i_sort
it_events = i_event
TABLES
t_outtab = it_so1
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM. " CALL_ALV
************** FIRST FIELDCATALOG *************************************
*& Form FLD_CAT
* text
* -->P_I_FLDCAT[] text
FORM fld_cat USING p_i_fldcat TYPE slis_t_fieldcat_alv.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'."TABLE NAME
i_fldcat-seltext_m = 'SALES ORDER NO.'.
i_fldcat-col_pos = 1. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-hotspot = 'X'.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'AUART'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'."TABLE NAME
i_fldcat-seltext_m = 'SALES DOC. TYPE'.
i_fldcat-col_pos = 2. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VKORG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES ORG.'.
i_fldcat-col_pos = 3. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 12. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'SPART'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'DIVISION'.
i_fldcat-col_pos = 4. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'KUNNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SOLD TO PARTY'.
i_fldcat-col_pos = 5. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES DOC. ITEM'.
i_fldcat-col_pos = 6. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 17. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'MATERIAL NO.'.
i_fldcat-col_pos = 7. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'MAKTX'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'DESCRIPTION'.
i_fldcat-col_pos = 8. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'KWMENG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'QUANTITY'.
i_fldcat-col_pos = 9. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-do_sum = 'X'. " For doing "SUM"
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES UNIT'.
i_fldcat-col_pos = 10. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
ENDFORM. " FLD_CAT
****************** ALV SORTING ***************************************
*& Form SORT
* text
* -->P_I_SORT text
FORM t_sort USING p_i_sort TYPE slis_t_sortinfo_alv .
DATA: i_sort TYPE slis_sortinfo_alv .
REFRESH p_i_sort .
CLEAR i_sort.
i_sort-spos = 1.
i_sort-tabname = 'IT_SO1'.
i_sort-fieldname = 'VBELN'.
i_sort-up = 'X'.
i_sort-subtot = 'X'.
i_sort-group = '*'.
APPEND i_sort TO p_i_sort.
ENDFORM. " SORT
*FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
* SET PF-STATUS 'ZSTANDARD'.
*ENDFORM. "Set_pf_status
***********FORM FOR EVENT USER_COMMAND1********************************
FORM user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
*CASE R_UCOMM .
* WHEN '&IC1' .
* IF rs_selfield-FIELDNAME = 'VBELN' .
* ENDIF .
* WHEN OTHERS .
* ENDCASE .
CLEAR wa_so.
REFRESH: it_del1 .
IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
rs_selfield-value IS NOT INITIAL.
READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = wa_so-vbeln
AND posnv = wa_so-posnr.
READ TABLE it_del_ful INTO wa_it_del_ful
WITH KEY vbeln = wa_vbfa-vbelv
posnr = wa_vbfa-posnn.
IF sy-subrc = 0.
CLEAR wa_del.
MOVE wa_it_del_ful TO wa_del.
APPEND wa_del TO it_del1.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
********* SECOND ALV GRID DISPLAY ***********************************
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND2'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_background_id = 'ALV_BACKGROUND'
it_fieldcat = i_fldcat2[]
it_sort = i_sort
TABLES
t_outtab = it_del_ful
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM . "USER_COMMAND1
********** FORM FOR EVENT USER_COMMAND 2 ******************************
FORM user_command2 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CLEAR wa_so.
REFRESH: it_del1 .
IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
rs_selfield-value IS NOT INITIAL.
READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
* IF SY-SUBRC = 0.
* LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = WA_SO-vbeln
* AND posnv = WA_SO-posnr.
READ TABLE it_del_ful INTO wa_it_del_ful
WITH KEY vbeln = rs_selfield-value
" vbeln = wa_vbfa-vbeln
posnr = wa_vbfa-posnn.
IF rs_selfield-fieldname = 'VBELN'.
SET PARAMETER ID 'VL' FIELD wa_vbfa-vbeln .
CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN.
ENDIF .
* ENDLOOP.
* ENDIF.
ENDIF.
ENDFORM . "USER_COMMAND2
********* SECOND FIELDCATALOG ******************************************
*& Form FLD_CAT2
* text
* -->P_I_FLDCAT2[] text
FORM fld_cat2 USING p_i_fldcat2 TYPE slis_t_fieldcat_alv .
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-tabname = 'IT_DEL_FUL'."TABLE NAME
i_fldcat2-seltext_m = 'DELIVERY NO.'.
i_fldcat2-col_pos = 1. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-hotspot = 'X'.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'DELIVERY ITEM'.
i_fldcat2-col_pos = 2. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'MATERIAL NO.'.
i_fldcat2-col_pos = 3. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'WERKS'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'PLANT.'.
i_fldcat2-col_pos = 4. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'LGORT'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'ST. LOCATION'.
i_fldcat2-col_pos = 5. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'CHARG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'BATCH NO.'.
i_fldcat2-col_pos = 6. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'LFIMG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'ACT. DEL. QTY.'.
i_fldcat2-col_pos = 7. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'SALES UNIT.'.
i_fldcat2-col_pos = 8. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
ENDFORM. " FLD_CAT2
***************** ALV LAYOUT *******************************************
*& Form LAYOUT
* text
* -->P_I_LAYOUT text
FORM t_layout USING p_i_layout TYPE slis_layout_alv .
p_i_layout-zebra = 'X'.
p_i_layout-totals_text = 'GRAND TOTAL ='.
* p_i_layout-CONFIRMATION_PROMPT = 'X'.
* p_i_layout-DEF_STATUS = ' '.
p_i_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " LAYOUT -
Xmlsequence with where clause or with join condition...
Hi
I have a XML as like below:
<File>
<FileDetails>
<Student>
<RegNo>1001</RegNo>
<Name>Joseph</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>80</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>78</Marks>
</Subjects>
</ResultDetails>
</Student>
<Student>
<RegNo>1002</RegNo>
<Name>Vincent</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>62</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>73</Marks>
</Subjects>
</ResultDetails>
</Student>
</FileDetails>
</File>
This XML file has been inserted into a table gtt_xmlfile on column "XML_DATA" of datatype "CLOB(4000)".
Now i have executed the below query:
select
extract(value(d),'//RegNo/text()').getStringVal(),
extract(value(d),'//Name/text()').getStringVal(),
extract(value(d),'//SNo/text()').getStringVal(),
extract(value(d),'//SubjectName/text()').getStringVal(),
extract(value(d),'//Marks/text()').getStringVal()
from gtt_xmlfile x,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student'))) d;
And i got the below output:
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 12 ENGLISHMATHS 8078
1002 Vincent 12 ENGLISHMATHS 6273
After i have executed the below query:
select
extract(value(d),'//RegNo/text()').getStringVal() RegNo,
extract(value(d),'//Name/text()').getStringVal() Name,
extract(value(e),'//SNo/text()').getStringVal() SNo,
extract(value(e),'//SubjectName/text()').getStringVal() SubjectName,
extract(value(e),'//Marks/text()').getStringVal() Marks
from gtt_xmlfile x,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student'))) d,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student/ResultDetails/Subjects'))) e
i get the below output: (Cartesian product)
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 1 ENGLISH 80
1001 Joseph 2 MATHS 78
1001 Joseph 1 ENGLISH 62
1001 Joseph 2 MATHS 73
1002 Vincent 1 ENGLISH 80
1002 Vincent 2 MATHS 78
1002 Vincent 1 ENGLISH 62
1002 Vincent 2 MATHS 73
But my required output should be like below:
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 1 ENGLISH 80
1001 Joseph 2 MATHS 78
1002 Vincent 1 ENGLISH 62
1002 Vincent 2 MATHS 73
How can i achieve that using a join condition??
Any help would be much appreciated...
Best Regards
MuthuNo
The above doesn't help me. Because, if the same set repeats, it gives an error:
XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence.
Note: Same set means, on the below sample, the student set repeats twice. In this case, that gives me error as mentioned above
<File>
<FileDetails>
<Student>
<RegNo>1001</RegNo>
<Name>Joseph</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>80</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>78</Marks>
</Subjects>
</ResultDetails>
</Student>
<Student>
<RegNo>1002</RegNo>
<Name>Vincent</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>62</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>73</Marks>
</Subjects>
</ResultDetails>
</Student>
</FileDetails>
</File>
Maybe you are looking for
-
FREE GOODS DETERMINATION IN RETURN SALES ORDER
Hello SD experts, When i am creating return sales order with reference to original invoice document, system copies only the main item,however it is not copying the Free Goods item even though it is displaying both the line items while adopting throug
-
i wiped my computer out yesterday and i want to keep the songs i have on my ipod and load more on there. how do i get the songs that are on my ipod back in my itunes library so i can keep those on my ipod and put more on it? I didnt purchase the mu
-
CS5 Mini Bridge Opens Images in Windows Paint
Can anyone tell me how to open images with Mini Bridge into Photoshop CS5? I have both an XP and a Windows 7 64-bit computer. I just downloaded the update to the CS5 program I had already installed and now when I go to open a JPEG image in Mini Bri
-
Pleasee Help , Urgent , XML Parsing
We should upload Sales Order XML File into OA Tables everyday . As I am very new to XML I request to give complete sample code ( giving just the logic needs time to understand, very urgent..) The current XML File can have mutilpe one sales order and
-
So I will be purchasing a MacBook soon, and I am currently a Windows user in distress, triggering this switch over to Apple. Because of this, most of my friends and family use a Windows computer. Question, If I get MS Office for Mac, lets say I creat