Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help with saving a big character strings contents as a file on AS

Hi Experts,

I need to have a delimited file saved on to the Application Server. I have got the data in delimited format using the standard FM : SAP_CONVERT_TO_TEX_FORMAT. Everythings fine up to here. The system returns the converted data as type TRUXS_T_TEXT_DATA which is nothing but a 4096 character field. I now need to save this character field as a file on the Application Server. Please help me as to how I can proceed. My coding is as shown below:

type-pools: TRUXS.

data: tb_afko type standard table of afko,
      tb_mseg type standard table of mseg,
      count type i,
      i_text(4096) TYPE c OCCURS 0.

data: lv_filename1 TYPE rlgrap-filename.

data: tb_data type table of TRUXS_T_TEXT_DATA,
      wa_data type TRUXS_T_TEXT_DATA.

select * from afko into table tb_afko.

sort tb_afko by aufnr descending.
delete adjacent duplicates from tb_afko comparing aufnr.

  EXPORTING
    I_FIELD_SEPERATOR          = '|'
  TABLES
    I_TAB_SAP_DATA             = tb_afko
 CHANGING
   I_TAB_CONVERTED_DATA        = i_text
 EXCEPTIONS
   CONVERSION_FAILED          = 1
   OTHERS                     = 2
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

I now need to save this i_text which is returned by the FM as a file on my Application Server. Please help with your valuable inputs.

Regards,

Uday

Not what you were looking for? View more on this topic or Ask a question