Report is showing extra lines in output

Hi,
I have a Account Receiving Report. My problem is that in report i have 2 radio buttons..First is for Base Line date and Second for Due date. When i execute the report from both the options, data is coming same.. Means in Due Date column, date is coming after the curent date (ex. today is 08-07-2009 and due date is showing 05-08-2009 also).. but i want that date should be less that current date... for that i code few line i.e. (see in BOLD)
    IF bsdtflag EQ 'X'.
      ntage = dd_stida -  rtab-zfbdt.
    ELSE.
      ntage = dd_stida - faede-netdt .
      IF faede-netdt > sy-datum.
        DELETE rtab.
        CLEAR rtab.
      ENDIF.
    ENDIF.
It works in Due date option, but now problem is coming that where is the data showing, above that data, 2 rows showing... means 2 rows are that, that dates are greater than current date.. these rows are totally blank showing but in due date column date is showing (i.e 05-08-2009)...
I don't want to show that rows...please tell me how can i do that...
Regards....

Hi,
Post the entire code segment which is populating that internal table.
Regards
Karthik D

Similar Messages

  • Report problem showing  characters(čžš) in pdf output

    nls teritory slovenian_slovenia
    bi publisher preferences
    UI Language =English     
    Report Locale =Slovenian(Slovenia)
    template rtf
    html output     
         ćčžćčžćčžćčžćčžćčžćčžćčćžčćžčžćčžćčĆŽČĆŽČŽĆČĆŽČŽĆČĆŽČĆŽČĆŽČĆ ( correct)
    pdf output
    ??????????????????????????????????????????????????????????????

    Hello,
    Your probably going to have to edit the xslt to get the result either by stripping out the comma or by setting that column to explicitly align the way you want it.
    Carl

  • UTLRP shows extra line after APEX installation

    We have recently installed APEX 4.0 in 10.2.0.4 database and later ran utlrp.sql to compile the invalid objects.
    We noticed the below line in UTLRP output :
    ...Database user "SYS", database schema "APEX_040000", user# "380" 14:59:11
    ...Compiled 0 out of 2717 objects considered, 0 failed compilation 14:59:12
    ...232 packages
    ...225 package bodies
    ...427 tables
    ...12 functions
    ...19 procedures
    ...3 sequences
    ...439 triggers
    ...1177 indexes
    ...175 views
    ...0 libraries
    ...4 types
    ...0 type bodies
    ...0 operators
    ...0 index types
    ...Begin key object existence check 14:59:12
    ...Completed key object existence check 14:59:12
    ...Setting DBMS Registry 14:59:12
    ...Setting DBMS Registry Complete 14:59:12
    ...Exiting validate 14:59:12
    The above lines are coming from the below code which is being called from utlrp:
    SQL> EXECUTE dbms_registry_sys.validate_components;
    ...Database user "SYS", database schema "APEX_040000", user# "380" 14:59:11
    ...Compiled 0 out of 2717 objects considered, 0 failed compilation 14:59:12
    ...232 packages
    ...225 package bodies
    ...427 tables
    ...12 functions
    ...19 procedures
    ...3 sequences
    ...439 triggers
    ...1177 indexes
    ...175 views
    ...0 libraries
    ...4 types
    ...0 type bodies
    ...0 operators
    ...0 index types
    ...Begin key object existence check 14:59:12
    ...Completed key object existence check 14:59:12
    ...Setting DBMS Registry 14:59:12
    ...Setting DBMS Registry Complete 14:59:12
    ...Exiting validate 14:59:12
    PL/SQL procedure successfully completed.
    ==============
    When i ran the same code in a database where APEX is not installed, i am not getting any messages:
    SQL> EXECUTE dbms_registry_sys.validate_components;
    PL/SQL procedure successfully completed.
    ==================
    PS: I have set "serveroutput on" on both the database sessions.
    Could some one please let me know why we are getting those additional lines after installaing APEX ?
    Thanks in advance.

    Hi there,
    This is simply diagnostic information being emitted by the APEX component validation procedure. You would get the same output if you simply ran sys.validate_apex on the instance where APEX is installed.
    This isn't anything to be alarmed about - everything looks normal to me.
    Joel

  • S_ALR_87013543 report not showing line item correctly

    Hi all,
    The S_ALR_87013543 report or any other cost plan report not showing the line item report correctly.
    eg When the S_ALR_87013543 report executed it showing 100 as a plan value against one of cost element when we double click and go to line item report it showing only one entry of 50 which is wrong.
    when i checked the COSP table for the wbse with that cost element it has two entries with value type 1 and 29. value type 29 says value from sales order and 1 as plan .
    My query is why S_ALR_87013543 report not showing the correct value or shall it not pick the value from value type 29.
    regards
    Shiv

    Hi Preeti,
    Thanks for the updates but one more issue. In one case COSP has a one entry for value type=1 with Busniess transaction SDOR but it was not shown in line item report. it says " no line item were selected". inspite of entry in COSP. 
    Screenshot of report  attached,.
    when i checked the drill down report for line item it says no line item found.
    Any idea what went wrong
    Regards
    shiv

  • Project Plan cost report - not showing any output.

    Dear Experts,
    I have created several projects and done the planning.  I have used work centers and activity types for manpower cost planning. Also created some PRs against the project.
    When I goto the network activities and select the line item in the menu path Edit - costs - Planned/Actual - cost planned /actual
    It shows me the planned cost of the activity correctly.
    But when I am running the report CJI4, it shows nothing. The report is not at all executing.
    I dont understand why it's \not showing.
    I have checked the control key PS01 for the cost field is enabled (tick available on the cost friled)
    Can any one please help me??
    Thanks and Regards,
    Praveen

    1) Please check that the WBS element is integrated in plan, and the plan integration is fully activated in the project.
    2) Plan line items are only written in certain cases.
    The following rules are valid:
    1. Plan line items can be written in
    a) structure-oriented cost planning CJ40 (total values, annual values),
    b) cost planning on orders KO12,
    c) unit costing independent of cost elements,
    d) structure-oriented revenue planning CJ42 (total values, annual values)
    e) structure-oriented financial budgeting CJ48 (total values, annual values, period values)
    f) primary cost planning,
    g) activity planning,
    h) revenue element planning.
    2. Plan line items are never written in
    a) Unit costing on cost element level
    b) Network costing
    3. Line items are only written if a user status permits the business transaction 'Write plan line items' explicitly.
    Exception:
    For plan-integrated WBS elements and orders, line items are written in cost-element oriented planning if integrated corporate planning is activated in the fiscal-year parameters of the respective plan version, regardless of the user status.
    4. Plan line items for structure-oriented planning can only be displayed in the respective planning transaction under menu option "Extras-->Line items".
    Let me know if this was useful
    Ritesh

  • Please Help Xml output with extra lines after removeNodeChild

    Hi guys. I'm having trouble googling this out.
    Here is the problem. Given an xml document. I read it on my app and manipulate it, then save it when I am done.
    When I remove a child, the output files shows all the extra lines from the formatting and indent. So it looks like a big hole in the xml file after the node is removed. Here is an example
    <bookshelf>
    <books>
    <book>
    <isbn>3349583080580584308</isbn>
    <author>Jon Stewart</author>
    </book>
    <book>
    <isbn>9900909770543356488</isbn>
    <author>Stephen Colbert</author>
    </book>
    </books>
    </bookshelf>
    Node parentNode = jonStewartNode.getParentNode();
    parentNode.removeChild (jonStewartNode);The result of this is the following xml.
    <bookshelf>
    <books>
    <book>
    <isbn>9900909770543356488< /isbn>
    <author>Stephen Colbert</author>
    </book>
    </books>
    </bookshelf>
    How can I output the xml without this extra lines?
    Thanks in advance,
    f(t)
    PS: here is the initialization, and configuration of the TransformerFactory, and Transformer, and finally the save method.
         * Initializes factory instances and member variables.
        private void initialize(){
            try{
                //obtain a trasformer factory to save the file
                this.transformerFactory = TransformerFactory.newInstance();
                this.transformerFactory.setAttribute("indent-number", 4);
                //obtain the transforme
                this.transformer = this.transformerFactory.newTransformer();
                //setup transformer
                this.transformer.setOutputProperty(OutputKeys.METHOD, "xml");
                this.transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                //this.transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount ", "4");
            }catch(TransformerConfigurationException tcex){
                this.logger.logException(this, "errors.storage.xml.configuringXmlTransformer", true, tcex);
         * Saves the DOM document to the XML file.
        private void saveDocument(){
            //verify that the documents is not null
            if(this.document==null)
                return;
            //sincronize document
            synchronized (this.document){
                try{
                    //normalize document
                    this.document.normalizeDocument();
                    //get a document documentSource object out of the document
                    DOMSource documentSource                = new DOMSource(this.document);
                    //create the file output stream
                    FileOutputStream fileOutputStream       = new FileOutputStream( this.file);
                    //create the output stream writer
                    OutputStreamWriter outputStreamWriter   = new OutputStreamWriter(fileOutputStream);
                    //create the stream streamResult out to the file Stream
                    StreamResult streamResult               = new StreamResult(outputStreamWriter);
                    //performe the trasformation
                    transformer.transform(documentSource, streamResult);
                    //clean up
                    outputStreamWriter.close();
                    outputStreamWriter = null;
                    fileOutputStream.close();
                    fileOutputStream = null;
                    documentSource = null;
                } catch (TransformerConfigurationException tcex) {
                    // Error generated by the parser
                    // Log Error
                    this.logger.logException(this, "errors.storage.xml.saveXMLRepositoryFile", true, tcex);
                } catch (TransformerException tex) {
                    // Error generated by the parser
                    // Log Error
                    this.logger.logException(this, "errors.storage.xml.saveXMLRepositoryFile", true, tex);
                } catch (Exception ex) {
                    // Unknown error
                    // Log Error
                    this.logger.logException(this, "errors.storage.xml.saveXMLRepositoryFile", true, ex);
        }

    I have an rtf template which is used to print output in pdf format. I have a table which has many rows which displays data for each record. In order to avoid breaking the page in between the rows of a record , i have added an outer table with single row and column and pasted the data table inside it and changed the row property of outer table to 'Allow Rows to Break Across Pages' to unchecked. It works fine only if the first record set length does not exceed a full page. IF the first record expanded to more than one page, it leaves a blank page at the very first and start the record at the second page. Can you please advise how to solve this issue. Its very URGENT please..

  • Report not showing proper output in apps 11i

    Hi,
    I am new to oracle Apps 11i. I Have created customized reports . But Layout showing in builder and oracle apps 11i are different. The differernce is distance between the fields. Also labels and fields not showing full (truncating) value. But the same report giving proper output in repots6i builder.
    (i.e all customized reports layout showing 1/2 the width in oracle apps 11i)
    I will appreciate if somebody can give me some suggetion regarding this issue. Also I would like to know any template avaliable for 11i reports development.
    Regards

    hi,
    please make sure that in report builder fields must not contain any bold text , any line or any color b'coz apps11i reports are character mode reports hence if ur report contain any of these mentioned above give format different from the one it shows in report builder. u have to add one by one field and and run the report in apps environment .. in this way u have to move forward... guess it will help u....

  • How to run the report and show the output in excel file

    salam
    how to run the report and show the output in excel file,
    how to run the report and print the o/p via printer
    how to run the report and send the o/p via mail
    thank u all

    Hi,
    There are Parameters DESTTYPE, DESFORMAT and DESNAME. You can set these parameters to get as you want.
    1) Output in Excel File
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
         ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'DELIMITED');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<file_name>.XLS');2) output to printer
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<printer_name>');3) Email - Have to configure SMTP and all. ( i didn't checked it)
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'MAIL');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<email_id>');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • A Standard RRB report that shows actual project cost line items .... ?

    A Standard RRB report that shows actual project cost line items but that also shows amount/qty by rejected, billed, to be billed, postponed?
    I'm looking for something that will allow project managers to reconciile with the RRB totals and be able to dril in a see a level detail not available in RRB to decide what should be billed, what should should be deferred (postponed) and what should be rejected out of hand.
    Thanks.

    Thanks Virendra Pal but the VAx5 reports are not really the answer - maybe a custom report will be required right enough.

  • CJI5 commitment line item report not showing po gross value

    Dear All,
    system is showing only net value in CJI5 report, actaully gross value of po must be reflected in CJI5 report and this happening in all po's like material, service's etc. example is as follows.
    Example:
    po net value: 1000
    st 10%: 100
    po gross value : 1100 (inclusive of all taxes, ed, disc. etc)
    what could be the reason for not showing po gross value in commitment line item report.
    Thanks & Regards,
    Sandeep

    Hi,
    As far as i know the commitment report will never show you the value that is inclusive of taxes. It will only show the net value of the PO.
    I just tried a scenario in my system by creating a PO for a net value of 3000 GBP and based on the tax code i entered system calculated a tax of 525 GBP. However when i check CJI5 report it shows only 3000 GBP as commitment and not 3525 GBP. This is how the standard system behaves, i believe. You can cross check this in the table COOI. The COOI table also shows the net value of the PO and does not include the tax amount in commitment.
    Regards,
    Gokul

  • Selection screen in Cc reporting showing two lines when changed Person Res.

    Hi Guruz
    I have changed Person responsible in Cost centre hierarchy. Now I have two interval with different person responsible 1st one is from 01.01.07 to 31.12.2008 and 2nd one is from 01.01.2009 to 31.12.9999. When I go to cost centre report and look for the cost centre fo this cost centre system is showing two lines one with 1st Person responsible and second with 2nd Person responsible. I don't know how to show only latest one on the selection screen in cost centre reporting, any thoughts on this one?
    Many thanks

    Hi
    I wanted to keep history as well as showing only latest line for cost centre on selection screen but unfortunately it's not possible.
    The only way we can do this is change the name of person responsible from 01.01.2008 and system will show only one line. In this situation we will loose the history of the pervious person responsible for that cost centre but that's the way it works OR if you want history then we have to live with more than one line.
    Many thanks

  • Report for showing pending (ageing) quantity according to store location w

    dear ABAP Gurus,
    I have made a roport for showing pending (ageiing) quantity acc to location wise.
    and i m sending here the code i made for same.Tell me if sme amendments required.
    Report for showing pending (ageing) quantity according to store location wise:   
    1.     Fields on selection screen (input screen) : Plant code From to , Material code From to , Current date, Numbers of days(for display the ageing(pending) balance for a given period,Storage locations from to.
    2.     Field in the output List : Material code , Material descriptions, Balance quantiy,Balance value ,Consumptions date. 
    the code is:
    REPORT  ZAGEIN_SUDHA.
    TABLES: mara,mseg,makt.
    TYPES: BEGIN OF t_mara,
    matnr LIKE mara-matnr,           "material number
    maktx LIKE makt-maktx,           "material description
    ersda LIKE mara-ersda,           "material creation date
    lgort like mseg-lgort,           "storage location
    bwart like mseg-bwart,           "goods received or issued
    menge like mseg-menge,           "value at movement type
    werks like mseg-werks,           "plant
    END OF t_mara.
    DATA: i_mara TYPE STANDARD TABLE OF t_mara with header line,
          itab type standard table of mara with header line,
    *wa_mara TYPE t_mara,
    v_date TYPE i,                      "age in days
    GI type mseg-menge,                 "goods issued
    GR type mseg-menge,                 "goods received
    bal type mseg-menge,                "balance
    total type i,
    grace type i,
    g_quan type mseg-menge.
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    SELECT-OPTIONS: p_matnr FOR mara-matnr.
    select-options: p_werks for mseg-werks.
    select-options: p_lgort for mseg-lgort.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    REFRESH i_mara.
    SELECT mr~matnr                        "mara-matnr
    mk~maktx                               "makt-maktx
    mr~ersda                               "mara-ersda
    mg~lgort                               "mseg-lgort
    mg~bwart                               "mseg-bwart
    mg~menge                               "mseg-menge
    INTO corresponding fields of table i_mara
    FROM mara AS mr INNER JOIN
    makt AS mk
    ON mrmatnr = mkmatnr INNER JOIN mseg AS mg on mkmatnr = mgmatnr
    WHERE mrmatnr IN p_matnr and mgwerks IN p_werks and mg~lgort IN
    p_lgort.
    total = 0.
    IF sy-subrc = 0.
    *CLEAR wa_mara.
    LOOP AT i_mara.
    if i_mara-bwart = '101' .
    GR = total + i_mara-menge.
    total = GR.
    elseif
    i_mara-bwart = '102' or i_mara-bwart = '122'.
    GR = GR - i_mara-menge.
    endif.
    if i_mara-bwart = '261'.
    GI = total + i_mara-menge.
    elseif i_mara-bwart = '262'.
    GR = GR + i_mara-menge.
    endif.
    bal = GR - GI.
    if bal GE  GR.
    grace = 30.
    else.
    grace = 10.
    endif.
    g_quan = bal - GR.
    v_date = sy-datum - i_mara-ersda.
    endloop.
    WRITE: / i_mara-matnr ,i_mara-maktx,' is ',v_date,' ,days old  and
    stored at' ,i_mara-lgort ,   ' with balance =', bal ,'the grace time is
    ', grace, 'and' ,'grace quantity is ' ,g_quan.
    *ENDLOOP.

    Hi,
    That sounds like a nice report.  What about it?!
    Gareth.

  • Report Not showing result

    Hi!
    I am unable to get the result for my one of the item as checkbox. Other two are working properly .Please check and let me know wheres the problem please.
    ***INCLUDE ZSD_CONTRACT_LIST_T01_RENTAL1 .
    TABLES: vbak, vbap, wbrk, zsdsched,vbkd, fplt, fpla, tvlvt.
    TYPE-POOLS: slis.
    data: BEGIN OF gt_report occurs 0,
        vbeln LIKE vbak-vbeln,              "Sales Document
        posnr LIKE vbap-posnr,              "Item
        ernam LIKE vbak-ernam,              "Created by
        erdat LIKE vbak-erdat,              "Created on
        audat LIKE vbak-audat,              "Document Date
        vbtyp LIKE vbak-vbtyp,              "SD document category
        auart LIKE vbak-auart,              "Sales Document type
        vkorg LIKE vbak-vkorg,              "Sales Org
        vtweg LIKE vbak-vtweg,              "Distribution Channel
        spart LIKE vbak-spart,              "Division
        vkbur LIKE vbak-vkbur,              "Sales Office
        guebg LIKE vbak-guebg,              "Valid from date
        gueen LIKE vbak-gueen,              "Valid to date    kunnrt LIKE kna1-name1,             "Sold-to Name
       kunwet    LIKE kna1-name1,          "Ship-to Name
       kunnrt LIKE kna1-name1,             "Sold-to Name
       kunret    LIKE kna1-name1,          "Bill-to Name
        kunnr LIKE vbak-kunnr,              "Sold-to party
        kunnrt LIKE kna1-name1,             "Sold-to Name
        kvgr4 LIKE vbak-kvgr4,              "Territory
        matnr LIKE vbap-matnr,              "Material
        arktx LIKE vbap-arktx,              "Material Short Text
        charg LIKE vbap-charg,              "Batch
        matkl LIKE vbap-matkl,              "Material Group
        pstyv LIKE vbap-pstyv,              "Item Category
        zmeng LIKE vbap-zmeng,              "Target Quantity
        zieme LIKE vbap-zieme,              "Target Unit
        kdmat LIKE vbap-kdmat,              "Customer Material Number
        werks LIKE vbap-werks,              "Plant
        lgort LIKE vbap-lgort,              "Storage Location
        vstel LIKE vbap-vstel,              "Shipping Point
        route LIKE vbap-route,              "Route
        netpr LIKE vbap-netpr,              "Net Price
        kpein LIKE vbap-kpein,              "Condition Price Unit
        kmein LIKE vbap-kmein,              "Condition Unit
        shkzg LIKE vbap-shkzg,              "Returns Item
        oidrc LIKE vbap-oidrc,              "DRC Code
        kunwe LIKE vbap-oid_ship,           "Ship-to
        aufnr LIKE vbap-aufnr,              "Order Number
        vkaus LIKE vbap-vkaus,              "Usage
        kunwet    LIKE kna1-name1,          "Ship-to Name
        zzwprofid LIKE vbap-zzwprofid,      "Waste Profile ID
        kunre     LIKE wbrk-kunre,          "Bill-to
        kunret    LIKE kna1-name1,          "Bill-to Name
        addl_schd LIKE icon-id,             "Push Button For addl line
        datab     LIKE zsdsched-datab,      "Valid-From Date
        datbi     LIKE zsdsched-datbi,     "Valid To Date
        zschdfreq  LIKE zsdsched-zschdfreq, "Contract schedule frequency
        frequency  LIKE zsdsched-frequency, "Frequency
        monday    LIKE zsdsched-monday,     "Mondays
        tuesday   LIKE zsdsched-tuesday,    "Tuesdays
        wednesday  LIKE zsdsched-wednesday, "Wednesdays
        thursday  LIKE zsdsched-thursday,   "Thursdays
        friday    LIKE zsdsched-friday,     "Fridays
        saturday  LIKE zsdsched-saturday,   "Saturdays
        sunday    LIKE zsdsched-sunday,     "Sundays
        dzieme    LIKE zsdsched-dzieme,     "Target quantity UoM
        comments  LIKE zsdsched-comments,   "Comments
       END OF gt_report.
      data: Begin of gt_report1 occurs 0,
        fksaf     LIKE fplt-fksaf,
        afdat     LIKE fplt-afdat,
        fakwr     LIKE fplt-fakwr,
        fkdat     LIKE fplt-fkdat,
        nfdat     LIKE fplt-nfdat,
        fpart     LIKE fpla-fpart,
        bedat     LIKE fpla-bedat,
        endat     LIKE fpla-endat,
        horiz     LIKE fpla-horiz,
        bezei     LIKE tvlvt-bezei,
        vbeln     LIKE vbak-vbeln,
        erdat     LIKE vbak-erdat,
        ernam     LIKE vbak-ernam,
        guebg     LIKE vbak-guebg,
        gueen     LIKE vbak-gueen,
        auart     LIKE vbak-auart,
        kunnr     LIKE vbak-kunnr,
        kvgr4     LIKE vbak-kvgr4,
        vkbur     LIKE vbak-vkbur,
        vkorg     LIKE vbak-vkorg,
        vtweg     LIKE vbak-vtweg,
        vbtyp     LIKE vbak-vbtyp,
        name1     LIKE kna1-name1,
        pstyv     LIKE vbap-pstyv,
        matnr     LIKE vbap-matnr,
        werks     LIKE vbap-werks,
        oid_ship  LIKE vbap-oid_ship,
        kpein     LIKE vbap-kpein,
        kmein     LIKE vbap-kmein,
        netpr     LIKE vbap-netpr,
        kdmat     LIKE vbap-kdmat,
        posnr     LIKE vbap-posnr,
        matkl     LIKE vbap-matkl,
        aufnr     LIKE vbap-aufnr,
        vkaus     LIKE vbap-vkaus,
        route     LIKE vbap-route,
        kunre     LIKE wbrk-kunre,          "Bill-to
        kunwe LIKE vbap-oid_ship,           "Ship-to
        kunwet    LIKE kna1-name1,          "Ship-to Name
        kunnrt LIKE kna1-name1,             "Sold-to Name
        kunret    LIKE kna1-name1,          "Bill-to Name
        End of gt_report1.
    data: gs_report    LIKE LINE OF gt_report,
          gs_report1   LIKE LINE OF gt_report1,
          gt_sched     TYPE TABLE OF zsdsched,
          gt_sched_tmp TYPE TABLE OF zsdsched,
          gs_sched     TYPE zsdsched,
          gt_sel       LIKE gt_report OCCURS 0,
          gt_sel1      LIKE  gt_report1 OCCURS 0,
          gt_vbpa  TYPE TABLE OF vbpa,
          gs_vbpa  TYPE vbpa,
          gv_auart TYPE auart,
          gv_counter TYPE i.
    **-- ALV variables
    DATA: ls_fieldcat     TYPE slis_fieldcat_alv,    "Field Catalog list
          gt_fieldcat     TYPE slis_t_fieldcat_alv,  "Field Catalog
          ls_sort         TYPE slis_sortinfo_alv,    "Sorting list
          gt_sort         TYPE slis_t_sortinfo_alv,  "Sort
          gs_layout       TYPE slis_layout_alv,      "List Layout
          gs_variant      TYPE disvariant,           "Display Variant
          gv_repid        LIKE sy-repid,
          gv_save(1)           TYPE c,
          ls_fieldcat1     TYPE slis_fieldcat_alv,    "Field Catalog list
          gt_fieldcat1     TYPE slis_t_fieldcat_alv,  "Field Catalog
          ls_sort1         TYPE slis_sortinfo_alv,    "Sorting list
          gt_sort1         TYPE slis_t_sortinfo_alv,  "Sort
          gs_layout1       TYPE slis_layout_alv,      "List Layout
          gs_variant1      TYPE disvariant,           "Display Variant
          gv_repid1        LIKE sy-repid,
          gv_exit(1)           TYPE c.
    CONSTANTS: gc_a     TYPE c VALUE 'A',
               gc_g     TYPE c VALUE 'G',
               gc_re(2) TYPE c VALUE 'RE'.
    Screen-control Variables
    CONTROLS:
      tctrl_sched TYPE TABLEVIEW USING SCREEN 1010.     " Schedule lines.
    *& Report  ZSD_CONTRACT_LIST
    *& Created on: January 21, 2007
    *& Description: List of Contracts - ALV
    REPORT  zsd_contract_list_rental1.
    INCLUDE zsd_contract_list_t01_rental1.
    Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK m1 WITH FRAME TITLE text-t01.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t02.
    SELECT-OPTIONS: s_vkorg FOR vbak-vkorg MEMORY ID vko,
                    s_vtweg FOR vbak-vtweg MEMORY ID vtw,
                    s_spart FOR vbak-spart MEMORY ID spa,
                    s_vkbur FOR vbak-vkbur MEMORY ID vkb.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                    s_erdat FOR vbak-erdat,
                    s_ernam FOR vbak-ernam,
                    s_guebg FOR vbak-guebg,
                    s_gueen FOR vbak-gueen,
                    s_auart FOR gv_auart MEMORY ID vta
                                         MATCHCODE OBJECT h_vakz,
                   s_fkarv FOR fplt-fkarv.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:
                    s_kunnr FOR vbak-kunnr,
                    s_kunwe FOR vbap-oid_ship,
                    s_kunre FOR wbrk-kunre.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS: s_werks FOR vbap-werks MEMORY ID wrk,
                    s_lgort FOR vbap-lgort MEMORY ID lag,
                    s_vstel FOR vbap-vstel MEMORY ID vst,
                    s_route for vbap-route,
                    s_matnr FOR vbap-matnr.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t04.
    PARAMETERS:     p_varia TYPE disvariant-variant MEMORY ID wrk,
                    p_all   AS CHECKBOX DEFAULT 'X',
                    p_group AS CHECKBOX DEFAULT 'X',
                    p_rental AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN END OF BLOCK m1.
    Start of Selection
    START-OF-SELECTION.
      PERFORM get_data.
    Display ALV
    END-OF-SELECTION.
      IF gt_report[] IS INITIAL.
        MESSAGE s419(brain).
      ELSE.
        PERFORM create_alv.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST                                 *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varia.
      PERFORM f01_f4_variant CHANGING p_varia.
    *&      Form  get_data
          text
    FORM get_data .
       select the appropriate rental data.
    IF  p_rental IS NOT INITIAL AND ( ( p_all IS INITIAL ) AND ( p_group IS INITIAL ) ).
    SELECT avbeln aerdat aernam aaudat avbtyp aauart a~vkorg
           avtweg aspart avkbur aguebg agueen akunnr a~kvgr4
           bpstyv bmatnr bwerks boid_ship bkpein bkmein
           bnetpr bkdmat bposnr bmatkl baufnr bvkaus b~route
           dbezei efkarv eafdat efakwr efkdat enfdat e~fksaf
           ffpart fbedat fendat fhoriz flodat ftndat b~oid_ship AS kunwe
    INTO CORRESPONDING FIELDS OF TABLE gt_sel1
         FROM vbak AS a
             INNER JOIN vbap AS b ON avbeln = bvbeln
            INNER JOIN vbpa as c ON avbeln = cvbeln
             INNER JOIN vbkd AS g ON avbeln = gvbeln
             INNER JOIN fplt AS e ON gfplnr = efplnr
             INNER JOIN fpla AS f ON efplnr = ffplnr
             INNER JOIN tvlvt AS d ON bvkaus = dabrvw
         WHERE a~vbeln IN s_vbeln
           AND a~erdat IN s_erdat
           AND a~vbtyp = gc_g
           AND a~ernam IN s_ernam
           AND a~vkorg IN s_vkorg
           AND a~vtweg IN s_vtweg
           AND a~spart IN s_spart
           AND a~vkbur IN s_vkbur
           AND a~guebg IN s_guebg
           AND a~gueen IN s_gueen
           AND a~auart IN s_auart
           AND a~kunnr IN s_kunnr
           AND b~oid_ship IN s_kunwe
           AND b~werks IN s_werks
           AND b~lgort IN s_lgort
           AND b~vstel IN s_vstel
           and b~route in s_route
           AND b~matnr IN s_matnr
           AND e~fkarv IN s_fkarv
           AND e~fksaf = 'A'
           OR  e~fksaf = 'B'.
        sort gt_sel1.
    *ENDIF.
        IF NOT gt_sel1[] IS INITIAL.
      Get Bill-to Party's for Item Lines
        SELECT vbeln posnr parvw kunnr INTO CORRESPONDING FIELDS OF TABLE gt_vbpa
            FROM vbpa
            FOR ALL ENTRIES IN gt_sel1
            WHERE vbeln = gt_sel1-vbeln
              AND parvw = gc_re.
    Loop through captured data for additional information
      LOOP AT gt_sel1 INTO gs_report1.
      Find the bill-to party
        READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report1-vbeln
                                                 posnr = gs_report1-posnr
                                                 parvw = gc_re.
        IF sy-subrc <> 0.
          READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report1-vbeln
                                                   parvw = gc_re.
          CHECK sy-subrc = 0 AND gs_vbpa-kunnr IN s_kunre.
        ELSE.
          CHECK gs_vbpa-kunnr IN s_kunre.
        ENDIF.
        gs_report1-kunre = gs_vbpa-kunnr.
    Get the Customer's Name
        gs_report1-kunnrt = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunnr ).
        gs_report1-kunwet = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunwe ).
        gs_report1-kunret = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunre ).
      Get the scheduling lines for the item line.
        CLEAR gv_counter.
        APPEND gs_report1 TO gt_report1.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM gt_report1.
    *ENDIF.
    ELSE.
    IF ( ( p_all IS NOT INITIAL ) OR ( p_group IS NOT INITIAL ) ) AND p_rental IS INITIAL.
      Select the appropriate contract data.
      SELECT a~vbeln a~erdat a~ernam a~audat a~vbtyp a~auart a~vkorg
       a~vtweg a~spart a~vkbur a~guebg a~gueen a~kunnr a~kvgr4
       b~posnr b~matnr b~charg b~matkl b~arktx b~pstyv b~zmeng
       b~zieme b~kdmat b~werks b~lgort b~vstel b~netpr b~kpein
       b~kmein b~shkzg b~oid_extbol b~oid_miscdl b~oidrc b~oid_ship AS kunwe
       b~zzwprofid c~datbi c~datab b~route
      baufnr bvkaus d~bezei
         INTO CORRESPONDING FIELDS OF TABLE gt_sel
         FROM vbak AS a
             INNER JOIN vbap AS b ON a~vbeln = b~vbeln
            INNER JOIN tvlvt AS d ON bvkaus = dabrvw
             LEFT OUTER JOIN zsdsched AS c ON b~vbeln = c~vbeln AND
                                   b~posnr = c~posnr
         WHERE a~vbeln IN s_vbeln
           AND a~erdat IN s_erdat
           AND a~vbtyp = gc_g
           AND a~ernam IN s_ernam
           AND a~vkorg IN s_vkorg
           AND a~vtweg IN s_vtweg
           AND a~spart IN s_spart
           AND a~vkbur IN s_vkbur
           AND a~guebg IN s_guebg
           AND a~gueen IN s_gueen
           AND a~auart IN s_auart
           AND a~kunnr IN s_kunnr
           AND b~oid_ship IN s_kunwe
           AND b~werks IN s_werks
           AND b~lgort IN s_lgort
           AND b~vstel IN s_vstel
           and b~route in s_route
           AND b~matnr IN s_matnr.
      SORT gt_sel.
    ENDIF.
      IF NOT gt_sel[] IS INITIAL.
      Get Bill-to Party's for Item Lines
        SELECT vbeln posnr parvw kunnr INTO CORRESPONDING FIELDS OF TABLE gt_vbpa
            FROM vbpa
            FOR ALL ENTRIES IN gt_sel
            WHERE vbeln = gt_sel-vbeln
              AND parvw = gc_re.
    endif.
      Select the remaining records from the ZSDSCHED Table.
    IF p_group IS NOT INITIAL.
        SELECT * FROM zsdsched
            INTO TABLE gt_sched
            FOR ALL ENTRIES IN gt_sel
            WHERE vbeln = gt_sel-vbeln
              AND posnr = gt_sel-posnr.
        SORT gt_sched.
      ENDIF.
    Loop through captured data for additional information
      LOOP AT gt_sel INTO gs_report.
      Find the bill-to party
        READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report-vbeln
                                                 posnr = gs_report-posnr
                                                 parvw = gc_re.
        IF sy-subrc <> 0.
          READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report-vbeln
                                                   parvw = gc_re.
          CHECK sy-subrc = 0 AND gs_vbpa-kunnr IN s_kunre.
        ELSE.
          CHECK gs_vbpa-kunnr IN s_kunre.
        ENDIF.
        gs_report-kunre = gs_vbpa-kunnr.
    Get the Customer's Name
        gs_report-kunnrt = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunnr ).
        gs_report-kunwet = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunwe ).
        gs_report-kunret = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunre ).
      Get the scheduling lines for the item line.
        CLEAR gv_counter.
        IF NOT p_group IS INITIAL.
        If we are grouping the lines add the icon button.
          LOOP AT gt_sched INTO gs_sched WHERE vbeln = gs_report-vbeln
                                         AND posnr = gs_report-posnr.
            IF gv_counter > 0.
              gs_report-addl_schd = '@1E@'.
              CONTINUE.
            ENDIF.
            MOVE-CORRESPONDING gs_sched TO gs_report.
            ADD 1 TO gv_counter.
          ENDLOOP.
        ELSE.
        Otherwise get the rest of the schedule information
          READ TABLE gt_sched INTO gs_sched
            WITH KEY vbeln = gs_report-vbeln
                     posnr = gs_report-posnr
                     datbi = gs_report-datbi
                     datab = gs_report-datab.
          IF sy-subrc = 0.
            MOVE-CORRESPONDING gs_sched TO gs_report.
          ENDIF.
        ENDIF.
        APPEND gs_report TO gt_report.
      ENDLOOP.
    Remove any duplicates from the reporting table
      DELETE ADJACENT DUPLICATES FROM gt_report.
    If Show all records is initial, delete non-scheduled lines (ex. Sub-items)
      IF p_all IS INITIAL.
        DELETE gt_report WHERE datbi = 0
                            AND datab = 0.
      ENDIF.
    endif.
    endif.
    ENDFORM.                    " get_data
    *&      Form  create_alv
          text
    FORM create_alv .
    if ( ( p_all is not initial ) or ( p_group is not initial ) ) and p_rental is initial.
      PERFORM initialize_fieldcat USING gt_fieldcat[].
      PERFORM populate_layout CHANGING gs_layout
                                       gs_variant.
      PERFORM populate_sort   USING gt_sort[].
      PERFORM display_alv_report.
    else.
    if  p_rental is not initial and ( ( p_all is initial ) and ( p_group is initial ) ).
    PERFORM initialize_fieldcat1 USING gt_fieldcat1[].
    PERFORM populate_layout1 CHANGING gs_layout1
                                      gs_variant1.
    PERFORM populate_sort1   USING gt_sort1[].
    PERFORM display_alv_report1.
    *endif.
    *endif.
    ENDFORM.                    " create_alv
    *&      Form  initialize_fieldcat
      Get and enhance the field catalog data
         -->L_FIELDCAT[]  text
    FORM initialize_fieldcat USING l_fieldcat TYPE slis_t_fieldcat_alv.
    IF p_rental IS NOT INITIAL .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = 'ZSD_CONTRACT_LIST_RENTAL1'
          i_internal_tabname     = 'GT_REPORT1'
          i_inclname             = 'ZSD_CONTRACT_LIST_T01_RENTAL1'
        CHANGING
          ct_fieldcat            = l_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'VBELN'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Contract'.
      ls_fieldcat-hotspot     = 'X'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNNRT'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sold-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNWET'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Ship-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNRET'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Bill-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
    READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'ADDL_SCHD'.
      IF NOT p_group IS INITIAL.
        ls_fieldcat-seltext_s = 'Schd'.
        ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Additional Scheduling Lines'.
        ls_fieldcat-icon = 'X'.
        CLEAR: ls_fieldcat-key,
               ls_fieldcat-ref_fieldname,
               ls_fieldcat-ref_tabname,
               ls_fieldcat-reptext_ddic,
               ls_fieldcat-ddic_outputlen.
        ls_fieldcat-hotspot     = 'X'.
        MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      ELSE.
        DELETE l_fieldcat INDEX sy-tabix.
      ENDIF.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'DATAB'.
      ls_fieldcat-seltext_s = 'Schd From'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. From Date'.
      CLEAR: ls_fieldcat-key.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat1 WITH KEY fieldname = 'DATBI'.
      ls_fieldcat-seltext_s = 'Schd To'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. To Date'.
      CLEAR: ls_fieldcat-key.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
    ELSE.
    IF p_rental IS INITIAL.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = 'ZSD_CONTRACT_LIST_RENTAL1'
          i_internal_tabname     = 'GT_REPORT'
          i_inclname             = 'ZSD_CONTRACT_LIST_T01_RENTAL1'
        CHANGING
          ct_fieldcat            = l_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'VBELN'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Contract'.
      ls_fieldcat-hotspot     = 'X'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNNRT'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sold-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNWET'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Ship-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNRET'.
      ls_fieldcat-seltext_s =
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Bill-to Name'.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'ADDL_SCHD'.
      IF NOT p_group IS INITIAL.
        ls_fieldcat-seltext_s = 'Schd'.
        ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Additional Scheduling Lines'.
        ls_fieldcat-icon = 'X'.
        CLEAR: ls_fieldcat-key,
               ls_fieldcat-ref_fieldname,
               ls_fieldcat-ref_tabname,
               ls_fieldcat-reptext_ddic,
               ls_fieldcat-ddic_outputlen.
        ls_fieldcat-hotspot     = 'X'.
        MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      ELSE.
        DELETE l_fieldcat INDEX sy-tabix.
      ENDIF.
      READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'DATAB'.
      ls_fieldcat-seltext_s = 'Schd From'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. From Date'.
      CLEAR: ls_fieldcat-key.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
      READ TABLE l_fieldcat INTO ls_fieldcat1 WITH KEY fieldname = 'DATBI'.
      ls_fieldcat-seltext_s = 'Schd To'.
      ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. To Date'.
      CLEAR: ls_fieldcat-key.
      MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
    ENDIF.
    ENDIF.
    ENDFORM.                    " initialize_fieldcat
    *&      Form  populate_layout
          text
         <--GS_LAYOUT
         <--GS_VARIANT
    FORM populate_layout CHANGING  gs_layout  TYPE slis_layout_alv
                                   gs_variant TYPE disvariant.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-allow_switch_to_list = 'X'.
      gs_layout-zebra                = 'X'.
      gs_variant-report = sy-repid.
    ENDFORM.                    " populate_layout
    *&      Form  populate_sort
          text
         -->l_SORT[]  text
    FORM populate_sort USING l_sort TYPE slis_t_sortinfo_alv.
    ENDFORM.                    " populate_sort
    *&      Form  display_alv_report
    FORM display_alv_report .
      gv_repid = sy-repid.
    IF p_rental IS INITIAL.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
          i_callback_program              =  gv_repid
        I_CALLBACK_PF_STATUS_SET       = ' '
          i_callback_user_command        = 'USER_COMMAND'
          i_structure_name               =  'GT_REPORT'
          is_layout                      =   gs_layout
          it_fieldcat                     =  gt_fieldcat
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
          it_sort                        =  gt_sort
        IT_FILTER                      =
        IS_SEL_HIDE                    =
          i_default                      = 'X'
          i_save                         = gc_a
          is_variant                     = gs_variant
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
        IS_PRINT                       =
        IS_REPREP_ID                   =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
          TABLES
            t_outtab                       = gt_report
         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.
    ENDIF.
    ELSE.
    IF p_rental IS NOT INITIAL.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
          i_callback_program              =  gv_repid
        I_CALLBACK_PF_STATUS_SET       = ' '
          i_callback_user_command        = 'USER_COMMAND'
          i_structure_name               =  'GT_REPORT1'
          is_layout                      =   gs_layout
          it_fieldcat                     =  gt_fieldcat
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
          it_sort                        =  gt_sort
        IT_FILTER                      =
        IS_SEL_HIDE                    =
          i_default                      = 'X'
          i_save                         = gc_a
          is_variant                     = gs_variant
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
        IS_PRINT                       =
        IS_REPREP_ID                   =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
          TABLES
            t_outtab                       = GT_REPORT1
         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.
    endif.
    endif.
    ENDFORM.                    " display_alv_report
    *&      Form  initialize_fieldcat1
      Get and enhance the field catalog data for rental fields
         -->L_FIELDCAT[]  text
    *FORM initialize_fieldcat1 USING l_fieldcat1 TYPE slis_t_fieldcat_alv.
    **if ***
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name         = 'ZSD_CONTRACT_LIST_rental1'
         i_internal_tabname     = 'GT_SEL1'
         i_inclname             = 'ZSD_CONTRACT_LIST_T01_rental1'
       CHANGING
         ct_fieldcat            = l_fieldcat1
       EXCEPTIONS
         inconsistent_interface = 1
         program_error          = 2
         OTHERS                 = 3.
    **else.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name         = 'ZSD_CONTRACT_LIST_rental1'
         i_internal_tabname     = 'GT_SEL1'
         i_inclname             = 'ZSD_CONTRACT_LIST_T01_rental1'
       CHANGING
         ct_fieldcat            = l_fieldcat1
       EXCEPTIONS
         inconsistent_interface = 1
         program_error          = 2
         OTHERS                 = 3.
    ***endfi.
    *ENDFORM.                    " initialize_fieldcat
    *&      Form  populate_layout
          text
         <--GS_LAYOUT
         <--GS_VARIANT
    *FORM populate_layout1 CHANGING  gs_layout1  TYPE slis_layout_alv
                                  gs_variant1 TYPE disvariant.
    gs_layout1-colwidth_optimize = 'X'.
    gs_layout1-allow_switch_to_list = 'X'.
    gs_layout1-zebra                = 'X'.
    gs_variant1-report = sy-repid.
    *ENDFORM.                    " populate_layout
    ***&      Form  populate_sort
          text
         -->l_SORT[]  text
    *FORM populate_sort1 USING l_sort TYPE slis_t_sortinfo_alv.
    *ENDFORM.                    " populate_sort
    ***&      Form  display_alv_report
    *FORM display_alv_report1 .
    gv_repid = sy-repid.
    if  p_rental is not initial and ( ( p_all is initial ) and ( p_group is initial ) ).
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
         i_callback_program              =  gv_repid
        I_CALLBACK_PF_STATUS_SET       = ' '
         i_callback_user_command        = 'USER_COMMAND'
         i_structure_name               =  'gt_sel1'
         is_layout                      =   gs_layout1
         it_fieldcat                     =  gt_fieldcat1
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
         it_sort                        =  gt_sort1
        IT_FILTER                      =
        IS_SEL_HIDE                    =
         i_default                      = 'X'
         i_save                         = gc_a
         is_variant                     = gs_variant1
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
        IS_PRINT                       =
        IS_REPREP_ID                   =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
         TABLES
           t_outtab                       = gt_sel1
        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.
    *endif.
    *ENDFORM.                    " display_alv_report
    *&      Form  f01_f4_variant
       Get the Layout variant for the user.
    FORM f01_f4_variant CHANGING c_variant TYPE disvariant-variant.
      DATA: ls_variant TYPE disvariant,
            l_exit     TYPE char1.
      ls_variant-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = ls_variant
                i_save              = 'A'
              it_default_fieldcat =
           IMPORTING
                e_exit              = l_exit
                es_variant          = ls_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 l_exit EQ space.
          c_variant = ls_variant-variant.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f01_f4_variant
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_report INTO gs_report INDEX rs_selfield-tabindex.
          CHECK sy-subrc = 0.
          CASE rs_selfield-fieldname.
            WHEN 'VBELN'.
          Set parameter ID for transaction screen field
              CHECK NOT gs_report-vbeln IS INITIAL.
              SET PARAMETER ID 'KTN' FIELD gs_report-vbeln.
              CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN.
            WHEN 'ADDL_SCHD'.
              CHECK NOT gs_report-addl_schd IS INITIAL.
              REFRESH gt_sched_tmp.
              LOOP AT gt_sched INTO gs_sched
                               WHERE vbeln = gs_report-vbeln
                                 AND posnr = gs_report-posnr.
                APPEND gs_sched TO gt_sched_tmp.
              ENDLOOP.
              CHECK sy-subrc = 0.
              CALL SCREEN '1010' STARTING AT 5 5.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Module  STATUS_1010  OUTPUT
          text
    MODULE status_1010 OUTPUT.
      SET PF-STATUS 'MAIN_1010'.
      SET TITLEBAR '1010' WITH gs_report-vbeln gs_report-posnr.
    ENDMODULE.                 " STATUS_1010  OUTPUT
    *&      Module  USER_COMMAND_1010  INPUT
          text
    MODULE user_command_1010 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'CANC'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1010  INPUT

    Hi !
    This report shows the schedule line items , group schedule line items and rental contact (billing plan) lines when particular checkbox is checked. The checkboxs p_all(non-schedule line) , p_group(group schedule line items) are working in my above alv report and showing  result but unfortunately when p_rental is checked it dosent give me result , it says  no data selected. This when checked has to show result based on a different set of selections as I have done, but its not shwoing me the result .
    Kindly help please.
    Thanks

  • Terminal generates so extra lines every time I use a pipe ? Any Ideas ?

    I am trying to extract my Public IP using bash, and have figured out several ways to do this, but I am having some unexpected lines in the result.
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 105 100 105 0 0 195 0 --:--:-- --:--:-- --:--:-- 0
    Anybody have any idea how to get rid of the extra lines ?
    I recently re-installed the OS on my machine, and switched over to bash. Ever since then every time I issue a command that contains a pipe, I am getting some extraneous lines before the result.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:56PM) -> [username] ~ $ curl http://checkip.dyndns.org/
    <html><head><title>Current IP Check</title></head><body>Current IP Address: 45.xxx.46.204</body></html>
    Comment : Need to get rid of everything except "45.xxx.46.204"
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:03PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.'
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 105 100 105 0 0 611 0 --:--:-- --:--:-- --:--:-- 0
    45.xxx.46.204
    Comment : OK. This returns the correct value but it inserted 3 additional lines prior to the result.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:56PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' '
    " 45.xxx.46.204 "
    Comment : This inserts replaces the unwanted characters with spaces, if I try to replace using '' the empty space, then "45.xxx.46.204" dissapears. It seems like a bug to me that you cannot replace a character with an empty value.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:57PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g'
    45.xxx.46.204
    Comment : OK. But requires an extra step...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:57PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt
    Comment : This works fine, sends the correct result to a file. The three extra lines remain with the terminal and do not go to the output file
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:21PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g'
    Current IP CheckCurrent IP Address: 45.xxx.46.204
    Comment : This uses sed instead of tr, but I still have to get rid of "Current IP CheckCurrent IP Address: "
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:22PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g'
    45.xxx.46.204
    Comment : OK. This returns the correct value but it inserted 3 additional lines.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:37PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    Comment : This works fine, sends the correct result to a file.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:43PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    45.xxx.46.204
    Comment : OK. This appears to be the easiest way to do this...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:44PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    Comment :
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:41PM) -> [username] ~ $ ifconfig | grep broadcast
    inet 192.168.1.102 netmask 0xffff0000 broadcast 192.168.255.255
    inet 192.168.1.153 netmask 0xffffff00 broadcast 192.168.1.255
    Comment : Now for the Private Addresses, and the netmask...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:46PM) -> [username] ~ $ ifconfig | grep broadcast | awk '{print $2 }'
    192.168.1.102
    192.168.1.153
    Comment : Now for the Private Addresses...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:49PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    45.xxx.46.204
    192.168.1.102
    192.168.1.153
    Comment : Here are the Public & Private Addresses
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:50PM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; \
    ifconfig | grep broadcast | awk '{print $2 }'
    45.xxx.46.204
    192.168.1.102
    192.168.1.153
    Comment : This is a slightly different way to enter one command on each line
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.15.05](12:08AM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    Comment : The Public & Private Addresses are sent to a file, and the file is opened
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.15.05](12:08AM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' \
    ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' \
    ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    Comment : This is a slightly different way to view the commands
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    #!/bin/bash
    # ip.sh
    testfile=/Applications/BBEdit.app/
    if [ -d $testfile ] ;
    then
    # THE NEXT LINE GENERATES AN ERROR -> line 10:  : command not found
      echo ${testfile} exists!
    fi
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt
    if [ -d /Applications/BBEdit.app ]; then
    open -a /Applications/BBEdit.app ~/Desktop/IP_Address.txt
    else
    open ~/Desktop/IP_Address.txt
    fi
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC & PRIVATE ADDRESS]
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC ADDRESS] THESE ALL WORK FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g'
    curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | tr '' '\n' | grep '\.'
    curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.'
    curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g'
    curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PRIVATE ADDRESS] THIS WORKS FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    ifconfig | grep broadcast | awk '{print $2 }'
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC & PRIVATE ADDRESS] THESE WORK FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    COPY CONTENT BETWEEN THE DASHED LINES AND PASTE IN THE TERMINAL
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' \
    ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' \
    ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    PROBLEM : I HAVE NO CLUE HOW TO GET RID OF THE THREE LINES:
    They were displayed by the terminal everytime I used a pipe, but I removed them for the sake of clarity
    Best Regards,
    Bill Hernandez
    Plano, Texas

    Thank You Very Much for enlightening me to the "-s" flag, that solved the problem...
    [2007.15.05](06:16PM) -> [username] ~ $ curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    45.xxx.46.204
    ( 1 ) Sure enough I was missing the "-s" flag, I kept thinking it was something to do with the pipes because if I just entered
    [2007.15.05](06:21PM) -> [username] ~ $ curl http://checkip.dyndns.org
    <html><head><title>Current IP Check</title></head><body>Current IP Address: 45.xxx.46.204</body></html>
    ( 2 ) It did not add the extra lines. They only appeared when I added a pipe. How bizarre...
    ( 3 ) Once I looked at the man pages the "-s" became more obvious. It is still odd...
    [2007.15.05](06:21PM) -> [username] ~ $ man curl
    -s/--silent
    Silent mode. Don't show progress meter or error messages. Makes Curl mute.
    If this option is used twice, the second will again disable mute.
    THIS SOLVES THE PROBLEM :
    [2007.15.05](06:21PM) -> [username] ~ $ \
    curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    ANYWAY HERE'S THE FINAL SCRIPT...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    #!/bin/bash
    # ScriptName : myip
    # Author : Bill Hernandez
    # Location : Plano, Texas
    # Modified : Tuesday, May 15, 2007 (6:32 PM)
    curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt
    if [ -d /Applications/BBEdit.app ]; then
    open -a /Applications/BBEdit.app ~/Desktop/IP_Address.txt
    else
    open ~/Desktop/IP_Address.txt
    fi
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    Best Regards,
    Bill Hernandez
    Plano, texas

  • Export to text creates extra line

    I've created a number of fixed width extract reports that will be used to upload data into another system.  The files, in general, are fine, however Crystal Reports 2008 is adding an extra line to the end of the file.  This is causing the upload to fail.
    I've created several. extract reports before, so I reviewed a sample extract from a report I created in Crystal Reports XI R2 and it, too, had the same issue.
    Googling indicates that others have had the same issue, but I have yet to find a resolution to the problem.
    Has anybody else encountered this and do you know how to resolve the issue?
    Thank you, Kurt

    Hi Kurt,
    In my scheduler app I have a command line option to remove (or replace characters) in the resulting export file.  This was developed for exactly that reason (so there is a special option to remove/replace only the last character in the file).
    You can develop the same approach.  Alternatively, there are more direct upload options (the export can go directly into a database table).
    hth,
    - Ido

Maybe you are looking for

  • Error in Claims Approval Process

    Hi, I Configured ESS.I applied LTA Claim through portal.It went fot the approval to the approver.It is there in Universal Worklist of Approver but when he clicks on it to approve instead of opening WebDynpro iView it is giving an error that "Portal R

  • Error while doing BDC

    Hi, I am doing a bdc program on t.code MIR4 (Display invoice screen).The problem is this screen has a SGA/GPA set so that whenever you into this transaction the last entered value is shown in the first screen. While doing BDC i deleted the old invoic

  • SAP Library - Business Transaction

    To add a comment, please log in or register on the top of this page and choose Reply. Please write your comment in English. You can also go back to the SAP help page.

  • UDB online backup runs forever

    Hi! I started an online backup last Friday. Until now the backup is still running. Seems it is because of some network issue but we dont know exactly what is wrong. We want either 1) kill the backup or 2) restart the server. We have tried to kill it

  • Hosting Websites

    Ok, im VERY new at making web pages/ putting them on the net, i want to make a site, and im trying to put a test page on the site, but i cant seem to do it, I want to host the site of my computer, so technically it schouldnt cost anything... right? i