IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MRP_PLANORDER ADD (FPLANSCOPE BIGINT DEFAULT 0 NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FINWARORG') 
 ALTER TABLE T_MRP_PLANORDER ADD (FINWARORG BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FINWAREHOUSE') 
 ALTER TABLE T_MRP_PLANORDER ADD (FINWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FINWARELOCATION') 
 ALTER TABLE T_MRP_PLANORDER ADD (FINWARELOCATION BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FMANUVERSION') 
 ALTER TABLE T_MRP_PLANORDER ADD (FMANUVERSION BIGINT DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYSUPPLYORGUNITID') 
 ALTER TABLE T_MRP_PLANORDERENTRY ADD (FENTRYSUPPLYORGUNITID BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYWAREHOUSE') 
 ALTER TABLE T_MRP_PLANORDERENTRY ADD (FENTRYWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYLOCATION') 
 ALTER TABLE T_MRP_PLANORDERENTRY ADD (FENTRYLOCATION BIGINT DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDER' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MRP_XPLANORDER ADD (FPLANSCOPE BIGINT DEFAULT 0 NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDER' AND KSQL_COL_NAME ='FINWARORG') 
 ALTER TABLE T_MRP_XPLANORDER ADD (FINWARORG BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDER' AND KSQL_COL_NAME ='FINWAREHOUSE') 
 ALTER TABLE T_MRP_XPLANORDER ADD (FINWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDER' AND KSQL_COL_NAME ='FINWARELOCATION') 
 ALTER TABLE T_MRP_XPLANORDER ADD (FINWARELOCATION BIGINT DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYSUPPLYORGUNITID') 
 ALTER TABLE T_MRP_XPLANORDERENTRY ADD (FENTRYSUPPLYORGUNITID BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYWAREHOUSE') 
 ALTER TABLE T_MRP_XPLANORDERENTRY ADD (FENTRYWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDERENTRY' AND KSQL_COL_NAME ='FENTRYLOCATION') 
 ALTER TABLE T_MRP_XPLANORDERENTRY ADD (FENTRYLOCATION BIGINT DEFAULT 0 NOT NULL);
  
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDER' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MRP_SIMULATEORDER ADD (FPLANSCOPE BIGINT DEFAULT 0 NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDER' AND KSQL_COL_NAME ='FINWARORG') 
 ALTER TABLE T_MRP_SIMULATEORDER ADD (FINWARORG BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDER' AND KSQL_COL_NAME ='FINWAREHOUSE') 
 ALTER TABLE T_MRP_SIMULATEORDER ADD (FINWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDER' AND KSQL_COL_NAME ='FINWARELOCATION') 
 ALTER TABLE T_MRP_SIMULATEORDER ADD (FINWARELOCATION BIGINT DEFAULT 0 NOT NULL);

  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDERENTRY' AND KSQL_COL_NAME ='FENTRYSUPPLYORGUNITID') 
 ALTER TABLE T_MRP_SIMULATEORDERENTRY ADD (FENTRYSUPPLYORGUNITID BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDERENTRY' AND KSQL_COL_NAME ='FENTRYWAREHOUSE') 
 ALTER TABLE T_MRP_SIMULATEORDERENTRY ADD (FENTRYWAREHOUSE BIGINT DEFAULT 0 NOT NULL);
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDERENTRY' AND KSQL_COL_NAME ='FENTRYLOCATION') 
 ALTER TABLE T_MRP_SIMULATEORDERENTRY ADD (FENTRYLOCATION BIGINT DEFAULT 0 NOT NULL);
