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

internal table

Former Member
0 Likes
542

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>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
516

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

5 REPLIES 5
Read only

Former Member
0 Likes
517

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

Read only

Former Member
0 Likes
516

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

Read only

Former Member
0 Likes
516

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.

Read only

Former Member
0 Likes
516

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

Read only

Former Member
0 Likes
516

Hi all

i found what is the mistake i have found.thanks for all