Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Input check+conversion without screen?

Clemenss
Active Contributor
0 Likes
529

Hi,

if I want to convert text field to internal value I can use FM CONVERSION_EXIT_xyz_INPUT if there is a conversion exit.

Simple date, time and numeric fields get converted automatically. Is there a way to do this conversion without a screen field?

TNX,

Clemens

4 REPLIES 4
Read only

Former Member
0 Likes
506

Hi

What are you exactly meaning?

U can write a code to convert the data before showing it and convert it again after showing it.

These code won't triggered automatically, of course.

Max

Read only

0 Likes
506

Max,

I'd like to use the same routine the system uses when converting implicitly. i.e. time in fomat 16:15 will become 161500 internally or 21.03.2006 will become 20060321 or 100,123.26 in US or 100.123,26 will be 100123.260 internal.

As far as I know, this is down in the screen processor and can not be used by ABAP, but who knows exactly. Still have not lost my hope.

Regards,

Clemens

Read only

0 Likes
506

Hi

U should convert tha data by yourself, if know the kind of data you should know which convertion you need to do.

Anyway try this:

CALL FUNCTION 'CONVERT_TIME_INPUT'
  EXPORTING
    INPUT                           = '20:30:11'
*   PLAUSIBILITY_CHECK              = 'X'
 IMPORTING
   OUTPUT                          = TIME
 EXCEPTIONS
   PLAUSIBILITY_CHECK_FAILED       = 1
   WRONG_FORMAT_IN_INPUT           = 2
   OTHERS                          = 3
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

DATA: DATE TYPE SY-DATUM.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
     EXPORTING
          DATE_EXTERNAL            = '19.11.2006'
     IMPORTING
          DATE_INTERNAL            = DATE
     EXCEPTIONS
          DATE_EXTERNAL_IS_INVALID = 1
          OTHERS                   = 2.
IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Max

Read only

Clemenss
Active Contributor
0 Likes
506

Ok, the answer is: Although there is some software doing implit I/O conversion for ABAP simple types, you can not use them from ABAP dynamic or static.

Not just satisfying and still I believe there must be a way to call respective kernel function.

Life goes on,

Clemens