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 declare a work area

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

I find it better to learn by doing rather than asking. It sticks better.

Rob

0 Kudos

>

>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.

Former Member
0 Kudos

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