IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDERENTRY_A' AND KSQL_COL_NAME ='FSUMREJQTY') 
 ALTER TABLE T_PUR_ORDERENTRY_A ADD (FSUMREJQTY DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SALOUTSTOCK_REJ') 
 CREATE TABLE T_PUR_SALOUTSTOCK_REJ (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPOBILLNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINBILLNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FREJDATE DATETIME,
FREJECTQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FREJECTREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPOENTRYID VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOBILLID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL
);
