Thursday, February 12, 2015

Reshuffling your Account Structure

image You come to work one morning and find a note on your desk saying that you need to change the structure of the account number. You need to add a segment to the beginning to keep track of the Company number. Then you need to rearrange the existing segments to better match reporting requirements. Well, you have heard that is not something you can do ‘out-of-the-box’. All of the documentation says you cannot do it and your partner says you cannot do it. Microsoft even says you cannot do it. Your partner tells you that you need to buy ‘Changer’ from Corporate Renaissance Group http://www.crgroup.com. Truth is you CAN do it. This article is intended to provide a step-by-step instruction on how to accomplish your directive ‘out-of-the-box’.

Setting the stage

Let’s take Fabrikam, Inc. (Fabrikam) as our example company – everybody knows good ole’ Fabrikam. You need to change the account format from its current format to a new format. The old and new formats are shown in the table below:
Old format New format
Division – Account – Department XXX – XXXX - XX

Company – Department – Division – Account X-XX-XXX-XXXX

Breaking your job down into simple steps, here is what you have to do: 1. Add a new single character segment to the front of the account
2. Move the Division segment to the third segment
3. Move the Department segment to the second segment
4. Move the main Account segment to the end.
Looks like a piece of cake. However, wait, you cannot add a segment to the front, you can only add one to the end. Another complication is that you cannot rearrange existing segments. Obviously, the plan needs to change. With that in mind, you take a different approach. You decide to change the lengths of the existing segments, add a new four-character segment to the end and then import the accounts back in with the configuration you want. Here is your new plan: 1. Shrink the first segment to one character from three characters.
2. Shrink the second segment from four characters to two characters.
3. Expand the third segment from two characters to three characters.
4. Add a four-character segment to the end.
5. Rearrange the numbers so that the account segments hold the correct values.
6. Import the accounts back in.
7. Re-label the segments.
Unfortunately, you cannot get past the first step. The system will not allow you to shrink the length of a segment. What to do?

Solving the problem

What follows is a step-by-step solution for changing your account structure. This is a complete list of the steps that are explained below: Step 1 – change to an Interim Account format
Step 2 – launch Excel and set it up to accept your current accounts
Step 3 – retrieve your current accounts from GL00105
Step 4 – select the returned data
Step 5 – copy the returned data
Step 6 – paste the data into Excel
Step 7 – prepare your ‘after’ columns
Step 8 – build your ‘after’ accounts
Step 9 – prepare your Excel spreadsheet to create the PSTL source
Step 10 – create the import file
Step 11 – open the PSTL tool
Step 12 – perform the import
Step 13 – confirm the structure of the new account numbers
Step 14 – commit the conversion
Step 15 – shrink the format
Step 16 – recreate the account index table (GL00105)
Step 17 – check your Inventory Setup and Site ID windows
Step 18 – final step – Reconcile

Step 1 – change the existing Account format Administration | Setup | Company | Account format
Beginning Format Length Interim Format Length
1 – Department 3 1 – Department 3
2 – Account 4 2 – Account 4
3 – Division 2 3 – Division 3
    4 – Segment4 4
You need to do it this way because you cannot shrink (yet) the existing segments, but you need to provide enough space for the final configuration. You will adjust the lengths to the desired size much later in this process. Step 2 – launch Excel and set it up to accept your current accounts Set the first five columns to a Text format. This step will prepare Excel to accept a ‘Paste’ of your existing chart of accounts without stripping off the leading zeros. Your worksheet should look substantially similar to this: clip_image002[11] Step 3 – retrieve your current accounts from GL00105 Open SQL Studio Manager and run the following SQL script: SELECT actindx
, actnumbr_1
, actnumbr_2
, actnumbr_3
, actnumbr_4
, actnumst
FROM gl00105
Step 4 – select the returned data Click in the upper left-hand corner of the results to select the entire contents. Your result set should look substantially similar to this: image Step 5 – copy the returned data Right click on the upper Left-Hand corner and select ‘Copy with Headers’. clip_image004[7] Step 6 – paste the data into Excel Switch over to Excel and ‘paste’ into cell A-1. Make sure Excel did not strip off your zeros. If they are, return to step 2 and start over. These will be your ‘before’ numbers and your spreadsheet should now look substantially similar to this: clip_image005[7] Step 7 – prepare your ‘after’ columns Take the ‘before’ columns and copy them into ‘after’ columns. Be sure to skip a column between the two groups. THIS IS IMPORTANT. You are going to need to use columns for formulas and text cells will not accept formulas. I like to add some rows to the top to keep track of what I’m doing. Below is an image showing the rows I add to the ‘after’ columns. clip_image006[7] Step 8 – build your ‘after’ accounts Next, you need to build the new account in the structure you want. This is where you rearrange the columns and create the ‘after’ accounts that you will be using with the PSTL tool. More about that later. I create an Excel formula that will piece together the account segments in the ‘after’ ACTNUMST column. For Fabrikam, I used this formula in column M: • =TRIM(I5)&"^^-"&TRIM(J5)&"^^-"&TRIM(K5)&"-"&TRIM(L5) The ‘after’ columns of my spreadsheet now look like this: clip_image007[7] I used the carrot symbol to show where the spaces need to go. If you do not provide spaces to fill up the account segment length, your ‘new’ account will not come out right. Without the spaces, the new account will just fill the account field one character after another. For example, the first ‘after’ account above would resolve to 300-0001-100- . That is not what you want. We will remove the carrots in an upcoming step. Step 9 – prepare your Excel spreadsheet to create the PSTL source The PSTL tool’s import source requires a text file with two columns. It needs the accounts as they exist today in the first column. I call this the ‘before’ column. The second column contains the new account numbers. I call this the ‘after’ column. Remember, you still need blank spaces in the ‘after’ column to populate the account master properly. We will remove the spaces later when we shrink the segments. Insert a column next to the ‘before’ ACTNUMST column. Copy the ‘after’ ACTNUMST column and paste the values (not the formulas) into the new empty column. To paste the values, select the Paste as illustrated below: clip_image008[6] Your spreadsheet should look substantially similar to this: clip_image009[7] Step 10 – create the import file This step will create the file you will eventually use as the import file for the PSTL tool. Launch Notepad. Copy just the ACTNUMST columns (both ‘before’ and ‘after’). Do not copy the headers, copy only the numbers. Paste it into Notepad. There will be a lot of space between the two columns; that’s OK. Save the file to a place and using a name you will remember. I’m naming this one OldAcctNewAcct.txt Replace the “^” characters with empty spaces. To do this, select CTRL+H in Notepad. The Replace window will open. In the ‘Find what’ field put the ^ symbol. In the ‘Replace with’ field put a single space. The Replace window should not look substantially similar to this: clip_image010[7] Click the Replace All button. Save the file Step 11 – open the PSTL tool Open the PSTL tool main window. If you are using GP2013, you will have a button in the lower section of your Navigation Pane that says ‘PSTL’. It will look substantially similar to the image below: Select the ‘Main Setup Window’ from the next window that opens. From the ‘Main Setup Window’, select the ‘Acct Modifier/Combiner’ radio button and then click the ‘Next’ button. You will find the ‘Acct Modifier/Combiner’ tool in the ‘Financial Tools’ section as illustrated below: clip_image011[7] Step 12 – perform the import Select the ‘import’ radio button and then click the ‘Validate’ button. The window is illustrated below: clip_image012[7] On the next screen, select the .txt file you created in an earlier step. The system will run through the validation. If you see any account numbers going by, your validation has failed. Print the report at the end of the process. Once it shows no invalid accounts, you are good to go. But wait, just because your ‘before’ column was valid doesn’t mean your ‘after’ column resulted in a desirable format. Step 13 – confirm the structure of the new account numbers Before hitting the ‘Modify’ button, go back to SQL Studio Manager and check the structure you are about to import. A table named ‘TACHANGE’ holds the before and after numbers. I only worked with four segments, so I ran the query below to check my format: SELECT actnumbr_1
, actnumbr_2
, actnumbr_3
, actnumbr_4
, omnesa_1
, omnesa_2
, omnesa_3
, omnesa_4
FROM tachange
The results of my query looked like this: image The ‘after’ accounts are stored in the Omnesa columns. These columns correspond to the account segments. This result shows that the accounts will be modified appropriately. If I did not have the spaces in the right place, my import might verify, but the results could look like this: image Clearly, this is not what I want. Go back to the drawing board and remake your import text file. Try the validation again and check the results. Do not import your changes until this table displays exactly what you want the new accounts to look like. Step 14 – commit the conversion Once you are happy with the new account numbers, click on the ‘Modify’ button. You will probably be presented with three dialogs during the course of the conversion. Each one is illustrated below, along with the appropriate response. clip_image017[7] Select OK clip_image018[7] Select No clip_image019[7] Select OK. A report will then print showing you the before and after results. Your report will look substantially similar to this: clip_image020[7] Step 15 – shrink the format Even after the conversion, we still have those blank spaces in our account segments. This step is the magic of the process. You perform a system reconcile on the Account Format Setup table to get rid of the empty spaces and shrink the length of the account segments. Administration | Utilities | System | Reconcile clip_image021[7] After the reconcile, check your Account Format window to make sure you have the expected results. Change the segment names and make sure the appropriate segment is selected as the Main account. Fabrikam’s window looks like this: clip_image022[7] Step 16 – recreate the account index table (GL00105) I know it has been a long road, but you are not there yet. Almost, but there are just a few things you need to do. Even after you change this account structure using the steps above, the ACTNUMST field in the Account Index master is not correct. Fabrikam’s looks like this: clip_image023[7] As you can see, there are still spaces in the account number. My thanks to Mike Lupro for suggesting this easy fix. You’ll need to go back to the PSTL module and use the System tool named ‘Toolkit’. Select the ‘Toolkit’ radio button and click ‘Next’. Mark the radio button next to ‘Rebuild GL00105’ and click ‘Next’. Click the ‘Rebuild GL00105’ button on the next window and the rebuild will begin. Once the rebuild is complete, you will get a dialog similar to this: clip_image024[7] You’re close, but you’re not done yet! Step 17 – check your Inventory Setup and Site ID windows Go to your Inventory Setup window and check the ‘Segment ID for Sites’ field. image If the segment in that field is not the right segment, you will need to change it at the SQL level. Change the field IV40100.ACSGFLOC to the correct segment number. Next, be sure to open each of your inventory sites and make sure the Location Segment values are correct. If you need to change them, go to IV40700.Location_Segment and change it to the appropriate value. Step 18 – final step – Reconcile The final leg of this journey is to reconcile your Financial module. Financial | Utilities | Financial | Reconcile Reconcile every year, open or closed. If you are using any other products that use your account segments in a similar way, you will need to check them and potentially change their values. Finally, run the Reconcile utility in the Financials module against all of your years. Financial | Utilities | Financial | Reconcile

Enjoying the resolution

As you lean back and admire your work, pick up a tall one and bask in the glow of doing something when ‘they said it couldn’t be done’ Enjoy Leslie





































































































11 comments:

Mariano Gomez said...

This is a fantastic and clever solution for changing the account format and rearranging the segments. However, what really has been labeled as "cannot be done out-of-the-box" and the reason why you need a tool like the CRG Re-formatter is changing the account framework. If for some reason you needed your first segment to be, say, 8 digits, this solution would not work as you are constrained by the segment length set up during installation.

MG.-
Mariano Gomez, MVP

Dynamics Confessor said...

Thank you Mariano!
I referred to Changer because I am not changing the Framework, only the format. If the new format exceeded the Framework, we'd have a whole different ballgame. Changer would be the right tool to accomplish what is described in this story.

Anonymous said...

This is one of my favorite posts Leslie! What a mind you have and a very clever way of restructuring the chart of accounts. Of course, it is good of Mariano to point out that if your framework is not large enough to accommodate then you'll need a tool like Changer. I'm happy to know that if I am approached with this type of fix I will now have it available in my toolbox.

Dynamics Confessor said...

Hi Sheila,
This means a lot coming from one of the best in the business. Thank you for your kind words and for helping me solve impossible problems throughout the years.
Kind regards,
Leslie

Mystique said...

Hi Leslie,

Do you know if this can be done on GP9? I know 9 is not supported anymore but you know there are those customers who dont ever upgrade.

Dynamics Confessor said...

Mystique,
The key to this solution is being able to modify the account number with the Professional Services Tools Library (PSTL), I think it used to be called the 'Technical Service Tools' or something like that. If you have the Account Modifier/Combiner tool from that collection, you can do it. This product was not included free with the software back in version 9 days. They might not even have the PSTL dictionary installed. The product code is 1838.You could also use 'Changer' from Corporate Renaissance Group in place of the PSTL tool.
Leslie

Anonymous said...

Thanks Leslie, great post. I'm new to organization, new to MS Dynamics GP (2013 v12.00.2130 R2). Current Account Format Setup is Max Length 20, Max Segments 4.

Current Account Length is 11, with 4 Segments.

The Segment Order is Fund (X), Dept (XXXX), Cost Center (XXX), and Account (XXX). Max Length is set on each segment to 5 (which is fine).

If I follow your clear instructions, will we be able to modify this by rearranging the order of the segments to Account (XXXXX), Dept (XXXXX), and Cost Center (XXXX)? This is reduction of the # of segments (from 4 to 3) and a complete rearrangement to the order and the length.

Thanks, Joseph

Unknown said...

Hi Leslie, I tried to do this with limited success, I want to change my GL Account Format from XX-XXX-XXXXXXX to a new mask XX-XXX-XXXXX-XXX when I followed the steps I ended up with XX-XXX-XXXXXXX-X instead, any thoughts on what I might need to do next? Do I just repeat the process again?

Kind regards
Kerrian

Dynamics Confessor said...

First and foremost, test this on a fake company before applying to production

XX-XXX-XXXXXXX=12 current format

XX-XXX-XXXXX-XXX=13 desired format

XX-XXX-XXXXXXX-X = 13 error format

Take your starting format of 2-3-7 and hang another 3-characters to the end. Now your format is 2-3-7-3, your ultimate goal is 2-3-5-3. I’m going to make up some account numbers and take you through the process. I’m using the ^ symbol where I need to fill with empty characters.
Current Format
Intermediate Format = before PSTL
Intermediate Format = after PSTL
Ultimate Format

Strip out the empty spaces

2-3-7 = 12 chrs
2-3-7-3 = 15 chrs
2-3-7-3 = 15 chrs
2-3-5-3

Beginning 10-100-6484788

After adding 4th segment 10-100-6484788-^^^
Post change step 1 result 10-100-64847^^-880
After system reconciliation 10-100-64847-880


Create your excel spreadsheet with the first Colum showing 3 blank spaces at the end

Create the second column showing 2 blank spaces after the first 5 in what is currently segment 3

Exercise the CTRL+H feature and replace all of the ^characters with blank spaces..

Add the three numbers you want in the 4th segment.
Column 1 10-100-6484788-^^^
Column 2 10-100-64847^^-880
Post modify use system Reconcile the Account Format Setup 10-100-64847-880

Columns 1 and 2 go into your import. Once imported, but not processed, you can check the TACHANGE table in SQL to make sure the end accounts are going to look the way you want. If they don’t, the most common error is the spaces aren’t in the right place. If it’s wrong, figure out why and start again. Once satisfied, run the System utility on the Account Format Table. After you run the utility check out your Account Format to make sure it removed the empty spaces. Also check that the appropriate segment is identified as the Main Segment.

Now, to get the GL00105.ACTNUMST field correct you’ll need to rebuild the GL index master using PSTL Toolkit. You want to mark the Radio Button to Rebuild the GL00105 table to match the accounts, you have finished. Now, run checklinks and reconcile on the financial module.

Kind regards,

Leslie

Dynamics Confessor said...

Joseph,
Yes, you should be able to accomplish the rearrangement so long as the account format still fits within your account framework. You will need to change any segment assignments to locations if you have any set up. Also, look at the inventory control setup and change the division if appropriate.
You should be able to go from X-XXXX-XXX-XXX (Fund-Dept-Cost Center-Account) to XXXXX-XXXXX-XXXX (Account-Dept-Cost Center).
Leslie

Unknown said...

Thanks Leslie!! I was doing this from memory. I was just reducing 5 segments to 2, not changing any existing lengths so I thought piece of cake. But afterward my SmartList was still showing 5 segments, with the last 3 blank. I was missing the rebuild of the GL00105. That did the trick!