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: 

Pf status

Former Member
0 Kudos

Hello everyone,

Below is a scenario

screen 1000

PBO

(where i need to Set PF-Status (LINK_TELNO) and modify functions. The functions available i.e. the buttons available will depend type of user and the order line item status VBAP-ZZAD_LINE_STATUS. The user types are telesales and customer op. The new authorisation object ZZCUSTTYPE will have either the value ‘TELESALES’ or ‘CUSTOPS’. This will be added into the profiles of the roles.)

i have already created authorisation object and assigned fields and users to them.

But when a user with a telesales profile 'logsin' all the functions(buttons) should be present on the screen 1000.

for another condition when a telesales user 'logsin' only few buttons should present on the screen 1000 like cancel and exec.

could some one provide me with a code.

Many Thanks

Kesi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

Yes the buttons are embedded in the screen. Rich can you eloberate little bit in the code you have provided.

'LOOP AT SCREEN.

IF SCREEN-NAME = 'BUTTON1'.

screen-invisible = '1'.

modify screen.endif.

ENDLOOP.

as i could not g'rasp theconcept behind it. IF you can provide the code for the conditon i eplained that will be great.

Regards

Kesi

14 REPLIES 14

Former Member
0 Kudos

Hi kesi,

1. One Single PF-STATUS won't do.

2. We need to create TWO Different PF Status.

3. Then based on conditions, we can set.

IF Condition1.

SET PF-STATUS 'TELESALES'

ELSE.

SET PF-STATUS 'CUSTOPS'

ENDIF.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos

Hi kesi,

i feel no need of two pf-status.

IF somecondition.
**don't assign any thing to pftab
SET PF-STATUS 'TELESALES' excluding pftab.
ELSE.
**assign the fcodes tp pftab which you don't want to show.
SET PF-STATUS 'TELESALES' excluding pftab.
ENDIF.

thanks

vijay

Former Member
0 Kudos

Hi Rahul,

Use this statement:

DATA: it_ucomm TYPE STANDARD TABLE OF sy-ucomm.

DATA l_ucomm TYPE sy-ucomm.

IF condition1 EQ true. "where you need all buttons

SET PF-STATUS <PF Status name>.

ELSEIF condition2 EQ true. "Where you need only 4

" buttons out of 6

Say the two which you dont need to have func codes 'ABC' and 'DEF'.

l_ucomm = 'ABC'.

APPEND l_ucomm TO it_ucomm.

l_ucomm = 'DEF'.

APPEND l_ucomm TO it_ucomm.

SET PF-STATUS <pf status name> EXCLUDING it_ucomm[].

ENDIF.

Regards,

Srikanth

Former Member
0 Kudos

Hello everyone,

The pf-status is l_no (PBO of the screen)

Now i have 4 conditions on which the pf-status depending on condiion have to be displayed.

For exemple:

condition 1: all the buttons on the screen are to be enabled.

condition 2: only 3 butons have to be enabled others disabled.

condition 3: only 2 buttons have to be enabled others disabled.

etc...

Now how to code the logic.

Regards

Kesi

0 Kudos

Just use what Srikanth has suggested.




data: it_ucomm type standard table of sy-ucomm.
data: l_ucomm  type sy-ucomm.

* Say you have 4 buttons.....
* Function codes are ABC, DEF, GHI, JKL


if condition1 eq true.        "where you need all 4 buttons "
  set pf-status <pf status name>.
elseif condition2 eq true.   " Only want 3 buttons "
  l_ucomm = 'JKL'.
  append l_ucomm to it_ucomm.
  set pf-status <pf status name> excluding it_ucomm[].
elseif condition3 eq true.   " Only want 2 buttons "
  l_ucomm = 'JKL'.
  append l_ucomm to it_ucomm.
  l_ucomm = 'GHI'.
  append l_ucomm to it_ucomm.
  set pf-status <pf status name> excluding it_ucomm[].
<b>elseif condition4 eq true.   " Only want 1 button "
  l_ucomm = 'JKL'.
  append l_ucomm to it_ucomm.
  l_ucomm = 'GHI'.
  append l_ucomm to it_ucomm.
  l_ucomm = 'DEF'.
  append l_ucomm to it_ucomm.
  set pf-status <pf status name> excluding it_ucomm[].</b>
endif.

And so on......

Regards,

Rich Heilman

0 Kudos

Hello Rich,

The code u have provided is good but works if iam selecting the buttons on the screen. But as this is a sub screen (dispalyed as pop window), it has to be displayed (PBO) with 4 or 3 or 2 buttons depending on the conditons (2). it is like...

module PBO

AUTHORITY-CHECK OBJECT ‘zxyz’

ID ‘zabc’ FIELD 'kill'.

sy-subrc = 0.

if conditon 1.

pop-window(all functions) displayed has 4 buttons.

elseif

conditon 2.

pop-up window is display only and has 2 buttons are available

endif.

endif.

AUTHORITY-CHECK OBJECT ‘zxyz’

ID ‘zbc’ FIELD 'bill'.

if conditon 1. (same as above)

pop up window all functions and all buttons

elseif

conditon 2.

pop-up window is display only & has 3 buttons.

endif.

endif.

Regards

Kesi

0 Kudos

Oh, so the buttons are embedded in a screen, not in the gui-status or application toolbar? If this is the case, you will have to handle it a different way. You will want to do a LOOP at SCREEN in your PBO of the screen.

LOOP AT SCREEN.
IF SCREEN-NAME = 'BUTTON1'.
screen-invisible = '1'.
modify screen.
endif.
ENDLOOP.

Regards,

Rich Heilman

Former Member
0 Kudos

Is this a report program? If so, put your logic in the AT SELETION-SCREEN OUTPUT event.

Former Member
0 Kudos

Hello,

This is not report program. We have placed a new button on SAPMV45A (item over view screen). When this button is pushed, the next screen is a pop up with the buttons i explained. But the pop screen will be displayed on certain conditons. Buttons on the screen( enabled/disabled) will be depend on the conditions.

Regards

Kesi

0 Kudos

Then you need to put the previous code in the PBO of the pop up screen. Is this not working for you?

Also, screen 1000 is usually reserved for selection screens, you should use something other than 1000 for regular dynpro screens.

Regards,

Rich Heilman

0 Kudos

Screen number 1000 is what confused me too Rich.

Kesi, if you are calling a pop-up screen, can you tell us how you are calling the pop-up? Is that a standard pop-up function module or your own program and screen? Or is it part of the user exit within SAPMV45A(I don't see how, if the screen number is 1000)?

Srinivas

0 Kudos

Hello,

A screen is created (se51) which includes those buttons and a table control. The code to call this screen is from a user-exit.

regards

kesi

Former Member
0 Kudos

Hello,

Yes the buttons are embedded in the screen. Rich can you eloberate little bit in the code you have provided.

'LOOP AT SCREEN.

IF SCREEN-NAME = 'BUTTON1'.

screen-invisible = '1'.

modify screen.endif.

ENDLOOP.

as i could not g'rasp theconcept behind it. IF you can provide the code for the conditon i eplained that will be great.

Regards

Kesi

0 Kudos

This is what Rich meant.


AUTHORITY-CHECK OBJECT ‘zxyz’ 
                    ID ‘zabc’ 
                 FIELD 'kill'. 
IF sy-subrc = 0.
  IF conditon 1.
    LOOP AT SCREEN.
       screen-active = 0.
       MODIFY screen.
    ENDLOOP.
  ELSEIF conditon 2.
    LOOP AT SCREEN.
     IF SCREEN-NAME = 'BUTTON1' OR <-- hide this button
        SCREEN-NAME = 'BUTTON2'.   <-- hide this button
       SCRREN-ACTIVE = '0'.
       MODIFY screen.
     ELSE.
       SCREEN-INPUT = 0.           <-- make all others display only
       MODIFY SCREEN.
     ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.

AUTHORITY-CHECK OBJECT ‘zxyz’ 
                    ID ‘zbc’ 
                 FIELD 'bill'. 
IF sy-subrc = 0.
  IF conditon 1.
    LOOP AT SCREEN.
       screen-active = 0.
       MODIFY screen.
    ENDLOOP.
  ELSEIF conditon 2.
    LOOP AT SCREEN.
     IF SCREEN-NAME = 'BUTTON1'.   <-- hide this button
       SCRREN-ACTIVE = '0'.
       MODIFY screen.
     ELSE.
       SCREEN-INPUT = 0.           <-- make all others display only
       MODIFY SCREEN.
     ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.