2006 Dec 29 10:19 AM
HI THIS IS THE LOGIC........NOW COULD U HELP ME OUT IN PREPARING REORTS:----
Pre-requisite
Document Number should exist in the database.
Program Logic/Pseudo Code:
Logic would be as under:
1. A new screen is to be prepared. Input would be the followings:
a. Company code
b. Posting Date (From To)
2. Select all BELNR (Accounting Document Numbers) from table BSAK where BLART is either KR or RE.
3. For all selected BELNR get only those BELNR which are available in the table BSIS where HKONT is 27611002.
4. For these BELNR get all the line items from the table BSIS where BSCHL is equal to 40. Get the report in the following format.
5. All the above mentioned searches to be made for company code 1000.
Report Layout (For Reports):-----
BSIS-BLDAT, BSIS-BUDAT, BSIS-BELNR, BSIS-HKONT, BSIS-WRBTR, BSAK-AUGDT, BSAK-LIFNR, BSAK-AUGBL
THANKS.
HI THIS IS THE LOGIC........NOW COULD U HELP ME OUT IN PREPARING REORTS:----
Pre-requisite
Document Number should exist in the database.
Program Logic/Pseudo Code:
Logic would be as under:
1. A new screen is to be prepared. Input would be the followings:
a. Company code
b. Posting Date (From To)
2. Select all BELNR (Accounting Document Numbers) from table BSAK where BLART is either KR or RE.
3. For all selected BELNR get only those BELNR which are available in the table BSIS where HKONT is 27611002.
4. For these BELNR get all the line items from the table BSIS where BSCHL is equal to 40. Get the report in the following format.
5. All the above mentioned searches to be made for company code 1000.
Report Layout (For Reports):-----
BSIS-BLDAT, BSIS-BUDAT, BSIS-BELNR, BSIS-HKONT, BSIS-WRBTR, BSAK-AUGDT, BSAK-LIFNR, BSAK-AUGBL
THANKS.
2007 Jan 02 6:26 AM
Make an internal table
data: begin of it_doc_no,
belnr like bsak-belnr,
end of it_doc_no.
data: begin of it_bsis occurs 0,
BELNR like bsis-belnr,
BLDAT like bsis-BLDAT,
BUDAT like bsis-BUDAT,
HKONT like bsis-HKONT,
WRBTR like bsis-WRBTR,
AUGDT like bsis-AUGDT,
LIFNR like bsis-LIFNR,
AUGBL like bsis-AUGBL,
end of it_bsis.
Select belnr
from Bsak
into table it_doc_no
where bukrs in s_bukrs and blart eq 'kr' or blart eq 're'.
endselect.
if it_doc_no[] is not initial.
Select BELNR
BLDAT
BUDAT
HKONT
WRBTR
AUGDT
LIFNR
AUGBL
from bsis
into table it_bsis
for all entries in it_doc_no
where HKONT eq '27611002' and BSCHL eq 40 and BUKRS = 1000.
Endselect.
endif.
Loop at it_bsis.
Write: it_bsis-BLDAT,
it_bsis-BUDAT,
it_bsis-BELNR,
it_bsis-HKONT,
it_bsis-WRBTR,
it_bsis-AUGDT,
it_bsis-LIFNR,
it_bsis-AUGBL.
Endloop.
I think this should work...please add the necessary validations ur self....where u need