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

select query

Former Member
0 Likes
305

i have to write a select query in which 6 tables are involved using following conditions.

Select line items from BSEG table where BSEG-BLDAT and BSEG-BUKRS are within the Report Date specified in the selection screen.

Additional condition BSEG-BLART = WE and BSEG-HKONT= 690100

1. Description (COAS-KTEXT), where COAS-AUFNR = BSEG-AUFNR

2. Vendor No (MSEG-LIFNR), where MSEG-EBELN = BSEG-EBELN and MSEG-EBELP = BSEG-EBELP and MSEG-AUFNR = BSEG-AUFNR and MSEG-BUKRS is the same as the selection screen.

3. Vendor Name (LFA1-NAME1), where MSEG-LIFNR = LFA1-LIFNR

4. Invoice Number (RSEG-BELNR), select single RSEG-BELNR from RSEG where RSEG-EBELN = BSEG-EBELN and RSEG-EBELP = BSEG-EBELP and RSEG-GJAHR and RSEG- BUKRS is within the selection criteria.

5. Invoice Date (RBKP-BLDAT), where RBKP-BELNR = RSEG-BELNR

6. Amount (BSEG-DMSHB)

selection screen consists of bseg-bukrs and bseg-bzdat.

can anybody help me..

Regards,

Sai prasad

1 REPLY 1
Read only

Former Member
0 Likes
262

HI,

Since, BSEG is a Cluster table.. it's not always recommended to use in Reports.

So, based on your requirements, in place of BSEG try to make use of :

If you want <b>Account Recivables</b> data use BSID and BSAD tables

If you want <b>GL Account Related data</b> use BSIS and BSAS tables

If you want <b>Account payables data</b> use BSIK and BSAK tables

Use 'Date_Range', BUKRS and BZDAT, BLART, HKONT on any one / more of these tables.

After this, try to retrive data from tables COAS, MSEG, LFA1, RSEG, RBKP etc...

Regards,

Manjunatha