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

set visible/invisible in dialog programing

Former Member
0 Likes
2,203

hi friends,

need your help.

i want to display few fields to the supervisors only if they have employees from perticular org unit & payroll area

initially the fields are set invisible.

actually want to know what is wrong with the following code.....

LOOP AT SCREEN.

IF screen-group1 = '001'.

select * from pa0001 into table i_p0001

for all entries in i_orgunit

where orgeh = i_orgunit-orgeh

and abkrs = 'v9'.

if sy-subrc = 0.

screen-active = 1.

endif.

ENDIF.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,108

You have make screen-invisible = 1

Cheers,

Satya

hi friends,

need your help.

i want to display few fields to the supervisors only if they have employees from perticular org unit & payroll area

initially the fields are set invisible.

actually want to know what is wrong with the following code.....

LOOP AT SCREEN.

IF screen-group1 = '001'.

select * from pa0001 into table i_p0001

for all entries in i_orgunit

where orgeh = i_orgunit-orgeh

and abkrs = 'v9'.

if sy-subrc = 0.

screen-active = 1.

endif.

ENDIF.

ENDLOOP.

13 REPLIES 13
Read only

Former Member
0 Likes
2,108

screen-active = 1.

wats ur exact requirement.

If u want to make the fields visble use

screen-visible = '1'.

also use

MODIFY SCREEN

Read only

0 Likes
2,108
LOOP AT SCREEN.
IF screen-group1 = '001'.
select * from pa0001 into table i_p0001
for all entries in i_orgunit
where orgeh = i_orgunit-orgeh
and abkrs = 'v9'. 
if sy-subrc = 0.
screen-active = 1.
<b>screen-invisible = 0.   "Not sure if you need this
modify screen</b>.
endif.
ENDIF.

Regards,

Rich Heilman

ENDLOOP.

Read only

Former Member
0 Likes
2,108

Which event did you place this code?

I see that you have SCREEN-ACTIVE = 1 in case sy-subrc = 0, but you need to deactivate them by setting SCREEN-ACTIVE = 0 when sy-subrc <> 0. Also don't forget <b><u>MODIFY SCREEN</u></b> statement before the ENDLOOP.

Do you have entries in i_orgunit when you are doing this select? I don't see any field from the screen playing a role in this select. So are you using some selection screen fields to fill I_ORG_UNIT? Make sure that you put IF NOT i_org_unit[] IS INITIAL statement before your SELECT statement because you are doing a FOR ALL ENTRIES IN.

Srinivas

Read only

Former Member
0 Likes
2,109

You have make screen-invisible = 1

Cheers,

Satya

Read only

0 Likes
2,108

Srinivas, Nekenti, in his original post he mentions...

<i>

initially the fields are set invisible.

</i>

Regards,

Rich Heilman

Read only

0 Likes
2,108

True Rich, but as the user plays on the selection screen changing values, there may be a need to reset them back to invisible. Don't you think so?

Srinivas

Read only

0 Likes
2,108

Sure, i don't have enough info about his requirement to cover all the bases.

Regards,

Rich Heilman

Read only

0 Likes
2,108

hi friends,

thanks for the reply

actually user is not playing with selection screen.

the logic is in pbo

i am getting usr from sy-uname then from that getting postion & based on that i have to check if he has employees from that perticular payroll area.

i have added modify screen but still not giving the output

regards

ankit

Read only

0 Likes
2,108

Is this value case sensitive?

and abkrs = <b>'v9'</b>.

Maybe try 'V9'?

Yep, just checked it in my system, try using "V9" instead of "v9". Let us know. Thanks.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Read only

0 Likes
2,108

In debugging, can you tell me if your select statement is working or not? Is this the first screen? Where did you fill the internal table?

Srinivas

Read only

0 Likes
2,108

hi friends,

thanks for your help.

the problem is solved.

actually i didnt place 'modify screen' at place

special thanks to rich & srini.

best regards

ankit

Read only

0 Likes
2,108

Cool. Please make sure to mark your post as solved. Thanks.

So the value needed to be "<b>V</b>9"?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
2,108

I don't think this answers the question you're asking, but it may help.

PA0001 can be quite large. Do you really want to

select * from pa0001 into table i_p0001
for all entries in i_orgunit
where orgeh = i_orgunit-orgeh
and abkrs = 'v9'. 

Particularly for each line in your screen? This could take quite a while. I think you could find a more efficient way of doing this (probably in PAI).

Of course, the screen still has to be modified in PBO.

Rob

Message was edited by: Rob Burbank