‎2008 Jul 14 10:56 AM
Hi Experts ,
Based on Company code. how to get G/L accounts. i need information regarding this.
Regards,
Sunita.
‎2008 Jul 14 12:02 PM
Hi Sunita,
Try this code :
TABLES:
skb1.
SELECT-OPTIONS :
s_bukrs FOR skb1-bukrs.
DATA :
t_skb1 LIKE
STANDARD TABLE
OF skb1.
DATA :
fs_skb1 LIKE LINE OF t_skb1.
TOP-OF-PAGE.
WRITE :/10 'Company Code' COLOR 7,
30 'G/L Account Number' COLOR 7.
START-OF-SELECTION.
SELECT bukrs
saknr
FROM skb1
INTO CORRESPONDING FIELDS OF TABLE t_skb1
WHERE bukrs IN s_bukrs.
SORT t_skb1 BY bukrs .
LOOP AT t_skb1 INTO fs_skb1.
AT NEW bukrs.
WRITE :/ fs_skb1-bukrs UNDER 'Company Code' COLOR 1.
ENDAT.
WRITE :/ fs_skb1-saknr UNDER 'G/L Account Number' COLOR 2.
ENDLOOP.It will accept a range of company codes on the selection-screen and fetches all the G/L Account numbers based on the given input.
Regards,
Swapna.
‎2008 Jul 14 10:58 AM
Hi,
You can get this info from table SKB1.
Give the company code, you will get GL accounts for tht company code.
Hope this helps!!
Regards,
Lalit
‎2008 Jul 14 11:01 AM
hiiii
in SKB1 table you will get field company code as BUKRS and G/L account as SAKNR.it will give you g/l number by company code
regards
twinkal
‎2008 Jul 14 11:03 AM
Hi,
SKA1 and SKB1 are the tables for G/L account.
SKB1 is having company code field BUKRS. by using this u can join both tables and you can get G/L'S data.
regards.
sriram
‎2008 Jul 14 11:46 AM
Hi,
Goto T-Code FS10N here u get the company code and G/L wise Opening balance and Closing balance for a Year.
Are u got the solution for Alv-grid column width thread.
If u got the solution, closed that thread.
Reward if useful.....
Thanks,
Durai.V
‎2008 Jul 14 12:02 PM
Hi Sunita,
Try this code :
TABLES:
skb1.
SELECT-OPTIONS :
s_bukrs FOR skb1-bukrs.
DATA :
t_skb1 LIKE
STANDARD TABLE
OF skb1.
DATA :
fs_skb1 LIKE LINE OF t_skb1.
TOP-OF-PAGE.
WRITE :/10 'Company Code' COLOR 7,
30 'G/L Account Number' COLOR 7.
START-OF-SELECTION.
SELECT bukrs
saknr
FROM skb1
INTO CORRESPONDING FIELDS OF TABLE t_skb1
WHERE bukrs IN s_bukrs.
SORT t_skb1 BY bukrs .
LOOP AT t_skb1 INTO fs_skb1.
AT NEW bukrs.
WRITE :/ fs_skb1-bukrs UNDER 'Company Code' COLOR 1.
ENDAT.
WRITE :/ fs_skb1-saknr UNDER 'G/L Account Number' COLOR 2.
ENDLOOP.It will accept a range of company codes on the selection-screen and fetches all the G/L Account numbers based on the given input.
Regards,
Swapna.
‎2008 Jul 14 12:14 PM
Hi Sunita,
As told by others the table for G/L account master for company code is SKB1.
and the value table for G/L account is SKA1 which is the
G/L Account master ( chart of account ).
With luck,
Pritam.
‎2008 Jul 14 1:46 PM
Hi Sunita,
I would like to suggest,
The field which represents the company code is "BUKRS".
To establish certain relationship between "Company Code" and "G/L Accounts", you can understand by checking the structure - BAPI3006_0.
This is a standard BAPI for General Ledger Account.
In this structure, we have BUKRS - Company code and SAKNR - G/L Account Numbers.
Hence, a relation can be established between these two.
I again, Suggest you to use - BAPI for G/L Account: BAPI_GL_ACC_GETLIST - List of G/L Accounts per Company Code.
This makes it better to understand the relationships and code it in program.
Make the best choice.
Hoping it to be usefull.
Good Luck & Regards.
Harsh Dave