Application Development 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: 

FI: Company code.

Former Member
0 Kudos

Hi Experts ,

Based on Company code. how to get G/L accounts. i need information regarding this.

Regards,

Sunita.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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