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: 

delimiter "prakash";'sharma";"992224"

Former Member
0 Kudos

hi to all,

i have to retrieve the data from diff infotypes and put into one internal table.this int table has to submith to application server file.

but the records should be delimited with ; and be in the form of

"prakash";"sharama";"9921000"; like this.

pls help how to get this kind of option.

thanks & regards,

j.prakash.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You need to concatinate with ; and insert into the Internal table then pass the internal table to Appliaction server using the DATASETS

Regards

Sudheer

4 REPLIES 4

Former Member
0 Kudos

Hi,

You need to concatinate with ; and insert into the Internal table then pass the internal table to Appliaction server using the DATASETS

Regards

Sudheer

0 Kudos

hi,

iam having 70 fields in one int table and each field contains so many records.

how is it possible

amit_khare
Active Contributor
0 Kudos

concatenate '"' itab-fld1 '"' ':' '"' itab-fld2'"' ';' '"' itab-fld3 '"' into v_string.

This is the only way.

Regards,

Amit

Reward all helpful replies.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Prakash

Perhaps the following sample report may be useful for you.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_CSV_FILE_DOWNLOAD
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_csv_file_download.


TYPE-POOLS: truxs.


DATA:
  gt_pa0000    TYPE STANDARD TABLE OF pa0000,
  gt_pa0001    TYPE STANDARD TABLE OF pa0001.

DATA:
  gt_data      TYPE truxs_t_text_data,                      " 4096 char
  gt_data_x    TYPE truxs_t_text_data,                      " 4096 char
  gd_line      LIKE LINE OF gt_data.




START-OF-SELECTION.

  SELECT * FROM pa0000 INTO TABLE gt_pa0000 UP TO 10 ROWS.
  SELECT * FROM pa0001 INTO TABLE gt_pa0001 UP TO 10 ROWS.


  CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
      i_field_seperator          = ';'
*     I_LINE_HEADER              =
*     I_FILENAME                 =
*     I_APPL_KEEP                = ' '
    TABLES
      i_tab_sap_data             = gt_pa0000
    CHANGING
      i_tab_converted_data       = gt_data_x
    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.
  APPEND LINES OF gt_data_x TO gt_data.
  REFRESH: gt_data_x.

  CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
      i_field_seperator          = ';'
*     I_LINE_HEADER              =
*     I_FILENAME                 =
*     I_APPL_KEEP                = ' '
    TABLES
      i_tab_sap_data             = gt_pa0001
    CHANGING
      i_tab_converted_data       = gt_data_x
    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.
  APPEND LINES OF gt_data_x TO gt_data.
  REFRESH: gt_data_x.


  OPEN DATASET '/tmp/infotype.csv' FOR OUTPUT IN TEXT MODE
                                   ENCODING DEFAULT.

  CHECK ( syst-subrc = 0 ).

  LOOP AT gt_data INTO gd_line.
    TRANSFER gd_line TO '/tmp/infotype.csv'.
  ENDLOOP.

  CLOSE DATASET '/tmp/infotype.csv'.

END-OF-SELECTION.

Regards

Uwe