How to do the reverse po in this report
Hi,
i have a one problem in this report . i don,t know how to display the
reverse po in this report. reverse po should have a po history cat. 'N' (field is bewtp)
i connect type 'Q' and the type 'E' but not been able to connect the 'N'. when i connect it will give me the wrong amount and some field should not been displayed. i will provide u the following code.
please help me.
Thanks
dinesh
*& Report Z_MM_PURCHASE_REGISTER
REPORT Z_MM_PURCHASE_REGISTER.
Short Description: Purchase Register
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,
budat1 TYPE ekbe-budat,
belnr1 TYPE ekbe-belnr,
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,
bukrs like ekpo-bukrs,
total LIKE ekbe-dmbtr,
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,
pr_plant for ekbe-werks,
pr_ekorg for ekko-ekorg.
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
*break-point.
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 in 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
and kalsm = 'SIL000'
AND EKORG = 'SDOP'.
GET ALL THE PO FOR WHICH MIRO HAS BEEN DONE
SELECT ebeln ebelp budat bldat werks
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 in 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 = 'Q'.
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 = 'Q'.
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.
ENDIF.
new code added
*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
*from bseg
*into corresponding fields of table it_bseg for all entries in it_lfa1 " it_ekko
*where LIFNR = it_lfa1-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.
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-budat = wa_ekko-bedat." change by dinesh
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 = wa_ekbe-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.
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_lfa1-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
Hi Ingo,
Thanks for the reply. But let me rephrase my question. In the Bex we get a extra row called overall result in the result set which gives the correct count/total/average based on exception aggregation. The question is how we show the overall result row in the crystal or rather how can we map it into crystal. So i thought as of now we should create a formula to compute the overall result and display it.
Hope I am clear this time in asking the right question.
Many many thanks in advance for your reply.
Kind regards,
Shiva.
Similar Messages
-
How to get the reverse color of a color
how to get the reverse color of a color
thanksint red = Math.abs(255 - oldColor.getRed());
int green = Math.abs(255 - oldColor.getGreen());
int blue = Math.abs(255 - oldColor.getBlue());
java.awt.Color inverseColor = new java.awt.Color(red, green, blue);
Where oldColor is a java.awt.Color object.
Hope this is want u need !!! -
Hi Team,
R12 Instance :
Oracle Installed Base Agent User Responsibility --> Item Instances -->
Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
In the above page there are two table regions.
Notes.
-------------------------------------Table Region---------------------------
Attachments
-------------------------------------Table Region---------------------------
--the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
I want to know what are the document types are displayed in this page ?
--We developed a custom program to attach the attachments to the services contracts and the above seeded OAF page displays those ..as needed.
But after recent changes..the Attachments--> table region is not showing the attachments.
I have verified the query..and could not find any clue in that..
but i need some help if you guys can provide..
SELECT *
FROM
*(SELECT d.DOCUMENT_ID,*
d.DATATYPE_ID,
d.DATATYPE_NAME,
d.DESCRIPTION,
DECODE(d.FILE_NAME, NULL,
*(SELECT message_text*
FROM fnd_new_messages
WHERE message_name = 'FND_UNDEFINED'
AND application_id = 0
AND language_code = userenv('LANG')
*), d.FILE_NAME)FileName,*
d.MEDIA_ID,
d.CATEGORY_ID,
d.DM_NODE,
d.DM_FOLDER_PATH,
d.DM_TYPE,
d.DM_DOCUMENT_ID,
d.DM_VERSION_NUMBER,
ad.ATTACHED_DOCUMENT_ID,
ad.ENTITY_NAME,
ad.PK1_VALUE,
ad.PK2_VALUE,
ad.PK3_VALUE,
ad.PK4_VALUE,
ad.PK5_VALUE,
d.usage_type,
d.security_type,
d.security_id,
ad.category_id attachment_catgeory_id,
ad.status,
d.storage_type,
d.image_type,
d.START_DATE_ACTIVE,
d.END_DATE_ACTIVE,
d.REQUEST_ID,
d.PROGRAM_APPLICATION_ID,
d.PROGRAM_ID,
d.category_description,
d.publish_flag,
DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
d.URL,
d.TITLE
FROM FND_DOCUMENTS_VL d,
FND_ATTACHED_DOCUMENTS ad
WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
*) QRSLT*
WHERE ((entity_name ='OKC_K_HEADERS_V'-- :1
AND pk1_value IN ( 600144,599046) --:2
AND category_id_query IN (1, :3, :4, :5, :6, :7) )
AND datatype_id IN (6,2,1,5)
AND (SECURITY_TYPE =4
OR PUBLISH_FLAG ='Y')))
--='000180931' -- 'ADP118'
The above seeded query is the one which is used for table region to retrieve the data..
how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
--SridharHi Patricia,
is it working for restricted key figure and calculated key figure ??
Note Number Fisc Period Opening Days
1 1 2
2 1 3
3 1 0
because I have other restriction, so I create two restricted key figure..
RK1 with restriction : Total Number of Note,
RK2 with restriction : Total Opening Days ,
then I Created a calculated key figure, average opening days in a period
CK1 = RK2 / RK1..
in this case, I am not sure if it will work or not..
for example, during RK2 calclation, it might be this 2+3 = 5, the line with 0 will be ignored..
during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
could you please confirm.. -
Recently i have been getting the color wheel a lot and it is screwing with my happiness. Any thoughts on how to clean the computer up so this stops?
Back up all data immediately as your boot drive may be failing.
If you have more than one user account, these instructions must be carried out as an administrator.
Triple-click anywhere in the line below on this page to select it:
syslog -k Sender kernel -k Message CReq 'Channel t|GPU D|I/O|Previous Sh' | tail | open -ef
Copy the selected text to the Clipboard (command-C).
Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
Paste into the Terminal window (command-V).
The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
A TextEdit window will open with the output of the command. If the command produced no output, the window will be empty. Post the contents of the TextEdit window (not the Terminal window), if any — the text, please, not a screenshot. The title of the window doesn't matter, and you don't need to post that. -
How to add the Assignment column on this post outgoing payment in f-53
Hi all,
how to add the Assignment column on this post outgoing payment in f-53?
thanks.
JooHi ,
If you want to see the assignment column in f-53 process open item screen
1. First in O7V3 check for t.code FBz2 which line layout ( 2 digit code is assigned)
2. Then in t.code O7z4s check in the line layout and if assignment field is not there then insert the field.
then check in F-53.
Hopw it will solve your problem.
Assign points if useful
Regards
Prabhat -
How long does the warranty last on this phone (F1*******H1C)?
<Edited by Host>The warranty/support, on that phone, has expired. But, it originally came with a one-year hardware warranty.
-
How to get the actual data in ALV report
I am doing some upgradation work in that i am using Submit & And return and also i am using some function modules like LIST FROM MEMORY , LIST TO TXT wnd WRITE LIST , it gives output in normal list format , But i need to print in ALV report .
With the use of set table for 1st display i got the ALV report but not with actual data, (some junk value is showing) , So can any 1 suggest me how to get the actual data in ALV report, With the use of Any Function Module or with Coding,
with regards,Hi Saravana
I am sure you must be getting the values in tables of table parameters from every FM.
consolidate the values from tables of all FMs in one table and built ALV for that table only.
I hope this way you can show the actual data in ALV.
thanks
Lalit -
How to modify the coding part of KE30 reports ?
How to modify the coding part of KE30 reports ,
so that I can be able to restrict report output based on sales office.
I am unable to find out the program name also.
Regards
Anubhav>
Venkat Reddy wrote:
> Hi,
>
> If u want to know the program running for KE30 just go to SE93 and give KE30
> and click on display you can see the program running for KE30 will be SAPMKCEE.
> I think this is much simpler :-).
>
> Rather than change the standard report try to prepared your own that will be more
> comfortable since it will be complex task to achieve editing the standard program.
> Good Luck
>
> Regards
> VEnk@
>
> Edited by: Venkat Reddy on Dec 11, 2009 4:52 PM
Venkat,your answer is much simpler If the OP knows there is a tcode Se93, what if he/she does not know it??
P.S: Just a thought.
Regards.
Vishwa. -
How to add the double headings in Alv Report.
Hi All,
Plz suggest me how to add the double headings in ALv Report.
RamHi,
Try out this program....
REPORT ypm_historycard_rep.
TYPE-POOLS : slis.
DATA : it_cbm TYPE STANDARD TABLE OF mara.
DATA : it_layout TYPE STANDARD TABLE OF slis_layout_alv WITH HEADER LINE,
wa_fcat TYPE slis_fieldcat_alv,
it_fcat TYPE slis_t_fieldcat_alv.
START-OF-SELECTION.
SELECT *
FROM mara
INTO CORRESPONDING FIELDS OF TABLE it_cbm
where matnr = 'D80K7'.
END-OF-SELECTION.
it_layout-zebra = 'X'.
it_layout-colwidth_optimize = 'X'.
it_layout-f2code = '&ETA'.
APPEND it_layout.
DEFINE macro4fcat.
wa_fcat-col_pos = &1.
wa_fcat-fieldname = &2.
wa_fcat-tabname = &3.
wa_fcat-seltext_l = &4.
append wa_fcat to it_fcat.
clear wa_fcat.
END-OF-DEFINITION.
macro4fcat '1' 'MATNR' 'IT_CBM' 'MATERIAL NO' .
DESCRIBE TABLE it_cbm.
IF sy-ucomm = '&F03'.
MESSAGE 'hi hello good morning "press enter button" this is quiz' TYPE 'S'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
is_layout = it_layout
it_fieldcat = it_fcat
i_save = 'A'
TABLES
t_outtab = it_cbm
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.
*& Form html_top_of_page
* text
* -->TOP text
FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
DATA: l_text(255) TYPE c.
DATA: text1(255) TYPE c.
DATA: t_header TYPE REF TO cl_dd_table_element ,
wa_header TYPE REF TO cl_dd_table_area.
CALL METHOD top->add_gap
EXPORTING
width = 10.
CALL METHOD top->add_text
EXPORTING
text = 'hello'
sap_style = 'HEADING'
CALL METHOD top->add_gap
EXPORTING
width = 20.
CALL METHOD top->add_text
EXPORTING
text = 'HOW ARE YOU'
sap_style = 'HEADING'.
CALL METHOD TOP->new_line
* EXPORTING
* repeat =
CALL METHOD top->add_gap
EXPORTING
width = 50.
CALL METHOD top->add_text
EXPORTING
text = '____________________________________________________________'
sap_style = 'HEADING'.
CALL METHOD TOP->new_line
* EXPORTING
* repeat =
CALL METHOD top->add_gap
EXPORTING
width = 90.
CALL METHOD top->add_text
EXPORTING
text = 'YOU CAN TRY LIKE THIS'
sap_style = 'HEADING'.
ENDFORM. "html_top_of_page
Regards
Debarshi -
How to capture the first execution of a report
Hi,
I am executing a report in background. The first time the report is executed I have to do a different processing. After the 1st execution I have to different processing.
Someone please tell me how to capture the 1st execution of a report. Is there a system variable ?
Appreciate your <removed by moderator> response.
Thanks,
Dikshitha G
Edited by: Thomas Zloch on May 12, 2011 11:36 AMKeshav.T wrote:
Are you going to create a Z table for this ???? ... Is there nobody to advice you in your firm ???
Hello Keshav,
A couple of years ago i would have recommended using the INDX table, but it has got it's demerits.
Maintenance of Z-table is easier than the INDX table. Say there is some error in the program & you want to override the flag. Will it be easier to do so in the INDX table or via SM30 for the Z-Table?
As a matter-of-fact i will recommend using the solution provided by Florian the TVARVC technique.
1. Create a parameter(specific to your program) & transport it.(See the trxn STVARV)
2. In your program check the value of this param & set it accordingly.
Using TVARVC you will 2 birds with one stone:
1. You don't have to create a custom table.
2. Easy maintenance via STVARV trxn.
Hope you get the point!
Cheers,
Suhas
PS: In our system we have a Z-table designed specifically for this particular purpose. All the programs having this kind of requirement refer to this table. -
How to attach the T.CODE to a report created through REPORT PAINTER
Hi all,
Please tell me "<b>How to attach the T.CODE to a report created through REPORT PAINTER".</b>.
Please show me the way how to do it as its getting too firing issue !!
Awaiting for the early responses !!
M.SoniDear All,
I got some good inputs from <b>Jessie</b> on this issue and observed that the reports which are created through report painter are standard one having entries in the TSTCP table .
<b>But the reports(Through Report Painter) which are creaed by us has no entry in TSTCP table !!</b>
Kindly show the way, how to attach the T.code to the reports which are created through report painter. as its getting so buggy now !!
Please tell me if someone know about this.
<b>Please note all my reports are created directly in the 500(Production</b>).
Waiting for quick inputs !!
Regards,
M.soni -
How to view the History of a Crystal Reports iView in EP6?
How to view the History of a Crystal Reports iView in EP6?
Our Crystal reports are viewed via Crystal Enterprise and are both BW and non-BW Crystal reports.
I have looked at the three supplied iViews from Business Objects (alert, folder and thumbnail) but I have only been able to access the last instance or run on demand a CR.
Our users would prefer to see a listing of the past runs of the report and choose which report to view. What parameters need set in the EP6 iView to see the history of a report?Hi Heather,
it is correct that there is no sample iView that shows the History of Crystal Reports that are stored in Crystal Enterprise but there a sample codes on our web site and there are sample codes as part of the SDK documentation that show how to call the history and you should be able to take the code and create your own Java or ASP iView based on that.
the link to our developer library :
http://www.businessobjects.com/products/dev_zone/default.asp?intcmp=products12
hope this helps
Ingo -
Getting error REP-1352: The fonts specified for this report cannot be found
Dear Friends,
I'm getting the following error when I run my reports on Application Server installed in Solaris 9.
REP-1352: The fonts specified for this report cannot be found for the character set specified by NLS_LANG.
I searched internet and found the reason for the issue i.e., as follows.
REP-1352: The fonts specified for this report cannot be found for the character set specified by NLS_LANG.
Cause: The NLS_LANG environment variable specifies a character set for which no font is available.
Action: You may choose a font that exists in the character set specified by NLS_LANG. Alternatively, you may use the Font Alias file to force an available font to be used instead of the one specified in the report.
I cannot change the font for each & every report as there are more than 100 reports. HOW CAN I USE THE FONT ALIAS FILE? It is very Urgent, please solve my problem.
Please help me ASAP.
Thanking you.
With Kind Regards,
Senthil Alagu .P.Check this post of Oracle related to font aliasing
http://download-east.oracle.com/docs/cd/B10464_05/bi.904/b13673/pbr_font.htm
Marcos -
How to improve the query performance in to report level and designer level
How to improve the query performance in to report level and designer level......?
Plz let me know the detail view......first its all based on the design of the database, universe and the report.
at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
and when you create a paremeter try to get it match with the key fields in the database.
good luck
Amr -
What are all the tables used for this report:
hi
what are all the tables used for this report:
report:
<b>Stock Report, which will give opening balance, receipt, issue, and closing balance for any given Duration for any material.</b>
thanks in advanceTables: MSEG, MKPF, MARD.
FOR REFERENCE SEE TRANSACTION : MB5B.
Message was edited by: Sharath kumar R
Maybe you are looking for
-
Output video for live streaming has black edges
I use tricaster mini to stream live from church but my output video has black edges and I have been trying to remove it but it's not working. I use adobe to encode any help?
-
Help - Default OS password for installing updates?
I have a G4. I tried to download and install software updates last night but it asked me for a password to install the updates. I'm not aware of any password I set up. Does anyone know if there is a default password for installing new software?
-
Application not showing in iTunes
i have recently purchased a macbook pro and a new iphone 5. When i access itunes my previously purchased applications are not showing. i have synced my ipad and iphone 4 to my macbook pro and they are still not appearing. Please help
-
Handful of devices some work sometimes
I have a lot of devices Ipad, Ipad2, Mac book, Mac book air, Iphone, Imac, ect. Anyway we (my tech and I) are trying to get wireless setup. He is able to connect to the wireless using a laptop computer. It has windows XP and ubuntu linux on it. They
-
Assigning Global Keyboard Shortcut to Display Home Folder
Hi there, I've done some hunting to determine if there is a way to assign a global keyboard shortcut to display a finder window displaying one's home folder contents. I don't see how I can do it using "Keyboard Shortcuts" in system preferences. Does