Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BESG

Former Member
0 Likes
1,100

i wanna some BAPI or Function or Any other table by which i can get data equivalant to BSEG table

I WANT THESE FOLLOWING FIELDS, OTHER THAN BSEG

BELNR, HKONT, AUFNR , WRBTR.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
948

hi

are you facing problems in fetching data from BSEG.

wat exactly is your requirement?

chk the blog which addresses the common BSEG data selection:

/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops

regards,

madhu

6 REPLIES 6
Read only

Former Member
0 Likes
949

hi

are you facing problems in fetching data from BSEG.

wat exactly is your requirement?

chk the blog which addresses the common BSEG data selection:

/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops

regards,

madhu

Read only

0 Likes
948

Report performance is very slow i have tried all the methods but i still in problem

so i need the method by which i can get data that i wann

SELECT belnr hkont aufnr wrbtr

FROM bseg INTO TABLE it_bseg

FOR ALL ENTRIES IN it_veh

WHERE belnr = it_veh-belnr

AND hkont IN ('0004018221','0004018211').

there is any problem in query

i have sort table it_veh before this loop i checked not initial of table it_veh

Is ther any method by which i can get same result Please tell me

Read only

0 Likes
948

for Bseg , u have to pass

1.Document number

2.year

3.Company COde

4.Documment type

5.list of G/L codes.

if it_veh[] is not initial.

SELECT belnr hkont aufnr wrbtr

FROM bseg INTO TABLE it_bseg

FOR ALL ENTRIES IN it_veh

WHERE belnr = it_veh-belnr

AND hkont IN ('0004018221','0004018211').

endif.

and pass all above fields.

Regards

Prabhu

Read only

0 Likes
948

Hi,

Since you are reading based on HKONT, i would suggest to read BSIS instead of BSEG. BSEG is index table of accounting based on G/L account.

Check this code. Also, since BSIS need BUKRS for complete key, the code is reading BSIS for complete range of Company code. Just replace the value of MIN and MAX company code with whatever min / max company code in your system.

*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
*--- MACRO - Fill Company Code
DEFINE fill_bukrs.
  r_bukrs-sign   = 'I'.
  r_bukrs-option = 'EQ'.
  r_bukrs-low    =  &1.
  r_bukrs-high   =  &2.
  append r_bukrs.
END-OF-DEFINITION.

TABLES: t001.

CONSTANTS: 
    c_bukrs_min LIKE t001-bukrs VALUE '1000', "Lowest Company code no.
    c_bukrs_max LIKE t001-bukrs VALUE '5000'. "Highest Company code no.


DATA: BEGIN OF lit_bsis OCCURS 0,
        bukrs LIKE bsis-bukrs,
        belnr LIKE bsis-belnr,
        gjahr LIKE bsis-gjahr,
        buzei LIKE bsis-buzei,
        aufnr LIKE bsis-hkont,
        wrbtr LIKE bsis-wrbtr,
      END OF lit_bsis.

RANGES: r_bukrs FOR t001-bukrs.

fill_bukrs c_bukrs_min c_bukrs_max.

IF NOT it_veh[] IS INITIAL.

  SELECT
        bukrs
        belnr
        gjahr
        buzei
        aufnr
        wrbtr FROM bsis
              INTO TABLE lit_bsis
              FOR ALL ENTRIES IN it_veh
              WHERE bukrs IN r_bukrs AND
                    hkont IN ('0004018221','0004018211') AND
                    belnr = it_veh-belnr.

ENDIF.
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*

Let me know if you still have a issue.

Regards,

RS

Read only

Former Member
0 Likes
948

there is no such FM or BAPI....U need to use select statement and get the values...

for these fields try creating an secondary index BELNR, HKONT, AUFNR , WRBTR.. now use this index in ur select statement and the program fetches data faster....

Read only

Former Member
0 Likes
948

Hi..,

All these fields are available in two tables (these two are transparent tables and not the cluster tables)..

BSIS - for open G/L accounts

BSAS - for cleared G/L accounts..

regards,

sai ramesh