cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric output format on SAPscript: what am I missing?

johnm16
Participant
0 Kudos

Hi Folks,

this is an ancient and much discussed issue, and yes, I've been all over the site like a rash looking for solutions/explanations. So far, no joy.

This concerns the numeric output format on a custom Purchase Order output in ECC6.  Here are the things I know, and the measures I have taken.

Driver program is ours;  heavily customised from the original.  SAP script ditto.  For output values,  the SAPscript is using numeric fields directly from EKKO and EKPO, rather than a character based 'carrier' structure.  The POs are all for our India Purchase Org., and they are all in rupees.  The vendors in the POs are based in India, and their currency is rupees also.  Our plant/company are in India.  The SAPscript is always invoked using the 'EN' language version.

The driver program contains these two lines of ABAP, executed before the form is opened:

SET COUNTRY 'GB'.
ITCPO-TELELAND = 'GB'.

These are here because we always want the numeric output in UK formati.e. 999,999.00.  And lots of posts advise using both of these, although the second one seems pretty unlikely to me: it's supposed to influence the phone number, not quantities/values.

In the SAP script, the SET COUNTRY 'GB' is repeated as a control command.  there are no other SET COUNTRY commands in either the driver program or the SAPscript.

The actual output lines in the SAPscript look like this: 

,,&EKPO-MENGE(.2ZC)& ,,&EKPO-MEINS& ,,&EKPO-MFZHI(.2ZC)& ,,&EKPO-NETPR(.2ZC)& 
&EKKO-WAERS& &'Per 'EKPO-PEINH(ZC)& ,,,,&EKPO-NETWR&

Normal, in other words. 

Now here's the thing.  I have 2 almost identical POs, one of which outputs all decimal numbers in UK format: 999,999.99 - and the other of which outputs all decimal numbers in the wrong format:  999.999,00   

I am executing both of them, and my default numeric format is UK.  The only difference in the POs is that one has more items than the other.  Otherwise remarkably similar.  Same IN10 Org., same currency (INR), same vendor country (IN), same ordering plant country (IN).  The NAST entries are identical (same printer, albeit I'm previewing both documents).  There are some legacy WRITE commands in the driver program:  they work perfectly in both cases (UK format result).

So the question is, why are my two outputs behaving differently?  What other attributes influence the format of numeric outputs in SAPscripts? 

I expect I've missed something really obvious.  Thanks for reading.

Cheers

John M.

 

Sandra_Rossi
Active Contributor
The only possible reason is a SET COUNTRY somewhere. In debug, add a Statement Breakpoint on SET COUNTRY to locate where it's sent by the standard.
View Entire Topic
johnm16
Participant

Hi Sandra,

that's exactly what I ended up doing (should have done it 3 hours earlier), and as you correctly surmised, there's a SET COUNTRY command buried in a function call within a chunk of conditional code.  What was unexpected was why one of two almost identical POs would call that routine and the other wouldn't;  as ever, no time to dig that far.

Thank you for taking the trouble to post when you should really have been mellowing on down for the weekend!

Cheers,

John

Sandra_Rossi
Active Contributor
Thanks for the feedback!