|  |  |  | 
|---|
|  |  |  | data.Name( versionname ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // Get Business Type from Scenario Name | 
|---|
|  |  |  | businesstype := select( globalotdtable, | 
|---|
|  |  |  | BusinessType, | 
|---|
|  |  |  | b, | 
|---|
|  |  |  | b.ScenarioName()=data.ScenarioName() ).BusinessTypeName(); | 
|---|
|  |  |  | data.BusinessType( businesstype ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // Copy scenario | 
|---|
|  |  |  | if( isnull( data.WrappedInstance() ) ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | // sync data | 
|---|
|  |  |  | if( data.EnableSync() ) { | 
|---|
|  |  |  | MacroPlan::DoSync( macroPlanNew, | 
|---|
|  |  |  | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ); | 
|---|
|  |  |  | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ,GlobalOTDTable); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.Close(); | 
|---|