05-19-2007 12:20 PM
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.
05-19-2007 12:31 PM
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
05-19-2007 12:31 PM
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
05-19-2007 1:09 PM
hi,
iam having 70 fields in one int table and each field contains so many records.
how is it possible
05-19-2007 1:12 PM
concatenate '"' itab-fld1 '"' ':' '"' itab-fld2'"' ';' '"' itab-fld3 '"' into v_string.
This is the only way.
Regards,
Amit
Reward all helpful replies.
05-19-2007 8:41 PM
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