Skip to Content
author's profile photo
Former Member

FINDING PROBLEM IN USING FM :QSS0_FLTP_TO_CHAR_CONVERSION

Hi Friends,

yday i got a fm QSS0_FLTP_TO_CHAR_CONVERSION for converting fltp value to characher value.

now i am finding a problem ..

i am fetching the value of qamv toleranzob and toleranzun using an itab.

now i have to use the above mentioned fm to convert the value

CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'

EXPORTING

i_number_of_digits = y

i_fltp_value = itab-toleranzob

  • I_VALUE_NOT_INITIAL_FLAG = 'X'

  • I_SCREEN_FIELDLENGTH = 16

  • IMPORTING

  • E_CHAR_FIELD = z

Here in y i have to take the last 2 digits of tloeranzob

eg : itab-toleranzob = 3.0275000000000000E+02

y = 02

can you kinldy tell me how to cut the value of tolernzob .. (last 2 digits)

(i tried using offset position ,but i am getting an error.)

Thanks and Regards

Yamini.A

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    author's profile photo
    Former Member
    Sep 30, 2005 at 05:25 AM

    Sasi,

    The last 2 digits can be 02 or 01 or 00 so n...

    i have to cut those 2 digits from the itab-toleranzob and pass it to another variable(Y).

    i am not able to get how to do this...

    Regards

    Yamini.A

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Please do the same below.

      data: w_char(100) type c,

      w_len type char4,

      w_int type int1

      w_one(22) type c,

      w_two(3) type c.

      w_char = '3.0275000000000000E+02'.

      w_len = strlen( w_char ).

      <b>SPLIT</b> w_char at '+' into w_one w_two.

      w_int = w_two. " converting char to integer

      <b>w_int</b> contains the needed value.

      This will resolve your issue.

      Please reward points if this explanation useful.

      Regards,

      Siva

      Regards,

      Siva

  • author's profile photo
    Former Member
    Sep 30, 2005 at 05:21 AM

    hi,

    data : l_value(16) type c,

    l_input type f.

    l_input = '3.0275000000000000E+02'.

    CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'

    EXPORTING

    I_NUMBER_OF_DIGITS = 2

    I_FLTP_VALUE = L_INPUT

    I_VALUE_NOT_INITIAL_FLAG = 'X'

    I_SCREEN_FIELDLENGTH = 16

    IMPORTING

    E_CHAR_FIELD = l_value.

    write l_value.

    try with this

    sasi

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 30, 2005 at 06:07 AM

    Try the following code,

    data: name1(120) type c.

    data: name2(2) type c.

    data: len type i.

    move '3.0275000000000000E+02' to name1.

    len = strlen( name1 ).

    len = len - 1.

    move name1+len(2) to name2.

    Write:/ name1.

    Write:/ name2.

    Clear: name1,

    name2,

    len.

    This is working fine.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 30, 2005 at 06:18 AM

    Hi,

    1. Copy itab-toleranzob to a character variable

    2. Use strlen to find the length

    3. Then exract the last 2 character of the character variable

    Hope it helps.

    Add comment
    10|10000 characters needed characters exceeded