• Welcome to the upgraded JDELIST forum and thank you for your patience.
    Please restrict discussions and issues regarding the new forum software to the Off Topic forum. We will be monitoring that forum for issues.
    If you have trouble logging in, please reset your password using the forgotten password form: https://www.jdelist.com/community/index.php?lost-password/
    If you are unable to successfully reset your password, please contact us: Click here!
    We hope that you enjoy the upgraded forum.
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

B4000050/B4001090 Problems retrieving Tax Rate

MikeS

Member
Hello JDEList,

I have been struggling with the two BSFNs over the past three days trying to get them to work. This is on E8.12 on an AS400 V5R3 OS. I want to obtain a total Sales Tax Rate for a customer based on his ship to zip code. I am using B4000050 to load the vertex cache and then B4001090 to retrieve (I hope) the Tax Rate(s) and Sales Tax amounts. I have found one example where the two BSNFs are used and have tried to fill them in accordingly. However the error code returned from from B4001090 is always 1 and all variables that I try to retrieve data with keep staying at "0".

Here is the code:

0164 If VA rpt_TaxArea1_TXA1 is not equal to <Blank>
0165 VA rpt_Company_CO = "00101"
0167 VA sec_TaxExplanationCode1_EXR1 = "S "
0168 VA sec_TaxArea1_TXA1 = [VA rpt_TaxArea1_TXA1]
0169 VA rpt_PaymentTermsCode01_PTC = "A"
0170 VA rpt_IdentifierShortItem_ITM = "359860SS"
0171 VA rpt_UnitsPrimaryQtyOrder_PQOR = "5000"
0172 VA rpt_AmountTaxable_ATXA = "187.50"
0173 VA sec_TaxableYN_TAX1 = "Y"
0175 Load and Retrieve Vertex Cache
"2" -> BF cCalledFromFlag
VA rpt_AddressNumber_AN8 -> BF mnSupplierOrShipTo
VA rpt_Date01_DATE01 -> BF jdDateTransactionJulian
"00101" -> BF szCompany
" 101" -> BF szHeaderBranchPlant
" 101" -> BF szDetailBranchPlant
VA rpt_JobnumberA_JOBS <> BF mnJobnumberA
"1" -> BF cModeProcessing
<Zero> -> BF cWriteRegisterFlag
VA rpt_IdentifierShortItem_ITM -> BF mnIdentifierShortItem
"SO" -> BF szOrderType
"S" -> BF szLineType
VA sec_TaxArea1_TXA1 <> BF szShipToGeoCode
"10801532" -> BF mnDocumentOrderInvoiceE
"00101" -> BF szCompanyKeyOrderNo
"000" -> BF szOrderSuffix
"1.000" -> BF mnLineNumber
VA sec_TaxableYN_TAX1 -> BF cTaxableYN
0176 Tax, Calculate for Sales and Purchasing
VA sec_TaxArea1_TXA1 -> BF szTaxArea1
VA sec_TaxExplanationCode1_EXR1 -> BF szTaxExplanationCode1
VA rpt_Date01_DATE01 -> BF jdTransactionDate
VA rpt_PaymentTermsCode01_PTC -> BF szPaymentTermsCode1
"00101" -> BF szCompany
VA rpt_IdentifierShortItem_ITM -> BF mnShortItemNumber
VA rpt_UnitsPrimaryQtyOrder_PQOR -> BF mnUnitsPrimaryQtyOrder
VA rpt_AmountTaxable_ATXA -> BF mnAmountTaxable
VA rpt_AmtTax2_STAM <- BF mnAmtTax2
VA sec_AmtDiscountAvailable_ADSC <- BF mnAmtDiscountAvailable
VA sec_TaxRate01_TRATE01 <- BF mnTaxRate1
VA sec_TaxRate02_TRATE02 <- BF mnTaxRate2
VA sec_TaxRate03_TRATE03 <- BF mnTaxRate3
VA sec_TaxRate04_TRATE04 <- BF mnTaxRate4
VA sec_TaxRate05_TRATE05 <- BF mnTaxRate5
VA sec_TaxAuthority1A_TA1 <- BF mnTaxAuthority1A
VA sec_TaxAuthority2_TA2 <- BF mnTaxAuthority2
VA sec_TaxAuthority3_TA3 <- BF mnTaxAuthority3
VA sec_TaxAuthority4_TA4 <- BF mnTaxAuthority4
VA sec_TaxAuthority5_TA5 <- BF mnTaxAuthority5
VA sec_TaxCalculationMethod_TXAV <- BF cTaxCalcMethod2
VA sec_TaxTypeForInterm3_T003 <- BF cTaxType3
VA sec_TaxTypeForInterm4_T004 <- BF cTaxType4
VA sec_TaxTypeForInterm5_T005 <- BF cTaxType5
VA sec_DescriptionBR_BDS4 <- BF szDescriptionTaxArea
VA sec_TaxRate10_TRATE10 <- BF mnTotalAreaTaxRate
VA sec_FactorValueMethod_FVMD <- BF cFactorValueType
VA sec_ErrorCode_ERRC <- BF cErrorCode
"4" -> BF cSystemCode
VA rpt_JobnumberA_JOBS -> BF mnJobnumberA
"1" -> BF cIsVertexActive
VA sec_Description_DESC <- BF szAuthority1Desc
VA sec_Description1_DESC01 <- BF szAuthority3Desc
VA sec_Description2_DESC02 <- BF szAuthority2Desc
VA sec_Description3_DESC03 <- BF szAuthority5Desc
VA sec_Description4 <- BF szAuthority4Desc
"10801532" -> BF mnDocumentOrderInvoiceE
"SO" -> BF szOrderType
"00101" -> BF szCompanyKeyOrderNo
"000" -> BF szOrderSuffix
"1.000" -> BF mnLineNumber
0178 End If


Any help is greatly appreciated. There have not been many posts here in the Vertex Forum but since this clearly is a Vertex item I did not want to double post this also in the regular Developer Forum. I am hoping still to receive some feedback here. Thank you for your time.

Mike

E8.12 - AS400 V5R3
 

mdalton

Member
Is your vertex instane active? Normally you'd call the NER, N7300001 Determine if vertex is active before you call the cache function.
Where are you getting the job number from? I see the variable, but I don't see that that you are retrieving it in the code sample. VA rpt_JobnumberA_JOBS
Is the order type and SO, and the line type always an S? "SO" -> BF szOrderType, "S" -> BF szLineType

When you call B4001090 are you using system code value 4? Have you run the taxcalculator through the debugger?

Take Care,

Mark
 

MikeS

Member
Mark,

Thanks for taking interest in my problem and posting such a quick reply.

Ok - here is my information regarding your questions:

I added N7300001 at the beginning of my routine and it returns a "1". I also added back into my routine B0000564 Get Internal Next Number to populate the Jobnumber. I had it in at the beginning of my testing but it seemed that B4000050 was also filling it. I am running all of it locally in Debug mode, so I know that that Jobnumber had a value.

For this exercise the Sales Order Type is always SO and the line type S. To explain this I guess it helps if I tell you what my program will be used for. Our company still has several subsidiaries that are not 100% on JDE and still run a variety of legacy systems. We are trying to keep our JDE customer master in synch with the legacy systems customer masters. My program will create a file of all customer master changes done on JDE within a certain time frame and pass these on via FTP to the legacy systems. One field of the customer record that we want to pass out is a Sales Tax Rate field based on the customers Zip Code. Now I know that this is not an exact science because in all the vertex functions I also have to provide the Company Code and there are rules in effect for the sales tax based on the company code, but we at least want to get the basic info to the legacy systems.

So I basically have to fake it with some of the information. I am using information from an existing sales order and was hoping I could get the tax rate that way. All I basically need is through this exercise is the total Sales Tax rate for this Zip Code.

And yes I have been running that in Debug mode on the fat client in 8.12 so I can look at the variables before and after the BSFNs are run.

Thank you for your time.

Any suggestions?

Mike
 

MikeS

Member
Mark,

My first reply to your post has not been "released" to the board yet - but I just reread your message and I think I did not answer one of your questions:

Yes, I am using system code value 4 when I call B4001090.

Did not want this to hold up the message flow.

Thanks again.

Mike
 

wrohrbach

Member
Mike,

I'm not sure if you have solved your problem yet, but I have something to add. I would forget using the B400* BSFN's for calculating tax. They do a lot more than I think you need. Instead, use B0000564 - GetInternalNextNumber to get a number for cache and use X00TAX - LoadAndRetrieveQuantumTaxCache to load the cache and retrieve specific geo code taxing information. Then use the same BSFN and pass a 4 in the mode to clean up the cache.

The X00TAX BSFN is used strictly for tax calculation and skips all the "JDE bloat" that is probably giving you errors. If you have problems, the BSFN Notes are quite detailed.

Hope this helps,
Wade Rohrbach
 

MikeS

Member
Wade,

thanks for your post. I just saw it today. I am jumping back and forth between projects and now am back at my tax issue. The previous suggestions from above in the thread already helped me quite abit. I know get some data back using the B4XXXX functions but so far all I get is a tax amount and not the rates. I will try your BSFN. It looks similar to the one I am using. I am in the process of modifying my UBE so it can be deployed. Then I will see if it helps.

Thanks for your Message!! I thought I had JDELIST set to Email me messages posted to my threads. It worked earlier but I don't recall receiving an Email about your post. Strange.

Mike
 
Top