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





































































































6 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.

Sheila Jefferson-Ross 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