06-27-2007 5:50 PM
Hi all,
I have an ztable with plant,material ,year and period.date ,time and user.
I also have an excel file which has values for the fields plant,material,period and year.I am populating the Ztable with data by uploading the data from excel file with the use of an intenal table.
The excel file has inputs for plant,material,period and year..But i also want to populate the other fields in ztable like data ,time and user.
<b>Can anyone help me on how to load the data for user,date and time into ztable
since these data are not in the excel file????how will i handle it internally???</b>
06-27-2007 5:52 PM
It depends on what tha date time and user means.
if that date , time and user mean the creation date, creation time and created by ,
then you can populate the internal table (After upload step) with
SY-DATUM, SY-UZEIT and SY-UNAME.
loop at itab.
itab-date = sy-datum.
itab-time = sy-uzeit.
itab-user = sy-uname.
modify itab index sy-tabix.
endloop.
Regards,
Ravi
06-27-2007 5:52 PM
It depends on what tha date time and user means.
if that date , time and user mean the creation date, creation time and created by ,
then you can populate the internal table (After upload step) with
SY-DATUM, SY-UZEIT and SY-UNAME.
loop at itab.
itab-date = sy-datum.
itab-time = sy-uzeit.
itab-user = sy-uname.
modify itab index sy-tabix.
endloop.
Regards,
Ravi
06-27-2007 5:54 PM
Hello,
First declare itab like the file and upload data from the excel file.
Then declare itab1 like ztable.
loop at itab.
move-corresponding itab to itab1.
itab1-user = sy-uname.
itab1-date = sy-datum.
itab1-time = sy-uzeit.
append itab1.
endloop.
if not itab1[] is initial.
modify ztable from itab1.
endif.
Vasanth
06-27-2007 5:55 PM
You can only "load" what is inside the excel file...What you can is, after you upload the data....
DATA: W_TABIX TYPE SY-TABIX.
FIELD-SYMBOLS: <DATA> LIKE LINE OF T_DATA_EXCEL.
LOOP AT T_DATA_EXCEL ASSIGNING <DATA>.
W_TABIX = SY-TABIX.
<DATA>-DATE = SY-DATUM.
<DATA>-TIME = SY-UZEIT.
<DATA>-USER = SY-UNAME.
MODIFY T_DATA_EXCEL FROM <DATA> INDEX W_TABIX.
ENDLOOP.
Greetings,
Blag.
06-27-2007 6:17 PM
Hi
I think there is an error in ur internal table declaration..
Declare ur internal table like below.
Data: begin of itab,
werks type ztable-werks,
matnr type mara-matnr,
period type syst-uzeit,
date type syst-datum,
user type syst-uname,
end of itab.
then try to populate values from excel to internal table.
And use Update statement to update ur ztable.
If not sloved please send ur code..
Regards
Ravi
07-02-2007 1:27 PM