How to join BKPF and BSEG
Hi Experts,
how to join BKPF and BSEG
Thanks
nagini
Hi,
BKPF is Transparent table but BSEG is cluster table. We can't create views by joining cluster tables.
hope it helps...
regards,
Raju
Similar Messages
-
How to use BKPF and BSEG without using inner join
Hi,
can anybody plz tell me the logic about how to complete the report without inner joining bkpf and bseg.Is this report can be really be made by using only bseg,bkpf ?
*selection-criteria .
BKPF-USNAM
BKPF-CPUDT
BKPF-BUDAT
BKPF-GJAHR
BKPF-BUKRS
BKPF-BELNR
BSEG-SAKNR
BSEG-LIFNR
BSEG-KUNNR
BSEG-ZUONR
BSEG-SGTXT
Output fields required.
BKPF-BUKRS
BKPF-BELNR
BKPF-GJAHR
BKPF-MONAT
BKPF-BLART
BKPF-CPUDT
BKPF-BLDAT
BKPF-BUDAT
BKPF-USNAM
BKPF-XBLNR
BKPF-STBLG
BKPF-BKTXT
BKPF-WAERS
BKPF-KURSF
BSEG-BUZEI
BSEG-BSCHL
BSEG-KOART
BSEG-UMSKZ
BSEG-SHKZG
BSEG-MWSKZ
BSEG-PSWBT
BSEG-PSWSL
BSEG-DMBTR
BSEG-SAKNR
BSEG-HKONT
BSEG-KOSTL
BSEG-KUNNR
BSEG-VBELN
BSEG-LIFNR
BSEG-ANLN1
BSEG-ANLN2
BSEG-AUFNR
BSEG-MATNR
BSEG-MENGE
BSEG-MEINS
BSEG-ZUONR
BSEG-SGTXT
Thanks,
Rahman
Moderator Message: Please search before posting your question. Thread locked.
Edited by: Suhas Saha on Jan 31, 2012 3:07 PMQuick question - what's preventing your from using built-in functions?
I suggest mapping your Time Dim to a standard Time Dim and work with it - you'll save a lot more time. You'd even need this table if you wanted to work around Todate/AGO.
It is possible to model this functionality w/o functions, but it'll be time consuming task, similar to using Time Series Wizard in Siebel Analytics. You'll need to build aliases and views along with some complex joins (such as TIME.KEY=TIME.KEY-365), introduce a bunch of variables to control. Also, you might not get much flexibility in terms of years. For each year, you'd need an alias table. (TIME_DIM_PY). -
How to join anla anlc bkpf and bseg in sap
any can u tel me how to join the anla anlc bkpf and bseg tables in sap.if any body having asset report send me plz
Moderator message - Welcome to SCN
But please search for answers here before posting and do not ask the forum to do your work for you.
Thread locked.
Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
Rob -
How to create view on bkpf and bseg?
friends,
can we create views on bkpf and bseg if yes wht are the steps...please note it down n send me..regards essam ([email protected])Hi,
Use standard views...
View name Short text
BKPF_AEDAT BW FI: BKPF Extraction Using AEDAT
BKPF_BSAD BW FI: BSAD Extraction Using CPUDT
BKPF_BSAD_AEDAT BW FI: BSAD Extraction using AEDAT
BKPF_BSAK BW FI: BSAK Extraction Using CPUDT
BKPF_BSAK_AEDAT BW FI: BSAK Extraction using AEDAT
BKPF_BSID BW FI: BSID Extraction Using CPUDT
BKPF_BSID_AEDAT BW FI: BSID Extraction using AEDAT
BKPF_BSIK BW FI: BSIK Extraction Using CPUDT
BKPF_BSIK_AEDAT BW FI: BSIK Extraction using AEDAT
CRMV_BKPF_BEBD FI Documents Relevant for Feedback to CRM
V_EWU_BKPF Update View for Parallel Processing on BKPF
V_VBSEGK
V_VBSEGS
Regards,
Omkar. -
Query with tables of BKPF and BSEG and Structures COBL, RF05A
hi experts,
I want to create query with the tables of BKPF and BSEG and Structures COBL, RF05A
How can i proceed?
Please give me complete points
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PMcheck the common fields and required fields and the write SELECT query useing Inner Joins or For all entries
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PM -
Hi all,
Please Clarify.
How to join OE_ORDER_HEADERS_ALL and HZ_PARTY_SITES,HZ_PARTIES in R12how can i make a join to get the Customer_Name and Customer_Number from RA_Customer table and oe_order_headers_all and oe_order_lines_all......thanks in advancePlease see these docs for examples on how to join those three tables.
Multiple Language Request For Sales Order Acknowledgment Has Performance Issue [ID 1275133.1]
Shipment History Data Are Not Populated In Dp [ID 889057.1]
Disc0unt Did Not Apply To Sales Order Line With Volume Offer As Modifier [ID 1415593.1]
Thanks,
Hussein -
Hi all ,
how to join ce_200_transactions_v and ce_statement_lines in Cash Management?
Please suggest.Did you check eTRM website? -- http://etrm.oracle.com/
Thanks,
Hussein -
Hi all,
Can someone help me optimize the performance of this code as i don't know how else to select from BSEG as i cannot use a join coz its a cluster table. I need to find a way to improve the perfomance.Any help would be much appreciated.
SELECT belnr gjahr bukrs budat stblg awkey blart
FROM bkpf INTO CORRESPONDING FIELDS OF TABLE t_bkpf
WHERE belnr IN s_belnr and
gjahr = p_gjahr and
bukrs = p_bukrs.
LOOP AT t_bkpf.
SELECT belnr gjahr buzei ebeln ebelp
wrbtr fipos geber fistl fkber
augbl augdt shkzg
INTO CORRESPONDING FIELDS OF table t_bseg
FROM bseg
WHERE belnr = t_bkpf-belnr
AND gjahr = t_bkpf-gjahr
AND bukrs = t_bkpf-bukrs.
Thanks alot
seemaHi Seema,
You have to avoid the database retrival inside the loop.You can use for all entries.
This is taken from a link.
Some of the SAP tables are not transparant, but pooled or clustered. Be aware of this !
There are a lot of limitations on how such tables can be accessed. You can not include such
tables in database views and join constructs. The FI-GL table BSEG, which is one of our
biggest PR1 tables, is an example of a clustered table. At the database-level, there is no table
called BSEG, but instead RFBLG is being used for the BSEG data. Most of the fields known
in BSEG are not known in the database table RFBLG, but are compressed in a VARDATA
field of RFBLG. So tests in the WHERE clause of SELECTs agains BSEG are not used by
the database (e.g. lifnr = vendor account number, hkont = G/L account, kostl = cost center).
As a consequence, these tests are done after the facts similar to using the CHECK statement,
and as already said in tip 1, CHECK statements are worse than tests in the WHERE-clause.
Check this link also.
How to Read BSEG Efficiently
you'll never select table bkpf alone.
alternatives:
1) select with header information from bkpf
2) use secondary index tables
Re: Tuning cluster table selection
3) use logical data base e.g.: BRF
Hope this helps.If so,reward points.Otherwise, get back. -
How to join BALDAT and BALHRD???
I am working on the reorganization of the basis tables of SAP and need to analyze the table BALDAT (Application Logs). I would like to know what years the data is from, but therefore I need to do a join.
But how to join these to tables? It can't be done directly...
Can anyone help me? Does anyone know?Another question: Am I in the right forum for this problem? Or where could I ask such things? Better in the ABAP forums?
-
Performance issue in BI due to direct query on BKPF and BSEG tables
Hi,
We had a requirement that FI document number fieldshould be extracted in BI.
Following code was written which has the correct logic but performance is bad.
It fetched just 100 records in more than 4-5 hrs.
The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
Is there any way to improve this code like adding GJAHR field in where clause? I dont want to change the logic.
Following is the code:
WHEN '0CO_OM_CCA_9'." Data Source
TYPES:BEGIN OF ty_bkpf,
belnr TYPE bkpf-belnr,
xblnr TYPE bkpf-xblnr,
bktxt TYPE bkpf-bktxt,
awkey TYPE bkpf-awkey,
bukrs TYPE bkpf-bukrs,
gjahr TYPE bkpf-gjahr,
AWTYP TYPE bkpf-AWTYP,
END OF ty_bkpf.
TYPES : BEGIN OF ty_bseg1,
lifnr TYPE bseg-lifnr,
belnr TYPE bseg-belnr,
bukrs TYPE bseg-bukrs,
gjahr TYPE bseg-gjahr,
END OF ty_bseg1.
DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
wa_bkpf TYPE ty_bkpf,
it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
wa_bseg1 TYPE ty_bseg1,
l_s_icctrcsta1 TYPE icctrcsta1.
"Extract structure for Datasoure 0co_om_cca_9.
DATA: l_awkey TYPE bkpf-awkey.
DATA: l_gjahr1 TYPE gjahr.
DATA: len TYPE i,
l_cnt TYPE i.
l_cnt = 10.
tables : covp.
data : ref_no(20).
SELECT lifnr
belnr
bukrs
gjahr
FROM bseg
INTO TABLE it_bseg1.
DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
SELECT belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf.
IF sy-subrc EQ 0.
CLEAR: l_s_icctrcsta1,
wa_bkpf,
l_awkey,
wa_bseg1.
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
ELSE. " IF AWORG IS NOT BLANK -
concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
ref_no
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
endif.
endif.
CLEAR: l_s_icctrcsta1.
CLEAR: COVP, REF_NO.
ENDLOOP.
ENDIF.Hello Amruta,
I was just looking at your coding:
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
I guess that this table does not contain millions of entries. Am I right?
If yes, the the first step would be to pre-select COVP entries:
select BELNR AWORG AWTYP into lt_covp from COVP
for all entries in c_t_data
where belnr = c_t_data-belnr.
sort lt_covp by belnr.
Once having this data ready, you build an internal table for BKPF selection:
LOOP AT c_t_data INTO l_s_icctrcsta1.
clear ls_bkpf_sel.
ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
if sy-subrc = 0.
ls_bkpf_sel-awtyp = lt_covp-awtyp.
endif.
ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
insert ls_bkpf_sel into table lt_bkpf_sel.
ENDLOOP.
Now you have all necessary info to read BKPF:
SELECT
belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf
for all entries in lt_bkpf_sel
WHERE
awkey = lt_bkpf_sel-awkey and
awtyp = lt_bkpf_sel-awtype and
gjahr = lt_bkpf_sel-gjahr.
Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
Moreover I would even try to make a join on DB level. But first try this solution.
Regards,
Yuri -
How to join Dimensions and Fact Tables in OBIEE
Hi All,
I need to create report which need to get the information from two fact tables and 7 dimensions. The granularity is not same in both the fact tables. One fact table is having common keys between all the dimension tables and second fact table have only two dimension keys but with different names. My requirement is to create the report by taking the measures from both the fact tables.
I have created joins between the second fact table and two dimension tables in physical and BMM layer and also set the highest level for all other dimension tables in the LTS of second fact table. when am creating report by taking the measures from both the fact tables, data is not getting for the measure which taken from the second fact table. Please advice me how to get the data for the measure which taken from the second fact table.
Thanks in Advancec !!You have to use the level-base measure capabilities.
http://gerardnico.com/wiki/dat/obiee/bi_server/design/fact_table/level_based_measure_calculations
For all measures of the second fact table with the lowest grain (with two dimension keys), set for all dimension where you don't have any key the logical level to the "All" or "Total".
And UNSET the highest level of the LTS for the second fact table.
Success
Nico -
Performance tuning on BKPF and BSEG for my code.
Please provide alternative code for the following code so that processing is fast.
my select queries are as follows. It take a lot of time and system gets loaded when it is scheduled.
select BUKRS
BELNR
GJAHR
BLART
BLDAT
BUDAT
TCODE
XBLNR
STBLG
WAERS
KURSF
AWKEY
STGRD
into CORRESPONDING FIELDS OF TABLE
IT_BKP from bkpf where bukrs = p_bukrs
and gjahr in s_gjahr
AND BLART NE 'SA'
and budat in s_date.
select BELNR
KOART
SHKZG
MWSKZ
DMBTR
KTOSL
SGTXT
VBELN
HKONT
KUNNR
MATNR
MENGE
FROM BSEG INTO CORRESPONDING FIELDS OF TABLE it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
and gjahr = it_bkpf-gjahr
and MWSKZ in s_MWSKZ .
Please help.Hi,
Declare internal table same fields as the you are selecting from table and
remove corresponding fields of and also check ur t_bkpf table is not initial
before using for all enteries.
foe e.g.
select BUKRS
BELNR
GJAHR
BLART
BLDAT
BUDAT
TCODE
XBLNR
STBLG
WAERS
KURSF
AWKEY
STGRD
into TABLE
IT_BKP from bkpf where bukrs = p_bukrs
and gjahr in s_gjahr
AND BLART NE 'SA'
and budat in s_date.
IF IT_BKPF[] IN NOT INITIAL.
select BELNR
KOART
SHKZG
MWSKZ
DMBTR
KTOSL
SGTXT
VBELN
HKONT
KUNNR
MATNR
MENGE
FROM BSEG INTO TABLE it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
and gjahr = it_bkpf-gjahr
and MWSKZ in s_MWSKZ .
ENDIF.
reward if useful. -
How to join payroll and general ledger
Hi, some one could help me to join the payroll table and general ledger?
what i need is to know how to obtain the gl_code_combination_id of a per_time_period
thanksTable PAY_PAYROLL_GL_FLEX_MAPS contain details of mapping between Cost Allocation Flexfield segments to Chart Of Accounts Segments.
-
How to join audio and screen recording
I have recorded with both the screen capture and audio capture and now want to join / merge the files into one. Does any one know how I can do this easily? What application would I need to use? CAn it be done with iMovies? Thanks
m2v files are usually used in DVD authoring. Is that what you are trying to create?
If so, you'll want a AC3 or aiff file format for the audio and use DVD Studio Pro to merge the two into VOB files.
If this isn't what you are trying to accomplish, please offer up more information.
x -
LOGICAL DATABASE BRF FOR ... BKPF AND BSEG
Hi friends ,
i want the change the input criteria ( select option) in my program , i am using the LDB "BRF" ..it gives me standard selection screen .. but i want to add the GSBER field in the input condition ..
How can i cahge the selection criteria in standard LDB ..How can i do that ..
Ialso want to convert select option in output to parameter ...
Plz suggest..Dude LDB gives me one extra selection parameter but i need not that parameter ...
Is ther any way by which i remove that selection parameter and add up my new paramere ...
The same thing i done in pnp LDB but i am unable to do same in brf LDB.
Beaus in PNP there is "HR report category " BY which i cam made >>>>
Maybe you are looking for
-
Creative Cloud desktop app stops loading after every restart (pc)
This has been happening since the last update. Every time I restart my PC, the Creative Cloud app not only doesn't launch automatically, but stops launching and working altogether. It is on the Task Manager as something that is opened, but it isn't.
-
Register AcroPDF.dll Windows XP
How can I Register AcroPDF.dll of version 9.1.0.163 in Windows XP in 32 bit version,so that i can use as PDF viewer control in VS2005. Note from host: Please to do not duplicate your question in the subject line. The subject line is a brief sysnopsis
-
Can't open my ebook (VE error 59)!
When I'm trying to open my ebook (bought from amazon) I just can't add it to the Library. Only this message shows up: Adobe DRM Error System: 8 State: 4 Code: 59 Class: 1 Message: VE error 59
-
Strange icons or pictures - please help!!
Guys, if anyone can help me, I'd be MOST thankful. When I try turning on my iPod (the 20 GB unit), I get a picture of a charging unit and an electrical outlet, but nothing else happens. Can anyone help me? what does it mean? what is the solution? My
-
BEx Web - Open/Save dialog - Set Default Type
Hi All, In the BEx Open/Save dialog (accessed thru New Analysis button), shows "Views" in the Type drop down as default. Is there a way to set this type to Query by default? Thanks & Regards, Sree