Can any body tell me how to create a layout variant in the selection

hi friends i would like to know how to create a layout variant in the selection screen and how to select the variant to display the ouptut using the layout using disvariant.please if possible give me example. thanks in advance.

hi,
I shall give you the code. It will definitely work.
<u><b>Declerations you need to make</b></u>
data:      WK_VARIANT      LIKE DISVARIANT,
           WX_VARIANT      LIKE DISVARIANT,
           WK_REPID        LIKE SY-REPID,
           WK_VARIANT_SAVE(1) TYPE C,
           WK_EXIT(1) TYPE C.
<b><u>Things you need to do in the initialization event:</u></b>
INITIALIZATION.
  PERFORM F_INIT_VARIANT.
  PERFORM F_VARIANT_DEFAULT USING PR_VARI.
*&      Form  f_init_variant
FORM F_INIT_VARIANT .
  CLEAR WK_VARIANT.
  WK_REPID = SY-REPID.
  WK_VARIANT-REPORT = WK_REPID.
  WK_VARIANT-USERNAME = SY-UNAME.
  WK_VARIANT_SAVE = 'A'.
ENDFORM.                    " f_init_variant
*&      Form  f_variant_default
FORM F_VARIANT_DEFAULT  USING    P_PR_VARI.
  WX_VARIANT = WK_VARIANT.
  IF NOT P_PR_VARI IS INITIAL.
    WX_VARIANT-VARIANT = P_PR_VARI.
  ENDIF.
  CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'
    EXPORTING
      I_SAVE        = WK_VARIANT_SAVE
    CHANGING
      CS_VARIANT    = WX_VARIANT
    EXCEPTIONS
      WRONG_INPUT   = 1
      NOT_FOUND     = 2
      PROGRAM_ERROR = 3
      OTHERS        = 4.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  CASE SY-SUBRC.
    WHEN 0.
      P_PR_VARI = WX_VARIANT-VARIANT.
    WHEN 2.
      CLEAR P_PR_VARI.
  ENDCASE.
ENDFORM.                    " f_variant_default
<b><u> After this Things you need to do in the At selection screen event:</u></b>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_VARI.
  PERFORM F_VARIANT_F4 USING PR_VARI.
*&      Form  f_variant_f4
FORM F_VARIANT_F4  USING    P_PR_VARI.
  CALL FUNCTION 'LVC_VARIANT_F4'
    EXPORTING
      IS_VARIANT    = WK_VARIANT
      I_SAVE        = WK_VARIANT_SAVE
    IMPORTING
      E_EXIT        = WK_EXIT
      ES_VARIANT    = WX_VARIANT
    EXCEPTIONS
      NOT_FOUND     = 1
      PROGRAM_ERROR = 2
      OTHERS        = 3.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  IF WK_EXIT IS INITIAL.
    WK_VARIANT-VARIANT = WX_VARIANT-VARIANT.
    P_PR_VARI = WX_VARIANT-VARIANT.
  ENDIF.
ENDFORM.                    " f_variant_f4
After this finally when you call the output using REUSE_ALV_GRID_DISPLAY YOU NEED TO mention this parameter in the function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      <i><u><b>IS_LAYOUT          = WA_LAYOUT</b></u></i>
      <i><u><b>I_SAVE             = 'X'</b></u></i>
      <u><i>I_DEFAULT          = 'X'</i></u>
      <u><b>IS_VARIANT         = WK_VARIANT</b></u>
    TABLES
      T_OUTTAB           = ITAB1
    EXCEPTIONS
      PROGRAM_ERROR      = 1
      OTHERS             = 2.
Once you do this,,, you can create a layout variant.
P.S. Mark all helpful answers for points.
JLN

Similar Messages

  • Can any body tell me how to make changes in the print layout of Fb03.

    hi,
    Can any body tell me how to make changes in the print layout of Fb03.
    I want to add comapny address on the layout.
    Regards
    Mave

    If you mean the correspondence, you have to change the configuration in Financial Accounting -> AR and AP -> Business Transactions -> Outgoing Invoices -> Carry Out abd Check Settings for Correspondence. There, you need to assign your custom Program or Layout for the Correspondence Type (like SAP19) and Program.
    If you mean the display layout in transaction FB03, You can change a few settings, mainly with BKPF and BSEG fields. I don't think you can add company address, though.
    Good luck,
    Bhanu

  • Can any 1 tell me how to create budget journal and how to enter journal ?

    hi all+
    Can any one tell me how to create budget journal and how to enter journal against that budget ?+
    Regards+
    Yasir+

    http://download.oracle.com/docs/cd/A60725_05/html/comnls/us/gl/budjrnl.htm#index-Budget-journals-Entering--0
    Enter budget journals to maintain an audit trail for your budget balances. You can use budget rules to calculate budget journal amounts automatically.
    When you post budget journals, the journal amounts update existing budget balances. You can review and change your budget journals before posting them.
    Attention: When you use budget rules in Journal Mode, General Ledger calculates the appropriate debit or credit needed to achieve the balance you enter for the account type.
    Prerequisites
    1. Define a budget
    2.Open one or more years for your budget
    3.Define a budget organization
    4. Assign the "Entered" budget entry type to the accounts for which you want to enter budget journals
    To enter budget journals for a single account:
    1. Navigate to the Enter Budget Journals window.
    2. Specify the Budget Organization for the account to which you want to budget. If the budget organization is password-protected, you must enter the password before you can enter budget journals.
    3. Enter the Budget you want to update. You cannot use a budget that is frozen.
    4. Enter the range of Accounting Periods to which you want to budget.
    5. Enter the Currency of the budget amounts you are entering. The accounts must be assigned to the budget organization for this currency.
    6. Choose Journal Mode from the region poplist to enter budget amounts in a journal format.
    You can also use Single Row Mode or Worksheet Mode to enter budget journal amounts. However, you can only generate budget journals from these entry modes when you use the Enter Budget Journals window.
    Additional Information: When you use Journal Mode, Balance Type is a display-only field. It displays Budget when you are entering budget journals. In the Enter Journals window, this field displays Actual when you are entering actual journals.
    7. Enter or query the Account to which you want to budget. You can also switch to Worksheet Mode to easily query accounts, then return to Journal Mode to enter budget journals.
    8. Enter a Debit or Credit amount for each period. Do not enter journal amounts if you want to use budget rules to calculate and distribute budget amounts.
    9. Choose Create Journals to create a budget journal batch. If you are using budgetary control, you specify a funds action when you create the batch.

  • Hi, i want to control my vi from multiple systems using ethernet options can any body tell me how to do that? thans in advance

    hi, i want to control my vi from multiple systems using ethernet options can any body tell me how to do that?  thans in advance

    There are multiple ways of doing this. Here are some of them..
    The Web Publishing tool allows you to publish the front panel and you can control the front panel remotely.http://www.ni.com/white-paper/2911/en/
    The TCP/IP socket can allow you to pass codes "strings" to another computer. Lookup the server client example.
    regards,
    Gautham

  • Can any body tell me how many records can a db hold in a minute

    can any body tell me how many records can a db hold in a minute

    user644700 wrote:
    can any body tell me how many records can a db hold in a minuteI would hope not since it will depend on X number of factors where X is a very large number.
    Did you have anything specific in mind (version, hardware, etc...)? I assume you mean load and not hold?

  • Can any body tell me, how to send/receive the sms from java application

    Hi All,
    Can any body tell me, how to send/receive the sms from java application to mobile phones.
    I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
    the following error.
    Cannot connect to GSM Device, error : -11

    The best place to ask your question is at the JSMS website, forum or mailing list since this is no error that directly comes from a class belonging to the core Java classes.

  • Can any body tell me how to get a call for adobe interview for a flex developer post for 2.6 years??

    can any body tell me how to get a call for adobe interview for a flex developer post for 2.6 years??

    hi,
    there's some microsoft support to this issue. check here http://support.microsoft.com/kb/2008385 
    regards.
    From out of Nowhere

  • Can any body tell me how to use the TCODE:ABF1 ?

    Can any body tell me how to use the TCODE:ABF1 ?
    Can any body tell me the different of the ABF1 and FB01?
    Thank very much.

    Hi Jie,
    both Transaction codes are working are same.
    Both are working through program : SAPMF05A.
    Packages are different: FIDC & AB.
    FB01 : we can control objects through F_BKPF_BUK
    Hope its clear.
    Kishore K

  • Can any body tell me How to store string array in a array

    Can any body tell me How to store string array in a array

    YesNot quite sure what question you're answering but here's how to copy an array.// given a String[] strArr
    // pre Java 6
    String[] newStrArr = new String[strArr.length];
    System.arrayCopy(strArr, 0, newStrArr, 0, strArr.length);
    // post Java 6
    String[] newStrArr = Arrays.copyOf(strArr, strArr.length);Edit:
    Or in fact use clone() as mark pointed out.
    Message was edited by:
    dwg

  • Can any one tell me how to attach a pdf file to the mail through workflow

    I have a smart which i am able  to convert it to a pdf file...now.. can any one tell me how to attach a pdf file to the mail through workflow

    Hi,
    To create the task for attachment
    Use the BOR SELFITEM and method NOTES_APPEND.
    The out come of this task contain a link called attachment with a clip attached. Clisk on that icon and choose the type of attachment u want . RAW , EXCEL , TXT , PDF... Then using the import icon u can attach the document u like.
    But the TYPE : OBJ.
    Similarly using NOTE_DISPLAY method u can display the documents u like.
    In any work item u have the facility to attach any atttchment for further circulation .
    Attchment @ WORKITEM
    1.Click the workitem for which you want to create the attchment
    2.Press create attachment
    3. Add the attachment u like (PDF)
    Reward points for useful answer.
    Richard A

  • Can any one tell me how to create logical database

    i want to create logical database which contain tables BSEG,BSIS,BSAS,BKPF.
      tell me how this table will come under hierarchary and
    what should i do.please guide me step by step for this problem,i am new to logical datbase.

    Hi,
    Use transaction SE37 or SLDB for creation of LDB.
    Three main things in creation of LDB are
    1)Structure(Hierarchy in nodes)
    2)Selections
    3)Source code
    In structure part we have to define hierarchy as IN NODES
    BKPF          - Accounting Document Header
    BSEG         - Accounting Document Segment
      BSIS
      BSAS
    In selections part we have to define selection screens for the LDB
    In source code part we have to write the data decelerations and data retrieval.
    Regards
    Rajesh Yadla

  • Can any body tell me how to pull SAP-CRM data into BW

    Hi BW guru`s,
    Does anybody tell me how to pull SAP-CRM data into BW.
    Is there any configuaration setings takes place in CRM system or BW system?
    Provide few of CRM datasources names (Transaction data Datasources)
    Please explain indetail and give some examples.
    Thanks in advance,
    venkat

    Hi.......
    SAP CRM uses BW Adapter to extract data from SAP CRM and send it to SAP Business Information Warehouse and SAP NetWeaver Business Intelligence. For mBDocs, BW Adapter extracts objects for CRM business transactions and CRM billing use the BAdI CRM_BWA_MFLOW. However, in releases prior to SAP CRM 2005, after using transaction code RSA5 to activate business content in SAP CRM, you must use transaction code BWA5 to activate the business content for the BW Adapter.
    Check this link :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2910623-0c01-0010-de8f-d1926988a986
    Hope this helps you.........
    Regards,
    Debjani........

  • Can any body tell me how to upload data for infotype 2011

    hi gurus,
    please tell me hw to create the bdc for infotype 2011.

    Go to SHDB and record the Tcode PA30 with Infotype 2011.
    ~BiSu

  • Can any body tell me how much bw configured on port from below mentioned config details.

    sh int GE-WAN3/1.720
    GE-WAN3/1.720 is up, line protocol is up
      Hardware is GigabitEthernet Interface, address is 0013.7f6d.2bc0 (bia 0013.7f6d.2bc0)
      MTU 4474 bytes, BW 1000000 Kbit, DLY 10 usec,
         reliability 255/255, txload 29/255, rxload 130/255
      Encapsulation 802.1Q Virtual LAN, Vlan ID  720.
      ARP type: ARPA, ARP Timeout 04:00:00
      Keepalive not supported
         43483205208 packets input, 30686252708584 bytes
         4126465891920915 packets output, 125766989568145 bytes
    and what is the above value indicate as it showing too much high BW.
    Pl. help 

    JC,
    The interface bandwidth is 1 Gbps as you can see below,
      MTU 4474 bytes, BW 1000000 Kbit, DLY 10 usec,
    The below are interface stats (or counters) that indicates the number of packets that came in via this interface 
     43483205208 packets input, 30686252708584 bytes
         4126465891920915 packets output, 125766989568145 bytes
    You can use "clear counters" to reset the above stats.
    -Nagendra

  • Can any body tell me how to map the jsp page with sling servlet

    here is my content.jsp
    <%@include file="/libs/foundation/global.jsp"%>
    <cq:include script="/libs/wcm/core/components/init/init.jsp"/>
    <div>
    <h3>Login</h3>
    <form name="frm" method="doGet" action="/LoginServlet">
    <cq:include path="texot" resourceType="sapphirenow_web/components/foundation/textlog"/>
    <cq:include path="text1" resourceType="sapphirenow_web/components/foundation/textlog"/>
    <cq:include path="text3" resourceType="sapphirenow_web/components/foundation/submit"/>
        </form>
    </div>
    here is my LoginServlet.java
    package com.sapphirenow.web;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import org.apache.sling.api.SlingHttpServletRequest;
    import org.apache.sling.api.SlingHttpServletResponse;
    import org.apache.sling.api.servlets.SlingAllMethodsServlet;
    * @scr.component metatype="true"
    * @scr.service interface="javax.servlet.Servlet"
    * @scr.property name="sling.servlet.paths"  value="/bin/mn"
    * @scr.property name="sling.servlet.methods" values="GET"
    public class LoginServlet extends SlingAllMethodsServlet
      public void doGet(SlingHttpServletRequest request,SlingHttpServletResponse response) throws ServletException,IOException
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              String name = request.getParameter("Username");
              String pass = request.getParameter("Password");
              out.println("<html>");
              out.println("<body>");
              out.println("Thanks  Mr." + "  " + name + "  " + "for visiting roseindia<br>" );
              out.println("Now you can see your password : " + "  " + pass + "<br>");
              out.println("</body></html>");
       its showing "The requested URL /LoginServlet was not found on this server."  how to solve this pls help me

    Hi,
    Bellow some links which maybe hepls you:
    -> http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html
    -> http://edivad.wordpress.com/2011/07/18/cq-sling-servlets-resourcetype/
    -> http://sling.apache.org/site/servlets.html
    -> http://blogs.adobe.com/aaa/tag/sling
    and some threads from the forum:
    -> http://forums.adobe.com/message/4943006#4943006
    -> http://forums.adobe.com/message/4915799#4915799
    By the way there is a lot of information which you can find in th network.
    Regards,
    kasq

Maybe you are looking for

  • How do I place music in web page

    I need to place background music in my web page possibly with a on and off button.

  • No signal mode

    my iphone 4 when enters in no signal mode/network doesn't come back automatically to the carriers network, so I can not receive calls or messages. In this case, I have to reset the iphone. Why does it happen?

  • Cyan screen when MBP comes out of sleep or power on.

    For around a month now, my MBP's screen has been going a Cyan colour, and sometimes with a green now and again. This usually happens when it comes out of a deep sleep or when I power it on. I took it to the Apple store and they said that there are no

  • Want to download a itunes game (slotomania)onto my computer. How do I do this??

    Hi out there How do you download a free itunes game to the computer? I want to play it but can't get it to download. Using Windows 7 Any help would be appreciated Thanks

  • Dreamweaver Site-wide Cross Reference

    I'm sort of new to Dreamweaver and I use CS4. I was asked to take over an existing web site and to maintain it.  It would be very helpful if I could produce a cross-reference to see where each class, for example, was used within the web site. I would