ALV like LIST GRID BLOCKED and HIRARCHIC using oops class SALV

Hi ,
Can any one let know me is it possible to display all the Flavours of ALV like LIST GRID BLOCKED and HIRARCHICAL
using oops class CL_GUI_ALV and class CL_SALV.
and the relevant events with respect to the type of ALV.
regards

Hello
Have you had a look at the documents of Rich Heilman:
[ALV Object Model - Simple 2D Table - Event Handling|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]
[ALV Object Model - Hierarchical Sequential List - The Basics|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0f03986-046c-2910-a5aa-e5364e96ea2c]
[ALV Object Model - Simple 2D Table - The Basics|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de4908a6]
Regards
  Uwe

Similar Messages

  • List of Port and Protocols used by OBIA and Informatica

    Hi Guys
    Please Let me know the List of Port and Protocols used by OBIA,Informatica.
    Regards
    Rama

    Re: OBIEE Ports

  • ALV grid with 2 headers - using OOPS

    Hi,
    I have a requirement wherein I need to display 2 headers using ALV Grid. I am using cl_gui_alv_grid->set_table_for_first display.
                    Header1                    Header2
    Col1     Col2     Col3     Col4     Col5
    1     2     3     4     5
    Please suggest if this is possible, if yes, how to acheive it.
    Thanks,
    Smita

    HI RAM,
    I have did same like what you said. but iam not getting. Below is the pgm what i have dev. please correct it and let me knwo.
    TYPE-POOLS: SLIS.
    DATA: I_CATLOG TYPE slis_t_fieldcat_alv,
          W_CATLOG TYPE SLIS_FIELDCAT_ALV,
          I_CATLOG2 TYPE slis_t_fieldcat_alv,
          W_CATLOG2 TYPE SLIS_FIELDCAT_ALV,
          V_PGM TYPE SY-REPID.
    data: begin of itab1 occurs 0,
            HEADER1(10) TYPE C,
            HEADER2(10) TYPE C,
          end of itab1.
    data: begin of itab occurs 0,
            vbeln like vbak-vbeln,
            posnr like vbap-posnr,
            MATNR LIKE VBAP-MATNR,
            MATWA LIKE VBAP-MATWA,
          end of itab.
    select vbeln
           posnr
           MATNR
           MATWA
      from vbap
      up to 20 rows
      into table itab.
    w_catlog-seltext_l = 'HEADER1'.
    w_catlog-datatype  = 'CHAR'.
    w_catlog-outputlen = 10.
    W_CATLOG-tabname = 'ITAB1'.
    append w_catlog2 to i_catlog2.
    clear  w_catlog2.
    w_catlog-seltext_l = 'HEADER2'.
    w_catlog-datatype  = 'CHAR'.
    w_catlog-outputlen = 10.
    W_CATLOG-tabname = 'ITAB1'.
    append w_catlog2 to i_catlog2.
    clear  w_catlog2.
    w_catlog-seltext_l = 'Sales Document'.
    w_catlog-datatype  = 'CHAR'.
    w_catlog-outputlen = 10.
    w_catlog-fieldname = 'VBELN'.
    W_CATLOG-tabname = 'ITAB'.
    append w_catlog to i_catlog.
    clear  w_catlog.
    w_catlog-seltext_l = 'ITEM'.
    w_catlog-datatype  = 'NUMC'.
    w_catlog-outputlen = 6.
    w_catlog-fieldname = 'POSNR'.
    W_CATLOG-tabname = 'ITAB'.
    append w_catlog to i_catlog.
    clear  w_catlog.
    w_catlog-seltext_l = 'MATERIAL'.
    w_catlog-datatype  = 'CHAR'.
    w_catlog-outputlen = 18.
    w_catlog-fieldname = 'MATNR'.
    W_CATLOG-tabname = 'ITAB'.
    append w_catlog to i_catlog.
    clear  w_catlog.
    w_catlog-seltext_l = 'Material entered'.
    w_catlog-datatype  = 'CHAR'.
    w_catlog-outputlen = 18.
    w_catlog-fieldname = 'MATWA'.
    W_CATLOG-tabname = 'ITAB'.
    append w_catlog to i_catlog.
    clear  w_catlog.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = V_PGM
       IT_FIELDCAT                       = I_CATLOG2
      TABLES
        T_OUTTAB                          = ITAB1
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = V_PGM
       IT_FIELDCAT                       = I_CATLOG
      TABLES
        T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • "list / grid view" and "sort by" for product catalogs

    Hi Everyone,
    Is there any progress to either have more layouts in our BC system for Catalogs, etc...
    or the Liquid Layout is being developed and I should use that on a real site?
    Customers keep asking for these basic E-commerce functions:
    - toggle between list view / grid view when viewing product catalogs;
    - sort by function for product catalogs;
    How should I achieve this???
    thanks for any insights,
    nova*

    Hey Liam,
    Is this found is suitable for what we are discussing here earlier? Namely, to change stylesheets with a link ... I try to do a list/grid view option here ...
    http://www.thesitewizard.com/javascripts/change-style-sheets.shtml
    Thanks for your time,
    nova*

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • How to extract list of object and formula used in variables as Excel for a particular Webi Report

    Hi,
    Is it possible to get the list of variables and objects, and variable formula used in a webi report extracted in excel or PDF in BO XI R3.1?
    Thanks In Advance,
    Shenbu

    Hi Shenbaga,
    You can try to get this information using the report engine sdks of BusinessObjects which is specific to webi reports.
    Please refer to the link to download the dev guide and api referrence for XI 3.1
    SAP BusinessObjects BI 3.x and Lower - Developer SDK Library
    Refer to the Report Engine Java SDK dev guide and api referrence.
    Go through the dev guide in detail and you would be able to use the report engine sdks as per your needs.
    Additional Note: There have been changes in report engine sdks from XI 3.1 to BI 4.0 and you would not be able to get all the features available in XI 3.1 report engine sdks in BI 4.0.
    Hope this helps.
    Regards,
    Chandrahas

  • Installing Grid Control and not using ASM

    Is it possible to install Grid Control and not be using ASM? We are on the brink of beginning our install (Peoplesoft) and may not use ASM. It seems to me from documentation that I'm reviewing that installing GC assumes you will be using ASM.
    Any info would be appreciated.

    Hi,
    the Grid Control Repository database does not require ASM. It works perfectly fine with datafiles on a normal filesystem.
    Best regards,
    Robert

  • ALV using OOPS class CL_GUI_ALV_GRID, call method SET_TABLE_FOR_FIRST_DISPL

    I NEVER USED OOPS CONCEPT.BUT I GOT A TASK ON ALV REPORT USING class CL_GUI_ALV_GRID, call method SET_TABLE_FOR_FIRST_DISPLAY for ALV . I HAD PASSED THE VALUES FROM INTERNAL TABLE AND GOT OUTPUT IN ALV.
    The problem is When i save an layout(default setting button ).
    iam unable to get the output for all fields.
    if u want i will send screenshots to ur mail
    THANKS IN ADVANCE.

    ok fine,
    In the output (alv grid) there is an icon for layout settings.
    if i want to save layout (as DEFAULT SETTING) i am missing some fields in output
    EX:
    mat no | batch  | proces order | time  |  date |
    when i save layout (as DEFAULT SETTING) i am missing some fields in output
    mat no | batch  |
    the rest of the field were not displayed.
    if u are not clear just ask me. i will send some more examples.

  • Customizing FD01 and FB70 using PS Class and Characteristics

    Hello SAP Experts
    I have the following issue:
    My client has a requirement where we need to customize the Customer Master  (FD01) screen and the Invoice Posting Screen (FB70). A few additional fields have to be added by creating a separate tab. I was intending to take Abaper's help and do this using user exits but I have been suggested by the cleint to use SAP PS Class and Characteristics feature to do this. Can someone please throw some light on this feature and how can i create custom fields on FD01 and FB70 screens. Is there a way we could customize these screens using PS class and characteristics. Your opinions would be much appreciated.
    Please kindly give your suggestions. Thanks in advance
    Regards,
    Nik

    Joao Paulo,
    Thank you for the response. I have tried to obtain some info from OSS but no luck. Tried all means but there is limited information available.
    Nik

  • Desktop like view of files and folders using Swing

    I have an application for upload/download of files from a server. The application is developed using swing and it works perfectly. Currently, the files and folders are displayed in a table view(using jtable) in which the file/ folder will be displayed with icon and extension in each row.
    I need to display these files and folders in a desktop like view. How can I implement this?
    Anees

    Any sample demos or links? Thats why people give you links to the Swing tutorial. The hope is that you will actually look at the Table of Contents and read the tutorial before you post a question.
    Or you could even read the JList API to find a link to the tutorial.

  • I am unable to add content to my iTunes library. I'm running 10.6.1 and didn't start having issues until a day or two ago. I've tried dragging and dropping content (like I always do) and also using file add to library. Neither work! Any suggestions?

    Please help!

    But why we are having to do this extra step I do not knew
    A post or two per day on this. Not happening to everybody obviously.  Maybe something to do with the details of the tracks to which this is happening (maybe a font character), or something else you did, but to figure this out people would have ot carefully dosument everything they were doing, including track names, machine specification, computer use history.  Nobody who posts on this posts all the detail, so there's nothing with which to work.  You can also report this issue to Apple (we're just other Mac users like you) but wihtout the detils they probably won't know what to do either.

  • My iphone was blocked and cant use it anymore

    I used to able to use my phone then i cant anymore. Would you please help me to unlock it again.

    Please explain.
    You forgot your password?  Restore it.

  • Problem in creating EJB and WebService using complex class structure

    Hi All,
    My requirement is like :
    I have a class with very complex structure.
    I have also used external .jars.
    Now when I have created an EJB with a method's return parameter as above class.
    But when I am creating a Webservice, it doesnot allow me to select this method.
    Not able to configure why ?
    Please Help.
    Thanks.

    Hi,
    I have gone through your code and the problem is that when you create jar it takes a complete path address (which is called using getAbsolutePath ) (when you extract you see the path; C:\..\...\..\ )
    You need to truncate this complete path and take only the path address where your files are stored and the problem must be solved.

  • Help Counting Vowels and Consonants using a class

    I'm currently working on a class project where I need take a user inputed string and count how many vowels and/or consonants are in the String at the user discretion. I have the main logic program working fine. However, the trouble I'm running into is how to take the string the user inputed and pass that data into the class method for counting.
    Here is the code for the program:
    package vowelsandconsonants;
    import java.util.Scanner;
    public class VowelConsCounter {
        public static void main(String[] args) {
            String input; //User input
            char selection; //Menu selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Get the string to start out with.
            System.out.print("Enter a string: ");
            input = keyboard.nextLine();
            //Create a VowelCons object.
            VowelCons vc = new VowelCons(input);
            do {
                // Display the menu and get the user's selection.
                selection = getMenuSelection();
                // Act on the selection
                switch (Character.toLowerCase(selection)) {
                    case 'a':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        break;
                    case 'b':
                        System.out.println("\nNumber of consonats: " +
                                vc.getNumConsonants());
                        break;
                    case 'c':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        System.out.println("Number of consonants: " +
                                vc.getNumConsonants());
                        break;
                    case 'd':
                        System.out.print("Enter a string: ");
                        input = keyboard.nextLine();
                        vc = new VowelCons(input);
            } while (Character.toLowerCase(selection) != 'e');
         * The getMenuSelection method displays the menu and gets the user's choice.
        public static char getMenuSelection() {
            String input;  //To hold keyboard input
            char selection;  // The user's selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Display the menu.
            System.out.println("a) Count the number of vowels in the string.");
            System.out.println("b) Count the number of consonants in the string.");
            System.out.println("c) Count both the vowels and consonants in the string.");
            System.out.println("d) Enter another string.");
            System.out.println("e) Exit the program.");
            //Get the user's selection
            input = keyboard.nextLine();
            selection = input.charAt(0);
            //Validate the input
            while (Character.toLowerCase(selection) < 'a' ||
                    Character.toLowerCase(selection) > 'e') {
                System.out.print("Only enter a,b,c,d or e:");
                input = keyboard.nextLine();
                selection = input.charAt(0);
            return selection;
    class VowelCons {
        private char[] vowels;
        private char[] consonants;
        private int numVowels = 0;
        private int numCons = 0;
        public VowelCons(String str) {
        public int getNumVowels() {
            return numVowels;
        public int getNumConsonants() {
            return numCons;
        private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
    }The UML given to me by my instructor calls for the counting method to be private. Being that I'm not too familiar with Java syntax I did not know if that may cause a problem with passing the user's input into that method.

    Well the only compilers i get are due to the code:
    private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
        }However, that is due to the fact that i have no data for those variables to use. I'm pretty much stuck on how to get the string the user inputs into that method shown above so the code can perform the task of counting the vowels and consonants.
    If i comment out the code within that function the program compiles and will allow me to enter the string and use the options but since i can't figure out how to pass the input to the counting method the program returns 0 for everything.

  • Traffic Signals in ALV Without using oops only for normal Grid Display.

    Hi Experts ,
    I need to add traffic signals into my normal ALV Grid program without using oops concepts.
    Please any one send me full code or provide me one program code without using oops concept for normal ALV Grid .
    I searched in many forums but i found most of the programs wriiten using oops concept with ALV's but here my requirement without using oops concept and only normal reuse_alv_grid_display.
    Thanks in Advance.
    Venky.

    You can check the below sample code.Traffic light is implemented in it.
    REPORT ztest NO STANDARD PAGE HEADING
                    LINE-SIZE 255 MESSAGE-ID zlqm.
    TYPE-POOLS : slis,icon.
    TABLES :qals,qave.
    INCLUDE : zlqmr002_top,              "Global Data Declaration
              zlqmr002_selection_screen, "Selection Screen Inputs
              zlqmr002_subroutine.       "Subroutines
    INITIALIZATION
    INITIALIZATION.
      PERFORM variant_init.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    Check for Variant existance
      PERFORM pai_of_selection_screen.
    *Validation for Material
    AT SELECTION-SCREEN ON s_matnr.
      IF NOT s_matnr IS INITIAL.
        SELECT SINGLE matnr
               INTO g_matnr
               FROM mara
               WHERE matnr IN s_matnr.
        IF sy-subrc <> 0.
          SET CURSOR FIELD 'S_MATNR'.
          MESSAGE e000 WITH text-003.
        ENDIF.
      ENDIF.
    *Validation for Plant
    AT SELECTION-SCREEN ON s_werk.
      IF NOT s_werk IS INITIAL.
        SELECT SINGLE werks
               INTO g_werk
               FROM t001w
               WHERE werks IN s_werk.
        IF sy-subrc <> 0.
          SET CURSOR FIELD 'S_WERK'.
          MESSAGE e000 WITH text-004.
        ENDIF.
      ENDIF.
    *Validation for Inspection Type
    AT SELECTION-SCREEN ON s_art.
      IF NOT s_art IS INITIAL.
        SELECT SINGLE art
               INTO g_art
               FROM tq30
               WHERE art IN s_art.
        IF sy-subrc <> 0.
          SET CURSOR FIELD 'S_ART'.
          MESSAGE e000 WITH text-005.
        ENDIF.
      ENDIF.
    *Validation for Code group
    AT SELECTION-SCREEN ON s_vcdgrp.
      IF NOT s_vcdgrp IS INITIAL.
        SELECT SINGLE codegruppe
               INTO g_vcdgrp
               FROM qpgr
               WHERE codegruppe IN s_vcdgrp.
        IF sy-subrc <> 0.
          SET CURSOR FIELD 'S_VCDGRP'.
          MESSAGE e000 WITH text-006.
        ENDIF.
      ENDIF.
    *Validation for Code
    AT SELECTION-SCREEN ON s_vcode.
      IF NOT s_vcode IS INITIAL.
        SELECT SINGLE code
               INTO g_vcode
               FROM qpcd
               WHERE code IN s_vcode.
        IF sy-subrc <> 0.
          SET CURSOR FIELD 'S_VCODE'.
          MESSAGE e000 WITH text-007.
        ENDIF.
      ENDIF.
    Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcdgrp-low.
      PERFORM get_codegroup.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcdgrp-high.
      PERFORM get_codegroup.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcode-low.
      PERFORM get_code.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcode-high.
      PERFORM get_code.
    START-OF-SELECTION.
    START-OF-SELECTION.
    **Selecting data form Database tables
      PERFORM select_data TABLES i_out i_out1.
    END-OF-SELECTION
    END-OF-SELECTION.
    **Generate ALV
      PERFORM generate_alv.
    DATA TYPES
    TYPES : BEGIN OF t_qals,
              matnr      TYPE  qals-matnr,          "Material
              werk       TYPE  qals-werk,           "Plant
              mengeneinh TYPE  qals-mengeneinh,     "UOM
              lmenge01   TYPE  qals-lmenge01,       "Unrestricted qty
              lmenge02   TYPE  qals-lmenge02,       "Scrap qty
              lmenge03   TYPE  qals-lmenge03,       "Sample qty
              lmenge04   TYPE  qals-lmenge04,       "Blocked qty
              lmenge05   TYPE  qals-lmenge05,       "Retain qty
              lmenge06   TYPE  qals-lmenge06,       "Othermat qty
              lmenge07   TYPE  qals-lmenge07,       "RTV qty
              lmenge08   TYPE  qals-lmenge08,       "Exp.scrap qty
              prueflos   TYPE  qals-prueflos,       "Inspection lot
              art        TYPE  qals-art,            "Inspection type
              charg      TYPE  qals-charg,          "Batch
              vcode      TYPE  qave-vcode,          "Usage decision
              vdatum     TYPE  qave-vdatum,         "Date
              qmnum      TYPE  qmel-qmnum,          "Notification
            END OF t_qals.
    TYPES : BEGIN OF t_out,
              icon       TYPE  icon-id,             "Status
              matnr      TYPE  qals-matnr,          "Material
              werk       TYPE  qals-werk,           "Plant
              mengeneinh TYPE  qals-mengeneinh,     "UOM
              vcode      TYPE  qave-vcode,          "Usage decision
              mncod(30)  TYPE  c,                   "Disposition
              lmenge01   TYPE  qals-lmenge01,       "Unrestricted qty
              lmenge02   TYPE  qals-lmenge02,       "Scrap qty
              lmenge03   TYPE  qals-lmenge03,       "Sample qty
              lmenge04   TYPE  qals-lmenge04,       "Blocked qty
              lmenge05   TYPE  qals-lmenge05,       "Retain qty
              lmenge06   TYPE  qals-lmenge06,       "Othermat qty
              lmenge07   TYPE  qals-lmenge07,       "RTV qty
              lmenge08   TYPE  qals-lmenge08,       "Exp.scrap qty
              prueflos   TYPE  qals-prueflos,       "Inspection lot
              art        TYPE  qals-art,            "Inspection type
              qmnum      TYPE  qmel-qmnum,          "Notification
              vdatum     TYPE  qave-vdatum,         "Date
              charg      TYPE  qals-charg,          "Batch
            END OF t_out.
    TYPES :  BEGIN OF t_qmsm,
               qmnum    TYPE  qmsm-qmnum,
               manum    TYPE  qmsm-manum,
               mncod    TYPE  qmsm-mncod,
             END OF t_qmsm.
    TYPES:   BEGIN OF t_disp,
               qmnum     TYPE  qmsm-qmnum,
               mncod(30) TYPE  c,
             END OF t_disp.
    TYPES:   BEGIN OF t_codegrp,
               katalogart  TYPE  qpgt-katalogart,
               codegruppe  TYPE  qpgt-codegruppe,
               kurztext    TYPE  qpgt-kurztext,
             END OF t_codegrp.
    TYPES:   BEGIN OF t_code,
               katalogart  TYPE  qpct-katalogart,
               codegruppe  TYPE  qpct-codegruppe,
               code        TYPE  qpct-code,
               version     TYPE  qpct-version,
               kurztext    TYPE  qpct-kurztext,
             END OF t_code.
    INTERNAL TABLES
    DATA: i_qals     TYPE TABLE OF t_qals,
          wa_qals    LIKE LINE  OF i_qals,
          i_qmsm     TYPE TABLE OF t_qmsm,
          wa_qmsm    TYPE t_qmsm,
          i_disp     TYPE TABLE OF t_disp,
          wa_disp    LIKE LINE  OF i_disp,
          i_out      TYPE TABLE OF t_out,
          wa_out     TYPE t_out,
          i_out1     TYPE TABLE OF t_out,
          wa_out1    TYPE t_out,
          i_codegrp  TYPE TABLE OF t_codegrp,
          i_code     TYPE TABLE OF t_code,
          i_qmsm_tmp TYPE TABLE OF t_qmsm.
    DATA: i_fieldcat  TYPE slis_t_fieldcat_alv,
          i_layout    TYPE slis_layout_alv,
          g_repid     TYPE sy-repid,
          wa_fieldcat TYPE slis_fieldcat_alv.
    Global Variables
    DATA : g_matnr    TYPE  matnr,
           g_werk     TYPE  werks,
           g_art      TYPE  qpart,
           g_vcdgrp   TYPE  qvgruppe,
           g_vcode    TYPE  qvcode,
           g_red      TYPE  c,
           g_yellow   TYPE  c,
           g_table(6) TYPE  c,
           g_save(1)  TYPE  c,
           g_exit(1)  TYPE  c,
           g_report   TYPE  sy-repid,
           g_var      TYPE  disvariant,
           g_variant  TYPE  disvariant.
    Constants
    CONSTANTS: c_green  TYPE icon-id VALUE '@08@',
               c_yellow TYPE icon-id VALUE '@09@',
               c_red    TYPE icon-id VALUE '@0A@'.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr   FOR  qals-matnr,    "Material Number
                     s_werk    FOR  qals-werk,     "Plant
                     s_art     FOR  qals-art,      "Inspection Type
                     s_vcdgrp  FOR  qave-vcodegrp, "Usage Decision Code Group
                     s_vcode   FOR  qave-vcode,    "Usage Decision Code
                     s_vdatum  FOR  qave-vdatum.   "Usage Decision Code Date
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_all   RADIOBUTTON GROUP g1 DEFAULT 'X',
                p_excp  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-009.
    "Variant Selection
    PARAMETERS: p_vari TYPE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK b3.
    *&      Form  select_data
          Select Inspection Details
    FORM select_data TABLES p_out  STRUCTURE wa_out
                            p_out1 STRUCTURE wa_out.
      DATA:l_mncod(30) TYPE c.
      REFRESH : i_qals,i_qmsm,i_qmsm_tmp,i_disp,p_out.
      SELECT qalsmatnr     qalswerk      qals~mengeneinh
             qalslmenge01  qalslmenge02  qals~lmenge03
             qalslmenge04  qalslmenge05  qals~lmenge06
             qalslmenge07  qalslmenge08  qals~prueflos
             qalsart       qalscharg     qave~vcode
             qavevdatum    qmelqmnum
             INTO CORRESPONDING FIELDS OF TABLE i_qals
                  FROM qals
                  INNER JOIN qave
                        ON qalsprueflos = qaveprueflos
                  INNER JOIN qmel
                        ON qalsprueflos = qmelprueflos
                  WHERE qals~matnr    IN s_matnr
                    AND qals~werk     IN s_werk
                    AND qals~art      IN s_art
                    AND qals~stat34   EQ 'X'
                    AND qave~vcodegrp IN s_vcdgrp
                    AND qave~vcode    IN s_vcode
                    AND qave~vdatum   IN s_vdatum.
      IF sy-subrc NE 0.
        MESSAGE i000 WITH text-008.
      ENDIF.
      IF NOT i_qals IS INITIAL.
        SELECT qmnum manum mncod INTO TABLE i_qmsm
                                 FROM qmsm
                                 FOR ALL ENTRIES IN i_qals
                                 WHERE qmnum EQ i_qals-qmnum
                                   AND mngrp LIKE 'Q_D%'
                                   AND kzloesch NE 'X'.
      ENDIF.
    ***Concatenation of Disposition Codes
      IF NOT i_qmsm IS INITIAL.
        i_qmsm_tmp = i_qmsm.
        SORT i_qmsm_tmp BY qmnum mncod.
        DELETE ADJACENT DUPLICATES FROM i_qmsm_tmp COMPARING qmnum mncod+0(2).
        CLEAR wa_qmsm.
        LOOP AT i_qmsm_tmp INTO wa_qmsm.
          MOVE wa_qmsm-qmnum TO wa_disp-qmnum.
          CONCATENATE l_mncod wa_qmsm-mncod+0(2) INTO l_mncod SEPARATED BY space.
          AT END OF qmnum.
            SHIFT l_mncod LEFT DELETING LEADING space.
            MOVE l_mncod TO wa_disp-mncod.
            APPEND wa_disp TO i_disp.
            CLEAR:wa_disp,l_mncod.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ***Transfer of data to the output table
      LOOP AT i_qals INTO wa_qals.
        MOVE-CORRESPONDING wa_qals TO wa_out.
        CLEAR wa_disp.
        READ TABLE i_disp INTO wa_disp
                          WITH KEY qmnum = wa_qals-qmnum.
        IF sy-subrc EQ 0.
          MOVE wa_disp-mncod TO wa_out-mncod.
        ENDIF.
        PERFORM check_quantity USING wa_qals.
        CLEAR wa_qmsm.
        LOOP AT i_qmsm INTO wa_qmsm
                       WHERE qmnum EQ wa_qals-qmnum.
          PERFORM check_group USING wa_qals
                                    wa_qmsm.
          CLEAR wa_qmsm.
        ENDLOOP.
        IF g_red NE 'X'.
          CLEAR wa_qmsm.
          LOOP AT i_qmsm INTO wa_qmsm WHERE qmnum = wa_qals-qmnum
                                        AND mncod0(2) NE wa_qals-vcode0(2).
            g_yellow = 'X'.
          ENDLOOP.
        ENDIF.
        IF g_yellow EQ 'X'.
          MOVE c_yellow TO wa_out-icon.
        ELSEIF g_red EQ 'X'.
          MOVE c_red TO wa_out-icon.
        ELSE.
          MOVE c_green TO wa_out-icon.
        ENDIF.
        APPEND wa_out TO p_out.
        CLEAR:wa_qals,wa_out,g_red,g_yellow.
      ENDLOOP.
    ***IF only exceptions are need to be displayed
      IF p_excp EQ 'X'.
        CLEAR wa_out.
        LOOP AT p_out INTO wa_out WHERE icon EQ c_red.
          APPEND wa_out TO p_out1.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " select_data
    *&      Form  populate_fieldcat
          Populate the Fieldcat Table
    FORM populate_fieldcat USING p_table TYPE c.
    **status
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'ICON'.
      wa_fieldcat-seltext_l   = text-010.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-icon        = 'X'.
      APPEND wa_fieldcat TO i_fieldcat.
    **Material
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'MATNR'.
      wa_fieldcat-seltext_l   = text-011.
      wa_fieldcat-outputlen   = 15.
      APPEND wa_fieldcat TO i_fieldcat.
    **Plant
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'WERK'.
      wa_fieldcat-seltext_l   = text-012.
      wa_fieldcat-outputlen   = 7.
      APPEND wa_fieldcat TO i_fieldcat.
    **Usage Decision
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'VCODE'.
      wa_fieldcat-seltext_l   = text-013.
      wa_fieldcat-outputlen   = 15.
      APPEND wa_fieldcat TO i_fieldcat.
    **Dispositions
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'MNCOD'.
      wa_fieldcat-seltext_l   = text-014.
      wa_fieldcat-outputlen   = 18.
      APPEND wa_fieldcat TO i_fieldcat.
    **UOM
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'MENGENEINH'.
      wa_fieldcat-seltext_l   = text-015.
      wa_fieldcat-outputlen   = 18.
      APPEND wa_fieldcat TO i_fieldcat.
    **Unrestricted Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE01'.
      wa_fieldcat-seltext_l   = text-016.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Scrap Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE02'.
      wa_fieldcat-seltext_l   = text-017.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Sample Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE03'.
      wa_fieldcat-seltext_l   = text-018.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Blocked Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE04'.
      wa_fieldcat-seltext_l   = text-019.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Retain Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE05'.
      wa_fieldcat-seltext_l   = text-020.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Other Mat Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE06'.
      wa_fieldcat-seltext_l   = text-021.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **RTV Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE07'.
      wa_fieldcat-seltext_l   = text-022.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Exp. Scrap Quantity
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'LMENGE08'.
      wa_fieldcat-seltext_l   = text-023.
      wa_fieldcat-qfieldname  = 'MENGENEINH'.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Inspection Lot
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'PRUEFLOS'.
      wa_fieldcat-seltext_l   = text-024.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Inspection Type
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'ART'.
      wa_fieldcat-seltext_l   = text-025.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Notification
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'QMNUM'.
      wa_fieldcat-seltext_l   = text-026.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Date
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'VDATUM'.
      wa_fieldcat-seltext_l   = text-027.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    **Batch
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname     = p_table.
      wa_fieldcat-fieldname   = 'CHARG'.
      wa_fieldcat-seltext_l   = text-028.
      wa_fieldcat-outputlen   = 20.
      APPEND wa_fieldcat TO i_fieldcat.
    ENDFORM.                    " populate_fieldcat
    *&      Form  check_quantity
          To Check the Quantity
    FORM check_quantity  USING  p_qals TYPE t_qals.
      IF wa_qals-lmenge01 GT 0.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND ( mncod CP 'UI'
                          OR   mncod CP 'SR'
                          OR   mncod CP 'ND' ).
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge02 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND ( mncod CP 'SC'
                          OR   mncod CP 'SR' ).
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge04 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND ( mncod CP 'RW'
                          OR   mncod CP 'RD' ).
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge05 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND mncod CP 'R1'.
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge06 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND mncod CP 'RD'.
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge07 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND mncod CP 'RV'.
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
      IF wa_qals-lmenge08 GT 0 AND g_red NE 'X'.
        LOOP AT i_disp TRANSPORTING NO FIELDS
                       WHERE qmnum EQ wa_qals-qmnum
                         AND ( mncod CP 'SC'
                          OR   mncod CP 'SE' ).
        ENDLOOP.
        IF sy-subrc NE 0.
          g_red = 'X'.
        ENDIF.
      ENDIF.
    ENDFORM.                    " check_quantity
    *&      Form  check_group
          To check the Disposition Code
    FORM check_group  USING  p_qals TYPE t_qals
                             p_qmsm TYPE t_qmsm.
      IF p_qmsm-mncod+0(2) EQ 'UI' AND
         NOT p_qals-lmenge01 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'RW' AND
         NOT p_qals-lmenge04 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'SC' AND
          NOT p_qals-lmenge02 GT 0 AND
          NOT p_qals-lmenge08 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'SE' AND
         NOT p_qals-lmenge08 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'RV' AND
         NOT p_qals-lmenge07 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'SR' AND
          NOT p_qals-lmenge01 GT 0 AND
          NOT p_qals-lmenge02 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'ND' AND
         NOT p_qals-lmenge01 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'R1' AND
         NOT p_qals-lmenge05 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
      IF p_qmsm-mncod+0(2) EQ 'RD' AND
          NOT p_qals-lmenge04 GT 0 AND
          NOT p_qals-lmenge06 GT 0.
        g_red = 'X'.
        EXIT.
      ENDIF.
    ENDFORM.                    " check_group
    *&      Form  call_alv
          Call ALV Grid Display
    FORM call_alv  TABLES   p_out STRUCTURE wa_out.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = i_layout
          it_fieldcat              = i_fieldcat[]
        TABLES
          t_outtab                 = p_out
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " call_alv
    *&      Form  generate_alv
          Build ALV
    FORM generate_alv .
      IF NOT i_out  IS INITIAL OR
         NOT i_out1 IS INITIAL.
        g_repid = sy-repid.
        IF p_excp EQ 'X'.
          MOVE 'I_OUT1' TO g_table.
        ELSEIF p_all EQ 'X'.
          MOVE 'I_OUT' TO g_table.
        ENDIF.
        PERFORM populate_fieldcat USING g_table.
        i_layout-zebra        = 'X'.
        i_layout-colwidth_optimize = 'X'.
        IF p_excp = 'X'.
          PERFORM call_alv TABLES i_out1.
        ELSEIF p_all = 'X'.
          PERFORM call_alv TABLES i_out.
        ENDIF.
      ENDIF.
    ENDFORM.                    " generate_alv
    *&             Form  PF_STATUS_SET
                 Setting PF Status
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'STATUS1' .
    ENDFORM.                    "PF_STATUS_SET
    *&              Form USER_COMMAND
               User Command Processing
    FORM user_command USING r_ucomm     TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN 'UDG'.
          IF p_all EQ 'X'.
            CLEAR wa_out.
            READ TABLE i_out INTO wa_out INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'QLS' FIELD wa_out-prueflos.
          ELSEIF p_excp EQ 'X'.
            CLEAR wa_out1.
            READ TABLE i_out1 INTO wa_out1 INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'QLS' FIELD wa_out1-prueflos.
          ENDIF.
          CALL TRANSACTION 'QA13' AND SKIP FIRST SCREEN.
        WHEN 'QNF'.
          IF p_all EQ 'X'.
            CLEAR wa_out.
            READ TABLE i_out INTO wa_out INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'IQM' FIELD wa_out-qmnum.
          ELSEIF p_excp EQ 'X'.
            CLEAR wa_out1.
            READ TABLE i_out1 INTO wa_out1 INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'IQM' FIELD wa_out1-qmnum.
          ENDIF.
          CALL TRANSACTION 'QM03' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM. "USER_COMMAND
    *&      Form  variant_init
         Initialize variant
    FORM variant_init .
    Set Options: save variants userspecific or general
      g_save = 'A'.
      g_report = sy-repid.
      g_var-report = g_report.
    Get default variant
      g_variant = g_var.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = g_save
        CHANGING
          cs_variant = g_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 0.
        p_vari = g_variant-variant.
      ENDIF.
    ENDFORM.                    " variant_init
    *&      Form  f4_for_variant
          F4 help for variant
    FORM f4_for_variant .
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = g_var
          i_save     = g_save
        IMPORTING
          e_exit     = g_exit
          es_variant = g_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF g_exit = space.
          p_vari = g_variant-variant.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f4_for_variant
    *&      Form  pai_of_selection_screen
          Check existence of Variant
    FORM pai_of_selection_screen .
      IF NOT p_vari IS INITIAL.
        MOVE g_var TO g_variant.
        MOVE p_vari TO g_variant-variant.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = g_save
          CHANGING
            cs_variant = g_variant.
        g_var = g_variant.
      ELSE.
        PERFORM variant_init.
      ENDIF.
    ENDFORM.                    " pai_of_selection_screen
    *&      Form  get_codegroup
          Get F4 help for Code Group
    FORM get_codegroup .
      DATA: i_return TYPE TABLE OF ddshretval.
      SELECT katalogart codegruppe kurztext FROM qpgt
                                            INTO TABLE i_codegrp
                                            WHERE katalogart EQ '3'
                                              AND sprache EQ sy-langu.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
        DDIC_STRUCTURE         = ' '
             retfield               = 'CODEGRUPPE'
             dynpprog               = sy-repid
             dynpnr                 = sy-dynnr
             dynprofield            = 'S_VCDGRP'
             value_org              = 'S'
           TABLES
             value_tab              = i_codegrp[]
          return_tab             = i_return[]
           EXCEPTIONS
             parameter_error        = 1
             no_values_found        = 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.
      ENDIF.
    ENDFORM.                    " get_codegroup
    *&      Form  get_code
          Get F4 help for Code
    FORM get_code .
      DATA: l_field       TYPE rsscr-name VALUE 'S_VCDGRP',
            l_field_kind  TYPE rsscr-kind VALUE 'S',
            li_par_values TYPE TABLE OF rsparams,
            la_par_values TYPE rsparams,
            r_cdgrp       TYPE RANGE OF qpct-codegruppe,
            la_cdgrp      LIKE LINE  OF r_cdgrp.
    **Get the values entered in the selection screen
      PERFORM f4_get_related_values IN PROGRAM rsdbspf4
              TABLES li_par_values
              USING l_field l_field_kind.
      IF NOT li_par_values IS INITIAL.
        CLEAR:la_cdgrp,la_par_values.
        LOOP AT li_par_values INTO la_par_values.
          MOVE-CORRESPONDING la_par_values TO la_cdgrp.
          IF la_cdgrp-option IS INITIAL.
            MOVE 'EQ' TO la_cdgrp-option.
          ENDIF.
          APPEND la_cdgrp TO r_cdgrp.
          CLEAR la_cdgrp.
        ENDLOOP.
      ENDIF.
      SELECT katalogart codegruppe
             code       version
             kurztext FROM qpct
                      INTO TABLE i_code
                      WHERE katalogart EQ '3'
                        AND codegruppe IN r_cdgrp
                        AND sprache EQ sy-langu.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
        DDIC_STRUCTURE         = ' '
             retfield               = 'CODE'
             dynpprog               = sy-repid
             dynpnr                 = sy-dynnr
             dynprofield            = 'S_VCODE'
             value_org              = 'S'
           TABLES
             value_tab              = i_code[]
         return_tab             =
           EXCEPTIONS
             parameter_error        = 1
             no_values_found        = 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.
      ENDIF.
    ENDFORM.                    " get_code

Maybe you are looking for