Skip to Content
avatar image
Former Member

pf status- hide self created custom button

i have created one custom pf status.. with some standard buttons and few mine custom..

now i want hide one of custom whose fcode is XYZ depending on some condition on selection screen,, unable to acieve it,,,, seek help !!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 23, 2011 at 01:30 PM

    what i have done is ..

    DATA: lo_functions TYPE REF TO cl_salv_functions,
                lt_func_list TYPE salv_t_ui_func,
                la_func_list LIKE LINE OF lt_func_list,
                found TYPE abap_bool.
    
      lo_functions = lo_alv->get_functions( ).
      lt_func_list = lo_functions->get_functions( ).
      LOOP AT lt_func_list INTO la_func_list.
        IF la_func_list-r_function->get_name( ) = 'XYZ'.
          found = abap_true.
          la_func_list-r_function->set_visible( ' ' ).
          EXIT.
        ENDIF.
      ENDLOOP.

    the loop loops through all the standard functions.. suppose instead of 'XYZ' if i give '&DETAIL'... FOUND variable becomes true..

    but it never finds 'XYZ' so i cant hide it... seems like it only loops through .. standard functions..

    suggest accurate solutions..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Know that this is an old question, but I faced the same issue recently and somehow discovered that newly added functions are not visible via get_functions method call. But if you create a new copy of your pf-status and use it everything will work just fine.

  • avatar image
    Former Member
    Dec 23, 2011 at 01:33 PM

    Hi,

    SET PF-STATUS 'STATUS' excluding FCTcode.

    Based on condition use the set pf_status with the exculding keyword so that the keyword will disable.

    Regards,

    G.Aditya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2011 at 04:32 PM

    Hi,

    As you want to hide the custom buttons on some condition do the same in AT SELECTION SCREEN OUTPUT event

    AT SELECTION-SCREEN OUTPUT.
     
      REFRESH fcode.
     
      IF s_inc IS INITIAL.
        APPEND 'CRTE' TO fcode.
        APPEND 'CHNG' TO fcode.
        APPEND 'DISP' TO fcode.
        APPEND 'PRNI' TO fcode.
        APPEND 'CRTL' TO fcode.
        *SET PF-STATUS 'STATUS_IN' EXCLUDING fcode.* 
      ENDIF.

    Thanks,

    Shailaja Ainala.

    Add comment
    10|10000 characters needed characters exceeded