Skip to Content
avatar image
Former Member

FUNCTION MODULE TO CONVERT TYPE P VARIABLE TO CHAR

IS THERE ANY FUNCTION MODULE TO CONVERT TYPE P VARIABLE TO CHAR.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Jun 29, 2007 at 02:49 PM

    Hi Kanti,

    There is no need of any FM.

    Just directly assign P value to the variable of type C.

    Reward points if useful.

    Regards,

    Atish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2007 at 03:36 PM

    Use FM Pack_Char_Conversion to convert from type P to type C

    Use FM Char_Pack_Conversion to convert from type C to type P

    Sagar

    Allways urs

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2007 at 02:46 PM

    Hi,

    Just declare a variable of type I and C.

    Assign value of variable type p to type i variable.

    Then assign the value of type i value to c varaiable.

    Data : a type i,

    b(10) type c

    c type p.

    a = c. "This is to round off if there are any decimal values.

    b = a.

    Reward if helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2007 at 02:49 PM

    Hi,

    FM: 'SPELL_AMOUNT'

    Example:

    REPORT ZSPELL.

    TABLES SPELL.

    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

    DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.

    SY-TITLE = 'SPELLING NUMBER'.

    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

    FORM SPELL_AMOUNT USING PWRBTR PWAERS.

    CALL FUNCTION 'SPELL_AMOUNT'

    EXPORTING

    AMOUNT = PAMOUNT

    CURRENCY = PWAERS

    FILLER = SPACE

    LANGUAGE = 'E'

    IMPORTING

    IN_WORDS = T_SPELL

    EXCEPTIONS

    NOT_FOUND = 1

    TOO_LARGE = 2

    OTHERS = 3.

    ENDFORM. " SPELL_AMOUNT

    Regards,

    Bhaskar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2007 at 03:34 PM

    PACK_CHAR_CONVERSION to convert type P to type C

    CHAR_PACK_CONVERSION to convert type C to type P

    Sagar

    Allways urs

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 29, 2007 at 03:47 PM

    Just do a WRITE pfield TO cfield DECIMALS n.

    Add comment
    10|10000 characters needed characters exceeded