In which case i want to use inner join & for alll entries statement
Dear all,
In which scenario i want to use for all entries statement and in which scenario i want to use innerjoin operation in ABAP.
please give me the solution.
Regards
syam
Dear all,
In which scenario i want to use for all entries statement and in which scenario i want to use innerjoin operation in ABAP.
please give me the solution.
Regards
syam
Similar Messages
-
Hi
1) SELECT RSEGBUKRS RSEGBELNR RSEGGJAHR RSEGBUZEI RBKPLIFNR RSEGWERKS RSEGEBELN RSEGEBELP RSEGMATNR RSEGWRBTR RBKPRBSTAT RBKPZUONR RBKPRMWWR RBKPWAERS RBKP~KURSF
INTO TABLE I_RSEG
FROM RBKP
INNER JOIN RSEG
ON
RBKPBELNR = RSEGBELNR AND
RBKPGJAHR = RSEGGJAHR
FOR ALL ENTRIES IN I_BKPF
WHERE RBKP~BELNR = I_BKPF-BELNR
AND RBKP~GJAHR = I_BKPF-GJAHR
AND RSEG~WERKS IN S_WERKS
AND RBKP~LIFNR IN S_LIFNR.
2) IF NOT I_BKPF[] IS INITIAL.
SELECT belnr gjahr lifnr rbstat zuonr rmwwr waers kursf stblg
FROM rbkp into corresponding fields of table i_rbkp1
FOR ALL ENTRIES IN I_BKPF
WHERE BELNR = I_BKPF-BELNR
AND GJAHR = I_BKPF-GJAHR
AND LIFNR = S_LIFNR.
ENDIF.
I am replacing the first select statment using inner join with for all entries. but it is not yelding same result.First select statement retrieves records while second one does not using same where conditions. How inner join would work,can we replace inner join using for all entries.
Regards,
Karthik.kany one suggest..
Regards,
Karthik -
How to use Inner Join for these 4 table's
Hi Guys,
My Requirement is i have to get the data into the final Internal table whose structure is like this (BWKEY type MBEW-BWKEY,
MATNR type MBEW-MATNR,
MAKTX type MAKT-MAKTX,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c,
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR)
from 4 table's MBEW , MARA MAKT and MARC.
Can anybody provide the logci for this based on the below requirement
"Go to table MBEW with material number, plant and valuation type; fetch the information laid out in output format. There are some fields which need to come from tables MARC, MARA and MAKT. The common criterion is material number across these tables.
MBEW-MATNR = MARC-MATNR
MBEW-MATNR = MARA-MATNR
MBEW-MATNR = MAKT-MATNR
Thanks,
Gopi.Hello Gopi,
I did not have system now and just written in notepad..
types : begin of ty_mbew ,
MATNR type MBEW-MATNR,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c, " What is this field ,i did not include in join
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR,
end of ty_mbew.
types : begin of ty_makt ,
matnr type makt-maktx,
MAKTX type MAKT-MAKTX,
end of ty_makt.
types : begin of ty_final ,
MATNR type MBEW-MATNR,
MAKTX type MAKT-MAKTX,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c,
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR,
end of ty_final.
Internal tables
data :i_mbew type standard table of ty_mbew,
i_makt type standard table of ty_makt,
i_final type standard table of ty_final.
Work Areas
data : wa_mbew like line of i_mbew,
wa_makt like line of i_makt,
wa_final like line of i_final.
start-of-selection.
get the data from MBEW,MARA,MARC Table
select aMATNR aBWTTY
aBWTAR bMEINS
aBKLAS aVPRSV
aSTPRS aPEINH
*CRCY(3) type c,
aLBKUM aSALK3 a~LAEPR
c~J_3ADEFSI type MARC-J_3ADEFSI,
c~J_4kDEFSC type MARC-J_4kDEFSC,
b~SCLAS type MARA-/AFS/SCLAS,
aEKALR aHKMAT
aHRKFT aKOSGR
cPRCTR cMMSTA
cSOBSK aPPRDL
aLPLPR aPPRDZ
a~ZPLPR into corresponding fields of table i_mbew
from mbew as a inner join mara as b on bmatnr = amatnr
inner join marc as c on cmatnr = amatnr.
if sy-subrc eq 0.
select matnr maktx from makt into table i_makt
for all entries in i_mbew
where matnr = i_mbew-matnr
and spras = sy-langu.
endif.
loop at i_mbew into wa_mbew.
read the data from MAKT Table
read table i_makt into wa_makt with key matnr = wa_mbew-matnr.
if sy-subrc eq 0.
move-corresponding wa_mbew to wa_final.
move wa_makt-maktx to wa_final-maktx.
append wa_final to i_final.
endif.
endloop.
Thanks
Seshu -
How to use inner joins for 4 0r 5 tables
Hai Experts,
plz check my code, n plz help to inner join all the tables
TYPES : BEGIN OF ITAB,
EBELN TYPE EKKO-EBELN, "P.O.NUMBER
AEDAT TYPE EKKO-AEDAT, "DATE
BPRME TYPE EKPO-BPRME, "UNIT PRICE
MENGE TYPE EKPO-MENGE, "Purchase order quantity
WERKS TYPE EKPO-WERKS, "PLANT
BRTWR TYPE EKPO-BRTWR, "Gross order value in PO
STRAS TYPE LFA1-STRAS, "House number and street
LIFNR TYPE LFA1-LIFNR, "VENDOR NO
NAME1 TYPE LFA1-NAME1, "V NAME
ORT01 TYPE LFA1-ORT01, "CITY
LAND1 TYPE LFA1-LAND1, "LAND
PSTLZ TYPE LFA1-PSTLZ, "POSTAL CODE
MAKTX TYPE MAKT-MAKTX, "DESCRIPTION
END OF ITAB.
<b>and i got stucked here:</b>
<u></u>
SELECT EKKO~EBELN
EKKO~AEDAT
EKPO~BPRME
EKPO~MENGE
EKPO~WERKS
EKPO~BRTWR
LFA1~LIFNR
LFA1~STRAS
LFA1~NAME1
LFA1~ORT01
LFA1~LAND1
LFA1~PSTLZ
MAKT~MAKTX
INTO TABLE ITAB
FROM EKKO
INNER JOIN EKPO LFA1 T001W MAKT
ON EKKOEBELN = EKPOEBELN
EKKO~EBELN
WHERE EKKO~EBELN IN S_EBELN.hi Rajesh,
you have to join the tables one by one:
SELECT ekko~ebeln
ekko~aedat
ekpo~bprme
ekpo~menge
ekpo~werks
ekpo~brtwr
lfa1~lifnr
lfa1~stras
lfa1~name1
lfa1~ort01
lfa1~land1
lfa1~pstlz
makt~maktx
INTO TABLE itab
FROM ekko AS ekko
INNER JOIN ekpo AS ekpo
ON ekkoebeln EQ ekpoebeln
INNER JOIN lfa1 AS lfa1
ON ekkolifnr EQ lfa1lifnr
INNER JOIN t001w AS t001w
ON ekpowerks EQ t001wwerks
INNER JOIN makt AS makt
ON ekpomatnr EQ MAKTmatnr
WHERE ekko~ebeln IN s_ebeln.
This is the complete SELECT. BUT! The performance will be much better if you take out T001W and MAKT from the INNER JOIN. Do select on these tables in separate steps and merge the internal tables afterwards.
hope this helps
ec -
Inner Join for Dynamic Select statement
Hi All,
Can some one please help me in rewriting the below select statement where i have to remove the existing table1 by putting a dynamic table name which has the same table structure.
select a~zfield1
a~zfield2
from ztab1 as a
inner join ztab2 as b
on b~ztab1-zfield3 = a~ztab2-zfield3
where a~zfield4 = 'A'.
I am looking something as below. But encountering an error when using the below statement
select a~zfield1
a~zfield2
from (v_ztab1) as a
inner join ztab2 as b
on b~ztab1-zfield3 = a~ztab2-zfield3
where a~zfield4 = 'A'.
No Separate selects please. Please help me in rewriting the same select statement itself.
Regards,
PSKhi,
What error you are getting ?
Also INTO is missing from the statement.
SELECT pcarrid pconnid ffldate bbookid
INTO TABLE itab
FROM ( spfli AS p
INNER JOIN sflight AS f ON pcarrid = fcarrid AND
pconnid = fconnid )
WHERE p~cityfrom = 'FRANKFURT' AND
p~cityto = 'NEW YORK' .
thanks -
I want to use Mac Mail for my work email address, which containts multiple outbound options (i.e. hr@, me@ etc). Is there a way to set up Mac Mail to have an account with multiple outbound addresses rather than adding in multiple accounts?
This sounds like the age old problem with keychain & Safari. I don't know of a way to solve it without using something like 1Password.
The iOS app has it's own built in browser, so it has more control over what gets autofilled. Safari on OS X has an 1Password extension that handles account selection & autofill etc.
Keychain is great in principle, but it quickly falls down when you need tight integration with many ID's & different use cases (work, home etc).
I'd suggest you submit feedback to Apple about your thoughts. I did so years ago about this issue & this is how far we have come (back to the point where me.com synced passwords) :^)
http://apple.com/feedback/macosx.html
Other tools like lastpass or keypassx may also help if you want to truly segregate password storage, but that doesn't fix autofill, the way around that issue is to dedicate one browser for work. -
I cracked my screen. I want to use other monitor which I had one. I bought an Apple Mini-DP to VGA adapter. It worked. It means I can see ADDITIONAL screen. However I want to use this monitor for the main screen. How can I do?? Please help.
You have the display set in Extended Desktop mode. The Menu Bar and Dock will be on the MacBook display and your background screen on the monitor. In System Preferences>Display on the MacBook screen there should be an Arrangement tab when you have the MacBook hooked up to the monitor and both screens working. When you click the Arrangement tab do you see two monitors side by side? One of them will have a Menu Bar at the top. Just click on the Menu Bar and drag it to the second monitor. That will make the second monitor your main screen. You can now use your MacBook in Clamshell Mode with a wired or Bluetooth keyboard and mouse. http://support.apple.com/kb/HT3131 When you disconnect from the monitor your Menu Bar will automatically change back to the MacBook.
-
How to get rid of a window which says: CalendarAgent wants to use the "login" keychain
How to get rid of a window which says: CalendarAgent wants to use the "login" keychain
I would get free EasyFind (Spotlight will be a total waste of time), and search for caremefile and caremefile.info. If it comes up with anything, right-click and select move to trash, or just destroy. Since you didn't install anything, shouldn't be necessary to authenticate with the admin password before it will move to trash. Could also click on reveal in finder, which will allow you to see the actual location. Set it up as per the screenshot below.
-
Is there a way to see the size of my ICloud backup files, so I can determine which one I want to use?
Go to Settings>iCloud>Storage & Backup>Manage Storage. Your backups are listed at the top, along with their sizes. Note: this will only list your most current backup. You may have your previous two backups available too but you cannot access any size information about them.
-
Every time i try to open my Firefox i get a window that pops up asking me which browser i want to use to open it. After choosing Firefox it asks to run a C:/Program Files (x86)/Mozilla Firefox/firefox.exe. But my search bar says file:///C:/Program Files (x86)/Mozilla Firefox/firefox.exe. Never seen anything like this, half tempted to stop using Mozilla for this sole fact. PLEASE someone help me.
Same error message, I disabled tab mix and made sure I only have the newest version of Java, restarted firefox, now it seems to be fine no error yet on Pogo games or pictures upload to ebay which were the biggest problems besides hanging. I had also had disabled AVG secure search yesterday but that did not solve the issue. Now I will try to add back in AVG search...I have very few adds ons, also the note embedded about re- installing a toolbar went away, my old one did not work with FF4, so I installed Yahoo toolbar but the message still did not go away until I applied this fix. Hopes this helps someone..
-
I had my iTunes stored on my external drive which crashed, i want to use the content stored on my 1st gen apple tv,but it won't recognize my new itunes library.
I had my iTunes stored on my external drive which crashed, i want to use the content stored on my 1st gen apple tv,but it won't recognize my new itunes library.
-
How to use INNER JOIN in such case
when i program as below[CASE1]. the code is able to active.
CASE1:
==========================
DATA: WK_BUKRS LIKE T001-BUKRS,
WK_BUTXT LIKE T001-BUTXT,
WK_TABLE(4) TYPE C VALUE 'T001'.
START-OF-SELECTION.
WK_BUKRS = 'DECN'.
PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
CHANGING WK_BUTXT.
WRITE: WK_BUTXT.
FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
I_TABLE
CHANGING O_BUTXT LIKE T001-BUTXT.
SELECT SINGLE BUTXT
INTO O_BUTXT
FROM (I_TABLE)
WHERE BUKRS = I_BUKRS.
ENDFORM.
===========================
but when I need to INNER JOIN another table [CASE2]
CASE2:
=======================
DATA: WK_BUKRS LIKE T001-BUKRS,
WK_BUTXT LIKE T001-BUTXT,
WK_TABLE(4) TYPE C VALUE 'T001'.
START-OF-SELECTION.
WK_BUKRS = 'DECN'.
PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
CHANGING WK_BUTXT.
WRITE: WK_BUTXT.
FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
I_TABLE
CHANGING O_BUTXT LIKE T001-BUTXT.
SELECT SINGLE BUTXT
INTO O_BUTXT
FROM (I_TABLE) AS G INNER JOIN BKPF AS H
ON GBUKRS = HBUKRS
WHERE G~BUKRS = I_BUKRS.
ENDFORM.
=================================
Syntax error:
Wrong expression "INNER" in FROM clause. WHERE condition.
Can anybody help me to solve the problem.
My requirement is to use INNER JOIN with variable tablehi slam,
chk this sample code.
hi,
table emp
empno name
a sasi
b xxx
c yyy
table sal
empno salary
a 1000
b 2000
Inner join
select eempno ename
s~sal
into table int_table
from emp as e
inner join sal as s
on
eempno = sempno.
if you made inner join between table a and b by emp no
the selection retrives only if the condition satisfy the output will be
a sasi 1000
b xxx 2000
rgds
anver
if hlped mark points
Message was edited by: Anversha s -
I need to delete records from a table using inner join from other tables. See below for the table structure and records.
CREATE TABLE STUDENT (ROLL_NO NUMBER(10),NAME VARCHAR2(100),DEPT_NO NUMBER(10),JOIN_DATE DATE);
CREATE TABLE DEPART (DEPT_NO NUMBER(10), DEPT_NAME VARCHAR2(100));
CREATE TABLE ACTIVE_DEPT (DEPT_NO NUMBER(10), IS_ACTIVE VARCHAR2(1));
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(1,'SAM',10,SYSDATE-10);
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(2,'ALEX',10,SYSDATE -10);
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(3,'FRANK',20,SYSDATE -10);
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(4,'WAYNE',20,SYSDATE+1);
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(5,'KRUL',30,SYSDATE -10);
INSERT INTO STUDENT (ROLL_NO,NAME,DEPT_NO,JOIN_DATE) VALUES(6,'ALICE',40,SYSDATE -10);
INSERT INTO DEPART (DEPT_NO,DEPT_NAME) VALUES (10,'DEPT1');
INSERT INTO DEPART (DEPT_NO,DEPT_NAME) VALUES (20,'DEPT2');
INSERT INTO DEPART (DEPT_NO,DEPT_NAME) VALUES (30,'DEPT3');
INSERT INTO ACTIVE_DEPT (DEPT_NO,IS_ACTIVE) VALUES (10,'Y');
INSERT INTO ACTIVE_DEPT (DEPT_NO,IS_ACTIVE) VALUES (20,'N');
INSERT INTO ACTIVE_DEPT (DEPT_NO,IS_ACTIVE) VALUES (30,'Y');
DELETE FROM STUDENT WHERE (STUDENT.DEPT_NO) IN (SELECT D.dept_no FROM DEPART D,ACTIVE_DEPT AD WHERE D.DEPT_NO = AD.DEPT_NO AND AD.IS_ACTIVE = 'N');The above delete query will delete two records from the STUDENT table. Now i want to include another condition say, join_date should be a past date (join_date < trunc(sysdate)).
How to include this condition in the above delete statement. I know i can do this using a subquery but i wont prefer that option. Basically i don't have much idea about join in delete statements.
Please help.Is this you need ?
DELETE FROM student WHERE join_date < TRUNC(SYSDATE)
AND student.dept_no IN (SELECT D.dept_no
FROM depart d,active_dept ad
WHERE d.dept_no = ad.dept_no AND ad.is_active = 'N');Only one record is deleted. -> 3,'FRANK',20,SYSDATE -10
>
Balaji wrote:
Yes. But here we are getting the dept_no from the sub query, is there a better way to achieve this without sub query?
>
As far I know you need to have sub query in this case.
You can close this thread if answered. If you have any further queries please post it so that someone can help you.
Edited by: Lokanath Giri on २० मार्च, २०१२ ५:०५ अपराह्न -
I live in Iran
Yesterday I wanted to use iTunes store for windows ; when i have open iTunes it gives me the error 0x80090318 .
I have search the web alot and i have check lots of Iranian and English website but have not find any solution for
this problem . Today I have find a software called "Hide my IP" i have opened up that
when this software was opened , itunes have said "iTunes can't verify the identify of the server "init.itunes.apple.com"".
then i have click on "continue" then iTunes said "iTunes could not connect to the iTunes Store. An unknown error occurred (310)."
And theres a matter that i think that have a connection with this topic and thats , that when i want to go to the lots
of websites like Google Yahoo! Mail and lots of other website my both browser ( FireFox and IE ) will say" This connection is untrusted " .
I think the solution of my second problem is the solution of my first problem too !Tried all the rest on this site did not work for me
Follow the link below & this one sorted it for me, it was a conflict in programs using Winsock & I got rid of my old program,
Sorted.
http://support.apple.com/kb/TS4123
Tom Ireland -
I recently moved and I got a new sim but I still use my old sim. I want to use both numbers for iMessage and FaceTime but i have absolutely no idea how to do it! please help me! I have a macbook pro and iphone 5
lewbobber wrote:
Basically i need to either take it to a shop that can unlock i.e. £40.00
Be aware, you go that route & every time you try to update or restore, it will error out, leaving your phone unusable. Not to mention, you void all warranty/support.
Sell it & use the proceeds towards an officially unlocked iPhone bought directly from Apple.
Good luck.
Maybe you are looking for
-
Trouble Using Apple's Video Adapter
I am having trouble getting my eMac to work with the Apple Mini-DVI to Video Adapter. There are no directions telling you how to use it or to even get it to work. I want to use it to import videos from my Sony Hi8 camcorder and was told by Apple's Li
-
BPM Condition editor QUALF issue
Hi Gurus, we are using a switch step to define different processing branches. If the "ORGID" in the second E1EDK14 segment is "S1" and the "QUALF" is "015", we can process the message. Otherwise the message hast to be stopped. <E1EDK14 SEGMENT="1">
-
Cannot find the configuration file bc4j.xcfg
I have compiled my Business Components Project in JDeveloper and all Projects that reference that BC Project are pointing to the correct classes directory, but I am still getting the following error: JBO-33001: Cannot find the configuration file /com
-
Hi All! I want to write a Stored Procedure(Oracle) I have a table 'rejrea' as follows: Name NULL? Type TCT_IK NOT NULL NUMBER(8) TRJ_TRAN_SEQ_NB NOT NULL NUMBER(8) LTRR_REJ_RSN_NB NOT NULL NUMBER(4) I have table 'REJTAB' NAME NULL? TYPE TCT_IK NOT NU
-
I want to convert a large pdf document into Word. I have CS5 and Adobe Story. Can this be done with the current software I have? Jacs