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

msaccess or excel

Former Member
0 Likes
594

hi how can ı to import data into my z** tables from excel and msaccess

please give me an example me?thnks

5 REPLIES 5
Read only

Former Member
0 Likes
575

Hi

u cannot import data into Z** tables. u can only update the Z** tables through programatically or manually create the entries.

To down load data from Z** tables, follow the following steps..

go to Se11

give ur Z** table name

execute to see the contents of the table

Now, go to System->List->Save->Local file. now u can save the file in the formats shown in the popup.

Hope it will help u...

Read only

Former Member
0 Likes
575

Hi

i forgot to tell one thing...if u want to update Z** from excel...u cannot directly do it..but u can load the data into an internal table from excel and then update it into Z** tables...

Read only

Former Member
0 Likes
575

could you pls help me?

Read only

Former Member
0 Likes
575

&----


*& Report ZPROD_BUDGET1

*&

&----


*&

*&

&----


REPORT zprod_budget1.

TABLES: zpr_budget.

DATA: BEGIN OF itab OCCURS 0,

mandt TYPE mandt,

co_code LIKE zpr_budget-co_code,

plant LIKE zpr_budget-plant,

fg_code LIKE zpr_budget-fg_code,

mbom LIKE zpr_budget-mbom,

abom LIKE zpr_budget-abom,

fg_desc LIKE zpr_budget-fg_desc,

ord_qty LIKE zpr_budget-ord_qty,

ord_unit LIKE zpr_budget-ord_unit,

updat LIKE zpr_budget-updat,

month_name LIKE zpr_budget-month_name,

END OF itab.

DATA: it_excel TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.

DATA: date1(13) TYPE c,

date(2) TYPE c,

month(2) TYPE c,

year(4) TYPE c.

PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY,

b_row TYPE i,

e_row TYPE i,

b_col TYPE i,

e_col TYPE i.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = p_file.

START-OF-SELECTION.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_file

i_begin_col = b_col

i_begin_row = b_row

i_end_col = e_col

i_end_row = e_row

TABLES

intern = it_excel

  • EXCEPTIONS

  • INCONSISTENT_PARAMETERS = 1

  • UPLOAD_OLE = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT it_excel.

itab-mandt = sy-mandt.

itab-updat = sy-datum.

CASE it_excel-col.

  • WHEN '0001'.

WHEN '0002'.

itab-co_code = it_excel-value.

WHEN '0003'.

itab-plant = it_excel-value.

WHEN '0004'.

itab-fg_code = it_excel-value.

WHEN '0005'.

itab-mbom = it_excel-value.

WHEN '0006'.

itab-abom = it_excel-value.

WHEN '0007'.

itab-fg_desc = it_excel-value.

WHEN '0008'.

itab-ord_qty = it_excel-value.

WHEN '0009'.

itab-ord_unit = it_excel-value.

WHEN '00011'.

itab-month_name = it_excel-value.

ENDCASE.

AT END OF row.

APPEND itab.

CLEAR: itab.

ENDAT.

CLEAR it_excel.

ENDLOOP.

MODIFY zpr_budget FROM TABLE itab.

IF sy-subrc = 0.

MESSAGE i398(00) WITH 'Data uploaded in table ZPR_BUDGET'.

ELSE.

MESSAGE i398(00) WITH 'Data not uploaded'.

ENDIF.

CALL TRANSACTION 'ZPR_BUDGET_1'.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
575

see the fn module

ALSM_EXCEL_TO_INTERNAL_TABLE