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

Abap Report programming

Former Member
0 Likes
830

Hi,

I am sap abap/4 consultant working ina small firm in new delhi India. I am working on the fnancial report generation program ion abap/4.I am using the tables 'ska1','skat','bseg' tables. I am finding problem in fetching data from bseg table because the field 'saknr' i.e, G/L A/c number which primary key in both tables ska1 and skat but not in bseg. My question is how to fetch records from the two tables when no common primary key is exists? This is my first problem.

My second problem is I find the field hkont in bseg table which is reference from the table skb1 with key saknr.but the values in hkont in bseg table didnot match with values in saknr of ska1 table.

Please give me the solution of these two tables mentioned above.

I am very greatful to you.

<<removed by moderator>>

4 REPLIES 4
Read only

JozsefSzikszai
Active Contributor
0 Likes
728

1. use BSIS/BSAS instead of BSEG

2. BSIS-HKONT = SKB1-SAKNR

Read only

Former Member
0 Likes
728

Hi Pankaj,

Hearty Welcome to SDN.

There will be link between the tables that you mentioned, currently i am not having SAP system to tell the links... but the concept i can make you clear.

Start searching such that in one table primary key field which is present has to be present in another table as normal field so that by using FOR ALL ENTRIES in the select statement you can fetch the data.

Cheers!!

VEnk@

Read only

Former Member
0 Likes
728

Hi,

As i understand u want the common data between the 3 tables

use like this....

Select * from databse table into table internal table 1 (ska1)

Select * from databse table into table internal table 2 (s--)

Now two internal tables get populated with key field ,

in order to keep only common data b/w them use

Loop at table 1

Read table 2 with key table2-key field = table1-keyfield.

if sy-subrc <> 0.

Delete from internal table 2.

endif.

endloop.

With this peace of code u get common key fields in internal table 2. now

select from database table 3 into table internal table 3

for all entries in internal table 2

where (fields to be matched)

-


For the second problem u can directly refer database tables

table 1-field = table2-field.

Thanks & regards

Ruchi Tiwari

Edited by: Ruchi Tiwari on Oct 30, 2008 4:31 AM

Read only

kiran_k8
Active Contributor
0 Likes
728

Pankaj,

Check this Blog which will give you a lead on extracting data from BSEG without any performance issues.

K.Kiran.