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

relation mbew with T030 table

Former Member
0 Likes
3,705

Hi experts,

i want to get the value from t030 table the field name is KONTS - - G/L Account Number. the logic is as follows i am selecting

SELECT matnr bwkey bklas

FROM mbew

INTO TABLE it_mbew

FOR ALL ENTRIES IN it_mara

WHERE matnr = it_mara-matnr

AND bwkey = p_bwkey.

but the problem is when i need to get the KONTS - - G/L Account Number.from t030 table the only the common field is BKLAS in mbew and t030 table is the any possibility to have link to below fields

KTOPL

KTOSL

BWMOD

KOMOK

bklas are the key fields in t030 table but i have only bklas get the glaccount number, could any body telme the other table which joins mbew and t030 table .....i need to finish this report immediately....

will be rewarded full points....

regards

sreenivas

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,455

The other fields don't process of the Material "There is not a single Account per Material"

<b>What you can join</b>

<i>KTOPL</i> come from <i>T001</i>, society, Part can have different account number in different society. Look for society code in <i>T001K</i> where <i>bwkey</i> field will give <i>bukrs</i> and also <i>bwmod</i> fields

<b>What you cannot join</b>

<i>KTOSL</i> is the operation ("Transaction key"), try '<i>BSX</i>' to get the account for stock valorization (there are other accounts used in material accounting, look at customization <b>OBYC</b> transaction)

Regards

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,456

The other fields don't process of the Material "There is not a single Account per Material"

<b>What you can join</b>

<i>KTOPL</i> come from <i>T001</i>, society, Part can have different account number in different society. Look for society code in <i>T001K</i> where <i>bwkey</i> field will give <i>bukrs</i> and also <i>bwmod</i> fields

<b>What you cannot join</b>

<i>KTOSL</i> is the operation ("Transaction key"), try '<i>BSX</i>' to get the account for stock valorization (there are other accounts used in material accounting, look at customization <b>OBYC</b> transaction)

Regards

Read only

0 Likes
2,455

Thanks Raymond ................ my issue is resolved....

i am rewarding you full points....

i did as below plz suggest me if i am wrong

i/p so_matnr

p_bwkey

so_budat

based on p_bwkey i got the bukrs,bwmod from t001k table

based on t001k-bukrs value i have got the ktopl from t001 table

based on so_matnr and p_bwkey i got the bklas from mbew table

by using mbew-bklas, t001-ktopl, mbew-bklas i have got the G/L Account number.

Please suggest me raymond if i am wrong......

Thanks once again...

Sreenivas

Message was edited by:

sharmashree kashi

Message was edited by: sreenivas

sharmashree kashi

Read only

0 Likes
2,455

You are right, just delimit by KTOSL = 'BSX' to get the only account used for stock valorization (check with financial)

Regards

Read only

Former Member
0 Likes
2,455

Yes you can perform that by using join condition between those tables you can do it bu=y using the fields BKLAS you can perform that

Regards

Pavan

Read only

0 Likes
2,455

pavan,

if i join mbew and t030 by using bklas, i can get multiple gl account number but i required single account number. Is there any posibility to join other table so that i can get unique account number. I guess joining of ktopl will do that job for me....

regards

sreeni

Read only

0 Likes
2,455

Hi

Check the G/L account numbers if they are repeating then you can use statement

 delete adjacent duplicates 

and you can delete those duplicates and if u want to know any other tables using this field then go to SE15 and goto the folder ABAP Dicttionary > Table fields> Give your field name and press execute then you can have a tables list which contains those fields out of which you have to check which table is giving you relevant data

Regards

Pavan