2005 Nov 11 9:51 PM
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.
2005 Nov 11 10:11 PM
You have make screen-invisible = 1
Cheers,
Satya
2005 Nov 11 9:55 PM
screen-active = 1.
wats ur exact requirement.
If u want to make the fields visble use
screen-visible = '1'.
also use
MODIFY SCREEN
2005 Nov 11 9:57 PM
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.
2005 Nov 11 10:09 PM
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
2005 Nov 11 10:11 PM
2005 Nov 11 10:12 PM
2005 Nov 11 10:18 PM
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
2005 Nov 11 10:20 PM
2005 Nov 11 10:34 PM
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
2005 Nov 11 10:40 PM
2005 Nov 11 11:24 PM
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
2005 Nov 12 2:41 AM
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
2005 Nov 12 2:44 AM
2005 Nov 11 10:44 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |