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

Alpha conversion on Internal table

0 Likes
13,658

Hi,

Is it possible to do alpha conversion on Internal table column using |{ variable alpha = in}| ?

1 ACCEPTED SOLUTION
Read only

Patrick_vN
Active Contributor
10,277

Something like this?

converted_table = VALUE #( FOR unconverted
                           IN unconverted_table
                           ( column_a = |{ unconverted-column_a ALPHA = IN }| )
                         ).
7 REPLIES 7
Read only

Patrick_vN
Active Contributor
10,278

Something like this?

converted_table = VALUE #( FOR unconverted
                           IN unconverted_table
                           ( column_a = |{ unconverted-column_a ALPHA = IN }| )
                         ).
Read only

0 Likes
10,277

Thanks Patrick,

I have tried this logic and it worked. But, all other fileds are blank in converted table

Read only

0 Likes
10,277

You have to add the other columns as well, for columns where the values don't have to be changed, you just map them like "column_b = unconverted-column_b", etc..

Read only

0 Likes
10,277

Instead of hardcoding the columns, Is that can achievable with Move corresponding between the converted and unconverted tables ?

I added the below statement. It is moveing the records but the converted values are getting blank.

converted_table = CORRESPONDING #( unconverted_table EXCEPT column_a)
Read only

0 Likes
10,277

Hi Mateusz,

My requirement is to add leading 0's.

Read only

MateuszAdamus
Active Contributor
0 Likes
10,277

In this case you need to go field by field. How else could the logic know that it's a new field and not the ending part of the previous one?

I will remove my answer as it is not relevant.


Kind regards,
Mateusz
Read only

MateuszAdamus
Active Contributor
10,277

Hello praveen_channa

Actually, you could try something like this.

FIELD-SYMBOLS:
  <lv_field> TYPE ANY.

LOOP AT lt_table REFERENCE INTO DATA(ld_row).
  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE ld_row->* TO <lv_field>.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.

    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input = <lv_field>
      IMPORTING
        output = <lv_field>.
  ENDDO.
ENDLOOP.
Kind regards,
Mateusz