‎2006 Sep 15 2:16 AM
Hello experts,
I am having problems using the hide statement in my code. Here is the error:
HIDE is not allowed for lines of internal tables.
And here is my code:
write results
LOOP AT it_output ASSIGNING <fs_output>.
FORMAT INTENSIFIED OFF COLOR = lv_color.
WRITE: / sy-vline.
FORMAT HOTSPOT ON.
IF <fs_output>-parent IS INITIAL.
WRITE: (17) <fs_output>-asset_subnum CENTERED.
HIDE <fs_output>-asset_subnum.
ELSE.
WRITE: (17) <fs_output>-asset_subnum RIGHT-JUSTIFIED.
HIDE <fs_output>-asset_subnum.
ENDIF.
FORMAT HOTSPOT OFF.
WRITE: (17) <fs_output>-parent_subnum CENTERED,
(30) <fs_output>-funcloc CENTERED,
(40) <fs_output>-description CENTERED.
IF p_equip = 'X'.
FORMAT HOTSPOT ON.
WRITE: (18) <fs_output>-equip_num CENTERED.
HIDE <fs_output>-equip_num.
FORMAT HOTSPOT OFF.
ENDIF.
WRITE: (15) <fs_output>-asset_sub CENTERED,
(40) <fs_output>-location CENTERED,
(15) <fs_output>-accq_cost CENTERED,
(20) <fs_output>-acc_dep CENTERED,
(20) <fs_output>-asset_book_val CENTERED,
sy-vline.
endloop.
As you can see, I am trying to hide the values of <fs_output>-asset_subnum and
<fs_output>-equip_num. Any help on this will be highly appreciated.
P.S. Also, can we split the values of <fs_output>-asset_subnum and put it in 2 variables then
hide those variabales? Thanks a lot guys!
‎2006 Sep 15 2:23 AM
Hi,
Use the INTO structure instead of assigning..
data: s_output like it_output.
LOOP AT it_output into s_output.
.....
...
HIDE s_output-asset_subnum.
ENDLOOP.
Thanks,
Naren
‎2006 Sep 15 2:23 AM
Hi,
Use the INTO structure instead of assigning..
data: s_output like it_output.
LOOP AT it_output into s_output.
.....
...
HIDE s_output-asset_subnum.
ENDLOOP.
Thanks,
Naren
‎2006 Sep 15 2:30 AM
Hi Narendran,
I tried to do what you advised but it is giving me an error saying that "IT_OUTPUT cannot be converted to the line type of WA_OUTPUT3".
I declared wa_output3 as:
data: wa_output3 like it_output.
Thanks again!
‎2006 Sep 15 2:33 AM
Hi,
How you have declared the field-symbols <fs_output>..declare it in the same way..like..
field-symbols <fs_output> type xxxx.
data: s_output type xxx...
OR
data: s_output like line of it_output.
Thanks,
Naren
‎2006 Sep 15 2:38 AM
Hi again,
I tried again doing what you advised butit is giving me an error saying cannot be used for lines of internal tables. Sorry for bothering you. Thanks again!
‎2006 Sep 15 2:39 AM
Hi,
Check this code..This is working fine for me..Use the same method.
data: t_mara type standard table of mara.
data: s_mara type mara.
select * up to 10 rows
from mara
into table t_mara.
loop at t_mara into s_mara.
write: / s_mara-matnr.
hide s_mara-matnr.
endloop.
at line-selection.
write: / s_mara-matnr.
Thanks,
Naren
‎2006 Sep 15 4:54 AM
Hi,
The problem is because yo uare using field symbols.
Hide statements work only on objects which are of flat.
it is clearly mentioned in the F1 help for HIDE
that 'HIDE' cannot be used on field symbols. I hope
this solves your issue.
Regards,
Sandeep