Skip to Content
0
Former Member
Jul 21, 2009 at 01:36 PM

How to save complex itab to CSV on app server

177 Views

Greetings.

I'm working on a report that, when ran in the background (SY-BATCH = 'X'), must write the data to either CSV or XLS (as long as it can be opened directly in Excel it matters not which format is actually used).

I've researched this problem on SDN and while I've seen some that come close I have not found anything to fit my particular need. Thus far I've tried the following FM's with the result as indicated:

SAP_CONVERT_TO_CSV_FORMAT

Short dump, i.e., "The current statement is only defined for character-type data objects." The error happens inside a call to FM "SAP_CONVERT_TO_TEX_FORMAT" which is called inside "SAP_CONVERT_TO_CSV_FORMAT". The particular line 164 (IF <F_SOURCE> CO C_DARL_NUMBER.". The line type of the internal table I need to write is complex in that it contains other structures, etc., and contains non-character data.

SAP_CONVERT_TO_XLS_FORMAT

Nothing happens; no errors, no file - nothing.

Before I start down the road of manually concatenating all these fields (and there are many of them) I want to see if there's a way to do this using some standard way to cut down my development time.

Many thanks.