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: 

fields at dynpro (screens)

juanluis_ragel
Participant
0 Kudos

Hi experts!.

I don't know how I can hide fields in my dynpro 0001. I try this:

PROCESS BEFORE OUTPUT.

...

loop at SCREEN.

if EXTRACT-name = 'ZUSERNAME'.

EXTRACT-visible = 0.

modify screen.

endif.

endloop.

PROCESS AFTER INPUT.

...

But don`t work. System said me:

Syntax error in screen

-


Program SAPLZHB_V

Screen 0001

Position Flow Logic Line 9

SCREEN is not a database table.

In another hand, I want set ZUSERNAME = SY-UNAME but I don't know where.

A lot of thanks in advance.

Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

i think u should not write your code their first make a module and write your code inside that module i think this will solve your problem definetely

17 REPLIES 17

0 Kudos

Hi,

USE

loop at SCREEN.

if SCREEN-name = 'ZUSERNAME'.

SCREEN-active = 0. " to hide 0 to show 1.

modify screen.

endif.

endloop.

Regards,

Sesh

0 Kudos

No work. I said:

SCREEN is not a database table.

regards

Former Member
0 Kudos

U can not loop screen directly in the Flow logic.

Try using this in any existing Modules of PBO or create your own module for this screen and write your code there..

Reward points if helpful.

Regards,

Sathish.V

0 Kudos

I cannot to create a PBO module.

Note: I created View with Table Maintenace Generator

And I try (at Flow logic) :

loop at SCREEN.

if SCREEN-name = 'ZUSERNAME'.

SCREEN-active = 0.

modify screen.

endif.

endloop.

But don`t work. Same problem

regards

0 Kudos

Hi,

In the flow logic write

MODULE init_screen.

Now double click on init_screen to create hte PBO module and say ok in the pop_up that appears.

The put the below in between statements

MODULE init_screen OUTPUT.

loop at SCREEN.

if SCREEN-name = 'ZUSERNAME'.

SCREEN-active = 0.

modify screen.

endif.

endloop.

ENDMODULE.

Regards,

Sesh

0 Kudos

Thanks for your reply Seshatalpasai Madala.

I do your idea but doesn`t work.

And I put a breakpoint into: if SCREEN-name = 'ZUSERNAME' And system stops and do SCREEN-active = 0 but doesn't work, sm30 show column.

Thanks you in advance.

regards

Former Member
0 Kudos

Hi,

U have to use

EXTRACT-active = 0. instead of EXTRACT-visible = 0.

If u use visible = 0,it means the the text field will show as password field where entries are replaced by *****

Message was edited by:

Arjun Puthuruthy

Former Member
0 Kudos

Hi

PROCESS BEFORE OUTPUT.

...
loop at SCREEN.

if SCREEN-name = sy-uname. "see change it will chk directly

screen-active = 0. "see change
modify screen.
endif.
endloop.
PROCESS AFTER INPUT.
...

Jogdand M B

0 Kudos

Sorry Jogdand M B but I don't understand you.

Regards.

0 Kudos

PROCESS BEFORE OUTPUT.

module screen_modify. -> use one module under PBO EVENT,double click on module name.

PROCESS AFTER INPUT.

Write the code as below.

module screen_modify.

loop at SCREEN.

if screen-name = 'ZUSERNAME'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

endmodule

It should work.

Thanks

Seshu

0 Kudos

Thank you for your response but don't work.

I don't know what happend. I try:

MODULE screen_modify.

loop at SCREEN.

if SCREEN-name = 'ZUSERNAME'.

SCREEN-active = 0.

SCREEN-invisible = 1.

modify screen.

endif.

endloop

But don't work

regards

0 Kudos

do not give SCREEN-active = 0.

and use like SCREEN-invisible = 1. -> 1 should be like <b>'1'</b>

Try now it should work.

MODULE screen_modify.

loop at SCREEN.

if SCREEN-name = 'ZUSERNAME'.

SCREEN-invisible = '1'.

modify screen.

endif.

endloop.

Thanks

Seshu

0 Kudos

Don't work.

I use only SCREEN-invisible = 1 and no work.

thank you for your time.

regards

0 Kudos

I guess you are not using this code in right area.

Table maintaice may have 2 screen numbers.

if you use right screen number then it will come,the same code i used many times,it works great.

Check the screen number where you are using and let me know.

other way :

take your Function group which is related to Table maintaince.

Now goto SE80 -> select Function group option -> enter function group name.

now you will see list of objects under Function group.

Select what screen you want -> double click on screen.

now click on change mode -> click on layout .

keep the cursor on your field name -> delete field there .

but i will not suggest this method

Thanks

Seshu

0 Kudos

I'm using this code in right area because when I put a breakpoint in this line:

if SCREEN-name = 'ZUSERNAME'.

And I go to SM30 transaction and put my custom table system stops at line:

if SCREEN-name = 'ZUSERNAME'.

And I can see how change screen table.

In another hand when I change General attributes of element list at my screen (like input output) I can see this modifications at sm30.

regards.

0 Kudos

Yeah I have tested what you written,it is not working .

You can achive this one by using table maitaince event,

Search in forum like table maitaince event in forum ,you get many links.

simple way to do in table maintaince event

1. Go to se11 in the change mode -


>

2. then to the maintanence genarator generator screen

3. then to menu path Environment->modification-->events

4. in this there is an event 21 ( fill hidden fields )

or

there's another way:

sm30 - configuration (icon right on top of the TC) - administrator - checkbox invisible

Thanks

Seshu

Former Member
0 Kudos

Hi,

i think u should not write your code their first make a module and write your code inside that module i think this will solve your problem definetely