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

Table Maintenace dialog modification

Former Member
0 Likes
1,073

Hi Gurus,

I have a small problem wit a maintenace table. I have genereated a maintenace dialog for a customizing table. Now i'd like to hide one column. But I'm not able to do this.I went to my generated dynpro and inserted a module with following code:

Loop at screen.

if screen-name = 'Tab-Field1'.

screen-invisible = '1'.

screen-active = 0.

modify screen.

endif.

endloop.

The column is no read only - but I still see the column. I there any possibility to do this with coding. I don't like to delete the columns in the element list.

Thanks for your help in advance Stefan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,048

Hi,

Try giving the following inside the LOOP AT...ENDLOOP...of the flow logic in the PBO event..

Flow logic.

PROCESS BEFORE OUTPUT.

 LOOP AT EXTRACT
 ...............
   MODULE REMOVE.   " Custom code.
 ENDLOOP.

    • Module*

MODULE remove OUTPUT.
Loop at screen.
if screen-name = 'Tab-Field1'.
screen-invisible = '1'.
screen-active = 0.
modify screen.
endif.
endloop.
ENDMODULE.

Thanks

Naren

8 REPLIES 8
Read only

Former Member
0 Likes
1,048

Hi,

if you always want the column to be invisible...Instead of writing code..change the attributes of the column to be invisible..and then activate the screen.

Thanks

Naren

Read only

Former Member
0 Likes
1,048

HI,

Loop at screen.
if screen-name = 'TAB-FIELD1'. " the field name should be in caps
screen-active = 0.
modify screen.
endif.
endloop.

or use

parameter: p_field(20) type c invisible.

regards

gurpreet

Read only

former_member194669
Active Contributor
0 Likes
1,048

if somebody regenerate the table maintenance generator functiongroup again , then you will loose all your flow logic coding

Instead of coding the table maintenace screen flow logic , create a maintenance view for the customising table and create a table maintenance generator for that view.

PS : remember while creating the maintenance view please kept only fields you want to display in the table maintenance generator..

a®

Read only

0 Likes
1,048

Hi thanks for the answers,

1. I can't make it invisible via checkbox, because the checkboxes in the element list are greyed out.

2. Sorry, in my codeexample I don't write it in captials, but in my "real program" i do.

3. I understand you, but with a view I have the same problem - because I have to fill the hidden column before saving to the db.

Any other ideas??

Thanks Stefan

Read only

0 Likes
1,048

For filling hidden column in the table maintenance while saving you may need to use EVENT in table maintenance generator

Please look at this link

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-87652872...

a®

Read only

Former Member
0 Likes
1,049

Hi,

Try giving the following inside the LOOP AT...ENDLOOP...of the flow logic in the PBO event..

Flow logic.

PROCESS BEFORE OUTPUT.

 LOOP AT EXTRACT
 ...............
   MODULE REMOVE.   " Custom code.
 ENDLOOP.

    • Module*

MODULE remove OUTPUT.
Loop at screen.
if screen-name = 'Tab-Field1'.
screen-invisible = '1'.
screen-active = 0.
modify screen.
endif.
endloop.
ENDMODULE.

Thanks

Naren

Read only

0 Likes
1,048

Hi,

thank you for the fast answers, but it doesn't work. I can still see the column.

Sorry, but any other ideas - i have no one.

Stefan

Read only

Former Member
0 Likes
1,048

Hi,

Try this code...I tried it and it is working for me..

PROCESS BEFORE OUTPUT.
 
** New code.   " Naren.
   
  MODULE remove_column.

** New code end.   " Naren.
 MODULE LISTE_INITIALISIEREN.
 LOOP AT EXTRACT WITH CONTROL
  TCTRL_xxxxxxx CURSOR NEXTLINE.   " TCTRL_xxxxxxx  - table control name check your Flow logic
   MODULE LISTE_SHOW_LISTE.
 ENDLOOP.

* Module code

 MODULE remove_column OUTPUT.

* You can get the table control name from the flow logic.
  DATA: wa_cols LIKE LINE OF TCTRL_XXXXXXX-COLS. 

  READ TABLE TCTRL_XXXXXXX-COLS 
                        INTO WA_COLS
                       WITH KEY SCREEN-NAME = 'Your column name'.

  IF SY-SUBRC = 0.
    WA_COLS-INVISIBLE = 'X'   . " Remove the column.
    MODIFY TCTRL_XXXXXXX-COLS FROM WA_COLS INDEX SY-TABIX.
  ENDIF.

 ENDMODULE..

Thanks

Naren