Application Development 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: 

Download CSV file in Background job

Former Member
0 Kudos

Hi All,

I am Using this FM for converting SAP To CSV Format."SAP_CONVERT_TO_CSV_FORMAT".after this i'm

getting Conversion (CSV) value CHANGING TAB. data : I_TAB_CONVERTED_DATA type TRUXS_T_TEXT_DATA.

after this i have open dataset & trying to transfer filename.but i'm not able transfer.

code : open dataset file_create1 for APPENDING in TEXT MODE ENCODING DEFAULT.

if sy-subrc eq 0.

TRANSFER I_TAB_CONVERTED_DATA to file_create1.

endif.

close dataset file_create1.

Error : I_TAB_CONVERTED_DATA cannot be a table ,a reference,a string,or containing any of these objects.

Note : If i am declare a internel table not able to convert CSV format.

Please Advice How to Download SAP Internel table to CSV files in Background JOB Mode.

Regards,

Raj

3 REPLIES 3

Former Member
0 Kudos

Hi All,


 data : I_TAB_CONVERTED_DATA type TRUXS_T_TEXT_DATA,
           gs_TAB_CONVERTED_DATA   type     ????????? .
I dont have table type TRUXS_T_TEXT_DATA on my system, but call se11 and put table type TRUXS_T_TEXT_DATA and click on diplay and look for structure behind this table type and enter this structure instead of ???????.

 open dataset file_create1 for APPENDING in TEXT MODE ENCODING DEFAULT.
loop at  I_TAB_CONVERTED_DATA  into gs_TAB_CONVERTED_DATA.
if sy-subrc eq 0.
TRANSFER gs_TAB_CONVERTED_DATA to file_create1.
endif.
close dataset file_create1.

Bye Jan

0 Kudos

HI All,

TRUXS_T_TEXT_DATA is not a type.Is a type group TRUXS. I am using Convert CSV format is using SAP Standard FM

"SAP_CONVERT_TO_CSV_FORMAT".SAP Using Changing tab this type group(TRUXS_T_TEXT_DATA ).

If i am decllare String,Or Char,is not converting.its going for short Dump.<removed by moderator>.

Regards,

Raj.

Edited by: Thomas Zloch on Nov 10, 2010 11:18 AM

0 Kudos

>

> HI All,

> TRUXS_T_TEXT_DATA is not a type.Is a type group TRUXS. I am using Convert CSV format is using SAP Standard FM

> "SAP_CONVERT_TO_CSV_FORMAT".SAP Using Changing tab this type group(TRUXS_T_TEXT_DATA ).

> If i am decllare String,Or Char,is not converting.its going for short Dump.<removed by moderator>.

> Regards,

> Raj.

I have no clue what TRUXS_T_TEXT_DATA is not a type.Is a type group TRUXS. means. But to transfer to a dataset, you need an internal table and loop over the contents and then pass each record to the dataset.

Example.

open dataset  xxxxxxx.
loop at itab into wa_itab.
  transfer wa_itab to xxxxxx.
endloop.
close dataset xxxxx.

That's what Jan tried to explain.