insert into system_events (
OBJ_NAME,
EVENT_CODE,
EVENT_CONTEXT,
SERVICE_CODE,
METHOD_RULE,
OVERWRITE_CORE,
CHG_DATE,
CHG_USER,
CHG_TERM,
RESULT_HANDLE,
COMP_TYPE,
COMP_NAME,
COMM_FORMAT
)    
select 
'porcp_edit' OBJ_NAME,
EVENT_CODE,
EVENT_CONTEXT,
SERVICE_CODE,
METHOD_RULE,
OVERWRITE_CORE,
CHG_DATE,
CHG_USER,
CHG_TERM,
RESULT_HANDLE,
COMP_TYPE,
COMP_NAME,
COMM_FORMAT
from system_events where obj_name = 'porcp' and event_code in ('audit_trail',
'post_item_change',
'post_validate',
'pre_confirm',
'pre_validate');
update system_events set service_code = 'prcm_default_1', comp_type = 'WSR', comp_name = 'nvo_business_object_dist_porcp'
where obj_name = 'porcp' and event_code = 'pre_confirm';
update itm2menu set win_name = 'w_porcp_edit', menu_path = 'WMS.1.27.0.0.0', descr = 'Edit Receipt ', obj_type = 'T'
where application = 'WMS' and level_1 = 1 and level_2 = 27 and level_3 = 0;

insert into obj_forms (
 WIN_NAME,
 TITLE,
 OBJ_BROW_NAME,
 OBJ_EDIT_NAME,
 CROSS_UPDATE_EXPR,
 EXPR_FLD_INFO,
 TARGET_FLD_INFO,
 EXPR_COMMENT,
 FORM_NO                
) select 
 'w_porcp_edit' WIN_NAME,
 TITLE,
 OBJ_BROW_NAME,
 OBJ_EDIT_NAME,
 CROSS_UPDATE_EXPR,
 EXPR_FLD_INFO,
 TARGET_FLD_INFO,
 EXPR_COMMENT,
 FORM_NO                
from obj_forms where win_name = 'w_porcp';
insert into transetup (
TRAN_WINDOW,
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
APPLICATION,
MULTITIRE_OPT,
REF_SER,
WRKFLW_INIT,
EDITTAX,
AUDIT_TRAIL_OPT                
) select 
 'w_porcp_edit' TRAN_WINDOW,
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
APPLICATION,
MULTITIRE_OPT,
REF_SER,
WRKFLW_INIT,
EDITTAX,
AUDIT_TRAIL_OPT                
from transetup where tran_window = 'w_porcp';

insert into obj_actions (
 OBJ_NAME,
 LINE_NO,
 IMAGE,
 DESCRIPTION,
 SERVICE_CODE,
 INTERACTIVE,
 RIGHTS_CHAR,
 TITLE,
 FORM_NO,
 SERVICE_HANDLER,
 PLACEMENT,
 ACTION_TYPE,
 TRAN_TYPE,
 CHG_DATE,
 CHG_TERM,
 CHG_USER               
)
select  
'porcp_edit' OBJ_NAME,
 LINE_NO,
 IMAGE,
 DESCRIPTION,
 SERVICE_CODE,
 INTERACTIVE,
 RIGHTS_CHAR,
 TITLE,
 FORM_NO,
 SERVICE_HANDLER,
 PLACEMENT,
 ACTION_TYPE,
 TRAN_TYPE,
 CHG_DATE,
 CHG_TERM,
 CHG_USER               
from obj_actions where obj_name = 'porcp' and title <> 'Add';
insert into obj_links (
 OBJ_NAME,
 FORM_NO,
 FIELD_NAME,
 TARGET_OBJ_NAME,
 LINK_FORM_NAME,
 LINK_TITLE,
 LINK_URI,
 LINK_TYPE,
 LINK_ARG,
 UPDATE_FLAG,
 LINK_NAME,
 RIGHTS_CHAR,
 IMAGE 
)
select  
'porcp_edit' OBJ_NAME,
 FORM_NO,
 FIELD_NAME,
 TARGET_OBJ_NAME,
 LINK_FORM_NAME,
 LINK_TITLE,
 LINK_URI,
 LINK_TYPE,
 LINK_ARG,
 UPDATE_FLAG,
 LINK_NAME,
 RIGHTS_CHAR,
 IMAGE 
from obj_links where obj_name = 'porcp';
//commit;