‎2007 Feb 08 9:34 AM
Hi! I am giving you the prog logic. anybody could help me out to develop a program for that.
Thanks.
SELECTION SCREEN:
Following fields will be available on initial screen of report.
Field Name Tech Name Range Field status
Doc Date BLDAT From -To-- Mandatory
Vendor LIFNR From -
To----- optional
SAP TABLES:
TABLES:BSEG, LFA1,MAKT are to be used for having output of report.
Report has to be run for specific GL accounts only which are to be hard coded in the program logic. Based on users input Range of Date all the documents within the range are to be selected along with below criteria from Table BKPF
Transaction code = ML81N
If user enters vendor range then select vendors (input values) from Table BSEG after selecting documents from BKPF based on date & TC as above.
Once the Document are selected from BKPF give as input to BSEG along with below list of GL account (field- HKONT) Below GL to be hard coded in program.
1001 Services - Catering -Food/Beverages
1002 Services - Catering - Hi Lift
1003 Services - Catering - Handling
1004 Services - Catering - Stores
1005 Services - Catering - Laundry
1006 Services - Catering Offloading
Based on above selection the output data from BSEG will be-
Vendor Cost Centre Amount in LC
(LIFNR) (KOSTL) (DMBTR)
‎2007 Feb 08 12:48 PM
Hi Chang,
Report ZXXXXX..
**Selection screen**
select-options : s_bldat for bkpf-bldat obligatory.
select-options : s_lifnr for lfa1-lifnr..
data : begin of it_docs occurs 0.
belnr,
bldat
tcode.......retc..
end of it_docs.
data : begin of table.
(req fields)
end of table.
ranges : g_range for BSEG-BELNR.
g_range = 'IEQ00000010010000000000' to ''IEQ00000010060000000000''
append g_ranges..
select * from bkpf into it_docs
where bldat in s_bldat
and tcode = 'ML81N'.
if s_lifnr is not initial.
select ....(req fields) into table ....
for all entries in it_docs
from BSEG
where lifnr in s_lifnr
and GL in g_range.
endif.
This will work.. populate the hard code values as a ranges in g_ranges..
Please check for syntax errors..
Logic will do..
Mark if useful..
Rajiv
‎2007 Feb 08 12:26 PM
Hi,
1) select bkpf with bldat and tcode
2) select bseg with bkpf-key and koart = 'K'
3) select bseg with bkpf-key and koart = 'S'
-> extract your data with collect itab
or an alternative would be to use a LDB like BRF
A.
‎2007 Feb 08 12:48 PM
Hi Chang,
Report ZXXXXX..
**Selection screen**
select-options : s_bldat for bkpf-bldat obligatory.
select-options : s_lifnr for lfa1-lifnr..
data : begin of it_docs occurs 0.
belnr,
bldat
tcode.......retc..
end of it_docs.
data : begin of table.
(req fields)
end of table.
ranges : g_range for BSEG-BELNR.
g_range = 'IEQ00000010010000000000' to ''IEQ00000010060000000000''
append g_ranges..
select * from bkpf into it_docs
where bldat in s_bldat
and tcode = 'ML81N'.
if s_lifnr is not initial.
select ....(req fields) into table ....
for all entries in it_docs
from BSEG
where lifnr in s_lifnr
and GL in g_range.
endif.
This will work.. populate the hard code values as a ranges in g_ranges..
Please check for syntax errors..
Logic will do..
Mark if useful..
Rajiv
‎2007 Feb 08 12:56 PM
‎2007 Feb 08 1:01 PM
Thyanks Rajiv,
I am sending u my complete requirement......see if u can help me out.....
SELECTION SCREEN:
Following fields will be available on initial screen of report.
Field Name Tech Name Range Field status
Doc Date BLDAT From -To-- Mandatory
Vendor LIFNR From -
To----- optional
SAP TABLES:
TABLES:BSEG, LFA1,MAKT are to be used for having output of report.
Report has to be run for specific GL accounts only which are to be hard coded in the program logic. Based on users input Range of Date all the documents within the range are to be selected along with below criteria from Table BKPF
Transaction code = ML81N
If user enters vendor range then select vendors (input values) from Table BSEG after selecting documents from BKPF based on date & TC as above.
Once the Document are selected from BKPF give as input to BSEG along with below list of GL account (field- HKONT) Below GL to be hard coded in program.
1001 Services - Catering -Food/Beverages
1002 Services - Catering - Hi Lift
1003 Services - Catering - Handling
1004 Services - Catering - Stores
1005 Services - Catering - Laundry
1006 Services - Catering Offloading
Based on above selection the output data from BSEG will be-
Vendor Cost Centre Amount in LC
(LIFNR) (KOSTL) (DMBTR)
The Cost center code which is the output from BSEG above has to be looked into below structures for the cost center group which it belongs, as we need report to be divided into two parts.(1) CATERING_E catering cost JET class (2) CATERING_F catering cost First class
Thus each of Expense head has to be print in two section based on the cost center group.
Cost center group structures GRPVALUES, GRPOBJECTS, GRPDYNP
The Service tax has to be find out from GL 27611002, once the vendors are known from BSEG. This for each vendor the cumulative amount of service tax in this GL has to be summarize for the period give in initial screen.
The vendor names also needs to be fetched up from LFA1 by vendor code found from BSEG, and to be printed on report.
The sequence of searching data for GL accounts must be same as above and also sequence of heads in report should be same as in report layout below.
The report display for two parts(JET class & JET First clss) is shown below
Report Catering Service Expenses
Date From -
To------
JET Class
Expense Head Vendor 1 Vendor 2 Vendor 3 Vendor 4 Vendor 5 Vendor 6 Vendor 7
F&B
Handling
Hi- Lift
Stores
Off_Loading
Laundry
Srv Tax
Total Rs
Date From -
To------
JET First
Expense Head Vendor 1 Vendor 2 Vendor 3 Vendor 4 Vendor 5 Vendor 6 Vendor 7
F&B
Handling
Hi- Lift
Stores
Off_Loading
Laundry
Srv Tax
Total Rs
‎2007 Feb 08 1:34 PM
Hi,
GRPVALUES, GRPOBJECTS, GRPDYNP are structures , u do not have any data in that...
Confirm with ur functional guy for data base tables,,
After that..
select (comp code comp group) from (database table1 into itab1
for all entries in itab
where comp group = CATERING_E or comp group = CATERING_F.
append itab1
endselect.
similarly do the selection from other database tables...
U will be having vendor details in internal table ITAB..
So for all the vendors in ITAB get amont for the GL accounts..
Then print the data accordingly..
Please proceed with the coding.. u can make it... and will encounter few more issues.. Do ask me then..
Awrd if useful..
thanks
rajiv
‎2007 Feb 09 9:59 AM
Still some confusion can u excplain me the coding part.
Thanks.............
SELECTION SCREEN:
Following fields will be available on initial screen of report.
Field Name Tech Name Range Field status
Doc Date BLDAT From -To-- Mandatory
Vendor LIFNR From -
To----- optional
SAP TABLES:
TABLES:BSEG, LFA1,MAKT are to be used for having output of report.
Report has to be run for specific GL accounts only which are to be hard coded in the program logic. Based on users input Range of Date all the documents within the range are to be selected along with below criteria from Table BKPF
Transaction code = ML81N
If user enters vendor range then select vendors (input values) from Table BSEG after selecting documents from BKPF based on date & TC as above.
Once the Document are selected from BKPF give as input to BSEG along with below list of GL account (field- HKONT) Below GL to be hard coded in program.
1001 Services - Catering -Food/Beverages
1002 Services - Catering - Hi Lift
1003 Services - Catering - Handling
1004 Services - Catering - Stores
1005 Services - Catering - Laundry
1006 Services - Catering Offloading
Based on above selection the output data from BSEG will be-
Vendor Cost Centre Amount in LC
(LIFNR) (KOSTL) (DMBTR)
The Cost center code which is the output from BSEG above has to be looked into below structures for the cost center group which it belongs, as we need report to be divided into two parts.(1) CATERING_E catering cost JET class (2) CATERING_F catering cost First class
Thus each of Expense head has to be print in two section based on the cost center group.
Cost center group structures GRPVALUES, GRPOBJECTS, GRPDYNP
The Service tax has to be find out from GL 27611002, once the vendors are known from BSEG. This for each vendor the cumulative amount of service tax in this GL has to be summarize for the period give in initial screen.
The vendor names also needs to be fetched up from LFA1 by vendor code found from BSEG, and to be printed on report.
The sequence of searching data for GL accounts must be same as above and also sequence of heads in report should be same as in report layout below.
The report display for two parts(JET class & JET First clss) is shown below
Report Catering Service Expenses
Date From -
To------
JET Class
Expense Head Vendor 1 Vendor 2 Vendor 3 Vendor 4 Vendor 5 Vendor 6 Vendor 7
F&B
Handling
Hi- Lift
Stores
Off_Loading
Laundry
Srv Tax
Total Rs
Date From -
To------
JET First
Expense Head Vendor 1 Vendor 2 Vendor 3 Vendor 4 Vendor 5 Vendor 6 Vendor 7
F&B
Handling
Hi- Lift
Stores
Off_Loading
Laundry
Srv Tax
Total Rs