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: 

SM 30:Make fields visible/invisible

Former Member
0 Kudos

Hi All,

I am stuck on 2 probems to do with SM30 at the moment.

1:How to make some fields invisible?

2:If 1 particular field is populated how do i make the invisible fields visible again?

Any help appreciated.

Thanks,

Michael

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi All,

I've been able to get part 1 of my problem working....I've done this through adding code in the PBO e.g.

Loop at screen.

If screen = fieldname i want to change.

Screen-invisible = 1.

Screen-active = 0.

modify screen.

endloop.

However i am still stuck on part 2 of my problem:making the field visible again once a certain field is filled by the user.

Mike

13 REPLIES 13

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Please, see the document "Table Maintenance Generator and its Modifications" by Nimisha Agarwal  in the link http://scn.sap.com/docs/DOC-10318

I hope this helps you

Regards

Eduardo

0 Kudos

Hi,

For the first quesry,

* Navigate to the screen of the function group where in you have created your table maintenance.

* In the Display Attributes tab under the Element list tab there is a checkbok marked INVISIBLE, mark it as checked for the field you want it as invisible

For the second query,

In the CHAIN - ENDCHAIN event of the PAI, check if the intended field has a value and make the other field invisible using SCREEN-INVISIBLE = 1 and MODIFY SCREEN statements.

Hope this helps

Former Member

Hi Michael,

To make a field invisible u have to create maintanence view for that table.

First, give the table name & then click on 'View Flds' tab.

This screen will appear..

Look at the 4th column 'P', put 'H' for the field u want to make invisible....

Regards,

Farid.

Former Member
0 Kudos

Hi All,

I've been able to get part 1 of my problem working....I've done this through adding code in the PBO e.g.

Loop at screen.

If screen = fieldname i want to change.

Screen-invisible = 1.

Screen-active = 0.

modify screen.

endloop.

However i am still stuck on part 2 of my problem:making the field visible again once a certain field is filled by the user.

Mike

0 Kudos

Hi,

Check the table maintenance events:

http://wiki.sdn.sap.com/wiki/display/ABAP/TABLE+MAINTENANCE+GENERATOR+and+ITS+EVENTS

Also have you tried to do it ion PAI that should get triggered when you create entries and press enter.

Cheers,

Arindam

0 Kudos

Hi,

    You are right with your first problem. and you have answer for second within you code with just little changes.

on Same PBO.

Loop at screen.

If screen = fieldname i want to change.

If field_value is initial.  "field_value is your certain field is filled by the user.

Screen-invisible = 1.

Screen-active = 0.

else.

Screen-invisible = 0.

Screen-active = 1.

endif.

modify screen.

endif.

endloop.

Former Member
0 Kudos

Hi Micheal ,

     U can make the field visible using the 'events' in table maintenance generator ,there are around 30 events in table maintence ,i hpe one or two is useful for u  ( 'After correcting the contents of a selected field ' ,'After checking whether the data has changed ')..

http://wiki.sdn.sap.com/wiki/display/ABAP/TABLE+MAINTENANCE+GENERATOR+and+ITS+EVENTS

In this link u wil find complete details of events i mentioned .

Do change the field to visible when a event of ur need occurs ..

Regards,

Juneed Manha

Former Member
0 Kudos

Hi,

In module pool, to hide the screen dynamically, go to the screen layout.......if u want to hide a group of fields together, then u can assign a common group name corresponding to the field attribute group.

then go the pai of the screen and write the following code.

loop at screen.

if screen-group1 = ' the group name u assigned in the screen layout'.

screen-invisible = 0.

to make it visible.

screen-visible = 'X'. or try giving screen-visible = 1 or screen-visible = ' '.

if no group name is assigned then

loop at screen.

if screen-name = ' the field name' ( remaining same as above) .

regards Suneesh

Former Member
0 Kudos

hi,

i think you can do this by table maintenance events in the TMG

.

check  this link http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2082425f-416b-2d10-25a3-85b8b6c53...

regards,

kiran

sivaganesh_krishnan
Contributor
0 Kudos

HI michael,

You can use the TMG event , in which you can write the code for making particular field visible again by checking if the target field is inital or not.

You can refer this,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2082425f-416b-2d10-25a3-85b8b6c53...

Regards,

Sivaganesh

Former Member
0 Kudos

Hii Michael,

Use the events

Fill hidden fields


This event gets triggered whenever user hits ‘Enter’ key of the keyboard while creating the new entries through table maintenance.


We can apply various validation checks in this routine. We can also generate the values of certain fields automatically on hitting of ‘Enter’ key.

code like

if not <field_name>  is initial.

    loop at screen.

     screen-active = 1.

    modify screen.

   endloop.

endif.

better u can put some fields in group and then enable or disable through if screen-group1 = 'group_name'

then ur code.

u can also try these with the events create_new_entry.

Regards

Syed

Former Member
0 Kudos

Hi All,

Thanks for the help.

I have solved my problem.

I placed code in the pbo and it worked.

Regards,

Michael

former_member184958
Active Participant

your table maintenance have the lot of events utility->table maintenance. then environment->modification->event. There you can define.

or else in your function group write the code on screen as like a module pool program.

Regards,

John.