[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference acadmy::tpas_notes

Title:Transfer Price Administration System
Notice:Conference has moved to ACADMY::TPAS_NOTES
Moderator:ACADMY::MAGNI
Created:Wed Jul 01 1992
Last Modified:Fri Mar 21 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:102
Total number of notes:459

50.0. "Ship FROM/Ship TO mixed in DEMOSITE_BASIC/TPAS_CALC_TRNSFR_PRC" by FUTURS::TON () Thu Dec 15 1994 06:53

I have just installed TPAS II. I have also compiled and linked the
TPAS_DEMOSITE_BASIC.BAS sample program, and the calls to
TPAS_CALC_TRNSFR_PRC successfully return a transfer price. Most of the
time. I have a number of questions/problems with the call to
TPAS_CALC_TRNSFR_PRC, and will enter each one in a separate note so that
the threads are easier to follow.

By the way, my TPAS II installation is using  a 'local' AMPS2 file. But the
AMPS2 file is not on the same node as the TPAS installation. I have defined
TPAS$AMPS as a network path, and TPAS_CALC_TRNSFR_PRC and
TPAS_DEMOSITE_BASIC.EXE seem to work fine (most of the time). I have no
PPCS link.

Here is the first problem....


SKNEES::TON> run tpas_demosite_basic/NODEB
 
PART NUMBER ? VSXXX-AA
SHIP FROM   ? AY
SHIP From Type (S/P/T/B) ? P
SHIP TO     ? AY
SHIP To Type (S/P/T/B) ? P
Order MLP or return    ? 100
Local Standard Cost or return    ? 12
Shipment Type (01,02,03,04)? 01
%APPIX-I-INTERPLANTSHIP, Successful INTERPLANT TRANSFER PRICING at STD COST

Part ID:   VSXXX-AA
Ship/Bill FROM Data : AY      - AYO - AY -  - MFG
Ship/Bill TO Data   : AY      - AYO - AY -  - MFG

TPAS Prodt Type   : OPT
STD Cost          : $      29.582000       STD Cost Type   : C
Corporate MLP     : $           175.00
Average Prodt NOR : $         0.000        Prevailing Rate :          0.000

Base Price        : $        29.582    Trnsfr Pricing Code : F
CMM  : 0.00           CALCULATED MLP Dscnt Perct To Rebill : 0.00
MLP Discount Percent : 0.00        NOR Discount Percent    : 0.00
STD Cost Uplift      : 0.00        REBILL Discount Percent : 0.00
Transfer Price  :         29.582   Currency : USD
Transfer Price To Rebill  : $         0.000

TPAS TRANS STATUS:  FAC Code : %APPIX-     Status Code : S
     Error Message : -NORMAL, normal successful completion


MORE PARTS, PRESS 'Y' OR 'N' ? Y
PART NUMBER ? VSXXX-AA
SHIP FROM   ? XX
SHIP From Type (S/P/T/B) ? P
SHIP TO     ? AY
SHIP To Type (S/P/T/B) ? P
Order MLP or return    ? 100
Local Standard Cost or return    ? 12
Shipment Type (01,02,03,04)? 01



Part ID:   VSXXX-AA
Ship/Bill FROM Data : XX      -     -    -  -
Ship/Bill TO Data   : AY      -     - XX -  -

TPAS Prodt Type   :
STD Cost          : $       0.000000       STD Cost Type   :
Corporate MLP     : $             0.00
Average Prodt NOR : $         0.000        Prevailing Rate :          0.000

Base Price        : $         0.000    Trnsfr Pricing Code :
CMM  : 0.00           CALCULATED MLP Dscnt Perct To Rebill : 0.00
MLP Discount Percent : 0.00        NOR Discount Percent    : 0.00
STD Cost Uplift      : 0.00        REBILL Discount Percent : 0.00
Transfer Price  :          0.000   Currency : USD
Transfer Price To Rebill  : $         0.000

TPAS TRANS STATUS:  FAC Code : %APPIX-     Status Code : F
     Error Message : -GETPLNTTO, TO PLANT MNEMONIC CODE not on CORP. TABLE


MORE PARTS, PRESS 'Y' OR 'N' ? N


Here the first call to TPAS_CALC... is successfully completing an
interplant transfer. In the second call, I have entered an invalid Ship
FROM plant, yet the error message complains about the TO PLANT. Looks like
FROM and TO are  being mixed up.
Unfortunately the User Guide does not include a formal defintion of the
TPAS_CALC_TRNSFR_PRC function, so I cannot tell if the parameters are being
passed to the function in the wrong order, or if the function is mixing
them up all by itself.
I have also noticed that the demo program uses some unusualy data typing
(SQL and VMS status's are declared as real numbers).

To sum up, I have two requests...

  - Please tell me where the from/to codes are being mixed up (hopefully
    its the proggy, not the function)

and

  - Please supply a formal definition of the TPAS_CALC_TRNSFR_PRC function
    listing all the parameters, giving their generic data type, and passing
    mechanism.


Thanks

George Ton
TOLAS Development
T.RTitleUserPersonal
Name
DateLines
50.1tpas_demosite_basic input to/from reversedAWARD::MAGNIIM&T - 223-9837Thu Dec 15 1994 15:2929
  - Please tell me where the from/to codes are being mixed up (hopefully
    its the proggy, not the function)

The problem is TPAS_DEMOSITE_BASIC.BAS. That program was never fully tested
as it was just written more as a 'this is how you would place a call using 
BASIC' program.
The mistake is in the MAP it has the to/from recversed. It should be:

MAP (MAP_TPAS_TRANS_RECORD)   STRING  TPAS_REQUEST_PART       = 30%, &
	                 STRING  TPAS_TRANS_SHIP_TO_STKRM     = 07%, &
	                 STRING  TPAS_TRANS_SHIP_TO_TYPE      = 01%, &
	                 STRING  TPAS_TRANS_SHIP_FROM_STKRM   = 07%, &
	                 STRING  TPAS_TRANS_SHIP_FROM_TYPE    = 01%, &
	                 DOUBLE  TPAS_ORDER_MLP                    , &
			 .
			 .
			 .



  - Please supply a formal definition of the TPAS_CALC_TRNSFR_PRC function
    listing all the parameters, giving their generic data type, and passing
    mechanism.

I will write that up, post it here and expand in the user doc.


Lois
50.2It worked, but I'm confused...FUTURS::TONFri Dec 16 1994 05:4825
Lois,

I made the change you suggested to TPAS_DEMOSITE_BASIC.BAS, and it worked.
To be honest, I was very surprised. Let me explain why.

In the call to TPAS_CALC_TRNSFR_PRC, each parameter is explicitly passed.
Generally it is the order in which the parameters are listed in the call
the is significant, not the order in which the parameter variables are
declared. Changing the order in which the variables are declared should
have no effect on the call. Is there something about the relationship
between the MAP and TPAS_CALC_TRNSFR_PRC the you're not telling us? Are
imdividual parameters really being passed, or are you passing the MAP?

There is something else that I am curious about. I notice that strings are
being passed by reference, and numbers by descriptor. Generally, in BASIC
at least, things are the other way round. With a number, we use Reference
since the length of the data being passed can by derived from the data
type. With strings, the length can be variable, so you need a starting
address and a length (which is what a descriptor gives). So why use
refernece for strings and descriptors for numbers? (This is just idle
curiosity)

Thanks

george
50.3I assume the MAP and LINKAGE use the same storageAWARD::MAGNIIM&T - 223-9837Wed Dec 21 1994 11:3119
>>I made the change you suggested to TPAS_DEMOSITE_BASIC.BAS, and it worked.
>>To be honest, I was very surprised. Let me explain why.

	The best explaination I can give is that a MAP defines storage
	and a LINKAGE defines storage. Even though the call is field
	by field the storage area is what is sent and received.
	I walked this through DEBUG and the FROM = "XX' & TO = "AY"
	put in the TPAS_DEMOSITE_BASIC is
	recevied in the COBOL TPAS_CALC_TRNSFR_PRC as TO = "XX" and FROM = "AY"
	when the MAP was reversed.


>>There is something else that I am curious about. I notice that strings are
>>being passed by reference, and numbers by descriptor. 

	It worked this way - that is the best I can tell you. 

Lois
50.4Fix for TPAS_DEMOSITE_BASIC.BASFUTURS::TONThu Jan 05 1995 10:5881
I have examined both the BASIC and the COBOL demo programs supplied with
the TPAS II kit, and they are quite different.

The COBOL program makes a call to TPAS_CALC_TRNSFR_PRC, and passed a single
parameter (the starting address of the storage area that contains the data
elements the function uses). Yet the BASIC program passed dozens of
parameters, (the addresses of each element).

Let my offer a suggested fix to the BASIC demo program...

- add this line immediately after the %IDENT

OPTION TYPE = EXPLICIT

- Replace the MAP with

RECORD tpas_record
	STRING  tpas_request_part		= 30%
	STRING  tpas_trans_ship_to_stkrm	= 07%
	STRING  tpas_trans_ship_to_type		= 01%
	STRING  tpas_trans_ship_from_stkrm	= 07%
	STRING  tpas_trans_ship_from_type	= 01%
	DOUBLE  tpas_order_mlp                    
	DOUBLE  tpas_local_std_cost               
	WORD    tpas_ship_type_cd                  
       	STRING  tpas_rcv_from_trnsfr_area	= 03%
       	STRING  tpas_rcv_to_trnsfr_area		= 03%
        STRING  tpas_rcv_from_plnt_mnemnc	= 02%
        STRING  tpas_rcv_to_plnt_mnemnc		= 02%
        STRING  tpas_rcv_tpas_prodt_type_cd	= 03%
        DOUBLE  tpas_rcv_std_cost                  
        DOUBLE  tpas_rcv_mlp                       
        SINGLE  tpas_rcv_cmm                      
        DOUBLE  tpas_rcv_base_price                
        STRING  tpas_rcv_price_type_ind		= 01%
        SINGLE  tpas_rcv_discount_percent         
        SINGLE  tpas_rcv_std_cost_uplift           
        DOUBLE  tpas_rcv_transfer_price           
        STRING  tpas_rcv_trnsfr_prc_curncy_cd	= 03%
        STRING  tpas_rcv_std_cst_type_cd	= 01%
        DOUBLE  tpas_rcv_trnsfr_prc_rebill        
        SINGLE  tpas_rcv_dscnt_mlp_rbill          
        SINGLE  tpas_rcv_nor_dscnt                
        SINGLE  tpas_rcv_rbill_dscnt              
        STRING  tpas_rcv_subsid_bill_cd_from	= 07%
        STRING  tpas_rcv_subsid_bill_cd_to	= 07%
        STRING  tpas_rcv_busns_from_type_cd	= 03%
        STRING  tpas_rcv_busns_to_type_cd	= 03%
        DOUBLE  tpas_rcv_avg_prodt_nor_amt        
        DOUBLE  tpas_rcv_prvailing_rate           
        STRING  tpas_rcv_facility_msg		= 07%
        STRING  tpas_rcv_part_status_code	= 01%
        STRING  tpas_rcv_error_message		= 72%
        LONG    tpas_rcv_sqlerr                   
        LONG  	tpas_rcv_vms_error
END RECORD TPAS_RECORD

EXTERNAL SUB tpas_calc_trnsfr_prc(tpas_record)

DECLARE tpas_record my_tpas


- replace the call of  tpas_calc_trnsfr_prc with...

	CALL tpas_calc_trnsfr_prc ( my_tpas BY REF)

- replace all remaining references to fields that were declared in the MAP
with  appropriate references to my_tpas::. For example

    Replace
        INPUT "PART NUMBER ";  TPAS_REQUEST_PART
    with
        INPUT "PART NUMBER ";  my_tpas::tpas_request_part.


The above works for me.


George Ton
TOLAS Development

50.5thanks for the other BASIC exampleAWARD::MAGNIIM&T - 223-9837Mon Jan 09 1995 11:188
George,

Your suggestion is great. The DEMOSITE in BASIC was a quick and dirty to 
give the MAXCIM installations an idea of what the call would look like.
Thanks for you effort. Sending one record is easier to code and manage in
code changes. I am sure other BASIC sites can utilize it.

Lois