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

Dynamically hide a screen field based on view cluster variant.

Former Member
0 Likes
1,321

Hello All,

I have a view cluster and two view cluster variant. In the screen I have a table with few columns. For one of the view cluster variants, I want to hide one of the columns of the table. Since both the view cluster variant is linked to the same view cluster that is to the same screen, I am dynamically suppressing the column w.r.t the view cluster variant.

This is the piece of code I have written:

loop at screen.

     if screen-name = 'FSH_SOFN_V-DOCTYPE' and fsh_sofn_v-soobj = 'ST'.

       screen-input = '0'.

       screen-output = '0'.

       screen-invisible = '1'.

       screen-active ='0'.

       modify screen.

      endif.

   ENDLOOP.

This piece of code hides the values of this particular screen field, but it is still shown in the UI. I want to completely remove it from the UI whenever I execute the view variant.

I feel Since I  have not written any code to remove it from the table control of the screen , it is still shown in the Table at UI.

The screens developed here are done from table maintenace generator , so it's all automated. Not getting how to change the table control values.


Could you please provide your inputs.??


I have attached a screenshot where I have highlighted the column to be removed.

1 ACCEPTED SOLUTION
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,024

Hello Rohit.

Check this thread http://scn.sap.com/message/6207918.

Regards.

Hello All,

I have a view cluster and two view cluster variant. In the screen I have a table with few columns. For one of the view cluster variants, I want to hide one of the columns of the table. Since both the view cluster variant is linked to the same view cluster that is to the same screen, I am dynamically suppressing the column w.r.t the view cluster variant.

This is the piece of code I have written:

loop at screen.

     if screen-name = 'FSH_SOFN_V-DOCTYPE' and fsh_sofn_v-soobj = 'ST'.

       screen-input = '0'.

       screen-output = '0'.

       screen-invisible = '1'.

       screen-active ='0'.

       modify screen.

      endif.

   ENDLOOP.

This piece of code hides the values of this particular screen field, but it is still shown in the UI. I want to completely remove it from the UI whenever I execute the view variant.

I feel Since I  have not written any code to remove it from the table control of the screen , it is still shown in the Table at UI.

The screens developed here are done from table maintenace generator , so it's all automated. Not getting how to change the table control values.


Could you please provide your inputs.??


I have attached a screenshot where I have highlighted the column to be removed.

3 REPLIES 3
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,025

Hello Rohit.

Check this thread http://scn.sap.com/message/6207918.

Regards.

Read only

0 Likes
1,024

Hi Arun,

I am trying to implement the above solution. I am facing some issues.

I have used a table maintenance generator. So Depending on the Fields I have choosed, screen is automatically generated with table control : TCTRL_FSH_SOFN_V.

Now, I have to declare a work area to store the values of the above type.

How do i do it??

The highlighted portion gives an syntax error as the table control is not defined.

data: wa_FSH_SOFN_V_cols type LINE OF TCTRL_FSH_SOFN_V-COLS.

loop at TCTRL_FSH_SOFN_V-COLS to wa_FSH_SOFN_V_cols."into .

   if sytabix = 4.

     wa_FSH_SOFN_V_cols-INVISIBLE = 1.

     MODify TCTRL_FSH_SOFN_V-COLS from wa_FSH_SOFN_V_cols.

    endif.

   

    endloop.

Read only

0 Likes
1,024

Rohit,

     Declare using like instead of type.

     data: wa_FSH_SOFN_V_cols LIKE LINE OF TCTRL_FSH_SOFN_V-COLS.