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

BDC table control using Excel sheet upload

Former Member
0 Likes
647

Hi All,

I am working BDC table control.I want to upload the From excel sheet.I am using the FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the the data into my internal table.The data is populating in the internal table.

Now i have problem tat how to populate this excel sheet data to the Bdc table control.

Can nybody help me out.\[removed by moderator\]

Thanks,

Swapna.

Edited by: Jan Stallkamp on Jul 25, 2008 10:57 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
608

The BDC is for 'KB31N' Transaction

4 REPLIES 4
Read only

Former Member
0 Likes
608

which transaction is the BDC for?

Read only

Former Member
0 Likes
608

after fetching data from EXCEL sheet, each column data (in excel sheet) will be uploaded to individual record into your internal table along with row number and column number, loop through that internal table and collect all your excel data into record format.pls refer the below code.

data:

i_excel type alsmex_tabline occurs 0 with header line,

l_row type i value 1.

data:

begin of x_data occurs 0,

kunnr like RF02L-KUNNR,

klimk(17) type c,

CTLPC like knkk-CTLPC,

end of x_data,

begin of x_data1 occurs 0,

data(106),

end of x_data1.

call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'

exporting

filename = p_fname

i_begin_col = 1

i_begin_row = 1

i_end_col = no.of columns in your excel file

i_end_row = no.of rows in your file

tables

intern = i_excel.

if sy-subrc = 0.

loop at i_excel.

if l_row <> i_excel-row.

append x_data.

clear x_data.

endif.

case i_excel-col.

when 1.

x_data-kunnr = i_excel-value.

when 2.

x_data-klimk = i_excel-value.

when 3.

x_data-CTLPC = i_excel-value.

endcase.

l_row = i_excel-row.

clear i_excel.

at last.

append x_data.

endat.

endloop.

endif.

then loop through the internal table X_DATA, pass the data to your table control like.

tbl_control-field1(1) = x_data-field1.

tbl_control-field2(1) = x_data-field2.

tbl_control-fieldn(1) = x_data-fieldn.

Regards,

Sreeram.

Read only

Former Member
0 Likes
609

The BDC is for 'KB31N' Transaction

Read only

0 Likes
608

Swapna,

as i would suggest you that we not suppose to do BDC with any enjoy transaction and here KB31N is an enjoy tx so please go ahead with KB31.

and for table control am sure if you search in SDN you will get hundred of answer for table control.

Amit.