12-01-2008 8:32 PM
Hi all,
I want to declare a work area and then wanto move everything from my ztable to that work area ...so can you please tell me how can I do that....
my table name is ztable...
Thanks.
Rajeev
Please Search the Forum before posting and follow Rules of engagement.
Edited by: Vijay Babu Dudla on Dec 1, 2008 11:40 PM
12-01-2008 8:35 PM
Hi Rajeev
You have to declare an internal table and then you can declare a owrk area of that internal table.
Data:itab type table of Ztable.
Work area will be :
Data:wa_itab like line of itab.
Regards
Neha
12-01-2008 9:00 PM
Hi Neha,
thanks....well then if I need to move the records from z table to the work area ....what would be the statement....
Select * from ztable into wa_test????
because I tried it doing like this...
Data:itab type standard table of Ztable.
select * from ztable into table itab.
if zdel = c_right.
delete ztable from itab.
commit work.
else.
delete ztable from itab where RYEAR >= S_RYEARS-LOW.
commit work.
endif.
and it give me this error:
You cannot use an internal table as a work area.
so can you please tell me how can I get rid of this.
Thanks,
Rajeev
Edited by: Rajeev Gupta on Dec 1, 2008 10:00 PM
12-01-2008 10:13 PM
What you are missing is the the keyword "table". The complete statement should be:
Delete ztable from table itab.
You can look up the syntax of any keyword by placing cursor over the keywork, in this case DELETE, then press F1.
To make your code compatible with later version like ECC 6.0, you should always declare an internal table and a work area for it, and try to avoid using OCCURS, and LIKE.
data: itab type standard table of ztable,
wa_itab type ztable.
12-01-2008 10:20 PM
Thanks for your reply....I tried doing this and now it's giving me ethis message
"." expected after "itab"
DELETE ztable from table itab WHERE RYEAR >= S_RYEARS-LOW.
COMMIT WORK.
ENDIF.
12-01-2008 10:34 PM
Rajeev - you keep asking one question and then try to do something different. If you had just pressed F1 on DELETE, you would have your answer by now.
Rob
12-01-2008 10:35 PM
Thanks ROB....I will do that!!! Sorry for the inconvinence !!! Actually I get nervous very quickly as I am still new to ABAP and still very much into the learning process.
Thanks.,
Rajeev
12-01-2008 10:39 PM
I find it better to learn by doing rather than asking. It sticks better.
Rob
12-01-2008 11:06 PM
>
>Actually I get nervous very quickly as I am still new to ABAP and still very much into the learning process.
Don't get nervous,Just Hold your Nerves and keep learning by self.
Everyone were new at their time.
12-02-2008 2:02 AM
Hi,
Don't be nervous. If you have doubt, you can first search from the forum and if you don't find any helpful answers, you just ask the question. I think many people are willing to answer you.
From your words, can I ask your some questions?
First: is c_right the parameter on the screen?
Second: is S_RYEARS the select-option on the screen?
Third: Do you want to delete some records from table ztable according to the condition?
Please feel free to answer it and maybe I can give you some hints.
Thanks and Regards,
Chris Gu