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: 

problem in concatenate

Former Member
0 Kudos

Hello Experts,

i am facing one problem that is i have 2 internal tables one is with field lables, 2nd one is with data. i have to get these table data to one single table.

after getting the data i should send it to

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD to display data with filed lables.

for example:

client salesdocument

140 5545

140 5546

code i wrote here

types: BEGIN OF t_it,

mandt type mandt,

vbeln type vbeln_va,

END OF t_it.

data: it type TABLE OF t_it.

types: begin of itt ,

header type string,

end of itt.

data: w_itt type itt,

it1 type table of itt.

types: begin of st_pro,

line type string,

end of st_pro.

data: wa_pro type st_pro,

it_pro type table of st_pro.

type-POOLs: slis.

data: gt_fieldcat type SLIS_T_FIELDCAT_ALV.

data: r_alvtab type ref to cl_salv_table,

r_col TYPE REF TO CL_SALV_COLUMNS_TABLE,

r_cols TYPE SALV_T_COLUMN_REF,

wa_col type SALV_S_COLUMN_REF,

ref_col type ref to CL_SALV_COLUMN,

lv_text type string.

START-OF-SELECTION.

SELECT mandt vbeln INTO TABLE it UP TO 10 rows from vbak.

*select kunnr name1 land1 from kna1 into table itab up to 10 rows.

perform get_header1 using it[] changing it1[].

loop at it1 into w_itt.

loop at it_pro into wa_pro.

concatenate w_it1 into wa_pro saparated by space.

append wa_pro to it_pro.

loop at it into t_it.

concatenate t_it into wa_pro saparated by space

append wa_pro to it_pro.

endloop.

endloop.

endloop.

FORM get_header1 USING p_TAB type any table

changing P_HEADER type any table.

data: begin of lv_tab occurs 0,

line type string,

end of lv_tab.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = r_alvtab

CHANGING

t_table = p_TAB.

CALL METHOD r_alvtab->get_columns

receiving

value = r_col.

CALL METHOD r_col->get

receiving

value = r_cols.

loop at r_cols into wa_col.

ref_col = wa_col-r_column.

CALL METHOD ref_col->get_medium_text

receiving

value = lv_text.

lv_tab-line = lv_text.

append lv_tab.

endloop.

p_HEADER[] = lv_tab[].

ENDFORM. " get_header1

in the above code i am not able to send the data from it1 to it_pro.

so plz any one tell me how to send the data from one table to another table using CONCATENATE statement.

Thankx in advance

Regards

Mahesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can insert Headings into your data table.

Here is an example -

READ TABLE IT_HEADER INDEX 1.

IT_DATA = IT_HEADER.

INSERT IT_DATA INDEX 1.

Here IT_HEADER and IT_DATA should have same structure else you will get an error.

This way you will have headings and data in same table and you can download the same.

ashish

You can also pass headings using HEADER Parameter of the Method.

Message was edited by:

Ashish Gundawar

2 REPLIES 2

Former Member
0 Kudos

You can insert Headings into your data table.

Here is an example -

READ TABLE IT_HEADER INDEX 1.

IT_DATA = IT_HEADER.

INSERT IT_DATA INDEX 1.

Here IT_HEADER and IT_DATA should have same structure else you will get an error.

This way you will have headings and data in same table and you can download the same.

ashish

You can also pass headings using HEADER Parameter of the Method.

Message was edited by:

Ashish Gundawar

0 Kudos

Hello Asish,

i am using only one field in table header, so only way is CONCATENATE statement to get result .

I need to send all header to one NEW table(line type string) using CONCATENATE statement saperated by TAB, after that all the data to same NEW table using CONCATENATE statement saperated by TAB.

if you know how to send as above plz help me

Kind Regards

Mahesh