Adding All Records In Report Parameter

This is in addition to my previous post.
I have this code as the source to a lov
SELECT l.extkey||' - '||l.longdescr a, l.clocid b
from udm_cloc l, udm_cust c, udm_lde lde
where l.custid = c.custid
and c.ldeid = lde.ldeid
and lde.ldekey = :F140_LDEKEY
and l.closedate is null
and l.orddcid = :P9_DCID
union
select 'ALL Records' a, -1 b from dual
ORDER by 2It is working fine except I need to change the ORDER BY clause to
ORDER BY to_number(l.extkey) asc
When I do that, I get an error
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
Cheers
Gus

Gus C wrote:
This is in addition to my previous post.
I have this code as the source to a lov
SELECT l.extkey||' - '||l.longdescr a, l.clocid b
from udm_cloc l, udm_cust c, udm_lde lde
where l.custid = c.custid
and c.ldeid = lde.ldeid
and lde.ldekey = :F140_LDEKEY
and l.closedate is null
and l.orddcid = :P9_DCID
union
select 'ALL Records' a, -1 b from dual
ORDER by 2It is working fine except I need to change the ORDER BY clause to
ORDER BY to_number(l.extkey) asc
When I do that, I get an error
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.Create your query as an in-line view, including any additional columns required for sorting, and perform the sort and final LOV projection in the outer query:
select
          lov_label
        , lov_value
from
          (select
                    deptno || ' - ' || ename                lov_label
                  , empno                                   lov_value
                  , /* to_number here if required */ deptno lov_sort
          from
                    emp
          union all
          select
                    '- All -'
                  , null
                  , null
          from
                    dual)
order by
          lov_sort nulls first

Similar Messages

  • "All" option in report parameter

    Hi
    I created 4 parameters for my report.
    Those default selected are the 1st value in database so if click "submit query" its not display ALL
    so now i wanna create an "All" option for each parameter and make it default so it make easier to users if they want to display all
    How to create this "All" option?
    Thank you

    Hi,
    First thing is that hopefully your query has been done is such a way that it can show all.
    If not you can use the parameter along with NVL as follows :
    where column_code = nvl (:test_parameter, column_code)
    user13010403 wrote:Those default selected are the 1st value in database so if click "submit query" its not display ALLI am not sure what you meant by this, I think you are using Report Parameter form.
    For the test_parameter in the query for the list of values use such a type of query:
    select column_code,  column_name
    from  table_name
    union
    select null, '***All***'
    from dual
    order by 2Note: using *** before All will place it first for ordering
    Hope this helps
    Best Regards
    Arif Khadas
    Also for List of Values for parameter check 'Hide first Column'
    Edited by: Arif Khadas on May 5, 2010 1:23 PM

  • Help with selecting 10 random records from all records meeting report selection criteria in Crystal 11

    <p>I am trying to select ten random records from all that match the report selection criteria then report on each of these random records for QA/QI.  I have tried the RND function however it is giving me a random number rather than a random record selection.  I cannot figure this out and am despirately seeking assistance.</p><p>Thank you,</p><p>Amy</p>

    <p>I don&#39;t know of any Random record selection functions but maybe you could write your own custom function inside of a record selection to randomly filter the records.  You would use the Rand function we currently have to decide if a record was included in the report data or not.</p><p>Another possible option is to filter the records before they get to the report.  You can only do this if you are pushing the data into the report instead of having the report pull the data.  An example of this would be passing an ado recordset to a report at runtime. </p><p>Rob Horne</p><p>http://diamond.businessobjects.com/blog/10 </p>

  • Not getting all records in reports

    Hi ,
    I'm using reports 6 version
    and i have a report and in that in the trailer section i have a repeating frame which should written 46 records. but in the out put it showing me only 31 records remainin records are not appearing. i guess that page can display only 31 records but its not going to next page and displaying the remaining records.
    if any one can help me pls do.
    thanks in advance

    This is the Forms forum.
    Please post you question in the [url http://forums.oracle.com/forums/forum.jspa?forumID=84]Reports Form I'm sure the guys over there can help you more.
    Regards
    Tony

  • Two report parameter with or condition /either should be selected

    hello,
    In my ssrs report builder 3 i am creating report for sharepoint list,where i have placed 2 report parameters ,when i select only one parameter it gives error as please give value for parameter,but if checked allow blank or allow null ,i am getting all values
    as report parameter is null or blank as the value of the report parameter is null or blank.
    so i need to select only one parameter and if i didnt give any value in another parameter it should take all values from the list.
    please help.
    thanks

    Hi Krishnakumar_DeV,
    If we are use SharePoint list as datasource, we have two method to add dataset parameter.
    Method1: Add filter in the dataset Query Designer dialog box.
    In this situation, it is defied a single-value parameter in the report.
    Method2: We can add a multi-values dataset parameter to filter data. Then, try to setting the default values for these parameters to work around your issue.
    Reference:
    http://technet.microsoft.com/en-us/library/aa337432(v=sql.105).aspx
    If you have any questions, please feel free to let me know.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Retrieve All records and display in Report using CAML query in Report Builder if Parameter value is blank

    Hello Experts,
    i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource.
    by using Following method
    Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.
    Here is my existing CAML query.
    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>Employees</ListName>
      <ViewFields>
        <FieldRef Name="Title" />
        <FieldRef Name="FirstName" />
        <FieldRef Name="LastName" />
        <FieldRef Name="FullName" />
        <FieldRef Name="UserName" />
        <FieldRef Name="Company" />
      </ViewFields>
      <Query>
        <Where>  
    <Eq> 
        <FieldRef Name="Title" />
      <Value Type="Text">    
       <Parameter Name="EmployeeId"/>    
    </Value>
    </Eq>                  
        </Where>
      </Query>
    </RSSharePointList>
    The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.
    Please suggest
    Thank you
    saroj
    saroj

    Your problem follows the well-established pattern of using an "All" parameter filter in SSRS. There are a few approaches depending on the size of your data. The easiest one is to return all data from CAML and then filter it within SSRS, the following thread
    provides some examples,
    http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value.
    Other options include passing all of the possible values within the CAML query when "All" is selected, using multiple Report Files to distinguish between both CAML queries, or to use multiple datasets with some logic to show/hide the correct one.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Crystal report paramater not showing all document number in parameter

    Hi,
    Customer is using Crystal report 2008 add on. The DO is having Doc Number in crystal report parameter. Eg DO in system had reached #1000 but it crystal report parameter user can only view DO up to 800. Is there any limitation in Crystal parameter if the records are many? How to resolve?
    Regards
    Thomas

    DO=Delivery Order in Sales A/R module.
    Customer is using Crystal report to print Delivery Order. DO DocNum is parameter in Crystal report for user to select which DO to print out but the selection list did not show all DO No.
    I saw similar question in forum. I had added "MaxRowsetRecords" ='99999999' into registry but the parameter still doesn't show all the DONo.
    I am using Type=REG_DWORD, value data=99999999 in registry and in crystal report the DocNum parameter is having "Dynamic" type.
    Don't know whether the setting is correct. Sorry I am not a Tech guy.
    Please advise.
    Regards
    Thomas

  • SSRS report parameter left blank to select all

    Hello,
    Before posting this question I have looked at related topics and couldn't find a clear answer!
    Question: Is there a workaround for a parameter to select all if blank?
    I have a report that has a multivalue parameter, my user is asking if there is a way to have an empty parameter box that will default to selet all, so if the user does not fill parameter and clicks on view report it should work.
    I have tried:
    SELECT Item FROM ItemTable
    UNION ALL
    SELECT '' AS Expr1 ORDER
    BY Item
    Then checked Allow Blank Value ''
    and checked Allow Null Values
    and did the change in my query. The problem here is that the parameter will have null check box which the user does not want see?
    Thanks

    Hi There
    Thanks for yourposting. I think you do not need to click on checkbox allow null value, just check allow blank value and change in your dataset query like this.
    Please change the query but the synxtax might look like this
    if @commenttype=''
    select * from Comment_Type
    else
    select * from Comment_Type
    where
    Comment_Type=@commenttype
    if @commenttype=''
    select * from Comment_Type
    else
    select * from Comment_Type
    where
    Comment_Type=@commenttype
    By default your parameter is blank and you display all records, but when user type something it will filter the datset based on the user input
    I am putting some screenshot for your help.
    If you have any questions pelase let me know
    Many Thanks
    Syed Qazafi Anjum
    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • How do I blank my BI Pub report parameter from returning the first record when output to HTML?

    Hi all.
    I have a report that has several parameters A, B, C D.
    I include these at the head of the rtf report.
    I run the report WITHOUT entering anything for parameters A & B.
    When the report generates (returning all the expected correct records), it enters into parameter fields A & B at the top of the report the first records’ A & B fields when they should be blank.
    IS there something I need to do in the rtf form field Help text along with the field name?
    ThanksForLoooking..
    Malc

    within the rtf of the report, within the form-field-help-text, this should work..
    <?xdofx:decode(<parameter name>,'','',<parameter name>)?>
    if the parameter is left blank, then don't put anything in the rtf field, otherwise put in anything that is selected in the parameter.
    or this..
    <?xdofx:if <parameter name>='' then 'All Params Included' else <parameter name> end if?>
    ..yet, when the parameter is left blank, the parameter field in the report generated is populated with whatever is in the first line of the parameter in the report.
    I also can't find anything in the old rdf that is causing this either.  Help!

  • Display all record in case of null parameter OR selecting "ALL"

    hi all,
    I want to show the all records in the report in case the user give empty parameter Or "ALL" from the parameter list.
    I used such the way in the query:
    select item
    from item_master
    where ITEM_ID = NVL(:P_ITEM,ITEM_ID);
    its working good but now I want to give the "ALL" in the list of parameter form. so when the user select the "ALL" then the all items to be displayed.
    thanks
    Muhammad Nadeem
    [email protected]

    Hello,
    You can use the following SQL Query :
    select item
    from item_master
    where (:P_ITEM='ALL' or ITEM_ID = NVL(:P_ITEM,ITEM_ID);)
    as long as :P_ITEM has a "type" compatible with a string ...
    Regards

  • XL Reporter Parameter that returns all data if not used

    Is there a way to use a parameter on a field, but if the user doesn't select a value, return all rows? I have a report that returns a bunch of data about items. I would like one report where if the use chooses to narrow it down to a specific item they can, but if they choose not to narrow it down, it would return all items. I can only get it to do one or the other, but not both in one report.
    Thanks

    I have a parameter setup for the ItemCode and I tried to assign it * for its default value, but it returns nothing. If I enter a valid item code it works, but it seems as if I put an * in, it looks specifically for that rather than treating it like a wildcard. If I remove the parameter and put the *, it returns all. I want the parameter available, but if they don't want to use it I would like to return all records.

  • Incomplete Data on report (report does not show all records from the table)

    Hello,
    I have problem with CR XI, I'm running the same report on the same data with simple select all records from the table (no sorting, no grouping, no filters)
    Sometimes report shows me all records sometimes not. Mostly not all records on the report. When report incomplete sometimes it shows different number of records.
    I'm using CR XI runtime on Windows Server 2003
    Any help appreciated
    Thanks!

    Sorry Alexander. I missed the last line where you clearly say it is runtime.
    A few more questions:
    - Which CR SDK are you using? The Report Designer Component or the CR assemblies for .NET?
    - What is the exact version of CR you are using (from help | about)
    - What CR Service Pack are you on?
    And a troubleshooting suggestion:
    Since this works on some machines, it will be a good idea to compare all the runtime (both CR and non CR) being loaded on a working and non working machines.
    Download the modules utility from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
    and follow the steps as described in this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=18424085&messageID=6186767
    The download also includes instructions on how to use modules.
    Ludek

  • All Records not showing in Report

    Hi All,
    U just solved my amount problem....
    But now i gives my earlier problem again, means displaying only 1 rows, when i executing for 1 month in selection criteria...and amount showing right total of all records...
    example---
    Document No......Doc. date.......P.date........Vendor..........Name.........Tax Code.........Base Amt....... Tax Amt........Ven. Ref.........P. Doc...
    5500000022 .......22.04.2008 ...28.04.2008....1011............XXXXXXX........NB..................500,000............25,000.............A-102.......4500034463
    This Document No. is my 1st Document no. (5500000022)..
    Here Base Amount (500,000) & Tax Amount (25,000) is the total of more than 100 records total but showing in Single Row...(This rows showing the only 1st record)...
    Here what is the problem in my program...where i m wrong in clearing the itab or itab2...
    please let me know...
    I m again sending my corrected Program...
    Code-----
    REPORT  zak_form_c4 NO STANDARD PAGE HEADING LINE-SIZE 125  .
    TABLES : bsik,bkpf,bseg,j_1imovend,lfa1,t001,t005u,bsak,ekko,bsis, ekkn, anla, anlc.
    TYPE-POOLS : slis.
    DATA : BEGIN OF itab OCCURS 0,
           hkont LIKE bseg-hkont, "Gl account
           mwskz LIKE bseg-mwskz, "Tax Code
           dmbtr LIKE bseg-dmbtr, "Amount
           buzei LIKE bseg-buzei, "line item
           ebeln LIKE bseg-ebeln, "Purchasing Document
           ebelp LIKE bseg-ebelp, "line item nbr
           hwbas LIKE bseg-hwbas, "Base amount
           shkzg LIKE bseg-shkzg, "Debit/Credit code
           belnr LIKE bsik-belnr, "Document number
           gjahr LIKE bsik-gjahr, "Fiscal Year
           bldat LIKE bsik-bldat, "Document Date
           budat LIKE bsik-budat, "Posting Date
           lifnr LIKE bsik-lifnr, "Vendor number
           xblnr LIKE mkpf-xblnr, "Ven invoice nbr
           name1(25),                                           "name1
           ort01 LIKE lfa1-ort01,   "City
           j_1ilstno LIKE j_1imovend-j_1ilstno,  " Vendor tin nbr
           regio LIKE lfa1-regio, "Region Code
           bezei LIKE t005u-bezei, "Region desc
           dmbtr1 LIKE bseg-dmbtr, "Amount
           hwbas1 LIKE bseg-hwbas, "Base amount
    END OF itab.
    DATA : BEGIN OF itab3 OCCURS 0.
            INCLUDE STRUCTURE itab.
    DATA:END OF itab3.
    DATA : wa LIKE LINE OF itab.
    DATA : BEGIN OF itab1 OCCURS 0.
            INCLUDE STRUCTURE itab.
    DATA:END OF itab1.
    DATA : BEGIN OF itab2 OCCURS 0.
            INCLUDE STRUCTURE itab.
    DATA:END OF itab2.
    ***********************************Purchase order history
    DATA:   BEGIN OF bet OCCURS 50.
            INCLUDE STRUCTURE ekbe.
    DATA:   END OF bet.
    DATA:   BEGIN OF bzt OCCURS 50.
            INCLUDE STRUCTURE ekbz.
    DATA:   END OF bzt.
    DATA:   BEGIN OF betz OCCURS 50.
            INCLUDE STRUCTURE ekbez.
    DATA:   END OF betz.
    DATA:   BEGIN OF bets OCCURS 50.
            INCLUDE STRUCTURE ekbes.
    DATA:   END OF bets.
    DATA:   BEGIN OF xekbnk OCCURS 10.
            INCLUDE STRUCTURE ekbnk.
    DATA:   END OF xekbnk.
    DATA : w_container TYPE scrfname VALUE 'CL_GRID',
           w_cprog TYPE lvc_s_layo,
           g_repid LIKE sy-repid,
           w_save TYPE c,
           w_exit TYPE c,
           cl_grid TYPE REF TO cl_gui_alv_grid,
           cl_custom_container TYPE REF TO cl_gui_custom_container,
           it_fld_catalog TYPE slis_t_fieldcat_alv,
           wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
           layout TYPE slis_layout_alv,
           col_pos  LIKE sy-cucol ,
           alvfc TYPE slis_t_fieldcat_alv.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS       :  hkont LIKE bseg-hkont OBLIGATORY. "GL Code
    *SELECT-OPTIONS   : hkont FOR bseg-hkont .
    SELECT-OPTIONS   : belnr FOR bsik-belnr .
    SELECT-OPTIONS   : gjahr FOR bsik-gjahr .
    SELECT-OPTIONS   : bldat FOR bsik-bldat.
    SELECT-OPTIONS   : budat FOR bsik-budat.
    SELECTION-SCREEN : END OF BLOCK b1.
    PERFORM fill_catalog1 USING:
    'HKONT'    'ITAB2'    'G/L Code' ,
    'BELNR'    'ITAB2'    'Document Number',
    'GJAHR'    'ITAB2'    'Year',
    'BLDAT'    'ITAB2'    'Doc. date' ,
    'BUDAT'    'ITAB2'    'Posting Date',
    'LIFNR'    'ITAB2'    'Vendor',
    'NAME1'    'ITAB2'    'Name',
    'EBELN'    'ITAB2'    'Purchasing Document',
    'MWSKZ'    'ITAB2'    'Tax Code',
    'HWBAS'    'ITAB2'    'Base Amount',
    'DMBTR'    'ITAB2'    'Tax Amount',
    'XBLNR'    'ITAB2'    'Vendor Inv. No.'.
    SELECT DISTINCT hkont belnr gjahr bldat budat INTO CORRESPONDING FIELDS OF TABLE itab
                      FROM bsis
                      WHERE bukrs = '1000'
                      AND hkont = hkont
                      AND belnr IN belnr
                      AND gjahr IN gjahr
                      AND bldat IN bldat
                      AND budat IN budat.
    SORT itab BY belnr.
    LOOP AT itab.
      SELECT * FROM bseg WHERE belnr = itab-belnr  AND gjahr = itab-gjahr
                                                   AND bukrs = '1000'
                                                   AND ( ebeln <> ' ' OR hkont = hkont ).
        IF sy-subrc = 0.
          itab-buzei = bseg-buzei.
          itab-mwskz = bseg-mwskz.
          IF bseg-ebeln <> ' '.
            itab-ebeln = bseg-ebeln.
            itab-ebelp = bseg-ebelp.
            MODIFY itab.
          ENDIF.
          IF bseg-hkont = hkont.
            itab-shkzg = bseg-shkzg.
            itab-hwbas = bseg-hwbas.
            itab-dmbtr = bseg-dmbtr.
            IF itab-shkzg = 'H'.
              itab-dmbtr = itab-dmbtr * ( -1 ).
            ENDIF.
            MOVE-CORRESPONDING itab TO itab2.
            APPEND itab2.
          ENDIF.
        ENDIF.
      ENDSELECT.
    ENDLOOP.
    LOOP AT itab2.
      SELECT SINGLE * FROM ekko WHERE ebeln = itab2-ebeln.
      IF sy-subrc = 0.
        itab2-lifnr = ekko-lifnr.
      ENDIF.
      CALL FUNCTION 'ME_READ_HISTORY'
        EXPORTING
          ebeln  = itab2-ebeln
          ebelp  = itab2-ebelp
          webre  = 'X'
        TABLES
          xekbe  = bet
          xekbz  = bzt
          xekbes = bets
          xekbez = betz
          xekbnk = xekbnk.
      itab2-xblnr = bet-xblnr.
      SELECT SINGLE * FROM lfa1 WHERE lifnr = itab2-lifnr.
      itab2-name1 = lfa1-name1.
      itab2-ort01 = lfa1-ort01.
      itab2-regio = lfa1-regio.
      SELECT SINGLE * FROM t005u WHERE bland = itab2-regio
                                  AND spras = 'EN'
                                  AND land1 = 'IN'.
      itab2-bezei = t005u-bezei.
      SELECT SINGLE * FROM  j_1imovend WHERE lifnr = itab2-lifnr.
      IF sy-subrc = 0 .
        itab2-j_1ilstno = j_1imovend-j_1ilstno.  " Vendor tin nbr
      ENDIF.
      MODIFY itab2.
    ENDLOOP.
    SORT itab2 BY belnr.
    LOOP AT itab2.
      DATA : cnt TYPE i,
             cnt1 TYPE i.
      itab1-dmbtr1 = itab1-dmbtr1 + itab2-dmbtr.
      itab1-hwbas1 = itab1-hwbas1 + itab2-hwbas.
      AT END OF belnr.
        cnt = sy-tabix.
        cnt1 = cnt - 1.
        DO cnt1 TIMES.
          DELETE itab2.
        ENDDO.
        CLEAR itab2.
        itab2-dmbtr = itab1-dmbtr1.
        itab2-hwbas = itab1-hwbas1.
        MODIFY itab2 TRANSPORTING dmbtr hwbas .
      ENDAT.
    ENDLOOP.
    layout-zebra = 'X' .
    layout-colwidth_optimize(1) = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = 'ZAK_FORM_C4'
        is_layout          = layout
        it_fieldcat        = it_fld_catalog
        i_default          = 'X'
        i_save             = 'A'
      TABLES
        t_outtab           = itab2
      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.
    *&      Form  FILL_CATALOG1
          text
         -->P_FIELDNAME  text
         -->P_REF_TABLE  text
         -->P_SCRTEXT    text
    FORM fill_catalog1  USING   p_fieldname TYPE any
                                p_ref_table TYPE any
                                p_scrtext   TYPE any.
      CLEAR : wa_fld_catalog.
      wa_fld_catalog-fieldname  = p_fieldname.
      wa_fld_catalog-tabname    = p_ref_table.
      wa_fld_catalog-seltext_s  = p_scrtext.
      wa_fld_catalog-seltext_m  = p_scrtext.
      wa_fld_catalog-seltext_l  = p_scrtext.
    wa_fld_catalog-datatype = 'CURR'.
      wa_fld_catalog-outputlen = 20.
      APPEND wa_fld_catalog TO it_fld_catalog.
    ENDFORM.                    " fill_catalog1.
    Plz let me know...
    Thanks

    Hello Prince,
    I just want that my code will show single time records..and Sum of base Value and Tax amount...
    You want to summarise Base Value and Tax amount per document, right
    I am making a very very small modification to the declaration of ITAB:
    DATA :
    BEGIN OF itab OCCURS 0,
    belnr LIKE bsik-belnr, "Document number "--> Add here
    buzei LIKE bseg-buzei, "line item "--> Add here
    hkont LIKE bseg-hkont, "Gl account
    mwskz LIKE bseg-mwskz, "Tax Code
    dmbtr LIKE bseg-dmbtr, "Amount
    " buzei LIKE bseg-buzei, "line item "--> Delete Here
    ebeln LIKE bseg-ebeln, "Purchasing Document
    ebelp LIKE bseg-ebelp, "line item nbr
    hwbas LIKE bseg-hwbas, "Base amount
    shkzg LIKE bseg-shkzg, "Debit/Credit code
    " belnr LIKE bsik-belnr, "Document number "--> Delete here
    gjahr LIKE bsik-gjahr, "Fiscal Year
    bldat LIKE bsik-bldat, "Document Date
    budat LIKE bsik-budat, "Posting Date
    lifnr LIKE bsik-lifnr, "Vendor number
    xblnr LIKE mkpf-xblnr, "Ven invoice nbr
    name1(25), "name1
    ort01 LIKE lfa1-ort01, "City
    j_1ilstno LIKE j_1imovend-j_1ilstno, " Vendor tin nbr
    regio LIKE lfa1-regio, "Region Code
    bezei LIKE t005u-bezei, "Region desc
    dmbtr1 LIKE bseg-dmbtr, "Amount
    hwbas1 LIKE bseg-hwbas, "Base amount
    END OF itab.
    And modified the code as below:
    DATA:
    V_DMBTR TYPE DMBTR,
    V_HWBAS TYPE HWBAS.
    LOOP AT ITAB2.
      V_DMBTR = V_DMBTR + ITAB2-DMBTR.
      V_HWBAS = V_HWBAS + ITAB2-HWBAS.
      AT END OF BELNR.
        ITAB2-DMBTR = V_DMBTR.
        ITAB2-HWBAS = V_HWBAS.
        APPEND ITAB2 TO ITAB3.
        CLEAR: ITAB2, V_DMBTR, V_HWBAS.
      ENDAT.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = 'ZAK_FORM_C4'
    is_layout = layout
    it_fieldcat = it_fld_catalog
    i_default = 'X'
    i_save = 'A'
    TABLES
    t_outtab = itab3 "itab2 --> Use ITAB3 instead of ITAB2
    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.
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 13, 2009 3:23 PM

  • Using (Select All) for report parameter

    Hi there,
    I am Looking for assistance in making the the (Select All) option work for a particular report. The parameter is for product families (which there are about 47 unique results for). The report is also influenced by two other parameters, one being a date type
    i.e 'MTD' 'YTD' 'MAT'. When a long date type such as MAT is selected, selecting all families causes the report to get stuck in an endless loop.
    I've tried creating my own <Select All'> item in the parameter dataset, then I have the opposite issue, the <Select All> selection works perfectly but when I try and tick two or more product families I recieve the following error:
    "An expressions of non-boolean type specified in a context where a condition is expected, near ',' "
    Parameter Dataset:
    SELECT '<Select All>' AS family_description, '<Select All>' AS family_code
    UNION ALL
    SELECT DISTINCT family_description, family_code
    FROM dim_item AS item
    ORDER BY family_description
    Snippet From Main Report Dataset:
    Where
    sales.oe_branch_code IN (@Branch)
    And
    sales.order_status <> 'X' and sales.line_status <> 'X'
    AND (item.family_code IN (@Family) OR @Family = '<Select All>')
    Any help is appreciated
    Thanks Kindly
    SQL Novice

    Hi KCBA,
    I have check the query you have provided the issue cause by the query "
    AND (item.family_code
    IN (@Family)
    OR @Family =
    '<Select All>')" you are using which is incorrect.
    If the parameter @Family have set as "Allow multiple values" then you don't need to add new label "Select All" for the multiple value parameter already have this section, if the parameter @Family is not the multiple values
    parameter and you want to select all the values or just select one, you can modify the query as below which will works fine:
    "AND (item.family_code =
    (@Family) OR
    @Family = '<Select All>'
    If you are using the stored procedure and have issue about add multiple value parameter in the where clause, you are take reference to below similar case about how to create an function to make it work:
    Passing multi-value parameter in stored procedure ssrs
    If I have some misunderstanding, please try to provide more details information about the relationship of all the parameters (Cascading or not ), current result  you have got and expect result you want(Snapshot).
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • ALV GRID Report is not showing all records which is in internal table

    hi all,
    have one doubt. please clarify me. ALV Report is working fine since long tiem. But suddenly this report is showing few records only for the given input.   Example:   it_main table have 50 records, but output is showing only 10 records only. (we have not made any modifications in this report).
    temporarily i have given excel output file from it_main table. excel file is showing all records.
    here it_main have all the records. but output is showing few records only. it is not showing any error. i have tested with REUSE_ALV_LIST_DISPLAY function also. but it also showing same results(few records only.)
    please give me some idea.
    FORM display_alv_report.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active          = 'X'
          i_callback_program       = sy-repid
          is_layout                = wa_layout
          it_fieldcat              = it_fcat
          it_events                = it_events
          i_save                   = 'A'
          is_variant               = wa_variant
        TABLES
          t_outtab                 = it_main
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE text-204 " 'Error in Display the list'
        TYPE 'I'.
        LEAVE TO LIST-PROCESSING.
      ENDIF.
    ENDFORM.            .                    "DISPLAY_ALV_REPORT
    Best Regards,
    Srinivas

    hi
    Please study this program and give me suggestions.
    ALV Declaration
    DATA : it_events TYPE slis_t_event,               "ALV event
               it_fcat   TYPE slis_t_fieldcat_alv,        "Field catalog
               it_list_top_of_page TYPE slis_t_listheader,
               c_tabname  TYPE slis_tabname   VALUE 'IT_MAIN'.
    DATA : wa_layout  TYPE slis_layout_alv,
                wa_event   TYPE slis_alv_event,
               wa_fcat    TYPE slis_fieldcat_alv,
               wa_variant TYPE disvariant.
    START-OF-SELECTION.
      PERFORM material_pass.
      PERFORM data_retrieval.
    END-OF-SELECTION.
      PERFORM sub_display_report.
    FORM sub_display_report .
      DATA status(1).
      IF r1 = 'X'.
        PERFORM build_fieldcatalog USING :
          '1'  'ERDAT'     'S.O DATE'             '' '10'  'X',
          '2'  'VBELN'     'SALE ORDER'           '' '10'  'X',
          '3'  'POSNR'     'SALE ITEM'            '' '6'   '',
          '4'  'BSTKD'     'CUSTOMER PO'          '' '35'  '',
          '5'  'BEZEI'     'REASON FOR REJECTION' '' '40'  '',
          '6'  'PLNUM'     'PLANNED ORDER'        '' '10'  '',
          '7'  'AUFNR'     'PROD.ORDER.'          '' '12'  '',
          '8'  'MATNR'     'MATERIAL NUMBER'      '' '18'  '',
          '9'  'MAKTX'     'MATERIAL DESCRIPTION' '' '40'  '',
          '10' 'WERKS'     'PLANT'                '' '4'   '',
          '11' 'KWMENG'    'SALE ORDER QTY'       '' '15'  '',
          '12' 'VRKME'     'UNIT'                 '' '4'   '',
          '13' 'GAMNG'     'PROD.ORDER QTY'       '' '13'  '',
          '14' 'IGMNG'     'CONFIRMED ORDER QTY'  '' '13'  '',
          '15' 'GMEIN'     'UNIT'                 '' '4'   '',
          '16' 'MENGE'     'G.R QUANTITY'         '' '13'  '',
          '17' 'SOBAL'     'S.O BALANCE'          '' '13'  '',
          '18' 'PRDBAL'    'PROD.BALANCE'         '' '13'  '',
          '19' 'GSM'       'GSM'                  '' '4'   '',
          '20' 'SIZE1'     'SIZE1'                '' '10'  '',
          '21' 'SIZE2'     'SIZE2'                '' '10'  ''.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = pathname
            filetype              = ftype
            append                = 'X'
            write_field_separator = 'X'
          TABLES
            data_tab              = it_mains
          EXCEPTIONS
            file_write_error      = 1.
        IF sy-subrc = 0.
          status = 'S'.
        ELSE.
          status = 'E'.
        ENDIF.
      ELSEIF r2 = 'X' OR r3 = 'X'.
        PERFORM build_fieldcatalog USING :
          '1'  'ERDAT'     'S.O DATE'             '' '10'  'X',
          '2'  'VBELN'     'SALE ORDER'           '' '10'  'X',
          '3'  'POSNR'     'SALE ITEM'            '' '6'   '',
          '4'  'BSTKD'     'CUSTOMER PO'          '' '35'  '',
          '5'  'BEZEI'     'REASON FOR REJECTION' '' '40'  '',
          '6'  'PLNUM'     'PLANNED ORDER'        '' '10'  '',
          '7'  'AUFNR'     'PROD.ORDER.'          '' '12'  '',
          '8'  'MATNR'     'MATERIAL NUMBER'      '' '18'  '',
          '9'  'MAKTX'     'MATERIAL DESCRIPTION' '' '40'  '',
          '10' 'WERKS'     'PLANT'                '' '4'   '',
          '11' 'KWMENG'    'SALE ORDER QTY'       '' '15'  '',
          '12' 'VRKME'     'UNIT'                 '' '4'   '',
          '13' 'GAMNG'     'PROD.ORDER QTY'       '' '13'  '',
          '14' 'IGMNG'     'CONFIRMED ORDER QTY'  '' '13'  '',
          '15' 'GMEIN'     'UNIT'                 '' '4'   '',
          '16' 'MENGE'     'G.R QUANTITY'         '' '13'  '',
          '17' 'SOBAL'     'S.O BALANCE'          '' '13'  '',
          '18' 'PRDBAL'    'PROD.BALANCE'         '' '13'  '',
          '19' 'GSM'       'GSM'                  '' '4'   '',
          '20' 'SIZE1'     'SIZE1'                '' '10'  '',
          '21' 'CUT1'      'CUT1'                 '' '11'  '',
          '22' 'SIZE2'     'SIZE2'                '' '10'  '',
          '23' 'CUT2'      'CUT2'                 '' '11'  '',
          '24' 'SIZE3'     'SIZE3'                '' '10'  '',
          '25' 'CUT3'      'CUT3'                 '' '11'  '',
          '26' 'SIZE4'     'SIZE4'                '' '10'  '',
          '27' 'CUT4'      'CUT4'                 '' '11'  '',
          '28' 'SIZE5'     'SIZE5'                '' '10'  '',
          '29' 'CUT5'      'CUT5'                 '' '11'  '',
          '30' 'SIZE6'     'SIZE6'                '' '10'  '',
          '31' 'CUT6'      'CUT6'                 '' '11'  ''.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = pathname
            filetype              = ftype
            append                = 'X'
            write_field_separator = 'X'
          TABLES
            data_tab              = it_mainall
          EXCEPTIONS
            file_write_error      = 1.
        IF sy-subrc = 0.
          status = 'S'.
        ELSE.
          status = 'E'.
        ENDIF.
      ENDIF.
      PERFORM build_layout.
      PERFORM build_events.
      PERFORM sub_comment_build USING it_list_top_of_page.
      PERFORM sub_set_variant.
      PERFORM display_alv_report.
      IF status = 'S'.
        MESSAGE 'Excel Output file Downloaded to Given Path' TYPE 'I'.
      ELSE.
        MESSAGE 'Download Not Possible' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " SUB_DISPLAY_REPORT
    FORM BUILD_FIELDCATALOG
    FORM build_fieldcatalog USING  p_col_pos
                                   p_fieldname
                                   p_text
                                   p_datatype
                                   p_outputlen
                                   p_col_freez.
      wa_fcat-row_pos        = '1'.
      wa_fcat-col_pos        = p_col_pos.
      wa_fcat-fieldname      = p_fieldname.
      wa_fcat-tabname        = c_tabname.
      wa_fcat-reptext_ddic   = p_text.
      wa_fcat-datatype       = p_datatype.
      wa_fcat-ddic_outputlen = p_outputlen.
      wa_fcat-key            = p_col_freez.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    FORM build_layout.
      CLEAR: wa_layout.
      wa_layout-window_titlebar   = 'LIST OF GSM WISE OPEN SALE ORDERS'.
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-totals_text       = 'CUMULATIVE'.
    ENDFORM.                    "BUILD_LAYOUT
    *&      Form  BUILD_EVENTS
    FORM build_events.
      CLEAR wa_event.
      REFRESH it_events.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_events
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      IF sy-subrc = 0.
        READ TABLE it_events INTO wa_event
             WITH KEY name = 'TOP_OF_PAGE'.
        IF sy-subrc EQ 0.
          wa_event-form = 'TOP_OF_PAGE'.
          APPEND wa_event TO it_events.
          CLEAR wa_event.
        ENDIF.
      ENDIF.
    ENDFORM.                    "BUILD_EVENTS
         -->P_IT_LIST_TOP_OF_PAGE  text
    FORM sub_comment_build  USING it_top_of_page TYPE slis_t_listheader.
      DATA ls_line TYPE slis_listheader.
      CLEAR ls_line.
      ls_line-typ = 'H'.
      ls_line-info = str1.
      APPEND ls_line TO it_top_of_page.
      CLEAR ls_line.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         it_list_commentary = t_header[].
    ENDFORM.                    " SUB_COMMENT_BUILD
    *&      Form  SUB_SET_VARIANT
          text
    -->  p1        text
    <--  p2        text
    FORM sub_set_variant .
      CLEAR wa_variant.
      wa_variant-report = sy-repid.
      wa_variant-username = sy-uname.
    wa_variant-variant = c_variant.
    wa_variant-variant = p_layout.
    ENDFORM.                    " SUB_SET_VARIANT
    *&      Form  DISPLAY_ALV_REPORT
    *Display Report Using ALV GRID
    FORM display_alv_report.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active          = 'X'
          i_callback_program       = sy-repid
         i_callback_pf_status_set = c_pf_status
         i_callback_user_command  = c_user_command
          is_layout                = wa_layout
          it_fieldcat              = it_fcat
         it_sort                  = it_sort[]
          it_events                = it_events
          i_save                   = 'A'
          is_variant               = wa_variant
        TABLES
          t_outtab                 = it_main
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE text-204 " 'Error in Display the list'
        TYPE 'I'.
        LEAVE TO LIST-PROCESSING.
      ENDIF.
    ENDFORM.            .                    "DISPLAY_ALV_REPORT
    *ALV Report Header
    FORM top_of_page.
      DATA : t_header TYPE slis_t_listheader WITH HEADER LINE,
             wa_header TYPE slis_listheader,
             t_line LIKE wa_header-info,
             ld_lines TYPE i,
             ld_linesc(10) TYPE c.
      wa_header-typ  = 'H'.
    T_HEADER-INFO = 'LIST OF GSM WISE OPEN SALE ORDERS'.
      wa_header-info = str1.
      APPEND wa_header TO t_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header[].
    ENDFORM.                    "TOP_OF_PAGE
    here it_main internal table having all data. but output is showing few records only.
    pl. give some idea.
    Thanks & Regards
    Srinivas.

Maybe you are looking for

  • Creating client stubs for web services with callback operations

    Hi, I have created a simple web service in Workshop to simulate an asynchronous communication. When I test it within workshop everything is fine but how do I generate the necessary stubs to create a java client that will support the callback operatio

  • Problem with Listing of Articles in Assortment Management

    Hi, I am new to SAP IS Retail. In fact new to SAP itself. I was working on Assortment Management. I created my own Merch. Category  and created products under them.  In Assort.Management I progressed in following way [ as mentioned in the Best Practi

  • Iphoto export and transparency

    Hi People, Does anyone know how i can make my autoviewer slideshow which I am using with iphoto export have a transparent background so the iweb page behind shows through around the photos? Right now the frame colour and background colour in the webe

  • Dump in  REUSE_ALV_LIST_DISPLAY after Upgrade

    Hi All We have gone for upgrade from 4.7 to ECC 6.0 An ALV list report works fine in 4.7 , but its going for Dump in ECC 6.0. Runtime Errors         DYN_TABLE_ILL_COMP_VAL Except.                CX_SY_DYN_TABLE_ILL_COMP_VAL Date and Time          17.

  • Urgent:OWB Customised job summary format

    Hi experts, We need customised job summary information or log file in OWB such as: (a) Total records read from data file; (b) Total records processed; (c) Total records successfully loaded; (d) Total records failed; (e) Failure records details. Can a