Silly question: Negative object keys...

Dart, Jocelyn jocelyn.dart at sap.com
Tue Sep 28 23:42:54 EDT 2004


Mike,
It's straightforward enough.  Because the object key needs to be compared and entered in a flat format in any number of programs so that it can be handled generically, you can only use character-based types.  Anything involving converting part of the bytes in the key, such as packed data (such as signed numbers) or hex values, is out.
 
NUMC is a character type - digits held as characters.
If you want a negative in your key, pass it in as a character string using a character field.
You can then move it to an appropriate packed field for use in function module calls.
 
By the way, these days, utility functions like ZDEADLINE can be done as ABAP classes in WebAs systems such as R/3 4.7.
Works nicely.
Regards,
Jocelyn
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of Michael Pokraka
Sent: Tuesday,28 September 2004 7:15 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Silly question: Negative object keys...
 
Hi Mark,
The good ol' ZDEADLINE.... albeit a slightly advanced version of the one in
the book, we need reverse factory calendar calculations for our deadlines.
 
The workarounds are many and varied, but the idea of having numerics but no
negatives annoyed me a little out of principle. I understand the SAP
concepts behind its data types (thanks Sheldon, for the detailed low-down),
but I can't see the reason for the limitation.
 
Anyway, it was just trivia...
 
Cheers
Mike
 
Mark Pyc wrote:
> Just out of curiosity, in terms of what is 'proper', what kind of object
> can you define that requires a negative numeric key????
>
>
>
>
>                       Michael Pokraka
>                       <workflow at quirky.me         To:
> SAP-WUG at MITVMA.MIT.EDU
>                       .uk>                        cc:
>                       Sent by: SAP                Subject: Silly question:
> Negative object keys...
>                       Workflow
>                       <Owner-SAP-WUG at MITV
>                       MA.MIT.EDU>
>
>
>                       27 Sep 2004 18:45
>                       Please respond to
>                       SAP Workflow Users'
>                       Group
>
>
>
>
>
>
> Hi all,
> A workaround is easy enough, so this is purely academic Monday/Tuesday
> trivia:
>
> I have an object with a numeric key and wanted to use a negative number. No
> can do says this 620 system, a NUMC doesn't permit a minus sign.
>
> Trying to give an INT-type field as a reference results in:
> "Only ABAP data types C, N, D and T are permitted as key fields"
>
> OK, ... type N obviously refers to NUMC as I couldn't fit any other
> suitable
> field types in there. Type N should allow negatives... or maybe not. The
> simple workaround is obviously to use a CHAR and fill it with whatever...
> but doing that is a bit ... well, not 'proper'.
>
> Anyway, not important... just curious.
>
> Cheers
> Mike
>
>
 


More information about the SAP-WUG mailing list