Application Development and Automation 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: 
Read only

Spliting Internal table row

Former Member
0 Likes
588

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.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
557

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

3 REPLIES 3
Read only

Former Member
0 Likes
557

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
558

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

Read only

0 Likes
557

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