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

Dynamic field lenth

Former Member
0 Likes
548

how to find the length of a field dynamically.

i'm displaying the output in flat file, with delimiter.

based on the length of field dynamically '|' should come.

05562031|26/07/2006|31/12/9999|P|12 Sanderling Rise |

0753||31/12/9999|| Jackdaw Drive 07562926|26/07/2006|31/12/9999|P|

I mean based on the field length pipe delimiter should come. if you observe first and second records especially first field length you can cleary identify what i'm exactly looking for.

Experts please help me.

Regards

vamsi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Hi,

You will have the data in a Internal table, then you will put that in the final one and download it to the faltfile, so before movin git to the internal table move with PIPE symbol

Regards

Sudheer

4 REPLIES 4
Read only

Former Member
0 Likes
532

Hi,

You will have the data in a Internal table, then you will put that in the final one and download it to the faltfile, so before movin git to the internal table move with PIPE symbol

Regards

Sudheer

Read only

Former Member
0 Likes
531

Hi Vamsi,

Make ur internal table as shown below :

data : begin of i_record occurs 0,

records type string,

end of i_record.

data : v_pipe type c value '|'.

LOOP AT I_TAB.

CONCATENATE I_TAB-matnr

I_TAB-mtart

I_TAB-meins

INTO I_record-RECORD SEPARATED BY V_PIPE.

APPEND i_record.

Download this data usinf FM 'gui_download' and the internal table i_record in to it.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
531

Hi Vamsi,

write ENDLOOP after appending i_record.

I forgot to write in previous thread.

Regards,

Hemant

Read only

Former Member
0 Likes
531

Hi Vamsi,

If you are trying to find out the length of a field and not the content you can use the

following abap statement for it.

DESCRIBE FIELD d_ntype-tdata LENGTH d_len IN CHARACTER MODE.

Regards,

Aravind