Tricks for Posting Template Setup

images\btn_see_also_programs64.gif

Simplifying Conditions

Program GPMM, Posting Parameter Item Maintenance, supports parameter item queries which are more powerful than the limited facilities we have in the posting templates in program GPTM, Posting Template Maintenance. Certain situations (like identifying material issue transactions) would require a large number of OR conditions in program GPTM, Posting Template Maintenance, which can be replaced by adding a new parameter item to the interface which will identify the condition for us. For example, we can create a query item called MATERIAL_ISSUE in the MFG interface which will contain a ‘Y' whenever the transaction type is one of the various issue transaction types. The query for this would be:

select 'Y' from dual where ^TRANS_TYPE^ in ('B','D','F','H','I','J','K')

In program GPTM, Posting Template Maintenance, we simply test for the condition MATERIAL_ISSUE = ‘Y', instead of 7 tests of trans_type.

This technique can be extended as needed, to the point of creating a rather readable and easy to understand set of posting templates. The ability to re-use standard contractions of complex conditions promotes accuracy in setup of posting templates, which tends to reduce the incidence of error in the actual postings.

Automatic Defined Segments

This is a little-known technique that can eliminate the need to create lots of posting templates in certain situations. Program GPTM, Posting Template Maintenance will tolerate parameter item references in a defined segment position ( previously they were only allowed in auto segments). The segment definitions can be used to translate values in the interface into account segment values. To do this, the segment description must contain a unique value which we can match to an item value in the interface.

For example, we may want to accrue sales tax by state for 50 states in the sales interface. The segment value for the state resides in segment 3, which is a defined segment with uses. We define a query item called STATE_SEG in program GPMM, Posting Parameter Item Maintenance, with the following query :

Select segment_value from gl_segment_values where segment_no = 3 and upper(segment_name) like ‘%STATE%' and substr(segment_name,1,2) = (select shipto_state from oehead where order_no = ^ORDER_NO^ and order_suffix = ^ORDER_SUFFIX^)

Our segment definitions would look like:

Value  Name

01  AK State of Alaska

02  AL State of Alabama

03  AR State of Arkansas

Etc.

The posting template would look something like :

Account number: 100-12345-01-^STATE_SEG^-0001

Posting type: TAX

Condition: WHERE ^SHIPTO_COUNTRY_ID^ = ‘USA'

At posting time, a sales shipment to Arkansas would give us an account number of 100-12345-01-03-0001.

This gets around having to exhaustively enumerate all the tax accounts on 50 posting templates.