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: 

few fi table doubts

Former Member
0 Kudos

Hi,

can anyone tell what for table bseg and bsak is used ,

i have a select statement like this

1)I KNOW THIS STATEMENT IS TO RETERIVE THE INVOICES

PAID BY CHECK,AND WHAT DOES BSCHL = '31'

iAM NOT SURE WHAT POSTING KEY (bschl= 31) MEANS

SELECT * FROM BSAK WHERE BUKRS = PAYR-ZBUKRS AND

AUGBL = PAYR-VBLNR AND

BSCHL = '31'.

2)CAN ANYONE TELL ME WHAT MIGHT BE THE PURPOSE FOR RETREIVING

THIS DATA for below statement AND WHAT BSCHL = 40 MEANS

SELECT * FROM BSEG WHERE BUKRS = BSAK-BUKRS AND

BELNR = BSAK-BELNR AND

GJAHR = BSAK-GJAHR AND

BSCHL = '40'.

CHECK BSEG-HKONT(4) = '0006'.

9 REPLIES 9

former_member181962
Active Contributor
0 Kudos

bschl = 31 means: Vendor Invoice

bschl = 40 means: Debit entry

Former Member
0 Kudos

hi suchitra,

bschl= 31 is Invoice.

bschl= 40 is Debit entry.

0 Kudos

Hiwhat i understood is that the invoice can be debit entry ,credit entry etc.

bschl = 40 when i use this in select statement that means ,i am selecting all the invoices that are based on debit entry.

am i right?

if yes ,pls let me know what debit entry exactly mean

0 Kudos

Accouting entries should be balanced always. That is the golden rule. So, if you are creating a vendor invoice, you credit the vendor account to reflect that you owe that much amount, but at the same time you have to tell from where that amount will be paid. So you specify another account from which you will deduct the amount.

In simple terms, when you pay your credit card bill, you hit the credit card account and at the same time, you are hitting your bank account from which you are paying the credit card account. That is why you will have two entries there. This will become more complicated when you say that you will pay part of the amount from one account and part of the amount from another account and so on. Then you will see multiple entries. But the net should always be zero.

0 Kudos

Hi,

I understood what you are talking about.

q1)THIS STATEMENT MEAN I AM RETRIEVING DATA FOR INVOICES WHICH ARE UNDER DEBIT ENTRY.

am i right?

SELECT * FROM BSEG WHERE BUKRS = BSAK-BUKRS AND

BELNR = BSAK-BELNR AND

GJAHR = BSAK-GJAHR AND

BSCHL = '40'.

2)BSEG-HKONT(4) = '0006'. what does this mean 0006 has any special meaning too

0 Kudos

Yes, it means that you are selecting only those lines of the accounting documents that have a posting key of 40 (debit entry).

2) All that is telling you is that you are interested only in accounts starting with '0006'.

0 Kudos

hI,

YOU ARE NOT UNDERSTANDING MY PROBLEM.

This is my code ,can you go through this and let me know what is trying to get.\in the second select statment he is trying to get invoices for the company code and claear

1)in first select statement he getting the checks

2)in second select statement he getting the invoices based on data from first select statement

3)i have problem what is he trying to do.

i understand the code but i want to know what the purpose he is doing that.

SELECT * FROM PAYR WHERE ZBUKR IN CO_CODE AND

LAUFD GE FIRST_DAY AND LAUFD LE LAST_DAY.

  • Get the invoices the checks paid

SELECT * FROM BSAK WHERE BUKRS = PAYR-ZBUKR AND

AUGBL = PAYR-VBLNR AND

BSCHL = '31'. " Invoices

  • There will only be one of these if any. If there are none,

  • skip to the next invoice paid by this check.

SELECT * FROM BSEG WHERE BUKRS = BSAK-BUKRS AND

BELNR = BSAK-BELNR AND

GJAHR = BSAK-GJAHR AND

BSCHL = '40'.

CHECK BSEG-HKONT(4) = '0006'.

SELECT SINGLE * FROM LFA1 WHERE LIFNR = BSAK-LIFNR.

  • Save all the needed data

MOVE:

BSEG-KOSTL TO INV-CC, " Cost center

PAYR-CHECT TO INV-CHECK_NO, " Check number

PAYR-LAUFD TO INV-CHK_DATE, " Check date

BSEG-BELNR TO INV-INVOICE, " Invoice number

PAYR-VBLNR TO INV-PAY_DOC, " Payment document

BSEG-BUKRS TO INV-COMPANY, " Company code

BSAK-LIFNR TO INV-VEND_NO, " Vendor number

LFA1-NAME1 TO INV-VENDOR, " Vendor name

BSAK-WRBTR TO INV-AMT, " Amount

BSAK-BLDAT TO INV-INV_DATE, " Invoice date

BSAK-XBLNR TO INV-REF_NO, " Reference number

BSAK-SGTXT TO INV-I_TXT. " Text

APPEND INV. " Save the invoice

suresh_datti
Active Contributor
0 Kudos

The Table BSAK holds only the Cleared items for the Vendors whereas BSEG is a pooled table(huge) holds all the Accounting Documents..

~Suresh

Former Member
0 Kudos

Hi,

check the table entries:

bschl= 31 Invoice.

bschl= 40 Debit entry.

regards,

keerthi.