‎2010 Jan 05 9:45 AM
hello all,
i have an internal table gt_final_csv , which has value in body and header is blank, and now i have to split this gt_final_csv row and have to append at particular point to another gt_final_csv . i m doing like below but it is giving error "GT_FINAL_CSV1" must be a character-like data object (data type C, N,D, T, or STRING) STRING).
can anyone plz help me.
Code. DATA: gt_final_csv TYPE truxs_t_text_data.
DATA: gt_final_csv1(4096) type c.
TYPES: BEGIN OF gst_strg,
strg(4096) type c,
END OF gst_strg.
DATA : gt_strg type table of gst_strg.
value in gt_final_csv is :
INVSUM;071;5013315;;1500;2;100104;21.12.2009;. .;1;1;SGD;USD;;;1.000.000,000;0000000000000;C_BPRATAMA;21.12.2009;;;A;G;N;04.01.2010;INVPO;613313;00.00.0000;INVLIN;001;0000000;613313;00001;000000000000900001;TEST;0,00;0,00;0,00;CS;5;1.000.000,000;SG;;INVCMT;;INVSCMT;;00000;;000;
i have to seperate it in another itab at INV and have to append it.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ','
TABLES
i_tab_sap_data = gt_final
CHANGING
i_tab_converted_data = gt_final_csv
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.
gt_final_csv1 = gt_final_csv[].
split gt_final_csv1 at 'INV' into table gt_strg.
please help.
‎2010 Jan 05 10:07 AM
paste the itab gt_final_csv declaration
Sorry check the fields in truxs_t_text_data, it must be of type c,string ...
Edited by: Keshav.T on Jan 5, 2010 3:40 PM
‎2010 Jan 05 9:53 AM
Hi,
make sure none of the components declared under the type truxs_t_text_data are of numeric types.
Everything should be character types.
ie C,N, D, T or String.
make the changes as per the requirement.
Hope this helps you.
Regards,
Ranjith Nambiar
‎2010 Jan 05 10:07 AM
paste the itab gt_final_csv declaration
Sorry check the fields in truxs_t_text_data, it must be of type c,string ...
Edited by: Keshav.T on Jan 5, 2010 3:40 PM
‎2010 Jan 05 10:13 AM
split gt_final_csv1 at 'INV' into table gt_strg
you cannot split the contents directly like this.
loop at gt_final_csv1 into wa
then split wa into table
endloop.
Edited by: Keshav.T on Jan 5, 2010 3:46 PM