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

Converting internal table fields into string

Former Member
0 Likes
1,438

Hi All,

I have a internal table where i populate equipment details. The requirement i have to display the columns of these internal table as a string in sap-script.

For eg: I have to display the values in the internal table it_equip-sernr(serial number) as

Serial Number : 12345,34567......

Equipment Number :3456, 6789....

Is there a function module to convert the field column to string?

Please advice

Thanks in Advance

Regards,

Subodh

2 REPLIES 2
Read only

Former Member
0 Likes
771

Hi,

DATA int_var TYPE i value '1234534567'.

DATA chr_var(15) TYPE c .

Write int_var to chr_var.

Try this

Regards

Read only

Former Member
0 Likes
771

Hi,

Try like below

FIELD-SYMBOLS: <lfs_table>, " Internal table structure

<lfs_con>. " Field Content

DATA: l_con(50) TYPE c. " Field Content in character format

  • Columns to be tab delimeted

LOOP AT it_extract ASSIGNING <lfs_table>.

DO.

ASSIGN COMPONENT sy-index OF STRUCTURE <lfs_table>

TO <lfs_con>.

CLEAR: l_con.

MOVE <lfs_con> TO l_con.

CONDENSE l_con.

IF sy-index = 1.

CLEAR: wa_output_file-sline.

MOVE l_con TO wa_output_file-sline.

ELSE.

CONCATENATE wa_output_file-sline l_con INTO wa_output_file-sline

SEPARATED BY cseparator.

ENDIF.

ENDDO.

APPEND wa_output_file TO it_output_file. " Add to output file

ENDLOOP.

(OR)

v_repid = sy-repid

CALL FUNCTION 'GET_COMPONENT_LIST'

EXPORTING

program = v_repid

fieldname = 'ITAB'

TABLES

components = components.