DuplicateBusinessUnit

Duplicate Business Unit

Major Business Rule

Object Name: B0900053

Parent DLL: CFIN

Location: Client/Server

Language: C

Functional Description

Purpose

This business function will duplicate a block of accounts from one business unit to another or to all 

business units of a specified type.  It will also duplicate any existing account translations to the 

F0901D file for the new account.


Special Logic

JDB_SetLowerLimit is used in this business function instead of a JDB_SetSelection statement because 

of the problem of copying all accounts (including those with blank or filled subsidiaries) within a 

block of accounts specified by a beginning account and an ending account.  An example of this would be to 

copy all accounts within a range beginning with 1.1110.BEAR and ending with 1.1133 (excluding 1.1110 

with a blank subsidiary).  If SetSelection were used, data selection on the subsidiary would probably 

be specified with a beginning and ending range (>= "BEAR" and <= 'blank').  Therefore, no records 

would be selected because an impossible subsidiary value would be specified.  This would also affect a 

Select Structure specifying only accounts with subsidiaries >= 'BEAR'. Only accounts with subsidiaries 

greater than or equal to 'BEAR' would be selected and all accounts with blank subsidiaries contained 

within this block of accounts would be excluded.  SetLowerLimit is used in this case to set the beginning 

account for the block of accounts specified, in order to solve this problem.



Technical Specification


Processing


Main Program:

• Return Errors if Invalid Data is passed in
• If "To Business Unit" is specifed and "To Business Unit Type" and "Company" are blank
• Open F0006 by Business Unit Key
• Fetch "To Business Unit"
• Copy F0901 account records to one business unit only
• Else (when "To Business Unit" is blank, but "To Business Unit Type" or "Company" is specified)
• Open F0006 by Business Unit Type and Company Keys
• If "To Company" is specified
• Fetch "To Business Units" with 2 keys (business unit type and company)
• Else (when "To Company" is Blank)
• Fetch "To Business Units" with 1 key (business unit type)
• Fetch first "To Business Unit"
• While fetch of "To Business Units" is successful
• Copy F0901 account records to current business unit
• Fetch next "To Business Unit"
• Exit

Internal Function to Copy Accounts for each Business Unit:

• If "From" object and subsidiary are specified
• Use four keys (company, business unit, object, subsidiary)
• Else
• If only "From" object is specified
• Use three keys (company, business unit, object)
• Else
• Use two keys (company, business unit)
• Set lower limit on beginning account in range.
• Select F0901 account records for "From Business Unit"
• Fetch the next "From account"
• While the account is within the specified range of accounts
• If the account is within the specified level of detail
• If the account already exists in "To Business Unit"
• Notify user
• Else (when the new account does not already exist)
• Get key values for new F0901 account record
• Assign next number to new account ID
• If "To Business Unit" is a model business unit
• Assign "M" to gmfmod flag on new account
• Get Update Audit information
• Write new F0901 account record for "To Business Unit"
• If insert successful, increment number of new accounts written
• Copy any matching F0901D Account Translations for the new account.
• Get next "From Account"
• If next account is not within the specified range
• exit while loop
• Exit

Data Structure

D0900053 - Duplicate Business Unit

This business function will copy accounts to:
 1) A single business unit if "To Business Unit" is specified.

 2) Multiple corresponding business units for all companies if a NON-BLANK "Business Unit type" is 

specified.

 3) Multiple corresponding business units within one company if a NON-BLANK "Business Unit type" and 

"Company" are specified.

 4) Multiple corresponding simple business units within one company if a BLANK "Business Unit type" 

and "Company" are specified.

(If an object/subsidiary range is not specified, all accounts in the "From Business Unit" will be 

copied.)

 

^

Parameter NameData ItemData TypeReq/OptI/O/Both
szCostCenterFMCUcharNONEINPUT

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szCostCenterTMCUcharNONEINPUT

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szCostCenterTypeSTYLcharNONEINPUT

A user defined code (00/MC) that identifies the classification of the business unit.

szCompanyCOcharNONEINPUT

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

cLevelofDetailLDAcharNONEINPUT

A number used to summarize and classify accounts in the general ledger by level of detail. Level 9 is the most detailed and Level 1 is the 
least detailed. Levels 1 and 2 are reserved for company and business unit totals. Levels 8 and 9 are reserved for job cost posting accounts in 
the Job Cost system. Examples of the other levels are: 3 Assets, Liabilities, Revenues, Expenses   4 Current Assets, Fixed Assets, Current 
Liabilities, and so on   5 Cash, Accounts Receivable, Inventories, Salaries, and so on 6 Petty Cash, Cash in Banks, Trade Accounts Receivable, 
and so on   7 Petty Cash - Dallas, Petty Cash - Houston, and so on 8 More Detail   9 More Detail  Do not skip levels of detail when you assign a 
level of detail to an account. Nonsequential levels of detail cause rollup errors in financial reports.

szObjectFromOBJcharNONEINPUT

The portion of a general ledger account that refers to the division of the Cost Code (for example, labor, materials, and equipment) into 
subcategories. For example, you can divide the Cost Code for labor into regular time, premium time, and burden. Note: If you use a flexible chart of 
accounts and the object account is set to 6 digits, J.D. Edwards recommends that you use all 6 digits. For example, entering 000456 is not 
the same as entering 456 because if you enter 456 the system enters three blank spaces to fill a 6-digit object.

szObjectThruOBJcharNONEINPUT

The portion of a general ledger account that refers to the division of the Cost Code (for example, labor, materials, and equipment) into 
subcategories. For example, you can divide the Cost Code for labor into regular time, premium time, and burden. Note: If you use a flexible chart of 
accounts and the object account is set to 6 digits, J.D. Edwards recommends that you use all 6 digits. For example, entering 000456 is not 
the same as entering 456 because if you enter 456 the system enters three blank spaces to fill a 6-digit object.

szSubsidiaryFromSUBcharNONEINPUT

A subset of an object account. Subsidiary accounts include detailed records of the accounting activity for an object account.

szSubsidiaryThruSUBcharNONEINPUT

A subset of an object account. Subsidiary accounts include detailed records of the accounting activity for an object account.

cExistFlagEV01charNONEOUTPUT

A value of 1 is returned in this flag if at least one of the accounts specified to be copied already 
existed in the destination business unit.

^

mnRecordsWrittenTOTALRECMATH_NUMERICOPTOUTPUT

This number represents the total number of new records created.

szErrorCodeZeroAcctsCopiedERNOcharOPTOUTPUT

The error number assigned by the JDE edit/update programs designating the exact error that occured.

cExcludeConsolidBusUnitsEV02charOPTINPUT

An option that specifies the type of processing for an event.

Related Functions

B0000035 Compare Object/Subsidiary String
B9800100 Get Audit Information

Related Tables

F0006 Business Unit Master
F0901 Account Master
F0901D Account Master - Alternate Description