‎2010 Dec 31 4:50 AM
Hi Experts,
I have declared a table with workarea. Whenever i do a 'select single' statement, that workarea gets filled. But, i want to avoid this for one scenario. so, when i use 'select single * from <table> into <wa>', will it fill the external work area and will it not disturb the internal workarea of that table ? as, i require to compare the old and new value of same table in a module pool programming.
Thanks,
Gaurav.
‎2010 Dec 31 6:51 AM
Hi Gaurav,
Assume u have an internal table and a separate work area.
data: it_outtab type table of mara with header line,
wa_outtab type mara. assume the workarea of it_outtab already has some data you require.
If you use the below code, the table's workarea will be filled with new values.
select single * from mara into it_outtab.If you use the below code, the table's workarea will contain the old values and new values will be placed in wa_outtab..
select single * from mara into wa_outtab.Regards,
Jovito.
‎2010 Dec 31 4:57 AM
Hi,
The entries will not be disturbed until you clear them or move some other values into the work area.
Regards,
Srini.
‎2010 Dec 31 6:51 AM
Hi Gaurav,
Assume u have an internal table and a separate work area.
data: it_outtab type table of mara with header line,
wa_outtab type mara. assume the workarea of it_outtab already has some data you require.
If you use the below code, the table's workarea will be filled with new values.
select single * from mara into it_outtab.If you use the below code, the table's workarea will contain the old values and new values will be placed in wa_outtab..
select single * from mara into wa_outtab.Regards,
Jovito.
‎2010 Dec 31 8:02 AM
By table with workarea, do you mean a table with a header line? Because tables with headerlines are obsolete, ambiguous and should no longer be used (Exception - some older parts of SAP require them). So you should define your work area seperately, and have an internal table without a header line. Then you won't have confusion over whether the reference is to a table or the workarea.
If your table doesn't have a header line then your question makes no sense to me.
matt