Skip to Content
0
Former Member
Jul 09, 2007 at 12:25 PM

start routine

10 Views

hai, friends,

pls help me with this

i wrote one start routine for update rules. pls help me with the bracketed parts

TABLES: /BIC/PCAPO_TPLN.

TABLES: /BIC/P0MATERIAL.

DATA: ITRANSUNIT1 like /BIC/PCAPO_TPLN occurs 0 with header line.

DATA: IMAT1 like /BIC/P0MATERIAL occurs 0 with header line.

DATA: QTY (15) type NUMC.

DATA: QTYBOM like QTY.

DATA: WOD like QTY.

DATA: VOM like QTY.

DATA: TUW like QTY.

DATA: TUV like QTY.

Select * from /BIC/PCAPO_TPLN into table ITRANSUNIT1.

Select * from /BIC/P0MATERIAL into table IMAT1.

loop at data_package.

read table ITRANSUNIT1 with key APO_LOCFR = data_package-/BIC/ZSEND_LOC

APO_LOCTO = data_package-/BIC/ZREC_LOC.

if sy-subrc = 0.

data_package-/BIC/CAPA_VOL = ITRANSUNIT1-CAPA_VOL.

data_package-/BIC/CAPA_WT = ITRANSUNIT1-CAPA_WT.

data_package-/BIC/CAPO_TPLN = ITRANSUNIT1-CAPO_TPLN.

data_package-/BIC/ZAPOTRUOM = ITRANSUNIT1-ZAPOTRUOM.

QTY = data_package-/BIC/Z9ATSHIP + data_package-/BIC/ Z9APSHIP.

read table IMAT1 with key 0MATL_TYPE= data_package-/BIC/MATERIAL.

if sy-subrc = 0.

{Convert unit of QTY to the unit of BaseUom(from masterdata of 0MATERIAL) and write it to QTYBOM }

WOD = IMAT1-0GROSS_WT * QTYBOM.

VOM = IMAT1-0VOLUME * QTYBOM.

{ Get the WOD and VOM Matching to the same Unit-of-Measure for 0CAPA_WT and 0CAPA_VOL}

TUW = ITRANSUNIT1-CAPA_WT / WOD.

TUV = ITRANSUNIT1-CAPA_VOL / VOM.

if TUW GT TUV.

data_package-/BIC/ZAPOTRUNT = TUW.

else.

data_package-/BIC/ZAPOTRUNT = TUV.

endif.

endif.

modify data_package.

endif.

endloop.