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: 

how to update Ztable from Excel file and how to check conditions ,

Former Member
0 Kudos

HI this uday,

pls help me how can i update Ztable from Excel file and how to check conditions .

regards

uday

Moderator message: please (re)search yourself before asking.

Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

4 REPLIES 4

anup_deshmukh4
Active Contributor
0 Kudos

ALSM_EXCEL_TO_INTERNAL_TABLE is the Fm to read the excel into a internal table...

loop at the internal table for checking condition

based on condition update the zee table..

Hope it helps..!

Former Member
0 Kudos

Hi

Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.

L_INTERN : internal table with your fields .

make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .

LOOP AT L_INTERN INTO WA_LINTERN .

MOVE WA_LINTERN-COL TO L_INDEX.

ASSIGN COMPONENT L_INDEX OF STRUCTURE WA_INREC TO <FS> .

IF SY-SUBRC = 0.

MOVE WA_LINTERN-VALUE TO <FS>.

ENDIF.

AT END OF ROW . "#EC *

APPEND WA_INREC TO IT_DATA. "

CLEAR WA_INREC.

ENDAT.

ENDLOOP.

Regards

Swapnil

mohammed_moqeeth
Active Participant
0 Kudos

Hi,

You can use function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' to upload data into internal table.

Example:

l_infile = 'c:\mat_data.txt'.

  • Call function module to upload data from excel to internal table

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = l_infile

i_begin_col = 1

i_begin_row = 1

i_end_col = 100

i_end_row = 100

tables

intern = i_tab[]

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3.

Loop this i_tab and filter the data based on conditions and then update ztable.

Regards,

Moqeeth.

former_member536879
Active Contributor
0 Kudos

Hi,

Please search in SCN before Posting. There are lots of threads availble for this . and this is a FAQ.

With Regards,

Sumodh.P