9 Replies Latest reply: Jun 23, 2014 9:15 AM by Kiran K RSS

How can we lock and then unlock a Variant ?

Rama Pammi
Currently Being Moderated

Hi friends,

I have a Report Program with selection screen.

I have created a variant for that.

<b>How can we lock and then unlock that Variant ?</b>

 

Regds,

Rama.Pammi

  • Re: How can we lock and then unlock a Variant ?
    Shailesh V S
    Currently Being Moderated

    While saving the variant, there is a checkbox called

    "Protect Variant".

     

    This allows only the creator to change a variant.

     

    Hope this helps you

  • Re: How can we lock and then unlock a Variant ?
    deepu k
    Currently Being Moderated

    Hello,

     

          In the Variants screen check the checkbox Protect Variant.

     

    Protect variant

    If you select this option, the variant can only be changed by the

    person who created it or the last person to change it. If you start

    a program using a protected variant, none of the fields on the

    selection screen accept user input.

     

    Regards,

    Deepu.K

    • Re: How can we lock and then unlock a Variant ?
      Currently Being Moderated

      Hello

       

      How do you take the Protect Variant off.

       

      We have created transportable variants using variant prefix CUS& and it automatically selects the protect variant checkbox.  You cannot deselect it and so only the user can change this variant.

       

      I have tried Program RSVARENT which is supposed to cancel variant protection but this did not work.

       

      Is it because the variant was for an SAP query report?

       

      Really appreciate any help

       

      cheers

      Louisa

      • Re: How can we lock and then unlock a Variant ?
        Partha Sarathi
        Currently Being Moderated

        Problem:

        How do you take the Protect Variant off.

        We have created transportable variants using variant prefix CUS& and it automatically selects the protect variant checkbox.  You cannot deselect it and so only the user can change this variant.

        I have tried Program RSVARENT which is supposed to cancel variant protection but this did not work.

         

         

        Protect variant:

        If you select this option, the variant can only be changed by the

        person who created it or the last person to change it. If you start

        a program using a protected variant, none of the fields on the

        selection screen accept user input.

         

         

        Solution:

        *&---------------------------------------------------------------------*
        *& Report  ZCV_RSVARENT
        *&
        *&---------------------------------------------------------------------*
        *&
        *&
        *&---------------------------------------------------------------------*

        REPORT  zrsvarent_partha.


        TABLES: varid,rsvar.

        DATA: i_varid TYPE STANDARD TABLE OF varid WITH HEADER LINE.

        SELECT-OPTIONS: s_report FOR rsvar-report,
        s_vari   FOR rsvar-variant.
        PARAMETERS: p_mandt  LIKE sy-mandt OBLIGATORY DEFAULT '000'.

        START-OF-SELECTION.

        SELECT * INTO TABLE i_varid
        FROM varid CLIENT SPECIFIED
        WHERE mandt     p_mandt
        AND report    IN s_report
        AND variant   IN s_vari
        AND protected NE space .

        IF sy-subrc = 0.
        LOOP AT i_varid.
        CLEAR i_varid-protected.
        IF NOT  i_varid-variant(4) EQ 'SAP&'
        AND NOT i_varid-variant(4) EQ 'CUS&'.
        MOVE 'F' TO i_varid-transport.
        ENDIF.
        MODIFY i_varid.
        ENDLOOP.
        MODIFY varid CLIENT SPECIFIED FROM TABLE i_varid .
        WRITE:/ 'SY-SUBRC = ' , sy-subrc.
        WRITE:/ 'No. of records updated = ' , sy-dbcnt.
        COMMIT WORK.
        ELSE.
        WRITE:/ 'No records found for the selection criteria.'.
        ENDIF.

         

         

         

        Inputs:

        S_REPORT – Report/Program name.

        S_VARI – Variant.

        P_MANDT – NO CHANGE (Let it be as ‘000’).

         

        Your variant will be unprotected.

         

         

         

        Regards,

        Partha S Goswami

  • Re: How can we lock and then unlock a Variant ?
    Kiran K
    Currently Being Moderated

    Rama,

     

    Any reason why you created the variants as CUS& ? We can create the varinat as Z.... and still can transport it using RSTRANSP.

     

    K.Kiran.

Actions