Skip to Content
author's profile photo Former Member
Former Member

CONVERSION_EXIT_ALPHA_INPUT

Hi,

I have a field in my internal table which i need to pass to FM CONVERSION_EXIT_ALPHA_INPUT before processing that internal table.

The simple method is to loop on the table and call FM each time.

But,the number of entries being Huge, this will hit the performance.

Can this Function module be called as a macro? if yes, then how?

regards

Nishant

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2006 at 11:19 AM

    Sorry .. But i guess there is no alternative .. The conversion exit routines are system calls.It takes only 1 input at a time.Even writing a macro wont help.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2006 at 01:46 PM

    Hi Nishant,

    You could use FIELD-SYMBOLS here to do a faster conversion. Use it like this:

    TYPES:
      BEGIN OF ty_input,
        field1(10) TYPE c,
        field2(10) TYPE c,
      END   OF ty_input.
    DATA:
      my_index TYPE syindex,
      wa_input TYPE ty_input,
      it_input TYPE ty_input OCCURS 0.
    FIELD-SYMBOLS:
      <fields> TYPE ty_input.
    * Test fill structure
    DO 20 TIMES.
      my_index = 20 - sy-index.
      WRITE:
        sy-index DECIMALS 0 TO wa_input-field1 LEFT-JUSTIFIED,
        my_index DECIMALS 0 TO wa_input-field2 LEFT-JUSTIFIED.
      APPEND wa_input TO it_input.
    ENDDO.
    * Faster conversion
    * Is directly updated in the internal table
    LOOP AT it_input ASSIGNING <fields>.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = <fields>-field1
        IMPORTING
          output = <fields>-field1.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = <fields>-field2
        IMPORTING
          output = <fields>-field2.
    ENDLOOP.
    * Release symbol
    IF <fields> IS ASSIGNED. UNASSIGN <fields>. ENDIF.
    * Test output
    LOOP AT it_input INTO wa_input.
      WRITE:
        / wa_input-field1,
          wa_input-field2.
    ENDLOOP.

    Since the FIELD-SYMBOL actually points towards a record, you do not have to add the MODIFY command into the conversion loop. This means a faster way of converting (if no other way is possible).

    Regards,

    Rob.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2006 at 05:43 PM

    Hi,

    how did the table get populated?

    why dont u use conversion exit during the population of that table? if it is populated from a flat file you have to use conversion exit within the loop, there is no other alternative.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.