Skip to Content
0
Former Member
Jun 26, 2009 at 11:57 AM

download file with fields with decimal values.

13 Views

Hi,

I need to download infotype records to a file.

I need a comma deleimited file.

I have got all the details from Infotype to my internal table 'IT_OUTPUT_OPR'

my code is as follows:

LOOP AT IT_OUTPUT_OPR.

CLEAR IT_FILE_OPR.

NUM = 0.

DO.

  • Get name of next structure field into <f>

ASSIGN COMPONENT SY-INDEX OF STRUCTURE IT_OUTPUT_OPR TO <F>.

IF SY-SUBRC <> 0. EXIT. ENDIF. " No more fields in structure

LEN = STRLEN( <F> ).

IT_FILE_OPR+NUM = <F>. " Write field to output table

NUM = NUM + LEN.

WRITE: ',' TO IT_FILE_OPR+NUM(DELIMIT_LEN).

NUM = NUM + DELIMIT_LEN.

ENDDO.

APPEND IT_FILE_OPR.

ENDLOOP.

my internal table contains 'decimal' fields too.

so I am getting the following runtim error: 'OBJECTS_NOT_CHARLIKE'

at the position:

LEN = STRLEN( <F> ).

Please could anyone tell me how could this issue be resolved?

any pointers in this regard would be helpful.

Thanks,

Saher