Inconsitency in BSIS & BSAS Tables
Due to the messup done by the consultants engaged by our organisation for SAP implementation with respect to SEM & BCS consolidation over and above the other goofups they made, we had to update certain fields ( Trading Partner & Recon Account - meant for related parties) directly in the tables.
After such updation we encountered line itme reports not matching the Totals. We reset back the reconcilation accounts to the Orginal value. All tables except the BSIS & BSAS are ok, due to certain duplicate reocrds in BSIS and BSAS tables vis a vis BSID, BSAD, BSIK & BSAK, can anyone advice and /or guide us as to the repurcussions if we delete these duplicate rows in BSIS and BSAS with respect to report generation, future transactions, closing etc.
Message was edited by:
Brad Master
It is baffling how SEM and BCS consultants ended up messing up your R/3 tables. That is one of the reason why there is always a separate ownership of the two process areas. Best practice is to have separate owners for FI and BCS areas. Never the twain shall meet!
Regardless of who is to blame for the messup, it is NEVER a good idea for you to update the SAP tables directly. Period. No exceptions.
The fact that someone (inhouse or same consultants?) actually suggested you do that and you did that is symptomatic of deeper problems in your organization.
My two cents: don't paper over the already exacerbated problem. Get rid of cheap consultants and get some knowledgeable help.
Similar Messages
-
Clearing details i could not getting at BSIS & BSAS table. after Payment
Hi All,
I posted one invoice document through MIRO like below
Itm PK BusA Acct no. Description Tx Amount in INR
001 31 1000 102961 DRUCK INDIA PVT. LTD. SC 479,777.20-
002 86 1000 350101 GR-IR-Account SC 427,000.00
003 40 300816 Service Tax 1 Cess SC 51,240.00
004 40 300817 CESS 1 SC 1,024.80
005 40 300817 CESS 1 SC 512.40
payment to vendor also done through F110.
Itm PK BusA Acct no. Description T x Amount in INR
001 25 1000 102961 DRUCK INDIA PVT. LTD. 479,777.20
002 50 140904 ABN Amro Payments 479,777.20-
now problem is Clearing details i could not getting at BSIS & BSAS table.
but iam getting clearing details at BSEG table. what is the problem . plse give help & solution. it is very urgant.if u have any doubts plse ask me.
Advance Thanks
RajDear sridhar/ all
vendor side is all tables updated. it is ok. but i want detals about BSAS & BSIS.
because iam working on service tax creidit configuration. in BSEG table it is showing cleared. but in BSAS & BSIS tables not showing as a cleared item. what is the reason . plse give solution/ help.
Raj -
BSIS/BSAS tables not populated
Dear Experts,
I have a GL/account having too many items but FAGLL03 returns no items.
I have found that the reason is that tables BSIS and BSAS are not being populated with line items. however tables BKPF and BSEG in addition to FAGLFLEXA are all populated.
can you please assist why BSIS/BSAS are not populated thus FAGLL03 is not working? what is wrong with this GL account?
Thanks for your assistance.
SamirHmmm... Is it normal FI document or it's posted through some interface? If it's normal document and the following is right:
a) G/L account of the document is defined with 'line item' flag in this company code (SKB1 table)
b) the document exists in BSEG
c) BSEG-XKRES flag is 'X' on the line for this account
Then, if all mentioned above is correct, I'd open OSS note.
Regards,
Eli -
Required replace BSEG with BSAK BSIK BSIS BSAS for report performance
Hi Experts
i m optimizing a report in which data is extracting from BSEG , 5 time so i reduses the performance of report
so i want replace BSEG with BSAK BSIK BSIS BSAS for the same data what I am getting now . this is report of Purchase of item. code is here.
REPORT zmm_pur_reg_kanhe LINE-SIZE 1023.
*& Des :Purchase Tax Register Report for KANHE
*& Created on :12-07-07
*& Suggested by:Paresh Saini(MM)
*& Changes By: Lailu Philip
*& Changed On: 24.09.2007
*& Changes: New columns for G/L Code Description,VAT Amt,VAT Perc,CST Perc
*& ,SHCESS Amounts,WCT G/L Acc., WCT Amt,Tax Code
*& for Purchase Order,WCT tax code & Percentage.
*& Request No: S6DK921577
Data Declaration
*& changes: by Vincy on 12.01.2007
*& changes: display purchase order with vendor type zpsr(get_zpsr)
*& Request No: S6DK930821
TABLES:ekbe, lfa1, faglflexa.",j_1iexcdtl,lfa1,bkpf,bseg.
TYPE-POOLS: slis. "ALV Declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
DATA: it_sortcat TYPE slis_sortinfo_alv OCCURS 1,
col_pos LIKE fieldcatalog-col_pos .
TYPES :BEGIN OF wa1_ekbe,
belnr TYPE ekbe-belnr,
budat TYPE ekbe-budat,
menge TYPE ekbe-menge,
matnr TYPE ekbe-matnr,
ebelp TYPE j_1iexcdtl-ritem1,
ebeln TYPE ekbe-ebeln,
gjahr TYPE ekbe-gjahr,
lfbnr TYPE ekbe-lfbnr,
lfpos TYPE ekbe-lfpos,
bldat TYPE ekbe-bldat,
REEWR TYPE REEWR,
END OF wa1_ekbe.
TYPES :BEGIN OF wa2_ekbe,
belnr TYPE ekbe-belnr,
budat TYPE ekbe-budat,
menge TYPE ekbe-menge,
ebelp TYPE ekbe-ebelp,
ebeln TYPE ekbe-ebeln,
gjahr TYPE ekbe-gjahr,
lfbnr TYPE ekbe-lfbnr,
lfpos TYPE ekbe-lfpos,
bldat TYPE ekbe-bldat,
REEWR TYPE REEWR,
awkey(20) TYPE c,
MATNR TYPE MATNR,
MWSKZ TYPE EKBE-MWSKZ,
END OF wa2_ekbe.
TYPES :BEGIN OF wa1_j_1iexcdtl,
exnum TYPE j_1iexcdtl-exnum,
exdat TYPE j_1iexcdtl-exdat,
lifnr TYPE j_1iexcdtl-lifnr,
matnr TYPE j_1iexcdtl-matnr ,
maktx TYPE j_1iexcdtl-maktx ,
capind TYPE j_1iexcdtl-capind,
exbas TYPE j_1iexcdtl-exbas,
exbed TYPE j_1iexcdtl-exbed,
ecs TYPE j_1iexcdtl-ecs,
werks TYPE j_1iexcdtl-werks,
ritem1 TYPE j_1iexcdtl-ritem1,
rdoc1 TYPE j_1iexcdtl-rdoc1,
docyr TYPE j_1iexcdtl-docyr,
bedinv type J_1IBEDINV,
ecsinv type J_1IECSINV,
EXADDINV1 type J_1IEXADDINV1,
exaddtax1 TYPE j_1iexcdtl-exaddtax1,
rdoc2 TYPE j_1iexcdtl-rdoc2,
ritem2 TYPE j_1iexcdtl-ritem2,
menge TYPE j_1iexcdtl-menge,
ADDED FOR RUDRAPUR ON 08.03.2008 BY ASHOK.CH
*ENDED ON 08.02.2008
END OF wa1_j_1iexcdtl.
TYPES :BEGIN OF wa1_lfa1,
name1 TYPE lfa1-name1,
ktokk TYPE lfa1-ktokk,
werks TYPE lfa1-werks,
lifnr TYPE lfa1-lifnr,
END OF wa1_lfa1.
TYPES :BEGIN OF wa1_ekexclf,
belnr TYPE ekbe-belnr,
budat TYPE ekbe-budat,
menge TYPE ekbe-menge,
ebelp TYPE ekbe-ebelp,
ebeln TYPE ekbe-ebeln,
gjahr TYPE ekbe-gjahr,
awkey(20) TYPE c,
exnum TYPE j_1iexcdtl-exnum,
exdat TYPE j_1iexcdtl-exdat,
lifnr TYPE j_1iexcdtl-lifnr,
matnr TYPE j_1iexcdtl-matnr ,
maktx TYPE j_1iexcdtl-maktx ,
capind TYPE j_1iexcdtl-capind,
exbas TYPE j_1iexcdtl-exbas,
exbed TYPE j_1iexcdtl-exbed,
ecs TYPE j_1iexcdtl-ecs,
werks TYPE j_1iexcdtl-werks,
ritem1 TYPE j_1iexcdtl-ritem1,
rdoc1 TYPE j_1iexcdtl-rdoc1,
docyr TYPE j_1iexcdtl-docyr,
name1 TYPE lfa1-name1,
ktokk TYPE lfa1-ktokk,
exaddtax1 TYPE j_1iexcdtl-exaddtax1,
added for rudrapur on 08.03.2008 by ASHOK.CH
bedinv type J_1IBEDINV,
ecsinv type J_1IECSINV,
EXADDINV1 type J_1IEXADDINV1,
END OF MODIFICATION ON 08.02.2008
END OF wa1_ekexclf.
TYPES :BEGIN OF wa1_bkpf,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
budat TYPE bkpf-budat,
tcode TYPE bkpf-tcode,
awkey TYPE bkpf-awkey,
END OF wa1_bkpf.
TYPES :BEGIN OF wa1_bseg,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
bschl TYPE bseg-bschl,
fwbas TYPE bseg-fwbas ,
pswbt TYPE bseg-pswbt,
hkont TYPE bseg-hkont,
wrbtr TYPE bseg-wrbtr,
ktosl TYPE bseg-ktosl,
koart TYPE bseg-koart,
shkzg TYPE bseg-shkzg,
mwskz TYPE bseg-mwskz,
qsskz TYPE bsis-qsskz,
dmbtr TYPE bseg-dmbtr,
lifnr TYPE bseg-lifnr,
matnr TYPE bseg-matnr,
flag TYPE C,
flag_21 TYPE C,
END OF wa1_bseg.
TYPES :BEGIN OF wa1_tax,
belnr TYPE bseg-belnr,
fi_docno TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
bukrs TYPE bseg-bukrs,
awkey TYPE bkpf-awkey,
fwbas TYPE bseg-fwbas ,
cst_amt TYPE bseg-pswbt,
vat_amt TYPE bseg-pswbt,
shcess_amt TYPE bseg-pswbt,
gl_accnt TYPE bseg-hkont,
gl_desc TYPE skat-txt50,
wctglacc TYPE bseg-hkont,
wctamt TYPE bseg-dmbtr,
taxcode TYPE t059z-wt_withcd,
taxperc TYPE t059z-qsatz,
total_value TYPE bseg-wrbtr,
set_off TYPE bseg-wrbtr,
cond_type TYPE konv-kschl,
description(20) TYPE c,
service_tax TYPE bseg-wrbtr,
service_ecess TYPE bseg-wrbtr,
service_shcess TYPE bseg-wrbtr, "vincy on 31.01.08
ebelp TYPE ekbe-ebelp, " on 15.04.08
flag TYPE c,
mwskz TYPE bseg-mwskz,
END OF wa1_tax.
DATA:BEGIN OF itab_skat,
saknr TYPE skat-saknr,
spras TYPE skat-spras,
txt50 TYPE skat-txt50,
END OF itab_skat.
DATA: iskat LIKE itab_skat OCCURS 0,
wa_skat LIKE itab_skat.
DATA : BEGIN OF zbsis OCCURS 0,
bukrs TYPE bsis-bukrs,
hkont TYPE bsis-hkont,
augdt TYPE bsis-augdt,
augbl TYPE bsis-augbl,
zuonr TYPE bsis-zuonr,
gjahr TYPE bsis-gjahr,
belnr TYPE bsis-belnr,
buzei TYPE bsis-buzei,
budat TYPE bsis-budat,
qsskz TYPE bsis-qsskz,
END OF zbsis.
DATA: BEGIN OF zt059z OCCURS 0,
land1 TYPE t059z-land1,
witht TYPE t059z-witht,
wt_withcd TYPE t059z-wt_withcd,
qscod TYPE t059z-qscod,
qsatz TYPE t059z-qsatz,
hkont TYPE bsis-hkont,
belnr TYPE bsis-belnr,
END OF zt059z.
DATA: BEGIN OF it_faglflexa OCCURS 0, "added by vincy
ryear TYPE faglflexa-ryear,
docnr TYPE faglflexa-docnr,
rldnr TYPE faglflexa-rldnr,
rbukrs TYPE faglflexa-rbukrs,
docln TYPE faglflexa-docln,
prctr TYPE faglflexa-prctr,
END OF it_faglflexa.
Final Table***
TYPES :BEGIN OF wa1_final,
belnr TYPE ekbe-belnr,
fi_docno TYPE bseg-belnr,
budat TYPE ekbe-budat,
menge TYPE ekbe-menge,
rate TYPE konv-kbetr,
ebelp TYPE ekbe-ebelp,
ebeln TYPE ekbe-ebeln,
mwskz TYPE bseg-mwskz,
gjahr TYPE ekbe-gjahr,
awkey(20) TYPE c,
exnum TYPE j_1iexcdtl-exnum,
exdat TYPE j_1iexcdtl-exdat,
lifnr TYPE j_1iexcdtl-lifnr,
matnr TYPE j_1iexcdtl-matnr ,
maktx TYPE j_1iexcdtl-maktx ,
capind TYPE string,
exbas TYPE j_1iexcdtl-exbas,
exbed TYPE j_1iexcdtl-exbed,
ecs TYPE j_1iexcdtl-ecs,
werks TYPE j_1iexcdtl-werks,
ritem1 TYPE j_1iexcdtl-ritem1,
rdoc1 TYPE j_1iexcdtl-rdoc1,
docyr TYPE j_1iexcdtl-docyr,
name1 TYPE lfa1-name1,
ktokk TYPE lfa1-ktokk,
fwbas TYPE bseg-fwbas ,
vat_per TYPE konv-kbetr,
vat_amt TYPE bseg-pswbt,
cst_per TYPE konv-kbetr,
cst_amt TYPE bseg-pswbt,
shcess_amt TYPE bseg-pswbt,
gl_accnt TYPE bseg-hkont,
gl_desc TYPE skat-txt50,
wctglacc TYPE bseg-hkont,
wctamt TYPE bseg-dmbtr,
taxcode TYPE t059z-wt_withcd,
taxperc TYPE t059z-qsatz,
total_value TYPE bseg-wrbtr,
total_value1 TYPE bseg-wrbtr,
excise_tax TYPE bseg-wrbtr,
excise TYPE bseg-wrbtr,
set_off TYPE bseg-wrbtr,
inventorised TYPE konv-kawrt,
cond_type TYPE konv-kschl,
cond_type2 TYPE konv-kschl,
description(20) TYPE c,
service_tax TYPE bseg-wrbtr,
service_ecess TYPE bseg-wrbtr,
service_shcess TYPE bseg-wrbtr, "vincy on 31.01.08
END OF wa1_final.
DATA :it2_ekbe TYPE TABLE OF wa1_ekbe WITH HEADER LINE,
it_ekbe TYPE TABLE OF wa1_ekbe WITH HEADER LINE,
it1_ekbe TYPE TABLE OF wa2_ekbe WITH HEADER LINE WITH KEY ebelp ebeln,
it_j_1iexcdtl TYPE TABLE OF wa1_j_1iexcdtl WITH HEADER LINE WITH KEY rdoc1 ritem1,
it_lfa1 TYPE TABLE OF wa1_lfa1 WITH HEADER LINE WITH KEY lifnr,
it_lfa2 TYPE TABLE OF wa1_lfa1 WITH HEADER LINE WITH KEY lifnr,
it_bkpf TYPE TABLE OF wa1_bkpf WITH HEADER LINE,
it_bseg TYPE TABLE OF wa1_bseg WITH HEADER LINE WITH KEY
bukrs belnr gjahr ktosl shkzg koart,
it1_bseg TYPE TABLE OF wa1_bseg WITH HEADER LINE WITH KEY
bukrs belnr gjahr ktosl shkzg koart,
it_tax TYPE TABLE OF wa1_tax WITH HEADER LINE WITH KEY awkey ,
it_ekexclf TYPE TABLE OF wa1_ekexclf WITH HEADER LINE,
it_final TYPE TABLE OF wa1_final WITH HEADER LINE,
it_final1 TYPE TABLE OF wa1_final WITH HEADER LINE, "vincy
wa_ekbe TYPE wa1_ekbe,
wa1_ekbe TYPE wa2_ekbe,
wa_j_1iexcdtl TYPE wa1_j_1iexcdtl,
wa_lfa1 TYPE wa1_lfa1,
wa_lfa2 TYPE wa1_lfa1,
wa_bkpf TYPE wa1_bkpf,
wa_bseg TYPE wa1_bseg,
wa_tax TYPE wa1_tax,
wa_ekexclf TYPE wa1_ekexclf,
PLANT TYPE WERKS_D,
wa_final TYPE wa1_final.
DATA: it_konv TYPE konv OCCURS 0 WITH HEADER LINE ,
wa_konv TYPE konv,
invent TYPE p DECIMALS 4,
invent1 TYPE konv-kawrt.
DATA:d1 TYPE konv-kposn,
d2 TYPE ekbe-ebelp.
DATA: v_belnr TYPE ekbe-belnr,
v_gjahr TYPE ekbe-gjahr,
v_awkey(20) TYPE c,
idx TYPE sy-tabix.
**********by vincy on 12.01.07***********
DATA: BEGIN OF it_ekko OCCURS 0,
ebeln LIKE ekko-ebeln,
bukrs LIKE ekko-bukrs,
bsart LIKE ekko-bsart,
lifnr LIKE ekko-lifnr,
belnr LIKE ekbe-belnr,
END OF it_ekko.
DATA: BEGIN OF it_ekpo OCCURS 0,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
txz01 LIKE ekpo-txz01,
END OF it_ekpo.
DATA: BEGIN OF it_lfa1v OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
END OF it_lfa1v.
DATA: BEGIN OF s_prctr OCCURS 0,
low LIKE faglflexa-prctr,
END OF s_prctr.
DATA: it_bsegv TYPE TABLE OF wa1_bseg WITH HEADER LINE.
DATA: it_konv1 LIKE konv OCCURS 0 WITH HEADER LINE.
DATA:cnt TYPE i,
awkey1(250).
DATA: LIFNR TYPE LIFNR,
NAME TYPE NAME1_GP,
MTART TYPE MARA-MTART,
MAKTX TYPE MAKTX,
TAX_TOT TYPE KWERT.
***********end of changes by vincy ************
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_werks1 FOR ekbe-werks,
s_budat1 FOR ekbe-budat,
s_fiscal FOR ekbe-gjahr,
s_lifnr FOR lfa1-lifnr.
SELECTION-SCREEN END OF BLOCK b1.
**"changes being by nahid on 16.04.2008
PARAMETERS : excel AS CHECKBOX DEFAULT 'X'.
PARAMETERS: infile LIKE rlgrap-filename.
DATA : zfile TYPE string.
**"changes ended by nahid on 16.04.2008
AT SELECTION-SCREEN.
IF s_werks1 IS INITIAL.
MESSAGE 'Please Enter Plant details' TYPE 'E'.
ENDIF.
IF s_budat1 IS INITIAL.
MESSAGE 'Please Enter Posting date' TYPE 'E'.
ENDIF.
IF s_fiscal IS INITIAL.
MESSAGE 'Please Enter Fiscal Year' TYPE 'E'.
ENDIF.
*start change by nahid on 16.4.08
AT SELECTION-SCREEN ON VALUE-REQUEST FOR infile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = infile
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
zfile = infile.
*end change by nahid on 16.4.08
START-OF-SELECTION.
plant = s_werks1-low.
MODIFIED FOR RUDRAPUR BY ASHOK.CH ON 13.03.2008
IF PLANT NE 'RD01'.
PERFORM get_data.
PERFORM get_zpsr. "vincy
ENDIF.
IF PLANT EQ 'RD01'.
PERFORM get_data1.
ENDIF.
*END OF MODIFICATION ON 13.03.2008
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*start chng by nahid on 16.4.08
IF excel = 'X'.
IF NOT infile IS INITIAL.
PERFORM excel_data.
ELSE.
MESSAGE e000(0) WITH 'Please Enter the File Path'.
ENDIF.
ENDIF.
*end by nahid on 16.4.08
*& Form get_data
FORM get_data .
SELECT belnr budat menge matnr ebelp ebeln gjahr lfbnr lfpos bldat REEWR FROM ekbe INTO
TABLE it_ekbe
WHERE werks IN s_werks1 AND
(bewtp EQ 'Q' OR bewtp EQ 'N') AND
bewtp IN ('Q' , 'N') AND "added N by vincy on 6.07.2008
budat IN s_budat1 AND
gjahr IN s_fiscal .
IF sy-subrc = 0. "for 1st ekbe
IF it_ekbe[] IS NOT INITIAL.
SELECT exnum exdat lifnr matnr maktx capind exbas exbed ecs werks
ritem1 rdoc1 docyr bedinv ecsinv EXADDINV1 exaddtax1 rdoc2 ritem2 menge
FROM j_1iexcdtl INTO TABLE it_j_1iexcdtl FOR ALL ENTRIES IN it_ekbe
WHERE rdoc1 = it_ekbe-ebeln
AND ritem1 = it_ekbe-ebelp AND
lifnr IN s_lifnr.
ENDIF.
IF it_j_1iexcdtl[] IS NOT INITIAL.
SELECT name1 ktokk werks lifnr FROM lfa1 INTO
TABLE it_lfa1 FOR ALL ENTRIES IN it_j_1iexcdtl
WHERE lifnr = it_j_1iexcdtl-lifnr.
ENDIF.
LOOP AT it_ekbe INTO wa_ekbe.
wa1_ekbe-belnr = wa_ekbe-belnr.
wa1_ekbe-budat = wa_ekbe-budat.
wa1_ekbe-menge = wa_ekbe-menge.
wa1_ekbe-ebelp = wa_ekbe-ebelp.
wa1_ekbe-ebeln = wa_ekbe-ebeln.
wa1_ekbe-gjahr = wa_ekbe-gjahr.
wa1_ekbe-matnr = wa_ekbe-matnr.
wa1_ekbe-lfbnr = wa_ekbe-lfbnr.
wa1_ekbe-lfpos = wa_ekbe-lfpos.
wa1_ekbe-bldat = wa_ekbe-bldat.
v_belnr = wa_ekbe-belnr.
v_gjahr = wa_ekbe-gjahr.
CONCATENATE v_belnr v_gjahr INTO v_awkey.
wa1_ekbe-awkey = v_awkey.
APPEND wa1_ekbe TO it1_ekbe.
CLEAR :wa_ekbe.
ENDLOOP.
************changes by vincy on 29.05.08 for 'FB08' and 'FB60'**************
LOOP AT s_werks1.
IF s_werks1-low = 'KN01'.
s_prctr-low = 'MUKNHSTM'.
ELSEIF
s_werks1-low = 'NS01'.
s_prctr-low = 'MUNSKSTM'.
ELSEIF
s_werks1-low = 'RD01'.
s_prctr-low = 'MURDPSTM'.
ENDIF.
APPEND s_prctr.
ENDLOOP.
SELECT bukrs belnr gjahr budat tcode awkey FROM bkpf INTO TABLE it_bkpf
WHERE bukrs = 'MU51' AND
gjahr IN s_fiscal AND
budat IN s_budat1 AND
( tcode = 'FB60' OR tcode = 'FB08' ).
IF it_bkpf[] IS NOT INITIAL.
SELECT ryear docnr rldnr rbukrs docln prctr FROM faglflexa INTO TABLE it_faglflexa
FOR ALL ENTRIES IN it_bkpf WHERE rbukrs = 'MU51' AND
ryear = it_bkpf-gjahr AND
docnr = it_bkpf-belnr.
ENDIF.
LOOP AT it_faglflexa.
READ TABLE s_prctr WITH KEY low = it_faglflexa-prctr.
IF sy-subrc <> 0.
DELETE it_faglflexa.
ENDIF.
CLEAR: it_faglflexa, s_prctr.
ENDLOOP.
**************************end of change*************************************
IF it1_ekbe[] IS NOT INITIAL.
SELECT bukrs belnr gjahr budat tcode awkey FROM bkpf APPENDING
TABLE it_bkpf FOR ALL ENTRIES IN it1_ekbe
WHERE bukrs = 'MU51' AND
gjahr IN s_fiscal AND
awkey = it1_ekbe-awkey.
ENDIF.
IF sy-subrc = 0. "bkpf
IF it_bkpf[] IS NOT INITIAL.
SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
FROM bseg INTO TABLE it1_bseg FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-belnr AND
gjahr = it_bkpf-gjahr AND
bukrs = it_bkpf-bukrs AND
( bschl = '21' ) AND
lifnr IN s_lifnr. "added 21 for miro cancelation
IF it1_bseg[] IS NOT INITIAL.
SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
FROM bseg INTO TABLE it_bseg FOR ALL ENTRIES IN it1_bseg
WHERE belnr = it1_bseg-belnr AND
gjahr = it1_bseg-gjahr AND "changed it_bkpf to it1_bseg
bukrs = it1_bseg-bukrs .
LOOP AT it_bseg.
it_bseg-wrbtr = it_bseg-wrbtr * -1.
it_bseg-fwbas = it_bseg-fwbas * -1.
it_bseg-pswbt = it_bseg-pswbt * -1.
it_bseg-flag_21 = 'X'.
MODIFY it_bseg.
CLEAR it_bseg.
ENDLOOP.
SELECT name1 ktokk werks lifnr FROM lfa1 INTO
TABLE it_lfa2 FOR ALL ENTRIES IN it1_bseg
WHERE lifnr = it1_bseg-lifnr.
ENDIF.
REFRESH it1_bseg.
SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
FROM bseg INTO TABLE it1_bseg FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-belnr AND
gjahr = it_bkpf-gjahr AND
bukrs = it_bkpf-bukrs AND
( bschl = '31' ) AND "added bschl and lifnr by vincy
lifnr IN s_lifnr.
IF it1_bseg[] IS NOT INITIAL.
SELECT name1 ktokk werks lifnr FROM lfa1 APPENDING
TABLE it_lfa2 FOR ALL ENTRIES IN it1_bseg
WHERE lifnr = it1_bseg-lifnr.
SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
FROM bseg APPENDING TABLE it_bseg FOR ALL ENTRIES IN it1_bseg
WHERE belnr = it1_bseg-belnr AND
gjahr = it1_bseg-gjahr AND "changed it_bkpf to it1_bseg
bukrs = it1_bseg-bukrs AND
bschl <> '35'. "added bschl to avoid vendor paymnt
ENDIF.
SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr ktosl koart shkzg mwskz qsskz dmbtr lifnr
FROM bseg APPENDING CORRESPONDING FIELDS OF TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-belnr AND
gjahr = it_bkpf-gjahr AND
lifnr IN s_lifnr AND
bukrs = it_bkpf-bukrs AND qsskz IN ('WI', 'WJ').
ENDIF.
ENDIF.
SORT it_bseg BY belnr buzei.
IF NOT it_bseg[] IS INITIAL.
SELECT saknr spras txt50 FROM skat
INTO TABLE iskat
FOR ALL ENTRIES IN it_bseg
WHERE saknr = it_bseg-hkont AND spras = 'EN'.
SELECT bukrs hkont augdt augbl zuonr gjahr belnr buzei budat qsskz FROM bsis
INTO TABLE zbsis
FOR ALL ENTRIES IN it_bseg
WHERE bukrs = 'MU51' AND hkont = it_bseg-hkont
AND belnr = it_bseg-belnr AND gjahr = s_fiscal
AND budat IN s_budat1.
ENDIF.
LOOP AT it_bseg.
READ TABLE zbsis WITH KEY hkont = it_bseg-hkont.
IF sy-subrc = 0.
it_bseg-qsskz = zbsis-qsskz.
MODIFY it_bseg.
ENDIF.
CLEAR: it_bseg,zbsis.
ENDLOOP.
LOOP AT zt059z.
LOOP AT it_bseg WHERE qsskz = zt059z-wt_withcd.
zt059z-hkont = it_bseg-hkont.
zt059z-belnr = it_bseg-belnr.
MODIFY zt059z.
CLEAR: it_bseg,zt059z.
ENDLOOP.
ENDLOOP.
CLEAR: wa_bkpf.
*******Filling Wa.
LOOP AT it_bkpf INTO wa_bkpf. "changes by vincy on 14.04.2008
LOOP AT it1_ekbe INTO wa1_ekbe .
READ TABLE it_bkpf INTO wa_bkpf
WITH KEY awkey = wa1_ekbe-awkey.
wa_tax-belnr = wa_bkpf-belnr.
wa_tax-gjahr = wa_bkpf-gjahr.
wa_tax-bukrs = wa_bkpf-bukrs.
wa_tax-awkey = wa_bkpf-awkey.
wa_tax-ebelp = wa1_ekbe-ebelp.
CLEAR: wa_bseg,wa_skat.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr INTO wa_bseg.
IF sy-subrc = 0.
wa_tax-fi_docno = wa_bseg-belnr.
wa_tax-mwskz = wa_bseg-mwskz.
CLEAR: wa_bseg.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'JP4' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-gl_accnt = wa_bseg-hkont.
READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
IF sy-subrc = 0.
wa_tax-gl_desc = wa_skat-txt50.
ENDIF.
wa_tax-set_off = wa_bseg-wrbtr.
wa_tax-fwbas = wa_bseg-fwbas.
wa_tax-cst_amt = wa_bseg-pswbt.
wa_tax-description = 'CST CG Sett off'.
wa_tax-cond_type = 'JVCS'.
ENDIF.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'VS1' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-fwbas = wa_bseg-fwbas.
ENDIF.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'JP7' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-gl_accnt = wa_bseg-hkont.
READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
IF sy-subrc = 0.
wa_tax-gl_desc = wa_skat-txt50.
ENDIF.
wa_tax-set_off = wa_bseg-wrbtr.
wa_tax-fwbas = wa_bseg-fwbas.
wa_tax-vat_amt = wa_bseg-pswbt.
wa_tax-description = 'VAT CG Sett off'.
wa_tax-cond_type = 'JVCD'.
ENDIF.
CLEAR wa_bseg.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'JP5' INTO wa_bseg.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
hkont = '0002868001' INTO wa_bseg. "vat changed for V0 tax code
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-gl_accnt = wa_bseg-hkont.
READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
IF sy-subrc = 0.
wa_tax-gl_desc = wa_skat-txt50.
ENDIF.
wa_tax-vat_amt = wa_bseg-pswbt.
wa_tax-set_off = wa_bseg-wrbtr.
wa_tax-cond_type = 'JVRD'.
wa_tax-fwbas = wa_bseg-fwbas.
wa_tax-description = 'VAT RM Set off'.
ENDIF.
CLEAR: wa_bseg,wa_skat.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
shkzg = 'H'
koart = 'K'
INTO wa_bseg.
IF sy-subrc = 0.
wa_tax-total_value = wa_bseg-wrbtr.
ENDIF.
START OF MODIFICATION BY ASHOK.CH ON 08.02.2008
service_tax
CLEAR wa_bseg.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'VS8' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-gl_accnt = wa_bseg-hkont.
READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
IF sy-subrc = 0.
wa_tax-gl_desc = wa_skat-txt50.
ENDIF.
wa_tax-service_tax = wa_bseg-wrbtr.
wa_tax-description = 'Service Tax'.
wa_tax-cond_type = 'JSRT'.
ENDIF.
service_ecess
CLEAR: wa_bseg,wa_skat.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'VS9' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-service_ecess = wa_bseg-wrbtr.
ENDIF.
**********changes by vincy on 31.01.08*********************
service_shcess
CLEAR: wa_bseg.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr
flag = ''
ktosl = 'VSE' INTO wa_bseg.
IF sy-subrc = 0.
wa_bseg-flag = 'X'.
MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
wa_tax-service_shcess = wa_bseg-wrbtr.
ENDIF.
*************************end of changes***********************
END OF MODIFICATION ON 08.02.2008
APPEND wa_tax TO it_tax.
ENDIF.
CLEAR :wa_tax,wa_bseg,wa_bkpf,wa_skat.
ENDLOOP.
CLEAR wa1_ekbe.
LOOP AT it1_ekbe INTO wa1_ekbe.
READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
WITH KEY rdoc1 = wa1_ekbe-ebeln
ritem1 = wa1_ekbe-ebelp.
*New query added by Nilesh
READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
WITH KEY rdoc1 = wa1_ekbe-lfbnr
ritem2 = wa1_ekbe-lfpos.
READ TABLE it_bkpf INTO wa_bkpf
WITH KEY awkey = wa1_ekbe-awkey.
IF sy-subrc = 0.
READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
belnr = wa_bkpf-belnr
gjahr = wa_bkpf-gjahr.
IF sy-subrc = 0.
wa_ekexclf-belnr = wa1_ekbe-belnr.
wa_ekexclf-budat = wa1_ekbe-budat.
wa_ekexclf-menge = wa1_ekbe-menge.
wa_ekexclf-ebelp = wa1_ekbe-ebelp.
wa_ekexclf-ebeln = wa1_ekbe-ebeln.
wa_ekexclf-gjahr = wa1_ekbe-gjahr.
wa_ekexclf-awkey = wa1_ekbe-awkey.
wa_ekexclf-lifnr = it_bseg-lifnr.
wa_ekexclf-matnr = it_bseg-matnr .
READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl "for records for which either rdoc1 or matnr
WITH KEY rdoc2 = wa1_ekbe-lfbnr "not maintained in ekbe by vincy on 16.06.08
menge = wa1_ekbe-menge.
IF sy-subrc <> 0 .
READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
WITH KEY rdoc1 = wa1_ekbe-ebeln
exdat = wa1_ekbe-bldat
matnr = wa1_ekbe-matnr
menge = wa1_ekbe-menge.
ENDIF.
READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
WITH KEY rdoc1 = wa1_ekbe-ebeln
ritem1 = wa1_ekbe-ebelp.
IF sy-subrc = 0.
wa_ekexclf-belnr = wa1_ekbe-belnr.
wa_ekexclf-budat = wa1_ekbe-budat.
wa_ekexclf-menge = wa1_ekbe-menge.
wa_ekexclf-ebelp = wa1_ekbe-ebelp.
wa_ekexclf-ebeln = wa1_ekbe-ebeln.
wa_ekexclf-gjahr = wa1_ekbe-gjahr.
wa_ekexclf-awkey = wa1_ekbe-awkey.
wa_ekexclf-exnum = wa_j_1iexcdtl-exnum.
wa_ekexclf-exdat = wa_j_1iexcdtl-exdat.
wa_ekexclf-lifnr = wa_j_1iexcdtl-lifnr.
wa_ekexclf-matnr = wa_j_1iexcdtl-matnr .
wa_ekexclf-maktx = wa_j_1iexcdtl-maktx .
wa_ekexclf-capind = wa_j_1iexcdtl-capind.
wa_ekexclf-exbas = wa_j_1iexcdtl-exbas.
wa_ekexclf-exbed = wa_j_1iexcdtl-exbed.
wa_ekexclf-ecs = wa_j_1iexcdtl-ecs.
wa_ekexclf-werks = wa_j_1iexcdtl-werks.
wa_ekexclf-ritem1 = wa_j_1iexcdtl-ritem1.
wa_ekexclf-rdoc1 = wa_j_1iexcdtl-rdoc1.
wa_ekexclf-docyr = wa_j_1iexcdtl-docyr.
wa_ekexclf-exaddtax1 = wa_j_1iexcdtl-exaddtax1.
IF it_bseg-flag_21 = 'X'.
wa_ekexclf-exbas = wa_ekexclf-exbas * -1.
ENDIF.
MODIFIED BY ASHOK.CH ON 08.03.2008
IF wa_j_1iexcdtl-WERKS NE 'RD01' .
wa_ekexclf-exbed = wa_j_1iexcdtl-exbed.
wa_ekexclf-ecs = wa_j_1iexcdtl-ecs.
wa_ekexclf-exaddtax1 = wa_j_1iexcdtl-exaddtax1.
IF it_bseg-flag_21 = 'X'.
wa_ekexclf-exbed = wa_ekexclf-exbed * -1.
wa_ekexclf-ecs = wa_ekexclf-ecs * -1.
wa_ekexclf-exaddtax1 = wa_ekexclf-exaddtax1 * -1.
ENDIF.
ELSE.
wa_ekexclf-exbed = wa_j_1iexcdtl-BEDINV.
wa_ekexclf-ecs = wa_j_1iexcdtl-ecsINV.
wa_ekexclf-exaddtax1 = wa_j_1iexcdtl-exaddINV1.
ENDIF.
END IF MODIFICATION ON 08.03.2008
APPEND wa_ekexclf TO it_ekexclf.
CLEAR :wa_lfa1,wa_j_1iexcdtl,wa1_ekbe.
ENDIF.
READ TABLE it_lfa2 INTO wa_lfa2
WITH KEY lifnr = wa_ekexclf-lifnr.
IF sy-subrc = 0.
wa_ekexclf-name1 = wa_lfa2-name1.
wa_ekexclf-ktokk = wa_lfa2-ktokk.
ENDIF.
APPEND wa_ekexclf TO it_ekexclf.
ENDIF.
ENDIF.
CLEAR :wa_lfa1,wa_j_1iexcdtl,wa1_ekbe,wa_lfa2,wa_ekexclf.
ENDLOOP.
CLEAR wa_ekexclf.
LOOP AT it_ekexclf INTO wa_ekexclf.
wa_final-belnr = wa_ekexclf-belnr.
wa_final-budat = wa_ekexclf-budat.
wa_final-menge = wa_ekexclf-menge.
wa_final-ebelp = wa_ekexclf-ebelp.
wa_final-ebeln = wa_ekexclf-ebeln.
wa_final-gjahr = wa_ekexclf-gjahr.
wa_final-awkey = wa_ekexclf-awkey.
wa_final-exnum = wa_ekexclf-exnum.
wa_final-exdat = wa_ekexclf-exdat.
wa_final-lifnr = wa_ekexclf-lifnr.
wa_final-matnr = wa_ekexclf-matnr .
wa_final-maktx = wa_ekexclf-maktx .
wa_final-shcess_amt = wa_ekexclf-exaddtax1.
IF wa_ekexclf-capind = 'C'.
wa_final-capind = 'Consumables'.
ENDIF.
IF wa_ekexclf-capind = 'A'.
wa_final-capind = 'Assets'.
ENDIF.
IF wa_ekexclf-capind = 'T'.
wa_final-capind = 'Tools'.
ENDIF.
IF wa_ekexclf-capind = ''.
wa_final-capind = 'Raw Material'.
ENDIF.
IF wa_ekexclf-capind = 'N'.
wa_final-capind = 'Non Cenvatable'.
ENDIF.
IF wa_ekexclf-capind NE 'C' AND wa_ekexclf-capind NE 'A' AND
wa_ekexclf-capind NE '' AND wa_ekexclf-capind NE 'N'.
wa_final-capind = wa_ekexclf-capind.
ENDIF.
wa_final-exbas = wa_ekexclf-exbas.
wa_final-exbed = wa_ekexclf-exbed.
wa_final-ecs = wa_ekexclf-ecs.
wa_final-werks = wa_ekexclf-werks.
wa_final-ritem1 = wa_ekexclf-ritem1.
wa_final-rdoc1 = wa_ekexclf-rdoc1.
wa_final-docyr = wa_ekexclf-docyr.
wa_final-name1 = wa_ekexclf-name1.
wa_final-ktokk = wa_ekexclf-ktokk.
wa_final-excise = wa_final-exbas + wa_final-exbed + wa_final-ecs + wa_final-shcess_amt.
CLEAR :wa_tax.Hi ,
I think you are using the redundant selects to fetch the data from BSEG.
First select all the data into an internal table based on bkpf.
Now you can distribute the data into whatever tables you want using the loop,read-binary search and append statements..
Loop at it_bseg.
read it_bseg where
xxxxx
xxxxx
binary search.
append wa to it2_bseg.
endloop
This avoid several database fetches..
Thank you.. -
Data in BSIS/BSAS for a non-open item managed account
Hi
We have a GL account (Bank account) which does not have open item management checked in its master data,
Still I can find line items for this account in table BSIS / BSAS
How is this possible ? and if an account is not open item managed, how do the records move from BSIS to BSAS ?
Regards
SachinNon Open Item Account should have entries only in Table BSIS and no entries in BSAS. Check if there was OpenItem mgmt earlier but deactivated later.
-
Data source for BSIS & BSAS data
Hi Experts,
Could you please let me know whcih data source will provide BSIS and BSAS tables data?
Thanks in advance.
Regards,
RajuHi,
BSIS is for open Item in Accounting document segment inFIGL
BSAS for closing in the same.
for this data comes from the BSEG table and Data source is 0FI_GL_4
See this link
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/gl-business-content-is-very-limited-no-line-items-level-datasource-available-102750
I hope this will help you.
Assidn points if this helps.
Regards
Tg
Edited by: Tg on Jul 10, 2008 8:24 AM -
How to know if records in BSIS/BSAS are for customers or vendors?
Hello Experts,
I am getting records from BSIS and BSAS, now I need to know those records(from BSIS and BSAS)
which are for customers or for vendors since that is my filter. Thank you and take care!Hi Guys,
Sorry I can't see my radiobuttons so I can't assign points but I will do so later.
Anyway, What I did was based from the records that I got from BSIS/BSAS, I did
a select statement from BSID and BSAD. Please see my code below:
* Get G/L line items(Open items)
SELECT bukrs hkont belnr
buzei gjahr budat
blart dmbtr shkzg
FROM bsis
INTO TABLE gt_bsis
FOR ALL ENTRIES IN gt_t012k
WHERE bukrs = gt_t012k-bukrs
AND hkont IN lr_hkont
AND budat <= p_budat.
* Get G/L line items(Cleared items)
SELECT bukrs hkont belnr
buzei gjahr budat
blart dmbtr shkzg
FROM bsas
INTO TABLE gt_bsas
FOR ALL ENTRIES IN gt_t012k
WHERE bukrs = gt_t012k-bukrs
AND hkont IN lr_hkont
AND budat <= p_budat.
APPEND LINES OF gt_bsis TO gt_bsis_bsas.
APPEND LINES OF gt_bsas TO gt_bsis_bsas.
IF NOT gt_bsis_bsas[] IS INITIAL.
* Get customer line items(Open items)
SELECT bukrs belnr gjahr blart
buzei budat dmbtr shkzg
FROM bsid
INTO TABLE gt_bsid_bsad
FOR ALL ENTRIES IN gt_bsis_bsas
WHERE bukrs = gt_bsis_bsas-bukrs
AND gjahr = gt_bsis_bsas-gjahr
AND belnr = gt_bsis_bsas-belnr.
* Get customer line items(Cleared items)
SELECT bukrs belnr gjahr blart
buzei budat dmbtr shkzg
FROM bsad
APPENDING TABLE gt_bsid_bsad
FOR ALL ENTRIES IN gt_bsis_bsas
WHERE bukrs = gt_bsis_bsas-bukrs
AND gjahr = gt_bsis_bsas-gjahr
AND belnr = gt_bsis_bsas-belnr.
ENDIF.
Then later on, I will loop through GT_BSIS_BSAS then I will check the current document
if it exists in GT_BSID_BSAD by using READ statement. Is this correct? Thank you guys! -
JOIN for BSEG, BSIS, BSAS, MSEG, BKPF and MKPF
I am developing a report related to G/L . i am using the Tables BSEG BSIS BSAS MSEG BKPF MKPF ............please give me the Joinings of these tables.......how exactly we can join and get the prefect Data....
Thank U waiting for ur replies....
Title edited by: Alvaro Tejada Galindo on Jun 3, 2008 3:41 PMI have given the tables, internal tables and the select queries which can give you the join conditions of your requirement.
tables: bsis,
bsas,
bkpf,
bseg,
ekbe,
mkpf,
mseg.
select-options: s_hkont for bseg-hkont,
s_bldat for bkpf-budat,
s_budat for bkpf-bldat obligatory,
s_lifnr for bseg-lifnr,
s_lfbnr for ekbe-lfbnr no intervals no-extension.
data: begin of i_bsis_bsas occurs 0,
bukrs like bsis-bukrs,
hkont like bsis-hkont,
gjahr like bsis-gjahr,
belnr like bsis-belnr,
budat like bsis-budat,
bldat like bsis-bldat,
xblnr like bsis-xblnr,
wrbtr like bsis-wrbtr,
buzei like bsis-buzei,
end of i_bsis_bsas,
begin of i_bkpf occurs 0,
bukrs like bsis-bukrs,
belnr like bsis-belnr,
gjahr like bsis-gjahr,
xblnr like bkpf-xblnr,
stblg like bkpf-stblg,
awtyp like bkpf-awtyp,
tcode like bkpf-tcode,
end of i_bkpf,
begin of i_bseg occurs 0,
bukrs like bsis-bukrs,
belnr like bsis-belnr,
gjahr like bsis-gjahr,
buzei like bseg-buzei,
buzid like bseg-buzid,
koart like bseg-koart,
zuonr like bseg-zuonr,
hkont like bseg-hkont,
lifnr like bseg-lifnr,
sgtxt like bseg-sgtxt,
ebeln like bseg-ebeln,
ebelp like bseg-ebelp,
wrbtr like bseg-wrbtr,
end of i_bseg,
begin of i_ekbe occurs 0,
ebeln like ekbe-ebeln,
ebelp like ekbe-ebelp,
gjahr like ekbe-gjahr,
belnr like ekbe-belnr,
buzei like ekbe-buzei,
lfgja like ekbe-lfgja,
lfbnr like ekbe-lfbnr,
lfpos like ekbe-lfpos,
matnr like ekbe-matnr,
end of i_ekbe,
begin of i_mkpf_mseg occurs 0,
mblnr like mkpf-mblnr,
mjahr like mkpf-mjahr,
bktxt like mkpf-bktxt,
xblnr like mkpf-xblnr,
frbnr like mkpf-frbnr,
zeile like mseg-zeile,
matnr like mseg-matnr,
erfmg like mseg-erfmg,
end of i_mkpf_mseg.
*data: wa_ekbe like i_ekbe.
select bukrs
hkont
gjahr
belnr
budat
bldat
xblnr
wrbtr
buzei appending corresponding fields of table i_bsis_bsas
from bsis
where bukrs eq p_bukrs
and hkont in s_hkont
and gjahr eq p_gjahr
and budat in s_budat
and shkzg eq 'S'.
select bukrs
hkont
gjahr
belnr
budat
bldat
xblnr
wrbtr appending corresponding fields of table i_bsis_bsas
from bsas
where bukrs eq p_bukrs
and hkont in s_hkont
and gjahr eq p_gjahr
and budat in s_budat
and shkzg eq 'S'.
endform. " f_get_bsis_bsas_data
*& Form f_get_bkpf_bseg_data
Subroutine to get BKPF and BSEG data
form f_get_bkpf_bseg_data.
check not i_bsis_bsas[] is initial.
select bukrs
belnr
gjahr
xblnr
stblg
awtyp
tcode into table i_bkpf
from bkpf
for all entries in i_bsis_bsas
where bukrs eq i_bsis_bsas-bukrs
and belnr eq i_bsis_bsas-belnr
and gjahr eq i_bsis_bsas-gjahr.
and awtyp = 'BKPFF'
and tcode = 'J1IE'.
check not i_bkpf[] is initial.
select bukrs
belnr
gjahr
buzei
buzid
koart
zuonr
hkont
lifnr
sgtxt
ebeln
ebelp
wrbtr into corresponding fields of table i_bseg
from bseg
for all entries in i_bsis_bsas
where bukrs eq i_bsis_bsas-bukrs
and belnr eq i_bsis_bsas-belnr
and gjahr eq i_bsis_bsas-gjahr.
and buzei eq i_bsis_bsas-buzei
and hkont eq i_bsis_bsas-hkont.
delete i_bseg where not hkont in s_hkont.
endform. " f_get_bkpf_bseg_data
*& Form f_get_ekbe_data
Subroutine to get EKBE data
form f_get_ekbe_data.
data: $i_bseg like i_bseg occurs 0 with header line.
$i_bseg[] = i_bseg[].
delete $i_bseg where ebeln is initial.
check not $i_bseg[] is initial.
select ebeln
ebelp
gjahr
belnr
buzei
lfgja
lfbnr
lfpos
matnr into table i_ekbe
from ekbe
for all entries in $i_bseg
where ebeln eq $i_bseg-ebeln
and ebelp eq $i_bseg-ebelp
and gjahr eq $i_bseg-gjahr
and bwart = '101'.
and belnr eq $i_bseg-belnr.
check not i_ekbe[] is initial.
select a~mblnr
a~mjahr
a~bktxt
a~xblnr
a~frbnr
b~zeile
b~matnr
b~werks
b~erfmg into table i_mkpf_mseg
from mkpf as a inner join
mseg as b on amblnr eq bmblnr
and amjahr eq bmjahr
for all entries in i_ekbe
where a~mblnr eq i_ekbe-lfbnr
and a~mjahr eq i_ekbe-gjahr
and b~zeile eq i_ekbe-lfpos
and b~werks eq p_werks.
<REMOVED BY MODERATOR>
Edited by: Srikanth Kadiyala on Jun 3, 2008 7:24 AM
Edited by: Alvaro Tejada Galindo on Jun 3, 2008 3:40 PM -
Hello
Can you please tell why do we need tables BSIS and BSAS. What kind kind of transactions they contain (practical example)?Hi,,
we need this tables at the time of making reports . based on requirement of client we take this tables,
what type of data is stored in that .i.e
BSIS is for open GL items.
BSAS is for closed GL items.
Regards,
R.N.Reddy. -
Data recovery from BSIS and BSAS tables
Hi all,
The records in the tables BSIS and BSAS are deleted due to adhoc circumstances.
How do I recover this data in SAP?
Please help!!!
Thanks,
RaghavHello Raghav,
two possibilities without a complete restore (in a standard SAP environment):
1) Flashback Query (but it only works if your UNDO tablespace still contains all the data - parameter undo_retention):
http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_flashback.htm#ADFNS01003
2) LogMiner
http://docs.oracle.com/cd/E11882_01/server.112/e22490/logminer.htm#i1005553
Regards
Stefan -
Inconsistency BSEG, BSIS, BSAS
Hi, likeable consultants!
In transactions reports: FBL3N and FS10N I have differents accounts balances
display.
analyzing BSEG Table, I have 15 line itens, and BSIS and BSAS have 18 line
itens. I request a solution to adjust these 3 line itens to balance equal.
I already had execute the RFSEPA01 and it don´t works.
Somebody knows a program to equal these tables?
Best kindly regards!After finishing the analysis I can confirm that the differences reported are due to the fact that you performed the ARCHIVING of documents in
2001/2002 for BTSA company code. You can see transaction SARA for more
details.
I had a look at your system BTP, 300 on account 991110000,BTSA
Account 991110000,BTSA is open item managed. From your customizing
settings, the existing archive runs and the varaints existing for
programm SAPF048I I assume you already did archiving and secondary
index deletion on this account. So this explains why line items balance
and GL summary balance differ ! There is no programm error.
See consulting note 81489 which describes this issue:
The balance of an account results from the balance of the open items. Inconnection with an archiving that has been carried out, the line item
display - used with cleared items - must not therefore be interpreted asa balance display. For the balance display, there are separate
correspond to the display balance of the open items from the line item
display.
Having archived and deleted secondary indexes ( with SAPF048I )
for an account you can not use line item drill down as a balance
display any more for a line item managed account.
( as not all line items are existing any more in table BSIS ! )
The transactions meant to display the binding balances are FS10N,
FK10N and FD10N.
They also give you the line items details, but only of those line
items not yet deleted ( by SAPF048I ). -
Excise values not updated BSAS Table
Excise Gate Pass when reversed thr T. code J1IH, The reversed entry is generated but it is not linked with original entry and are not moving to table BSAS. Instead when invoice is reversed thr VF11, further entry is generated and original and new entries are reflected ion BSAS
Thanks
MaheshHi Umesh,
How did you change the characteristic values for what object?
For example, if you are changing the material master which has class type 300 class assigned, then you have to use engineering change management to change the classification data, and you need to ensure you have activated ECM for Class Type 300 and object MARA in O1CL:
1.O1CL ->
Object Table -> MARA
Class Type -> 300
Details
ECH(times) (untick -> tick)
2.Click the save icon to save settings
3.O1CL -> Objects ->
Class Type:300,Object:MARA
Details
ECH(times) (untick -> tick)
4.Save settings.
Then after you change the material classification with change number, you will find the change document for the classification in classification view: menu Environment -> change docs.
The values and changes are also stored in table AUSP with the change number, but only when you use change number, the changes could be stored also.
Regards,
Rachel -
Performance issue with BSAS table
Hi,
I am considering 1 lac gls for BSAS selection. It is giving runtime error DBIF_RSQL_INVALID_RSQL and exception CX_SY_OPEN_SQL_DB.
To overcome this issue i used the followiing code :
DO.
PERFORM f_make_index USING sy-index.
REFRESH lr_hkont.
CLEAR lr_hkont.
APPEND LINES OF gr_hkont FROM gv_from TO gv_to TO lr_hkont.
IF lr_hkont[] IS INITIAL.
EXIT.
ENDIF.
SELECT bukrs hkont gjahr belnr buzei budat augbl augdt waers wrbtr
dmbtr dmbe2 shkzg blart FROM bsas
APPENDING CORRESPONDING FIELDS OF TABLE
gt_bsas
FOR ALL ENTRIES IN gt_bsis
WHERE bukrs = gt_bsis-bukrs
AND hkont IN lr_hkont
AND gjahr = gt_bsis-gjahr
AND augbl = gt_bsis-belnr
and budat = gt_bsis-budat.
enddo.
I am passing 500 gls for each BSAS selection and appending to GT_BSAS internal table. This code it is taking 50 hours to fetch the data.
Please suggest me how to improve the performance of the report.
Thanks,Hi,
1. check whether the SELECT inside the DO statement is required. this shud be the culprit.
2. In the SELECT query avoid using APPENDING CORRESPONDING TABLES caluse. directly populate into another internal table and append it later.
3. check whether the internal table gt_bsis is initial before using FOR ALL ENTRIES in the select query. check if it has duplicate entries too. if it has....delete the duplictaes.
regards,
madhu -
hi all ,
In which table entry store for created document thru FB01. I am able to see one entry in table BSIS but other entry is not available.
Can anyone suggest the table name for other entry?
Thanks,
PArasAll accounting document related records are stored in BKPF,BSEG tables.
If specific to GL you can use BSIS,BSAS tables.
If specific to Customer you can use BSID,BSAD tables.
If specific to Vendor you can use BSIK,BSAK tables. -
How to write optimized select statements for this requirement
I. G/L Account No. Info: Get all the list of G/L Account no. , company code and the corresponding long description from SKB1 & SKAT tables based on the G/L Account no. and company code values entered in the selection screen.
II. No. of transactions posted: For each of the Company code & Posting date or fiscal year/ period combination, select all document numbers from BKPF table into an internal table. For each of the company code, GL Account no combination find out no. of distinct records in the BSEG table (or combination of BSIK, BSAK, BSID, BSAD, BSIS & BSAS tables) to get the No. of transactions posted.
III. For Last posting FY/period: for each G/L account, Company code combination, determine the MAX (Doc. No) in BSEG, and look up the corresponding document in BKPF table to get the last posting FY/Period.
Thanks,
Prakash.I) with a query (sq01/2) and logical database SDF
or standard abap RFSKVZ00
II)a) select bkpf
b) select count( * ) from bsik...
III) a)select max( belnr ) from bseg...
b) selec single monat from bkpf
A.
Maybe you are looking for
-
Help! need "How To" for a feature of iBooks on iPad using iTunes
On the bottom of the iBooks main screen there is "Bookshelf", "Titles", "Authors", "Categories" buttons. Pressing any one will sort books by that tab. In iTunes, the same Column headers can come up when you select them under "View Options". So far, s
-
Video signal lost on launch of iTunes (after "update")
I just (foolishly) "updated" to the most recent version of itunes. And, surprise surprise, a headache has ensued. I am using a mac mini hooked into a TV via HDMI (the setup is mac mini ---> receiver ---> TV). After the itunes update, Weirdly, when
-
Want to add multiple selesction to billing doc????
I would like to add Multiple selection to the Billing Document parameter Currently, it would only give data for one of the documents in the selection. report used: SD70AV3A what cjhanges do i have to make in order to do this??????
-
Multiple Airport Express Base Station Set-up
I live in the country and need to re-configure four Airport Express (AE) stations for coverage to multiple buildings. I set this up successfully about two+ years ago. Last week, our place got struck by lightning which took out our modem and main base
-
hi abap gurus.. is there any bapi which gets the SD doc flow details(qutaion no,sales order no,delivery order no,billing doc no)? thanks.. lakshman. save a life by sending information. www.help2patients.wordpress.com.