Posted: Fri Apr 02, 2010 3:09 pm Post subject: calculating tax(vat cenvat cst) in po report
hiiiiiiiiiii friends
i am sending a report of purchase order in that i want the calculation of VAT CENVAT & CST OF amount depending on tax code how is possible plz tell me solution for that plz its urgent for me
data: begin of itekpo occurs 0,
ebeln type ekpo-ebeln, " po no.
aedat type ekpo-aedat, " change date
lifnr type ekko-lifnr, " vendor code
bedat type ekko-bedat, " po date
matnr type ekpo-matnr, " material no.
bukrs type ekpo-bukrs, " company code
werks type ekpo-werks, " plant
meins type ekpo-meins, " unit
netpr type ekpo-netpr, " net price
prdat type ekpo-prdat, " price date = creat date
netpr2 type ekpo-netpr, " net price
prdat2 type ekpo-prdat, " price date = creat date
aedat2 type ekpo-aedat,
txz01 type ekpo-txz01, " short text
menge type ekpo-menge, " quantity
netwr type ekpo-netwr, " net value
brtwr type ekpo-brtwr, " gross value
mwskz type ekpo-mwskz, " tax code
text1 like t007s-text1," Tax description
name1 like lfa1-name1, " VENDOR NAME
end of itekpo.
data: begin of itab occurs 0,
ebeln type ekpo-ebeln, " po no.
aedat type ekpo-aedat, " change date
lifnr type ekko-lifnr, " vendor code
bedat type ekko-bedat, " po date
matnr type ekpo-matnr, " material no.
bukrs type ekpo-bukrs, " company code
werks type ekpo-werks, " plant
meins type ekpo-meins, " unit
netpr type ekpo-netpr, " net price
prdat type ekpo-prdat, " price date = creat date
txz01 type ekpo-txz01, " short text
menge type ekpo-menge, " quantity
netwr type ekpo-netwr, " net value
brtwr type ekpo-brtwr, " gross value
mwskz type ekpo-mwskz, " tax code
text1 like t007s-text1," Tax description
name1 like lfa1-name1, " VENDOR NAME
butxt type t001-butxt, " company name
plant type t001w-name2, " plant name
end of itab.
data : gv_butxt type char50. " company name
data : gv_plant type t001w-name2. " plant name
*********ALV Declaration*************************
data: it_fieldcatalog type slis_t_fieldcat_alv with header line,
wa_fieldcatalog like line of it_fieldcatalog,
wa_layout type slis_layout_alv,
it_rec type table of itab,
it_rec1 type table of itab,
wa_rec like line of itab,
wa_itab like line of itab.
data : it_sort type slis_t_sortinfo_alv,
wa_sort type slis_sortinfo_alv.
constants: lc_page type slis_formname value 'TOP_OF_PAGE'.
*********ALV Declaration*************************
selection-screen : begin of block b with frame title text-100.
select-options:
company for ekpo-bukrs no intervals default '1000',
plant for ekpo-werks no intervals default '1021',
mat_no for ekpo-matnr,
po_date for ekpo-prdat.
selection-screen end of block b .
start-of-selection.
select ebeln aedat matnr bukrs werks netpr prdat txz01 menge meins netwr mwskz brtwr
from ekpo into corresponding fields of table itekpo
where
bukrs in company and
werks in plant and
matnr in mat_no and
prdat in po_date .
end-of-selection.
loop at itekpo.
select single lifnr bedat from ekko into (itekpo-lifnr, itekpo-bedat)
where ebeln = itekpo-ebeln.
select single name1 from lfa1 into (itekpo-name1)
where lifnr = itekpo-lifnr.
select single text1 from t007s into (itekpo-text1)
where mwskz = itekpo-mwskz and spras = 'E'
and kalsm = 'TAXINN'.
move : itekpo-ebeln to itab-ebeln,
itekpo-aedat to itab-aedat,
itekpo-lifnr to itab-lifnr,
itekpo-txz01 to itab-txz01,
itekpo-menge to itab-menge,
itekpo-meins to itab-meins,
itekpo-netwr to itab-netwr,
itekpo-brtwr to itab-brtwr,
itekpo-mwskz to itab-mwskz,
itekpo-name1 to itab-name1,
itekpo-text1 to itab-text1,
itekpo-bedat to itab-bedat,
itekpo-matnr to itab-matnr,
itekpo-bukrs to itab-bukrs,
itekpo-werks to itab-werks,
itekpo-meins to itab-meins,
itekpo-netpr to itab-netpr,
itekpo-prdat to itab-prdat.
********** for PLANT name in heading ******
select single name2
from t001w
into gv_plant
where werks = itekpo-werks.
move : gv_plant to itab-plant.
**************************************************
append itab.
clear: itekpo.
clear: itab.
endloop.
if not itab[] is initial.
perform sort.
perform populate_field_catalog.
perform fill_layout.
perform display_alv.
else.
write: ' NO DATA'.
endif.
*&---------------------------------------------------------------------*
*& Form populate_field_catalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form populate_field_catalog .
*&---------------------------------------------------------------------*
*& Form fill_layout
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form fill_layout .
wa_layout-no_input = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-zebra = 'X'.
endform. " fill_layout
*& Form display_alv
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form display_alv .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = lc_page
is_layout = wa_layout
it_fieldcat = it_fieldcatalog[]
i_default = 'X'
i_save = 'A'
it_sort = it_sort
tables
t_outtab = itab
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number
sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " display_alv
********************TOP-OF-PAGE******************
*******************
*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&--------------------------------------------------------------------*
* TOP-OF-PAGE for ALV list display
*---------------------------------------------------------------------*
form top_of_page.
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
gv_date(10),
sv_date_low(10),
sv_date_high(10).
* Convert the date format.
write sy-datum to gv_date mm/dd/yyyy.
write po_date-low to sv_date_low mm/dd/yyyy.
write po_date-high to sv_date_high mm/dd/yyyy.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.