*&---------------------------------------------------------------------*
*& Include ZXM06U43 *
*&---------------------------------------------------------------------*
DATA : W_CNT TYPE I,
W_WERKS TYPE T001W-WERKS,
w_matnr type mara-matnr,
w_matnr1 type mara-matnr,
w_perc type P DECIMALS 2.
data: w_mwskz type ekpo-mwskz.
data: begin of itab occurs 0,
matnr type ZVVF_MT018_ADVLI-matnr,
end of itab.
data: count.
data: begin of data occurs 0,
LIC_INDICATOR TYPE ZEXP_LICENSE-LIC_INDICATOR,
LICENSENO type ZEXP_LICENSE-EXP_LINCENSE_NO,
MATNR type zvvf_mt018_advli-MATNR,
POVALUE type mseg-dmbtr,
BALQTY type P DECIMALS 4,
BALVAL type P DECIMALS 4,
WERKS LIKE EKPO-WERKS,
ELIKZ like ekpo-elikz,
end of data.
DESCRIBE TABLE TEKPO LINES W_CNT.
IF W_CNT > 1.
READ TABLE TEKPO INDEX 1 .
W_WERKS = TEKPO-WERKS.
LOOP AT TEKPO.
select single matnr into w_matnr from zvvf_06_sopo where matnr =
tekpo-matnr.
if sy-subrc <> 0.
IF TEKPO-WERKS NE W_WERKS.
MESSAGE E000(ZPO_EXIT).
ENDIF.
endif.
ENDLOOP.
ENDIF.
* Start of insertion by Niraj on 11-05-2005
loop at tekpo.
read table tkomv with key kposn = tekpo-ebelp Kschl = 'ZLAN'.
if sy-subrc = 0.
clear w_perc.
w_perc = ( ( tekpo-effwr - tkomv-kwert ) / tkomv-kwert ) * 100.
if w_perc > 0.
message e001(zpo_exit) with tekpo-ebelp w_perc.
endif.
endif.
if TEKPO-UEBTO > '10'.
message e002(zpo_exit) with tekpo-ebelp.
endif.
endloop.
* End of insertion by Niraj on 11-05-2005
*Code Added by Upinder Singh on 02-06-2006
*Advance License Validation
loop at tekpo where loekz ne 'L'.
if I_EKKO-BSART eq 'ZI' and tekpo-idnlf eq '99' .
* exit.
elseif I_EKKO-BSART eq 'ZI' and tekpo-idnlf eq '98' .
* exit.
elseif I_EKKO-BSART eq 'ZI' and tekpo-idnlf eq '97' .
* exit.
elseif I_EKKO-BSART ne 'ZI'.
* exit.
elseif I_EKKO-BSART eq 'ZI' and tekpo-idnlf eq space.
message e003(zpo_exit) with tekpo-ebeln tekpo-ebelp.
leave to current transaction.
else.
Select matnr from ZVVF_MT018_ADVLI into corresponding fields of
table itab where LICENSENO eq tekpo-idnlf.
if sy-subrc ne '0'.
message e005(zpo_exit) with tekpo-idnlf.
else.
loop at itab.
if itab-matnr eq tekpo-matnr.
Submit ZADVANCELICENSESUMMARY with so_lisno = tekpo-idnlf
and return.
count = 'X'.
w_matnr1 = itab-matnr.
IMPORT data FROM MEMORY ID 'ZUPI11'.
clear data.
pack tekpo-matnr to tekpo-matnr.
condense tekpo-matnr.
read table data with key matnr = tekpo-matnr.
unpack tekpo-matnr to tekpo-matnr.
if tekpo-meins eq 'KG'.
tekpo-menge = tekpo-menge / 1000.
endif.
if data-balqty <>
* message 'License Qty is less than PO Quantity' type 'E'.
message e006(zpo_exit) with data-balqty tekpo-menge.
endif.
free memory id 'ZUPI11'.
endif.
endloop.
endif.
if count eq space.
message e004(zpo_exit) with tekpo-matnr w_matnr1.
* message 'PO Material is not same as LIC Indicator''s Material' type
*'E'.
endif.
endif.
endloop.
*End of Code by Upinder Singh
*break-point.
No comments:
Post a Comment