IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_SUPDEM_RANGENEW') 
 CREATE TABLE T_MRP_SUPDEM_RANGENEW (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FMATCHRULE BIGINT DEFAULT 0 NOT NULL,
FMRPPLAN BIGINT DEFAULT 0 NOT NULL,
FBIZPLAN BIGINT DEFAULT 0 NOT NULL
);

 EXEC P_ALTERPK 'PK_MRP_SUPDEM_RANGENEW', 'T_MRP_SUPDEM_RANGENEW', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_SUPDEM_RANGENEW') CREATE INDEX IDX_MRP_SUPDEM_RANGENEW ON T_MRP_SUPDEM_RANGENEW ( FBILLNO );