Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to connect gl accout to this folowing report

hi,

i develop one purchase register. everything is going fine but when i

connect gl a/c to this report it will take more time to execute but output

come perfect. when i debug this it take more time on select query where i connect the gl a/c. can anyone tell how to improve perfomance of this report.

&----


*& Report Z_MM_PURCHASE_REGISTER

*&

&----


*&

*&

&----


REPORT Z_MM_PURCHASE_REGISTER.

***********************************************************************

  • Short Description: Purchase Register

*

*

  • --------------------------------------------------------------------

*

*

----


  • INCLUDE *

----


----


  • TABLES *

----


TABLES : ekko, taxcom, ekpo, ekbe,ekkn,konv,komv,t007s, j_1imovend, bseg .

TYPE-POOLS: slis.

----


  • TYPES: Begin with TY_ *

----


TYPES : BEGIN OF ty_ekko,

BSART LIKE EKKO-BSART,

KNTTP LIKE EKPO-KNTTP,

ebeln LIKE ekko-ebeln,

knumv LIKE ekko-knumv,

lifnr LIKE ekko-lifnr,

waers LIKE ekko-waers,

kalsm LIKE ekko-kalsm,

lands LIKE ekko-lands,

ekorg LIKE ekko-ekorg,

wkurs LIKE ekko-wkurs,

bedat LIKE ekko-bedat,

ebelp LIKE ekpo-ebelp, "po line item

mwskz LIKE ekpo-mwskz, "tax code

bukrs LIKE ekpo-bukrs,

matkl LIKE ekpo-matkl,

mtart LIKE ekpo-mtart,

  • netpr LIKE ekpo-netpr, "Net price in purchasing document

  • meins LIKE ekpo-meins, "unit

menge LIKE ekpo-menge, "quantity

txz01 LIKE ekpo-txz01, "material description

txjcd LIKE ekpo-txjcd, "tax jurisdiction code

matnr LIKE ekpo-matnr,

llief LIKE ekko-llief,

meins LIKE ekpo-meins,

bprme LIKE ekpo-bprme,

netpr LIKE ekpo-netpr,

peinh LIKE ekpo-peinh,

  • lifnr like lfa1-lifnr,

name1 like lfa1-lifnr,

pstlz like lfa1-pstlz,

stras like lfa1-stras,

text1 like t007s-text1,

END OF ty_ekko.

TYPES : BEGIN OF ty_ekbe,

ebeln LIKE ekbe-ebeln, "po number

ebelp LIKE ekbe-ebelp, "po line item

buzei LIKE ekbe-buzei,

belnr LIKE ekbe-belnr, "Number of material document

budat LIKE ekbe-budat, "Posting date in the document

xblnr LIKE ekbe-xblnr, "Reference document number

werks LIKE ekbe-werks, "plant

matnr LIKE ekbe-matnr, "material

menge LIKE ekbe-menge, "quantity

peinh LIKE ekpo-peinh,

dmbtr LIKE ekbe-dmbtr, "Amount in local currency

kalsm LIKE ekko-kalsm, "Procedure (pricing)

waers LIKE ekbe-waers, "currency

wrbtr LIKE ekbe-wrbtr, "Amount in document currency

bwtar LIKE ekbe-bwtar, "Valuation type

shkzg LIKE ekbe-shkzg,

maktx LIKE makt-maktx,

mwskz LIKE ekbe-mwskz,

bldat LIKE ekbe-bldat,

srvpos LIKE ekbe-srvpos,

packno LIKE ekbe-packno,

introw LIKE ekbe-introw,

lfbnr LIKE ekbe-lfbnr,

bwart TYPE ekbe-bwart,

END OF ty_ekbe.

TYPES : BEGIN OF ty_display,

BSART LIKE EKKO-BSART,

KNTTP LIKE EKPO-KNTTP,

lifnr(10) TYPE C, " LIKE ekko-lifnr,

ebeln LIKE ekko-ebeln,

bedat LIKE ekko-bedat,

budat LIKE ekbe-budat,

matnr LIKE ekbe-matnr,

maktx LIKE makt-maktx,

belnr LIKE ekbe-belnr,

bldat LIKE ekbe-bldat,

menge LIKE ekpo-menge,

peinh LIKE ekpo-peinh,

dmbtr LIKE ekbe-dmbtr,

shkzg LIKE ekbe-shkzg,

custduty LIKE konv-kwert,

bed LIKE konv-kwert,

cvd LIKE konv-kwert,

sertax LIKE konv-kwert,

sereducess LIKE konv-kwert,

surcharge LIKE konv-kwert,

educess LIKE konv-kwert,

insure LIKE konv-kwert,

freight LIKE konv-kwert,

octroi LIKE konv-kwert,

kursf LIKE rbkp-kursf,

grossamt LIKE konv-kwert,

vat4 LIKE konv-kwert,

vat8 LIKE konv-kwert,

vat125 LIKE konv-kwert,

INC LIKE KONV-KWERT, "

PF LIKE KONV-KWERT,

CF LIKE KONV-KWERT,

INS LIKE KONV-KWERT,

cst LIKE konv-kwert,

subdeb LIKE ekbe-dmbtr,

netamt LIKE ekbe-dmbtr,

cenvatcreditbed LIKE konv-kwert,

cenvatcreditecc LIKE konv-kwert,

vatcredit LIKE konv-kwert,

bgcharges LIKE konv-kwert,

srvpos LIKE ekbe-srvpos,

ktext1 LIKE esll-ktext1,

sertaxcredit LIKE konv-kwert,

sereducesscredit LIKE konv-kwert,

totaltaxbenefit LIKE konv-kwert,

inventoryvalue LIKE konv-kwert,

bwart TYPE ekbe-bwart,

belnr1 TYPE ekbe-belnr,

budat1 TYPE ekbe-budat,

lfbnr TYPE ekbe-lfbnr,

bprme LIKE ekpo-bprme,

meins LIKE ekpo-meins,

name1 like lfa1-name1,

pstlz like lfa1-pstlz,

stras like lfa1-stras,

mwskz like ekpo-mwskz,

text1 like t007s-text1,

kalsm like t007s-kalsm,

j_1icstno like j_1imovend-j_1icstno,

hkont(10) TYPE C, " like bseg-hkont,

saknr like ska1-saknr,

sakan like ska1-sakan,

ktoks like ska1-ktoks,

mcod1 like ska1-mcod1,

WAERS LIKE EKKO-WAERS,

END OF ty_display.

TYPES : BEGIN OF ty_services,

ebeln LIKE ekpo-ebeln,

ebelp LIKE ekpo-ebelp,

lfbnr LIKE ekbe-lfbnr,

packno LIKE esll-packno,

sub_packno LIKE esll-sub_packno,

srvpos LIKE esll-srvpos,

ktext1 LIKE esll-ktext1,

netwr LIKE esll-netwr,

act_wert LIKE esll-act_wert,

menge LIKE esll-menge,

bldat LIKE ekbe-bldat,

END OF ty_services.

TYPES : BEGIN OF ty_konv,

ebeln LIKE ekpo-ebeln,

ebelp LIKE ekpo-ebelp,

knumv LIKE konv-knumv,

kposn LIKE konv-kposn,

kschl LIKE konv-kschl,

kwert LIKE konv-kwert,

kbetr LIKE konv-kbetr,

END OF ty_konv.

TYPES : BEGIN OF ty_lfbnr,

belnr TYPE ekbe-belnr,

lfbnr TYPE ekbe-lfbnr,

END OF ty_lfbnr.

TYPES : BEGIN OF ty_miro,

belnr1 TYPE ekbe-belnr,

belnr TYPE ekbe-belnr,

budat TYPE ekbe-budat,

END OF ty_miro.

types: begin of ty_lfa1,

lifnr like lfa1-lifnr,

name1 like lfa1-lifnr,

pstlz like lfa1-pstlz,

stras like lfa1-stras,

end of ty_lfa1.

types: begin of ty_t007s,

mwskz like t007s-mwskz,

text1 like t007s-text1,

spras like t007s-spras,

kalsm like t007s-kalsm,

end of ty_t007s.

types: begin of ty_j_1imovend,

lifnr like j_1imovend-lifnr,

j_1icstno like j_1imovend-j_1icstno,

end of ty_j_1imovend.

types: begin of ty_bseg,

lifnr like bseg-lifnr,

dmbtr like bseg-dmbtr,

shkzg like bseg-shkzg,

hkont like bseg-hkont,

BELNR LIKE BSEG-BELNR,

end of ty_bseg.

types: begin of ty_ska1,

saknr like ska1-saknr,

sakan like ska1-sakan,

ktoks like ska1-ktoks,

mcod1 like ska1-mcod1,

end of ty_ska1.

DATA : it_lfbnr TYPE STANDARD TABLE OF ty_lfbnr,

wa_lfbnr TYPE ty_lfbnr,

it_lfa1 type standard table of ty_lfa1,

wa_lfa1 TYPE ty_lfa1,

it_t007s type standard table of ty_t007s,

wa_t007s TYPE ty_t007s,

it_j_1imovend type standard table of ty_j_1imovend,

wa_j_1imovend TYPE ty_j_1imovend,

it_bseg type standard table of ty_bseg,

wa_bseg TYPE ty_bseg,

it_ska1 type standard table of ty_ska1,

wa_ska1 TYPE ty_ska1,

it_miro TYPE STANDARD TABLE OF ty_miro,

wa_miro TYPE ty_miro,

w_belnr TYPE ekbe-belnr,

w_lfbnr TYPE ekbe-lfbnr,

w_belnr1 TYPE ekbe-belnr,

w_budat TYPE ekbe-budat.

----


  • CONSTANTS: Begin with C_ *

----


----


  • DATA: Begin with W_ *

----


DATA : w_flag TYPE c.

----


  • INTERNAL TABLES: Begin with IT_ *

----


DATA : it_ekko TYPE STANDARD TABLE OF ty_ekko WITH NON-UNIQUE KEY ebeln

ebelp,

  • it_ekpo type standard table of ty_ekpo,

it_ekbe TYPE STANDARD TABLE OF ty_ekbe,

it_ekbe1 TYPE STANDARD TABLE OF ty_ekbe WITH NON-UNIQUE KEY ebeln

ebelp,

it_display TYPE STANDARD TABLE OF ty_display,

it_subdebit TYPE STANDARD TABLE OF ty_ekbe,

it_services TYPE STANDARD TABLE OF ty_services,

it_packno TYPE STANDARD TABLE OF ty_services,

it_konv TYPE STANDARD TABLE OF ty_konv.

DATA : it_fieldcat TYPE slis_t_fieldcat_alv,

it_layout TYPE slis_layout_alv,

it_komv TYPE STANDARD TABLE OF komv WITH NON-UNIQUE KEY knumv

kschl.

----


  • WORKAREAS: Begin with WA_ *

----


DATA : wa_ekbe TYPE ty_ekbe,

wa_ekbe1 TYPE ty_ekbe,

wa_ekko TYPE ty_ekko,

wa_komv TYPE komv,

wa_display TYPE ty_display,

  • WA_LFA1 TYPE TY_LFA1,

  • W_GROSS_AMT type KOMV-KWERT,

wa_subdebit TYPE ty_ekbe,

wa_packno TYPE ty_services,

wa_services TYPE ty_services,

wa_konv TYPE ty_konv,

wa_taxcom TYPE taxcom,

wa_ls_fieldcat TYPE slis_fieldcat_alv.

----


  • FIELD-SYMBOLS: Begin with FS_ *

----


----


  • FIELD-GROUPS: Begin with FG_ *

----


----


  • CONTROLS: *

----


----


  • SELECT-OPTIONS: Begin with SO_ *

----


SELECT-OPTIONS : so_lifnr FOR ekko-lifnr ,

  • so_mtart FOR ekpo-mtart,

so_ebeln FOR ekbe-ebeln,

so_matnr FOR ekbe-matnr,

  • so_date FOR sy-datum no-display,

do_date for ekko-bedat,

tax_code for ekpo-mwskz,

mr_date for ekbe-budat,

mat_gr for ekpo-matkl,

mat_tp for ekpo-mtart.

----


  • PARAMETERS: Begin with PR_ *

----


PARAMETER : pr_plant LIKE ekpo-werks OBLIGATORY,

pr_ekorg LIKE ekko-ekorg . "OBLIGATORY.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .

PARAMETER : pr_preg TYPE c radiobutton group g1 default 'X',

pr_ror TYPE c RADIOBUTTON GROUP g1 .

SELECTION-SCREEN : END OF BLOCK b1.

----


  • START-OF-SELECTION *

----


START-OF-SELECTION .

*--- Get the data reguired--


PERFORM f001-get_data.

*-------Calculate the tax required -


PERFORM f002-cal_taxes.

PERFORM miro_get_data.

----


  • END-OF-SELECTION *

----


END-OF-SELECTION.

*---Display the report--


PERFORM f003-display_register.

&----


*& Form F001-GET_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f001-get_data .

*----


  • Clear and Refresh all internal table and work area.

*----


REFRESH : it_ekko,

it_ekbe,

it_services,

it_packno,

it_konv,

it_lfa1,

it_komv.

CLEAR : wa_ekko,

wa_ekbe,

wa_services,

wa_packno,

wa_konv,

wa_lfa1,

wa_komv.

*********************************************************************************

*----


  • Get the history records for all the selected PO. from table EKBE of

  • type GR.

*----


IF pr_preg = 'X'.

  • *----------------------------------------------------------------------

*Get Purchasing Document Number, Number of the document condition,

*Vendor's accountNumber, Currency Key, Procedure , Country for Tax

*ReturnPurchasing OrganizationExchange rate In an internal table it_ekko

*----


SELECT pBSART qknttp pebeln pknumv plifnr pwaers pkalsm plands pekorg pwkurs

wkurs pbedat qebelp qbukrs qmatkl qmtart pllief qmeins qbprme

qtxjcd qmwskz pwkurs qnetpr qmenge QPEINH

INTO CORRESPONDING FIELDS OF TABLE it_ekko

FROM ekko AS p INNER JOIN ekpo AS q

ON pebeln = qebeln

WHERE p~ekorg = pr_ekorg

AND p~lifnr IN so_lifnr

  • AND q~mtart IN so_mtart

AND p~ebeln IN so_ebeln

and p~bedat in do_date

and q~mwskz in tax_code

and q~matkl in mat_gr

and q~mtart in mat_tp.

*----


  • GET ALL THE PO FOR WHICH MIRO HAS BEEN DONE

*----


SELECT ebeln ebelp budat bldat

INTO CORRESPONDING FIELDS OF TABLE it_ekbe1

FROM ekbe

FOR ALL ENTRIES IN it_ekko

WHERE ebeln = it_ekko-ebeln

AND ebelp = it_ekko-ebelp

  • AND bewtp = 'Q'

AND werks = pr_plant

  • AND budat IN so_date

  • AND ( bwart = '101' OR bwart = '102' ) "OR bwart = '105' OR bwart = '106' OR bwart ='')

AND ebeln IN so_ebeln

and budat in mr_date

AND matnr IN so_matnr.

  • AND ( BUDAT >= SO_DATE-low and BUDAT <= SO_DATE-high ).

*----


  • Check whether any records is present

*----


IF sy-subrc = 0.

IF NOT it_ekbe1 IS INITIAL.

SELECT ebeln ebelp buzei belnr budat xblnr werks matnr menge

dmbtr waers wrbtr bwtar shkzg dmbtr bldat srvpos

packno introw lfbnr bwart

INTO CORRESPONDING FIELDS OF TABLE it_ekbe

FROM ekbe

FOR ALL ENTRIES IN it_ekbe1

WHERE ebeln = it_ekbe1-ebeln

AND ebelp = it_ekbe1-ebelp

and budat in mr_date

  • AND budat IN so_date

  • and ( BUDAT >= SO_DATE-low and BUDAT <= SO_DATE-high )

AND bewtp = 'E'

AND ( bwart = '101' OR bwart = '102' OR bwart = '103' OR bwart = '105' ). "OR bwart = '105' OR bwart = '106' OR bwart ='').

  • AND bwart = '103'.

  • and WERKS = PR_PLANT.

IF sy-subrc = 0.

ENDIF.

ELSE.

SELECT ebeln ebelp buzei belnr budat xblnr werks matnr menge

dmbtr waers wrbtr bwtar shkzg dmbtr bldat srvpos

packno introw lfbnr bwart

INTO CORRESPONDING FIELDS OF TABLE it_ekbe

FROM ekbe

FOR ALL ENTRIES IN it_ekbe1

WHERE ebeln = it_ekbe1-ebeln

AND ebelp = it_ekbe1-ebelp

and budat in mr_date

  • AND budat IN so_date

  • and ( BUDAT >= SO_DATE-low and BUDAT <= SO_DATE-high )

AND bewtp = 'E'

AND ( bwart = '101' OR bwart = '102' OR bwart = '103' OR bwart = '105' ) . "OR bwart = '105' OR bwart = '106' OR bwart ='').

  • AND bwart = '102'.

  • and WERKS = PR_PLANT.

IF sy-subrc = 0.

ENDIF.

ENDIF.

*----


  • Get the history records for all the selected PO. from table EKBE of

  • type invoice reciept

*----


SELECT ebeln ebelp belnr dmbtr shkzg

INTO CORRESPONDING FIELDS OF TABLE it_subdebit

FROM ekbe

FOR ALL ENTRIES IN it_ekbe1

WHERE ebeln = it_ekbe1-ebeln

AND ebelp = it_ekbe1-ebelp

AND budat IN mr_date

  • AND ( BUDAT >= SO_DATE-low and BUDAT <= SO_DATE-high )

AND bewtp = 'Q'

AND werks = pr_plant.

IF sy-subrc = 0.

ENDIF.

*----


  • Get the package number and sun package no. of all selected PO.

*----


SELECT pebeln pebelp qpackno qsub_packno rbldat rlfbnr

INTO CORRESPONDING FIELDS OF TABLE it_packno

FROM essr AS p INNER JOIN esll AS q

ON ppackno = qpackno

INNER JOIN ekbe AS r

ON plblni = rbelnr

FOR ALL ENTRIES IN it_ekbe1

WHERE p~ebeln = it_ekbe1-ebeln

AND p~ebelp = it_ekbe1-ebelp.

  • and ( PBLDAT >= SO_DATE-low and PBLDAT <= SO_DATE-high ).

  • AND p~bldat IN so_date.

  • AND bewtp = 'D'.

IF sy-subrc = 0.

ENDIF.

ENDIF.

*******************************************************************************

  • new code added by dinesh

*****************************************************************************

*get the venor address

select alifnr bname1 bpstlz bstras b~lifnr

into corresponding fields of table it_LFA1

from ekko as a inner join lfa1 as b

on alifnr = blifnr

for all entries in it_EKKO

where B~lifnr = it_EKKO-lifnr.

*************************************************************************

***tax code description added*******************

select mwskz text1 spras kalsm

from t007s

into corresponding fields of table it_t007s for all entries in it_ekko

where mwskz = it_ekko-mwskz and spras = 'E' and kalsm = 'TAXSIL'.

*******************************************************************************

*******vendor vat no. added*************

select lifnr j_1icstno

from j_1imovend

into corresponding fields of table it_j_1imovend for all entries in it_ekko

where lifnr = it_ekko-lifnr.

********************************************************************************

**********gl code added******************************************

*select lifnr shkzg dmbtr hkont BELNR

*from bseg

*into corresponding fields of table it_bseg for all entries in it_ekko

*where LIFNR = it_EKKO-LIFNR and shkzg = 'S'.

*

***********************************************************************************

*************gl code description added*******************************************

*select saknr ktoks mcod1 sakan

*from ska1

*into corresponding fields of table it_ska1 for all entries in it_bseg

*where sakan = it_bseg-hkont and ktoks = 'MAT'.

*

*----


  • Get the package number , service number , service text , net price ,

  • accual amount , qty. etc

*----


IF NOT it_packno[] IS INITIAL.

SELECT ppackno psrvpos pktext1 pnetwr pact_wert pmenge

INTO CORRESPONDING FIELDS OF TABLE it_services

FROM esll AS p "inner join ESLL as Q

  • on PPLN_PACKNO = QPACKNO

  • and PINTROW = QINTROW

FOR ALL ENTRIES IN it_packno

WHERE p~packno = it_packno-sub_packno.

IF sy-subrc = 0.

ENDIF.

ENDIF.

*----


  • Get Number of the document condition ,line item number, Condition

  • value for all selected PO.

*----


IF NOT it_ekko[] IS INITIAL.

SELECT knumv kposn kschl kwert

INTO CORRESPONDING FIELDS OF TABLE it_konv

FROM konv

FOR ALL ENTRIES IN it_ekko

WHERE knumv = it_ekko-knumv.

IF sy-subrc = 0.

ENDIF.

ENDIF.

ENDIF.

ENDFORM. " F001-GET_DATA

*

&----


*& Form F002-CAL_TAXES

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f002-cal_taxes .

*----


  • Calculate taxes for all the PO.

*----


LOOP AT it_ekbe INTO wa_ekbe.

CLEAR : wa_display,

wa_ekko.

READ TABLE it_ekko WITH TABLE KEY ebeln = wa_ekbe-ebeln

ebelp = wa_ekbe-ebelp

INTO wa_ekko.

IF sy-subrc = 0.

ENDIF.

CLEAR wa_taxcom.

  • select single KTEXT1

  • into WA_DISPLAY-KTEXT1

  • from ESLL

  • where PACKNO = WA_EKBE-PACKNO

  • and INTROW = WA_EKBE-INTROW.

*----


  • Get the text for the Material.

*----


SELECT SINGLE maktx

INTO wa_display-maktx

FROM makt

WHERE matnr = wa_ekbe-matnr

AND spras = sy-langu.

wa_taxcom-bukrs = wa_ekko-bukrs.

wa_taxcom-budat = wa_ekbe-bldat.

wa_taxcom-waers = wa_ekbe-waers.

wa_taxcom-kposn = wa_ekbe-ebelp.

wa_taxcom-mwskz = wa_ekko-mwskz.

wa_taxcom-txjcd = wa_ekko-txjcd.

  • taxcom-shkzg = 'H'.

wa_taxcom-xmwst = 'X'.

  • IF ekko-bstyp EQ bstyp-best.

wa_taxcom-wrbtr = wa_ekko-netpr * wa_ekbe-menge * wa_ekko-wkurs.

  • WA_TAXCOM-WRBTR = wa_ekbe-dmbtr.

  • ELSE.

  • taxcom-wrbtr = ekpo-zwert.

  • ENDIF.

wa_taxcom-lifnr = wa_ekko-lifnr.

wa_taxcom-land1 = wa_ekko-lands. "WIA

wa_taxcom-ekorg = wa_ekko-ekorg.

wa_taxcom-hwaer = 'INR'. "t001-waers.

wa_taxcom-llief = wa_ekko-llief.

wa_taxcom-bldat = wa_ekbe-bldat.

wa_taxcom-matnr = wa_ekbe-matnr. "HTN-Abwicklung

wa_taxcom-werks = pr_plant.

  • taxcom-bwtar = ekpo-bwtar.

wa_taxcom-matkl = wa_ekko-matkl.

wa_taxcom-meins = wa_ekko-meins.

wa_taxcom-ebeln = wa_ekbe-ebeln.

wa_taxcom-ebelp = wa_ekbe-ebelp.

wa_taxcom-mglme = wa_ekbe-menge.

wa_taxcom-mtart = wa_ekko-mtart.

*Call function module CALCULATE_TAX_ITEM--


CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = wa_taxcom

display_only = 'X'

  • dialog = diakz

IMPORTING

e_taxcom = wa_taxcom

  • nav_anteil = hwert

TABLES

t_xkomv = it_komv

EXCEPTIONS

OTHERS = 01.

IF sy-subrc = 0.

ENDIF.

wa_display-bsart = wa_ekko-bsart.

wa_display-knttp = wa_ekko-knttp.

wa_display-bprme = wa_ekko-bprme.

wa_display-meins = wa_ekko-meins.

wa_display-lifnr = wa_ekko-lifnr.

wa_display-ebeln = wa_ekbe-ebeln.

wa_display-bedat = wa_ekko-bedat.

wa_display-bwart = wa_ekbe-bwart.

wa_display-budat = wa_ekbe-budat.

wa_display-matnr = wa_ekbe-matnr.

wa_display-belnr = wa_ekbe-belnr.

wa_display-menge = wa_ekbe-menge.

wa_display-PEINH = wa_ekko-PEINH.

wa_display-dmbtr = ( wa_ekko-netpr * wa_ekbe-menge * wa_ekko-wkurs ) / wa_ekko-PEINH.

  • WA_DISPLAY-DMBTR = WA_EKBE-DMBTR.

wa_display-srvpos = wa_ekbe-srvpos.

wa_display-mwskz = wa_EKKO-mwskz.

wa_display-WAERS = wa_EKKO-WAERS.

  • clear W_GROSS_AMT .

*----


  • Get the custom duty

*----


read table it_lfa1 into wa_lfa1 with key lifnr = wa_ekko-lifnr.

wa_display-name1 = wa_lfa1-name1.

wa_display-pstlz = wa_lfa1-pstlz.

wa_display-stras = wa_lfa1-stras.

read table it_t007s into wa_t007s with key mwskz = wa_ekko-mwskz.

wa_display-text1 = wa_t007s-text1.

read table it_j_1imovend into wa_j_1imovend with key lifnr = wa_ekko-lifnr.

wa_display-j_1icstno = wa_j_1imovend-j_1icstno.

read table it_bseg into wa_bseg with key LIFNR = wa_ekKO-LIFNR.

wa_display-HKONT = wa_bseg-HKONT.

read table it_ska1 into wa_ska1 with key sakan = wa_bseg-hkont.

wa_display-mcod1 = wa_ska1-mcod1.

READ TABLE it_komv WITH KEY kschl = 'JCDB'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-custduty = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JCDB'.

IF wa_ekko-menge <> 0.

wa_display-custduty = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*----


  • Get the BED OR EXCISE DUTY

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JMOP'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0 .

wa_display-BED = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'JMOQ'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-BED = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JMOP'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-BED = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY

knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JMOQ'.

IF wa_ekko-menge <> 0.

wa_display-BED = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

********************************************************************************************

******END OF EXCISE DUTY AND THE BED******************************************************

********************************************************************************************

*******************************************************************************************

*----


  • Get the EDUCATION CESS

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JEC1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0 .

wa_display-educess = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'JESQ'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-educess = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JEC1'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-educess = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY

knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JESQ'.

IF wa_ekko-menge <> 0.

wa_display-educess = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

*******************************************************************************************

*END OF EDUCATION CESS

**********************************************************************************

*********************************************************************************************

**----


*-

    • Get the SERVICE TAX

**----


*-

clear : WA_KOMV , WA_KONV.

read table IT_KOMV with key KSCHL = 'JSRT'

KPOSN = WA_EKKO-EBELP

into WA_KOMV.

if SY-SUBRC = 0.

WA_DISPLAY-SERTAX = WA_KOMV-KWERT .

else.

read table IT_KONV into WA_KONV with key KNUMV = WA_EKKO-KNUMV

KPOSN = WA_EKKO-EBELP

KSCHL = 'JSRT'.

WA_DISPLAY-SERTAX = WA_KONV-KWERT * wa_ekko-WKURS.

endif.

*************************************************************************

                      • END OF SERVICE TAX****************************************

**************************************************************************

**----


*-

    • Get the EDUCATION CESS ON SERVICE TAX************************

**----


*-

*

*

clear : WA_KOMV , WA_KONV.

read table IT_KOMV with key KSCHL = 'JEC5'

KPOSN = WA_EKKO-EBELP

into WA_KOMV.

if SY-SUBRC = 0.

WA_DISPLAY-SEREDUCESS = WA_KOMV-KWERT .

else.

read table IT_KONV into WA_KONV with key KNUMV = WA_EKKO-KNUMV

KPOSN = WA_EKKO-EBELP

KSCHL = 'JEC5'.

WA_DISPLAY-SEREDUCESS = WA_KONV-KWERT * wa_ekko-WKURS.

endif.

********************************************************************************************

******END OF SERVICE TAX ON EDUCATION CESS************************************************

********************************************************************************************

**************************************************************************************************************************

**************************************************************************************************************************----


  • Get the CVD

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JCV1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-cvd = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JCV1'.

IF wa_ekko-menge <> 0.

wa_display-cvd = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*----


  • Get the total INSURANCE

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'ZIN1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0 .

wa_display-insure = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'ZIN2'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-insure = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'ZIN1'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-insure = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY

knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'ZIN2'.

IF wa_ekko-menge <> 0.

wa_display-insure = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

*----


  • Get the total FREIGHT AMOUNT**********************************

*----


  • CLEAR : wa_komv , wa_konv.

*

  • READ TABLE it_komv WITH KEY kschl = 'FRB2'

  • kposn = wa_ekko-ebelp

  • INTO wa_komv.

*

*

  • IF sy-subrc = 0 .

  • wa_display-freight = wa_komv-kwert .

  • ELSE.

  • READ TABLE it_komv WITH KEY kschl = 'FRC2'

  • kposn = wa_ekko-ebelp

  • INTO wa_komv.

*

  • IF sy-subrc = 0.

  • wa_display-freight = wa_komv-kwert .

  • ELSE.

  • READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'FRB2'.

  • IF sy-subrc = 0.

  • IF wa_ekko-menge <> 0.

  • wa_display-freight = ( wa_ekbe-menge / wa_ekko-menge

  • ) * wa_konv-kwert * wa_ekko-wkurs.

  • ENDIF.

  • ELSE.

  • READ TABLE it_konv INTO wa_konv WITH KEY

  • knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'FRC2'.

  • IF wa_ekko-menge <> 0.

  • wa_display-freight = ( wa_ekbe-menge / wa_ekko-menge

  • ) * wa_konv-kwert * wa_ekko-wkurs.

  • ENDIF.

  • ENDIF.

  • ENDIF.

*

  • ENDIF.

*BREAK-POINT.

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'FRB2'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-FREIGHT = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'FRB2'.

IF wa_ekko-menge <> 0.

wa_display-FREIGHT = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

  • ********************************************************

READ TABLE it_komv WITH KEY kschl = 'FRC2'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-FREIGHT = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'FRC2'.

IF wa_ekko-menge <> 0.

wa_display-FREIGHT = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*BREAK-POINT.

*CLEAR : wa_komv , wa_konv.

*

  • READ TABLE it_komv WITH KEY kschl = 'FRC2'

  • kposn = wa_ekko-ebelp

  • INTO wa_komv.

*

  • IF sy-subrc = 0 .

  • wa_display-FREIGHT = wa_komv-kwert .

  • ELSE.

  • READ TABLE it_komv WITH KEY kschl = 'FRB2'

  • kposn = wa_ekko-ebelp

  • INTO wa_komv.

*

  • IF sy-subrc = 0.

  • wa_display-FREIGHT = wa_komv-kwert .

*

  • ELSE.

  • READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'FRB2'.

  • IF sy-subrc = 0.

  • IF wa_ekko-menge <> 0.

  • wa_display-FREIGHT = ( wa_ekbe-menge / wa_ekko-menge

  • ) * wa_konv-kwert * wa_ekko-wkurs.

  • ENDIF.

  • ELSE.

  • READ TABLE it_konv INTO wa_konv WITH KEY

  • knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'FRC2'.

  • IF wa_ekko-menge <> 0.

  • wa_display-FREIGHT = ( wa_ekbe-menge / wa_ekko-menge

  • ) * wa_konv-kwert * wa_ekko-wkurs.

  • ENDIF.

  • ENDIF.

  • ENDIF.

  • ENDIF.

************************************************************************

********END OF FREIGHT AMOUNT*****************************************

************************************************************************

*************GET THE PACKING AND THE FORWARDING CHARGES****************

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'ZPK1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-PF = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'ZPK1'.

IF wa_ekko-menge <> 0.

wa_display-PF = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

  • ********************************************************

READ TABLE it_komv WITH KEY kschl = 'ZLUC'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-PF = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'ZLUC'.

IF wa_ekko-menge <> 0.

wa_display-PF = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

************END OF PACKING AND THE FORWARDING CHARGES***********************

******************************************************************************

************GET THE C AND F CHARGES***********************

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'YUL1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-CF = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'YUL1'.

IF wa_ekko-menge <> 0.

wa_display-CF = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

************END OF C AND F CHARGES************************

***************GET THE INSURANCE****************************

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'YIN1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-INS = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'YIN1'.

IF wa_ekko-menge <> 0.

wa_display-INS = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

  • ********************************************************

READ TABLE it_komv WITH KEY kschl = 'YIN2'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-INS = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'YIN2'.

IF wa_ekko-menge <> 0.

wa_display-INS = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

**************END OF INSURANCE********************************

*----


  • Get the total OCTROI

*----


*break-point.

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JOCM'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-octroi = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JOCM'.

IF wa_ekko-menge <> 0.

wa_display-octroi = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

***************************************************

********END OF OCTROI AMOUNT*****************************

***************************************************

*----


  • Get the total GROSS AMOUNT

*----


wa_display-grossamt = wa_display-dmbtr +

wa_display-custduty +

wa_display-bed + wa_display-cvd +

wa_display-sertax + wa_display-sereducess +

wa_display-educess + wa_display-insure +

wa_display-freight + wa_display-octroi .

CLEAR w_flag.

READ TABLE it_komv WITH KEY kschl = 'JVRN'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc <> 0.

READ TABLE it_komv WITH KEY kschl = 'JVCN'

kposn = wa_ekko-ebelp

INTO wa_komv.

ENDIF.

*break-point.

IF sy-subrc = 0.

w_flag = 1.

  • wa_display-vat8 = wa_komv-kbetr. "change by dinesh

  • wa_display-vat125 = wa_komv-kwert . " change by dinesh

ENDIF.

  • IF w_flag IS INITIAL.

  • READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'JVRN'.

*

*

  • IF sy-subrc <> 0.

*

  • READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

  • kposn = wa_ekko-ebelp

  • kschl = 'JVCN'.

*

  • ENDIF.

*

  • IF sy-subrc = 0.

*

  • CLEAR w_flag.

*

*

*

  • wa_display-vat125 = ( wa_ekbe-menge / wa_ekko-menge

  • ) * wa_konv-kwert .

*

*

  • ENDIF.

  • ENDIF.

*********************************************************************************************

**********GET THE VAT AMOUNT***************************************************************

*********************************************************************************************

CLEAR : wa_komv , wa_konv , w_flag.

READ TABLE it_komv WITH KEY kschl = 'JVRD'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc <> 0.

READ TABLE it_komv WITH KEY kschl = 'JVCD'

kposn = wa_ekko-ebelp

INTO wa_komv.

ENDIF.

IF sy-subrc = 0.

w_flag = 1.

  • if WA_KOMV-KBETR = '40.00'.

*

  • WA_DISPLAY-VAT4 = WA_KOMV-KWERT .

*

  • elseif WA_KOMV-KBETR = '80.00'.

*

  • WA_DISPLAY-VAT8 = WA_KOMV-KWERT .

*

  • elseif WA_KOMV-KBETR = '108.40'.

wa_display-vat8 = ( wa_komv-kbetr + wa_display-vat8 ) / 10.

wa_display-vat125 = wa_komv-kwert + wa_display-vat125 .

ENDIF.

IF w_flag IS INITIAL.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JVRD'.

IF sy-subrc <> 0.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JVCD'.

ENDIF.

IF sy-subrc = 0.

  • if WA_KONV-KBETR = '40.00'.

*

  • WA_DISPLAY-VAT4 = WA_KONV-KWERT * wa_ekko-WKURS.

*

  • elseif WA_KONV-KBETR = '80.00'.

*

  • WA_DISPLAY-VAT8 = WA_KONV-KWERT * wa_ekko-WKURS.

*

  • elseif WA_KONV-KBETR = '108.40'.

wa_display-vat8 = ( wa_konv-kbetr + wa_display-vat8 ) / 10.

IF wa_ekko-menge <> 0.

wa_display-vat125 = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

  • endif.

ENDIF.

CLEAR w_flag.

ENDIF.

*******************************************************************************

*******GET THE INCOME TAX**************************************************

*******************************************************************************

CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'ZIPS'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-INC = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'ZIPS'.

IF wa_ekko-menge <> 0.

wa_display-INC = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

  • if W_FLAG is initial.

*

  • read table IT_KONV into WA_KONV with key KNUMV = WA_EKKO-KNUMV

  • KPOSN = WA_EKKO-EBELP

  • KSCHL = 'JVRD'.

  • if SY-SUBRC <> 0.

*

  • read table IT_KONV into WA_KONV with key KNUMV = WA_EKKO-KNUMV

  • KPOSN = WA_EKKO-EBELP

  • KSCHL = 'JVRN'.

  • if SY-SUBRC <> 0.

*

  • read table IT_KONV into WA_KONV with key KNUMV = WA_EKKO-KNUMV

  • KPOSN = WA_EKKO-EBELP

  • KSCHL = 'JVCD'.

  • if SY-SUBRC <> 0.

*

  • read table IT_KONV into WA_KONV with key

  • KNUMV = WA_EKKO-KNUMV

  • KPOSN = WA_EKKO-EBELP

  • KSCHL = 'JVCD'.

*

  • endif.

*

  • endif.

*

  • endif.

*

  • if SY-SUBRC = 0.

*

  • if WA_KOMV-KWERT = 4.

*

  • WA_DISPLAY-VAT4 = WA_KONV-KWERT * wa_ekko-WKURS.

*

  • elseif WA_KOMV-KWERT = 8.

*

  • WA_DISPLAY-VAT8 = WA_KONV-KWERT * wa_ekko-WKURS.

*

  • elseif WA_KOMV-KWERT = '12.5'.

*

  • WA_DISPLAY-VAT125 = WA_KONV-KWERT * wa_ekko-WKURS.

*

  • endif.

*

  • endif.

*

  • W_FLAG = 0.

*

  • endif.

*----


  • Get the total CST

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JIPC'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-cst = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JIPC'.

IF wa_ekko-menge <> 0.

wa_display-cst = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*----


  • Get the total CENVAT CREDIT ON BED

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JMX1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-cenvatcreditbed = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JMX1'.

IF wa_ekko-menge <> 0.

wa_display-cenvatcreditbed = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*----


  • Get the total CENVAT CREDIT ON ECC

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JEX1'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-cenvatcreditecc = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JEX1'.

IF wa_ekko-menge <> 0.

wa_display-cenvatcreditecc = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

*----


  • Get the total VAT CREDIT

*----


CLEAR : wa_komv , wa_konv.

READ TABLE it_komv WITH KEY kschl = 'JVRD'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0 .

wa_display-vatcredit = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'JVCD'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

wa_display-vatcredit = wa_komv-kwert .

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JVRD'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-vatcredit = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY

knumv = wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JVCD'.

IF wa_ekko-menge <> 0.

wa_display-vatcredit = ( wa_ekbe-menge / wa_ekko-menge

) * wa_konv-kwert * wa_ekko-wkurs.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

wa_display-vatcredit = wa_display-vatcredit / wa_display-peinh.

*----


  • Calculate toatl subsequent debit

*----


CLEAR wa_subdebit.

READ TABLE it_subdebit INTO wa_subdebit WITH KEY

ebeln = wa_ekbe-ebeln

ebelp = wa_ekbe-ebelp.

*------ -


  • Check whether it is credit or debit.

*----


IF wa_subdebit-shkzg = 'H'.

wa_subdebit-dmbtr = 0 - wa_subdebit-dmbtr.

ENDIF.

wa_display-subdeb = wa_subdebit-dmbtr .

  • WA_DISPLAY-NETAMT = WA_DISPLAY-GROSSAMT

  • + WA_DISPLAY-CENVATCREDITBED

  • + WA_DISPLAY-CENVATCREDITECC

  • + WA_DISPLAY-SUBDEB

  • + WA_DISPLAY-VATCREDIT.

  • wa_display-vat8 = wa_display-vat8 / wa_display-peinh.

wa_display-vat125 = wa_display-vat125 / wa_display-peinh.

wa_display-netamt = wa_display-grossamt

+ wa_display-subdeb

+ wa_display-cst

+ wa_display-vat125.

  • + WA_DISPLAY-VAT4

  • + WA_DISPLAY-VAT8.

*

*------ -


  • Get th taxes for service PO..

*----


CLEAR wa_packno.

IF NOT it_packno[] IS INITIAL.

  • loop at IT_PACKNO into WA_PACKNO.

CLEAR wa_packno.

READ TABLE it_packno INTO wa_packno WITH KEY

ebeln = wa_ekbe-ebeln

ebelp = wa_ekbe-ebelp

lfbnr = wa_ekbe-lfbnr.

IF sy-subrc = 0.

LOOP AT it_services INTO wa_services.

IF wa_services-packno = wa_packno-sub_packno.

wa_display-srvpos = wa_services-srvpos.

wa_display-ktext1 = wa_services-ktext1.

wa_display-dmbtr = wa_services-netwr.

  • WA_TAXCOM-WRBTR = WA_SERVICES-NETWR * WA_EKKO-MENGE.

wa_taxcom-wrbtr = wa_services-netwr.

wa_taxcom-bldat = wa_packno-bldat.

wa_taxcom-budat = wa_packno-bldat.

CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = wa_taxcom

display_only = 'X'

  • dialog = diakz

IMPORTING

e_taxcom = wa_taxcom

  • nav_anteil = hwert

TABLES

t_xkomv = it_komv

EXCEPTIONS

OTHERS = 01.

IF sy-subrc = 0.

ENDIF.

CLEAR : wa_komv , wa_konv,w_flag.

wa_display-menge = wa_services-menge.

READ TABLE it_komv WITH KEY kschl = 'JSRT'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

w_flag = 1.

wa_display-sertaxcredit = wa_komv-kwert .

wa_display-sertax = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'JSRN'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

w_flag = 1.

wa_display-sertax = wa_komv-kwert .

ENDIF.

ENDIF.

  • IF SY-SUBRC = 0.

  • W_FLAG = 1.

  • WA_DISPLAY-SERTAX = WA_KOMV-KWERT .

*

  • ENDIF.

CLEAR : wa_komv , wa_konv.

IF w_flag IS INITIAL.

READ TABLE it_konv INTO wa_konv WITH KEY knumv =

wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JSRT'.

IF sy-subrc = 0.

wa_display-sertaxcredit = wa_konv-kwert *

wa_ekko-wkurs.

IF wa_ekko-menge <> 0.

wa_display-sertax = ( wa_ekbe-menge /

wa_ekko-menge ) * wa_konv-kwert *

wa_ekko-wkurs.

ENDIF.

ELSE .

READ TABLE it_konv INTO wa_konv WITH KEY knumv =

wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JSRN'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-sertax = ( wa_ekbe-menge /

wa_ekko-menge ) * wa_konv-kwert *

wa_ekko-wkurs.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

CLEAR w_flag.

READ TABLE it_komv WITH KEY kschl = 'JEC3'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

w_flag = 1.

wa_display-sereducess = wa_komv-kwert.

wa_display-sereducesscredit = wa_komv-kwert .

ELSE.

READ TABLE it_komv WITH KEY kschl = 'JEC4'

kposn = wa_ekko-ebelp

INTO wa_komv.

IF sy-subrc = 0.

w_flag = 1.

wa_display-sereducess = wa_komv-kwert.

ENDIF.

ENDIF.

  • IF SY-SUBRC = 0.

*

  • W_FLAG = 1.

*

  • WA_DISPLAY-SEREDUCESS = WA_KOMV-KWERT .

*

  • ENDIF.

IF w_flag IS INITIAL.

READ TABLE it_konv INTO wa_konv WITH KEY knumv =

wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JEC3'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-sereducess = ( wa_ekbe-menge /

wa_ekko-menge ) * wa_konv-kwert .

wa_display-sereducesscredit = ( wa_ekbe-menge /

wa_ekko-menge ) * wa_konv-kwert .

ENDIF.

ELSE.

READ TABLE it_konv INTO wa_konv WITH KEY knumv =

wa_ekko-knumv

kposn = wa_ekko-ebelp

kschl = 'JEC4'.

IF sy-subrc = 0.

IF wa_ekko-menge <> 0.

wa_display-sereducess = ( wa_ekbe-menge /

wa_ekko-menge ) * wa_konv-kwert .

ENDIF.

ENDIF.

ENDIF.

ENDIF.

  • IF SY-SUBRC = 0.

*

  • W_FLAG = 0.

  • WA_DISPLAY-SEREDUCESS = WA_KONV-KWERT * wa_ekko-WKURS.

*

*

  • ENDIF.

  • ENDIF.

CLEAR w_flag.

wa_display-grossamt = wa_services-netwr

+ wa_display-custduty

+ wa_display-bed

+ wa_display-cvd

+ wa_display-sertax

+ wa_display-sereducess

+ wa_display-educess

+ wa_display-insure

+ wa_display-freight

+ wa_display-octroi .

  • wa_display-vat8 = wa_display-vat8 / wa_display-peinh.

wa_display-vat125 = wa_display-vat125 / wa_display-peinh.

wa_display-netamt = wa_display-grossamt

+ wa_display-subdeb

+ wa_display-cst

+ wa_display-vat125.

  • + WA_DISPLAY-VAT4

  • + WA_DISPLAY-VAT8.

" wa_display-netamt = wa_display-netamt / wa_display-peinh.

wa_display-TOTALTAXBENEFIT = wa_display-cenvatcreditbed

+ wa_display-cenvatcreditecc

+ wa_display-vatcredit

  • + wa_display-bgcharges

+ wa_display-sertaxcredit

+ wa_display-sereducesscredit.

wa_display-INVENTORYVALUE = wa_display-netamt

- wa_display-TOTALTAXBENEFIT.

APPEND wa_display TO it_display.

ENDIF.

ENDLOOP.

ELSE.

wa_display-TOTALTAXBENEFIT = wa_display-cenvatcreditbed

+ wa_display-cenvatcreditecc

+ wa_display-vatcredit

  • + wa_display-bgcharges

+ wa_display-sertaxcredit

+ wa_display-sereducesscredit.

wa_display-INVENTORYVALUE = wa_display-netamt

- wa_display-TOTALTAXBENEFIT.

APPEND wa_display TO it_display.

ENDIF.

  • endloop.

ELSE.

wa_display-TOTALTAXBENEFIT = wa_display-cenvatcreditbed

+ wa_display-cenvatcreditecc

+ wa_display-vatcredit

  • + wa_display-bgcharges

+ wa_display-sertaxcredit

+ wa_display-sereducesscredit.

wa_display-INVENTORYVALUE = wa_display-netamt

- wa_display-TOTALTAXBENEFIT.

APPEND wa_display TO it_display.

ENDIF.

CLEAR wa_ekbe.

ENDLOOP.

ENDFORM. " F002-CAL_TAXES

&----


*& Form f003-display_register

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f003-display_register .

DATA: gs_variant LIKE disvariant.

gs_variant-report = sy-repid.

DATA : w_repid LIKE sy-repid.

w_repid = sy-repid.

************************************************************

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 14.

wa_ls_fieldcat-fieldname = 'BELNR1'.

wa_ls_fieldcat-seltext_m = 'MIRO DOC'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 15.

wa_ls_fieldcat-fieldname = 'BUDAT1'.

wa_ls_fieldcat-seltext_m = 'MIRO DATE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 10.

wa_ls_fieldcat-fieldname = 'BELNR'.

wa_ls_fieldcat-seltext_m = 'MIGO DOC'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'. "EKBE'.

wa_ls_fieldcat-OUTPUTLEN = 15 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 11.

wa_ls_fieldcat-fieldname = 'BUDAT'.

wa_ls_fieldcat-seltext_m = 'MIGO DATE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 4.

wa_ls_fieldcat-fieldname = 'EBELN'.

wa_ls_fieldcat-seltext_m = 'PURCHASE ORDER'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 5.

wa_ls_fieldcat-fieldname = 'BEDAT'.

wa_ls_fieldcat-seltext_m = 'PO DATE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 1.

wa_ls_fieldcat-fieldname = 'BSART'.

wa_ls_fieldcat-seltext_m = 'PO TYPE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 2.

wa_ls_fieldcat-fieldname = 'MWSKZ'.

wa_ls_fieldcat-seltext_m = 'TAX CODE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 2.

wa_ls_fieldcat-fieldname = 'TEXT1'.

wa_ls_fieldcat-seltext_m = 'TAX DESC'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 3.

wa_ls_fieldcat-fieldname = 'LIFNR'.

wa_ls_fieldcat-seltext_m = 'VENDOR'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 44.

wa_ls_fieldcat-fieldname = 'NAME1'.

wa_ls_fieldcat-seltext_m = 'VENDOR NAME'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 44.

wa_ls_fieldcat-fieldname = 'J_1ICSTNO'.

wa_ls_fieldcat-seltext_m = 'VENDOR VAT NO.'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 45.

wa_ls_fieldcat-fieldname = 'PSTLZ'.

wa_ls_fieldcat-seltext_m = 'Pin No '.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 46.

wa_ls_fieldcat-fieldname = 'STRAS'.

wa_ls_fieldcat-seltext_m = 'Street'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 6.

wa_ls_fieldcat-fieldname = 'MATNR'.

wa_ls_fieldcat-seltext_m = 'MATERIAL'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 7.

wa_ls_fieldcat-fieldname = 'MAKTX'.

wa_ls_fieldcat-seltext_m = 'MATERIAL DESC.'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 8.

wa_ls_fieldcat-fieldname = 'HKONT'.

wa_ls_fieldcat-seltext_m = 'GL NUMBER'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 9.

  • wa_ls_fieldcat-fieldname = 'MCOD1'.

  • wa_ls_fieldcat-seltext_l = 'GL DESC.'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 12.

wa_ls_fieldcat-fieldname = 'BWART'.

wa_ls_fieldcat-seltext_m = 'MOVEMENT TYPE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 13.

wa_ls_fieldcat-fieldname = 'LFBNR'.

wa_ls_fieldcat-seltext_m = 'REF. DOC'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 16.

wa_ls_fieldcat-fieldname = 'MENGE'.

wa_ls_fieldcat-seltext_m = 'QUANTITY'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 17.

wa_ls_fieldcat-fieldname = 'MEINS'.

wa_ls_fieldcat-seltext_m = 'ORDER UNIT'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 18.

  • wa_ls_fieldcat-fieldname = 'BPRME'.

  • wa_ls_fieldcat-seltext_l = 'ORDER UNIT(PURCHASING)'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 19.

  • wa_ls_fieldcat-fieldname = 'PEINH'.

  • wa_ls_fieldcat-seltext_l = 'PRICE UNIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 20.

wa_ls_fieldcat-fieldname = 'WAERS'.

wa_ls_fieldcat-seltext_l = 'CURRENCY'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 20.

wa_ls_fieldcat-fieldname = 'DMBTR'.

wa_ls_fieldcat-seltext_m = 'BASIC AMOUNT'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 21.

  • wa_ls_fieldcat-fieldname = 'CUSTDUTY'.

  • wa_ls_fieldcat-seltext_l = 'CUSTOM DUTY'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 22.

wa_ls_fieldcat-fieldname = 'BED'.

wa_ls_fieldcat-seltext_m = 'BED'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 23.

  • wa_ls_fieldcat-fieldname = 'CVD'.

  • wa_ls_fieldcat-seltext_l = 'CVD'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 24.

wa_ls_fieldcat-fieldname = 'SERTAX'.

wa_ls_fieldcat-seltext_m = 'SERVICE TAX'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 25.

wa_ls_fieldcat-fieldname = 'SEREDUCESS'.

wa_ls_fieldcat-seltext_m = 'SERVICE EDUCATION CESS'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 26.

wa_ls_fieldcat-fieldname = 'EDUCESS'.

wa_ls_fieldcat-seltext_m = 'EDUCATION CESS'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 27.

  • wa_ls_fieldcat-fieldname = 'INSURE'.

  • wa_ls_fieldcat-seltext_l = 'INSURANCE'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 28.

wa_ls_fieldcat-fieldname = 'FREIGHT'.

wa_ls_fieldcat-seltext_m = 'FREIGHT'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 29.

wa_ls_fieldcat-fieldname = 'OCTROI'.

wa_ls_fieldcat-seltext_m = 'OCTROI'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 30.

  • wa_ls_fieldcat-fieldname = 'GROSSAMT'.

  • wa_ls_fieldcat-seltext_l = 'GROSS AMOUNT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • clear WA_LS_FIELDCAT.

  • WA_LS_FIELDCAT-COL_POS = 23.

  • WA_LS_FIELDCAT-FIELDNAME = 'VAT4'.

  • WA_LS_FIELDCAT-SELTEXT_L = 'VAT 4%'.

  • WA_LS_FIELDCAT-TABNAME = 'IT_DISPLAY'.

  • append WA_LS_FIELDCAT to IT_FIELDCAT.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 31.

wa_ls_fieldcat-fieldname = 'VAT8'.

wa_ls_fieldcat-seltext_m = 'VAT %'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 32.

wa_ls_fieldcat-fieldname = 'VAT125'.

wa_ls_fieldcat-seltext_m = 'VAT VALUE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 33.

wa_ls_fieldcat-fieldname = 'CST'.

wa_ls_fieldcat-seltext_m = 'CST'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 33.

wa_ls_fieldcat-fieldname = 'INC'.

wa_ls_fieldcat-seltext_m = 'INCOME TAX'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 33.

wa_ls_fieldcat-fieldname = 'PF'.

wa_ls_fieldcat-seltext_L = 'P&F CHARGE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 33.

wa_ls_fieldcat-fieldname = 'CF'.

wa_ls_fieldcat-seltext_L = 'C&F CHARGE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 33.

wa_ls_fieldcat-fieldname = 'INS'.

wa_ls_fieldcat-seltext_L = 'INSURANCE'.

wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

wa_ls_fieldcat-OUTPUTLEN = 10 .

APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 34.

  • wa_ls_fieldcat-fieldname = 'SUBDEB'.

  • wa_ls_fieldcat-seltext_l = 'SUBSEQUENT DEBIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 35.

  • wa_ls_fieldcat-fieldname = 'NETAMT'.

  • wa_ls_fieldcat-seltext_l = 'NET AMOUNT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 36.

  • wa_ls_fieldcat-fieldname = 'CENVATCREDITBED'.

  • wa_ls_fieldcat-seltext_l = 'CENVAT CREDIT BED'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 37.

  • wa_ls_fieldcat-fieldname = 'CENVATCREDITECC'.

  • wa_ls_fieldcat-seltext_l = 'CENVAT CREDIT ECC'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 38.

  • wa_ls_fieldcat-fieldname = 'VATCREDIT'.

  • wa_ls_fieldcat-seltext_l = 'VAT CREDIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

*

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 39.

  • wa_ls_fieldcat-fieldname = 'SERTAXCREDIT'.

  • wa_ls_fieldcat-seltext_l = 'SERVICE TAX CREDIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 40.

  • wa_ls_fieldcat-fieldname = 'SEREDUCESSCREDIT'.

  • wa_ls_fieldcat-seltext_l = 'ECS CREDIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 41.

  • wa_ls_fieldcat-fieldname = 'BGCHARGES'.

  • wa_ls_fieldcat-seltext_l = 'BG CHARGES'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

*

  • "ADDED BY ABID ON 14-FEB 07

  • CLEAR wa_ls_fieldcat.

    • wa_ls_fieldcat-col_pos = 42.

  • wa_ls_fieldcat-fieldname = 'TOTALTAXBENEFIT'.

  • wa_ls_fieldcat-seltext_l = 'TOTAL TAX BENEFIT'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

*

  • CLEAR wa_ls_fieldcat.

  • wa_ls_fieldcat-col_pos = 43.

  • wa_ls_fieldcat-fieldname = 'INVENTORYVALUE'.

  • wa_ls_fieldcat-seltext_l = 'INVENTORY VALUE'.

  • wa_ls_fieldcat-tabname = 'IT_DISPLAY'.

  • APPEND wa_ls_fieldcat TO it_fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_grid_title = sy-title

i_callback_program = w_repid

  • i_callback_top_of_page = 'F004-TOP_OF_PAGE'

is_layout = it_layout

it_fieldcat = it_fieldcat

  • it_sort = it_sort

i_save = 'A'

is_variant = gs_variant

TABLES

t_outtab = it_display

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. " f003-display_register

&----


*& Form miro_get_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM miro_get_data .

REFRESH : it_lfbnr,

it_miro.

break-point.

LOOP AT it_display INTO wa_display.

SELECT belnr lfbnr FROM ekbe INTO (w_belnr,w_lfbnr)

WHERE belnr = wa_display-belnr.

ENDSELECT.

IF sy-subrc = '0'.

wa_display-lfbnr = w_lfbnr.

ELSE.

wa_display-lfbnr = ''.

ENDIF.

MODIFY it_display FROM wa_display TRANSPORTING lfbnr.

wa_lfbnr-belnr = w_belnr.

wa_lfbnr-lfbnr = w_lfbnr.

APPEND wa_lfbnr TO it_lfbnr.

CLEAR : wa_display,

wa_lfbnr,

w_belnr,

w_lfbnr.

ENDLOOP.

LOOP AT it_lfbnr INTO wa_lfbnr.

  • WRITE :/ wa_lfbnr-belnr,

  • wa_lfbnr-lfbnr.

IF wa_lfbnr-lfbnr IS NOT INITIAL.

wa_miro-belnr = wa_lfbnr-belnr.

APPEND wa_miro TO it_miro.

ENDIF.

CLEAR : wa_miro,

wa_lfbnr.

ENDLOOP.

LOOP AT it_lfbnr INTO wa_lfbnr.

IF wa_lfbnr-lfbnr IS NOT INITIAL.

SELECT belnr budat FROM ekbe

INTO (w_belnr1, w_budat)

WHERE bewtp = 'Q' AND lfbnr = wa_lfbnr-lfbnr .

ENDSELECT.

wa_miro-belnr1 = w_belnr1.

wa_miro-budat = w_budat.

MODIFY it_miro FROM wa_miro TRANSPORTING belnr1 budat WHERE belnr = wa_lfbnr-belnr.

CLEAR : wa_lfbnr,

w_belnr1,

w_budat,

wa_miro.

ENDIF.

ENDLOOP.

  • LOOP AT it_miro INTO wa_miro.

  • WRITE :/ wa_miro-belnr,

  • wa_miro-belnr1,

  • wa_miro-budat.

*

  • ENDLOOP.

LOOP AT it_display INTO wa_display.

READ TABLE it_miro INTO wa_miro WITH KEY belnr = wa_display-belnr.

wa_display-belnr1 = wa_miro-belnr1.

wa_display-budat1 = wa_miro-budat.

MODIFY it_display FROM wa_display TRANSPORTING belnr1 budat1.

CLEAR : wa_miro,

wa_display.

ENDLOOP.

  • LOOP AT it_display INTO wa_display.

  • WRITE :/ wa_display-belnr,

  • wa_display-budat,

  • wa_display-bwart,

  • wa_display-belnr1,

  • wa_display-budat1.

*

  • ENDLOOP.

ENDFORM. " miro_get_data

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question