Tuning Reporting for ALSB

Is there a way to limit the number of threads/beans for processing reporting messages? We recently had a problem where our reporting DB ran out of space and the backup of messages prevented regular service requests from going through. What I'd like to be able to do is limit the priority and/or number of active reporting messages that can be processed at once so that it will never affect in flight service traffic.
Thanks in advance for your help!

The reporting messages are sent to a JMS queue before being read by the ReportingMDB and persisted to a database. You can control the threads associated to the Reporting MDbean. I think the MDBean is defined in jmsreportprovider.jar
Gregory Haardt
ALSB Prg. Manager
[email protected]

Similar Messages

  • Error on Bursting Report for BI Publisher

    hi all,
    i am getting the following error when i am bursting the report for BI Publisher.
    * Nested Exception (Underlying Cause) ---------------
    oracle.apps.xdo.servlet.scheduler.ProcessingException: java.lang.NullPointerExce
    ption
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.jav
    a:2116)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:358)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
    ava:520)
    Caused by: java.lang.NullPointerException
    at com.sun.java.util.collections.Hashtable.get(Hashtable.java:321)
    at oracle.apps.xdo.batch.bursting.ProcessEnterpriseDocument.processLayou
    t(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue(Unkno
    wn Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument(
    Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.endDocument(Unknown Sou
    rce)
    at oracle.xml.parser.v2.XMLContentHandler.endDocument(XMLContentHandler.
    java:119)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingP
    arser.java:311)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:263)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(Unknown
    Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process(Unknown Source)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.jav
    a:2008)
    ... 3 more
    Kindly Help..
    Thanks.

    Thanks alot Guru for u r reply, i am attaching more Details regarding my error.
    In Reporting options i gave
    Reporting folder CCB
    Reporting server:BIPUbliser url
    Reporting password:Admin     
    Reproting userid:Admin
    I already configured Bill Display Algorithm OBLD_CRYS in installation-frame work
    Now i am getting the error the value in the field is not a valid value for the field.
    In Console I am getting the error '
    SYSUSER - 612791-31-1 2011-05-26 11:32:21,709 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR (schema.rules.BusinessObjectRuleProcessor$Factory) There is more th
    an 1 MO for the service 'CILCSVAP': MaintenanceObject_Id(SA), MaintenanceObject_Id(CM_CONT), using 1st one 'MaintenanceObject_Id(SA)'
    <May 26, 2011 11:32:22 AM IST> <Error> <HTTP> <BEA-101020> <[ServletContext@4736418[app:SPLWeb module:/spl path:/spl spec-version:2.5]] Servlet failed with Exception
    com.splwg.shared.common.ApplicationError: (Server Message)
    Category: 3
    Number: 501
    Call Sequence: ;CIPCSVAP
    Program Name: CIPCSVAP
    Text: You are not allowed access (directly/indirectly) to this account.
    Description: Please contact your security administrator to check your security for this account.
    Table:
    Field:
    at com.splwg.base.support.context.FrameworkSession.addError(FrameworkSession.java:1177)
    at com.splwg.base.support.context.FrameworkSession.addError(FrameworkSession.java:1158)
    at com.splwg.base.support.cobol.CobolSubprogram.populateError(CobolSubprogram.java:142)
    at com.splwg.base.support.cobol.CobolSubprogram.checkForErrors(CobolSubprogram.java:94)
    at com.splwg.base.support.cobol.AbstractCobolProgram$CallCobolClosure.run(AbstractCobolProgram.java:214)
    Truncated. see log file for complete stacktrace

  • Can we use xml Publisher reporting for sql* Plus in EBS

    Hello All,
    The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
    So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
    Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
    Thanks and Regards
    Balaji.

    Hi
    Thanks for the reply..
    I tried to do the follwoing
    1. changed the output to xml in the conc. prog.
    2. ran the same report but i am getting the follwoing error in the output file
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource
    Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
    So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
    if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
    thanks in advance
    Balaji.

  • What should be take action against following sql tuning report.

    Hi
    what should be take action against following sql tuning report.
    SQL ID : fn3mt5dvm7fba
    SQL Text : SELECT * FROM (select
         to_number(ow.waybl_no) waybl_no,ow.id wb_id,
         To_Number(ogp.gp_no) gp_no,
         To_Number(ots.trip_sht_no) trip_sht_no,
         otr.nm,
         ots.gty_br_mast_id,
         DECODE(otr.sign_recd,'1','YES','NO') Sign_Recd,
         DECODE(otr.stamped,'1','YES','NO') Stamped,
         otr.dlvry_dt dlvry_dt,
         otr.tel_no,
         --otr.remarks,                                                   
         Decode(otr.comments, NULL,'','Yes') remarks,
         otr.id ID,ops_safex_utl.get_br_nm(to_number(ow.bkg_br_mast_id))
    book_br,
         ow.pick_dt book_date
    from
         ops_ts_reconsile otr,
         ops_pultd_wb_dtls opuwd,
         ops_trip_sht ots,
         ops_waybl ow,
         ops_ultd_wb_dtls ouwd,
         ops_gate_pass ogp
    where
         otr.trip_sht_id=ots.id and
         otr.pultd_wb_dtls_id=opuwd.id and
         opuwd.ultd_wb_dtls_id=ouwd.id and
         ouwd.gate_pass_id=ogp.id and
         opuwd.waybl_id=ow.id and
         otr.status_lid=157 and
         ots.gty_br_mast_id = (:br_Id) and
         (otr.dlvry_dt = :searchDate OR :searchDate IS NULL) and
         otr.note_prpd = 'N' and otr.pod_recd = '1' and
         not exists (select TS_RECONSILE_ID from OPS_POD_FRWD_NOTE_DTLS
    where TS_RECONSILE_ID = otr.id)
    union
    select
         to_number(ow.waybl_no) waybl_no, ow.id wb_id,
         To_Number(ogp.gp_no) gp_no,
         null trip_sht_no,
         ogr.nm,
         ogp.dlvry_br_mast_id,
         DECODE(ogr.sign_recd,'Y','YES','NO') Sign_Recd,
         DECODE(ogr.stamped,'Y','YES','NO') Stamped,
         ogr.dlvry_dt dlvry_dt,
         ogr.tel_no,
         --ogr.remarks,                                                   
         Decode(ogr.comments, NULL,'', 'Yes') remarks,
         ogr.id ID,ops_safex_utl.get_br_nm(to_number(ow.bkg_br_mast_id))
    book_br,
         ow.pick_dt book_date
    from
         ops_gp_reconcile ogr,
         ops_gate_pass ogp,
         ops_waybl ow
    where
         ogr.gp_id=ogp.id and
         ogp.waybl_id=ow.id and
         ogp.dlvry_br_mast_id = (:br_Id) and
         (ogr.dlvry_dt = :searchDate) and
         ogr.note_prpd = 'N' and ogr.pod_recd = 'Y' and
         not exists (select GP_RECONSILE_ID from OPS_POD_FRWD_NOTE_DTLS
    where GP_RECONSILE_ID = ogr.id)) QRSLT ORDER BY trip_sht_no desc
    Bind Variables :
    1 - (VARCHAR2(32)):37069
    2 - (DATE):07/11/2011 00:00:00
    3 - (DATE):07/11/2011 00:00:00
    4 - (VARCHAR2(32)):37069
    5 - (DATE):07/11/2011 00:00:00
    FINDINGS SECTION (3 findings)
    1- SQL Profile Finding (see explain plans section below)
    2 potentially better execution plans were found for this statement. Choose
    one of the following SQL profiles to implement.
    Recommendation (estimated benefit<=10%)
    - Consider accepting the recommended SQL profile.
    execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_58643',
    task_owner => 'SYS', replace => TRUE);
    Recommendation (estimated benefit: 99.15%)
    - Consider accepting the recommended SQL profile to use parallel execution
    for this statement.
    execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_58643',
    task_owner => 'SYS', replace => TRUE, profile_type =>DBMS_SQLTUNE.PX_PROFILE);
    Executing this query parallel with DOP 128 will improve its response time
    99.11% over the SQL profile plan. However, there is some cost in enabling
    parallel execution. It will increase the statement's resource consumption by
    an estimated 14.56% which may result in a reduction of system throughput.
    Also, because these resources are consumed over a much smaller duration, the
    response time of concurrent statements might be negatively impacted if
    sufficient hardware capacity is not available.
    The following data shows some sampled statistics for this SQL from the past
    week and projected weekly values when parallel execution is enabled.
    Past week sampled statistics for this SQL
    Number of executions 17494
    Percent of total activity 7.2
    Percent of samples with #Active Sessions > 2*CPU .63
    Weekly DB time (in sec) 614696.04
    Projected statistics with Parallel Execution
    Weekly DB time (in sec) 704166.9
    2- Restructure SQL finding (see plan 1 in explain plans section)
    An expensive "UNION" operation was found at line ID 4 of the execution plan.
    Recommendation
    - Consider using "UNION ALL" instead of "UNION", if duplicates are allowed
    or uniqueness is guaranteed.
    3- Alternative Plan Finding
    Some alternative execution plans for this statement were found by searching
    the system's real-time and historical performance data.
    The following table lists these plans ranked by their average elapsed time.
    See section "ALTERNATIVE PLANS SECTION" for detailed information on each
    plan.
    id plan hash last seen elapsed (s) origin note
    1 209247904 2011-07-12/10:09:08 7.564 Cursor Cache
    2 4029269565 2011-07-12/10:20:21 15.374 Cursor Cache original plan
    3 4128886984 2011-07-08/11:30:25 42.426 AWR
    4 3695555639 2011-07-12/08:30:30 101.459 AWR
    Recommendation
    - Consider creating a SQL plan baseline for the plan with the best average
    elapsed time.
    execute dbms_sqltune.create_sql_plan_baseline(task_name => 'TASK_58643',
    owner_name => 'SYS', plan_hash_value => 209247904);
    ADDITIONAL INFORMATION SECTION
    - The optimizer could not merge the view at line ID 3 of the execution plan.
    The optimizer cannot merge a view that contains a set operator.
    - SQL Profile "SYS_SQLPROF_01306b26f6aa0000" exists for this statement and
    was ignored during the tuning process.

    afzal wrote:
    Hi
    what should be take action against following sql tuning report.
    <snip>Perhaps no action at all.
    You can ALWAYS produce a report that will show "top 5" issues. The question is NOT "do I have an issue reported by a tuning report". Yes you do. Everyone does. Always. Even if you slowest batch job runs in 1.3 seconds and your slowest OLTP transaction completes in 0.0001 second.
    The question is "do I have a problem that is serious enough to spend time solving?"
    If your average OLTP transaction completes in 3 seconds, how much effort is justified to get a 50% improvement?
    How much effort is justified to get that same 50% improvement on transactions that complete in 1.5 seconds? 0.2 seconds?
    Beware of Compulsive Tuning Disorder.

  • Tuning report by creating index.

    Hi...all,
    I try to tuning discoverer reports for getting better performance by creating index on columns that used to join
    between tables, but when I set join type to one to one relationship and outer join on detail in Discoverer Admin.,I found that index I created was not used in query (explain plan show full scan table).
    Anyone know how to solve this problem?
    Thank you,
    Vilas

    Hi,
    According to the documentation you will get this error when:
    Cause: The select clause referenced UID, USER, ROWNUM, SYSDATE, CURRENT_TIMESTAMP, MAXVALUE, a sequence number, a bind variable, correlation variable, a set result,a trigger return variable, a parallel table queue column, collection iterator, etc.
    Action: Remove the offending expression or disable the REWRITE option on the materialized view.
    You will probably find you have one of these expressions in your custom business area/folder.
    Rod West

  • Report for Qty Contract and Value Contract with PO release exceeding limits

    Hi All,
    Is there a std report in SAP that the users can use to view Qty and Val Contracts that has exceed in Qty (in case of Qty Contracts) or Val (in case of Val Contracts) ?
    Thanks in advance!

    hi Duke,
    If thinking logically, then there is no report for the same..this may be because you enter the qty or value limits in the contract doc itself....So, when you make the PO for the same, and if the qty or value exceeds the system automatically provides the message..stating that the qty or value has exceeded....
    So, there is no report for the same...
    Hope it helps...
    Regards
    Priyanka.P

  • PS report for Actual and commitment Balance

    Dear experts,
    Is there any report in PS where i can see list of projects has actual balance and commitment balance?
    Note: I want to see only the balance of actual cost ( which is not settled) and commitment balance (Open PO, PR etc..)
    Regard
    Vetrivelan

    Hi,
    For commitment- CJI5
    actual - CJI3 with correct layout as per you requirement.
    also try S_ALR_87013558 report & go to line item report for detail actuals(& you have to change the layout accordingly) & commitment.
    hope this would help you...
    regards,
    SL

  • Simulair report for FBL5N and FBL1N for new general ledger on segment level

    We are working with segments in new G/L ledger. We want to run a open item report where we can combine customers and vendors by segment. The vendors and customers are linked in the master data. In the "old"  reports FBL5N and FBL1N you can do this but not by segment.I found the following report on segment level:
    - S_PCO_36000218 - Receivables: Segment
    - S_PCO_36000219 - Payables: Segment
    What I'm missing is to run 1 report for Customers and vendors. What I'm missing to is that there are only some fields available on line item level. (I like to have invoice number, documentype,.......)
    Is there a standard report for this in new genaral leger?
    Is it possible to ad additional field to th list viewer.

    What is this user license type?  All financial transactions need professional license.
    Thanks,
    Gordon

  • How to create a report for open sales orde documents which are not invoiced

    Hi Experts this is urgent,
    +pls give the Logic for document flow+
    My requirement is create a report for sales orders which are not invoiced  using the following table.
    VBAK : sales order header
    VBAP : sales order item
    VBFA : sales document flow
    VBUK for processing status
    KOMV for duties value and sales order value
    LIKP : delivery not header
    LIPS :delivery note item
    For information : In the header level the processing Status is indicated in the table VBUK field LFSTK for one sales order number. A,B , C are the possible entries.
    Case A : When a sales order is invoiced we can display information on the header status :
    Overall status : Completed  and display a invoice number in the document flow. When the items of the sales orders are invoiced the process status is the following :  Overall status       Completed            
    Delivery status      Fully delivered      
    Case B : An open sales order not delivered and not invoiced will have overall status : Open on the header and item level and will not have subsequent documents.
    Case C :
    When the items for the sales order are delivered but not invoiced the status will be u201Cfully deliveredu201D
    And the subsequent documents will be delivery notes and good issue if the delivery note is issued.
    With regards
    ravi
    Edited by: ravik ravik on Jun 25, 2008 3:29 PM

    Hello Ravi,
    U neednot develop any report..
    there is std report with txn V.02
    or copy this and make necessary changes.
    Reward, if helpful.
    Rgds,
    Raghu.

  • Aging report for Open Invoice

    Hi All,
    I need to develop an Aging report for open invoice, there is no indication for open invoice or close invoice since we are using customise DS and DS from third party system. only one key flag we have is clearing date. so kindly let me know how to write the logic for this requirement.. can I use Customer exit for this? I have an Idea to do like
    first logic is
    *If Clearing date = blank than invoice is = open (by using of this logic we can get all open invoice).
    second logic
    total number of invoice = current date - document date.
    but I do not know how to implement this logic in BEx hnece kinnly advice me whether this logic can be work or suggest with different solution ples..
    Regards,

    hi,
    You can  check few default PO reports wid proper paramater in it
    or
    Can check table EKBE
    or
    Check PO history in the PO doc
    Or
    Check the ME80FN
    Regards
    Priyanka.P

  • Report for material with sloc,qty available, and production order

    hi friends, i need advice on getting this report for material with qty and specific sloc with the corresponding Prodn order numbers. in mb51 i could get all these details except the prodn order no. could you advice me please?

    to make sure you know how to do this.
    In the material document list, hit "Ctrl+F8" on your keyboard.
    A window will pop up. Click on the button position and look for "order" in the list of available fields. That should do it.
    Rgds.

  • Report for Comparison of Material Qty

    Hi All,
    I need to Develop an Interactive report for Comparison of Material Qty. ordered through Purchase requisition, ordered material through PO and corresponding Material Receipt report.
    Can Someone Give a brief description about this & fields tcode & tables regarding this report.A sample code would be much appreciated.
    Thanks & regards,
    Ravi S

    To get the material number combined with the PO text you will need the help of an ABAP programmer.  The programmer can create a report for you using the function module READ_TEXT in the function group STXD.  The tables to use are:
    STXH - STXD SAPscript text file header
    STXL - STXD SAPscript text file lines
    The selection screen should have at least the following:
    OBJECT - STXH-TDOBJECT
    NAME - STXH-TDNAME
    LANGUAGE - STXH-TDSPRAS
    TEXTID - STXH-TDID
    You find the information for these fields by going to the PO text entry screen and displaying the header information under Goto -> Header.  For materials, the object is MATERIAL, the name is "material number", the language is "EN", and the text ID is BEST.  You can use this program to get long text in lots of places like information records, purchase order texts, etc.
    Hope this helps.

  • Report for open process orders

    Dear SAP experts,
    As the period of the process order from open to close is not short, will take 1 or 2 months in our business case, so we want to find a report which can get the information just like the output of KSPP(for planned orders) .
    I tried to analysis the logic of program KSPP, and it seems the function modules based on the planned orders only.
    Is there any way to get the similar report for open process orders?
    Many Thanks,
    Lisa Yao

    Is there any clues?

  • Report for open order and shipped qty  summary

    Dear Folks,
               Can any one please help me.
    Report for open order summary Vs shipped quantity
    what are the related programs to it.
    throw some light on it.

    >
    arpita b wrote:
    > Dear rohit
    >    
    >     Iam asking about any report which compares or give details of open order vs shipped qty.
    >
    > Any sis report is available for this?
    Hi Arpita,
    There is no such sis report available. You will have to configure and create two seperate reports and do the comparison.
    If you want, I will send you the list of all T.codes used to generate reports in SD.
    Revert back to me if you need the same.
    Regards,
    Swapna D.

  • Report for stock statement

    hi guy's,
       i am doing report for the stock statement .... my issue is in MB5B if i reverse some document it shows as it move's to issue QTY and my receipt is same but my closing stock is correct ...is there any std report avalible ....
    thank's in advance

    Use this code :
    TABLES : MSEG,MKPF,MARA,MAKT,BEWART,MSLB,BSIM.
    TYPE-POOLS : SLIS.
    DATA : IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
           IT_LIST_HEADER TYPE SLIS_T_LISTHEADER,
           IT_EVENTS TYPE SLIS_T_EVENT,
           GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
           WA_SORT TYPE SLIS_SORTINFO_ALV,
           IT_SORT TYPE SLIS_T_SORTINFO_ALV,
           REPID LIKE SY-REPID,
           FRM_DATE(10),TO_DATE(10),
           DISPTEXT(255),DISPTEXT2(255).
    TYPES : BEGIN OF ST_OPBAL,
             MATNR LIKE MSEG-MATNR,
             MAKTX LIKE MAKT-MAKTX,
             BATCH LIKE MSEG-CHARG,
             BWART LIKE MSEG-BWART,
             MENGE LIKE MSEG-MENGE,
             ZEILE LIKE MSEG-ZEILE,
             WERKS LIKE MSEG-WERKS,
             SOBKZ LIKE MSEG-SOBKZ,
             BUDAT LIKE MKPF-BUDAT,
             SHKZG LIKE MSEG-SHKZG,
             DMBTR LIKE MSEG-DMBTR,
             MBLNR LIKE MSEG-MBLNR,
             LGORT LIKE MSEG-LGORT,
           END OF ST_OPBAL.
    DATA : OPBAL TYPE ST_OPBAL OCCURS 0 WITH HEADER LINE,
           TMP_OPBAL TYPE ST_OPBAL OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF BAL_NOREF OCCURS 0,
              MATNR LIKE MARA-MATNR,
              SHKZG LIKE MSEG-SHKZG,
              DMBTR LIKE MSEG-DMBTR,
           END OF BAL_NOREF.
    DATA : BEGIN OF OPBAL2 OCCURS 0,
             SNO(3)      TYPE N,
             MATNR       LIKE MSEG-MATNR,
             MAKTX       LIKE MAKT-MAKTX,
             OP_BAL      LIKE MSEG-MENGE,
             OP_STKVAL   LIKE MSEG-DMBTR,   "NEW
             REC         LIKE MSEG-MENGE,
             T_OPBAL_REC LIKE MSEG-MENGE,
             REC_STKVAL  LIKE MSEG-DMBTR,   "NEW
             ISS         LIKE MSEG-MENGE,
             ISS_STKVAL  LIKE MSEG-DMBTR,   "NEW
             SALES       LIKE MSEG-MENGE,
             T_ISS       LIKE MSEG-MENGE,
             CL_BAL      LIKE MSEG-MENGE,
             BATCH       LIKE MSEG-CHARG,
             SUBCON      LIKE MSEG-MENGE,
             CL_STKVAL   LIKE MSEG-DMBTR,
           END OF OPBAL2.
    DATA  SERNO(4) TYPE C.
    DATA OPTOT  TYPE P DECIMALS 3.
    DATA RECTOT TYPE P DECIMALS 3.
    DATA ISSTOT TYPE P DECIMALS 3.
    DATA TOTALL TYPE P DECIMALS 3.
    DATA FLG        TYPE N.
    DATA FLAG       TYPE N.
    DATA STOCKVAL        TYPE MSEG-DMBTR.
    DATA REC_STOCKVAL    TYPE MSEG-DMBTR.
    DATA ISS_STOCKVAL    TYPE MSEG-DMBTR.
    DATA CL_STKVAL       TYPE MSEG-DMBTR.
    SELECTION-SCREEN BEGIN OF BLOCK X WITH FRAME.
         SELECT-OPTIONS: P_MATNR FOR MSEG-MATNR,
                         P_MGRP  FOR MARA-MATKL,
                         P_DATE FOR MKPF-BUDAT,
         P_PLANT FOR MSEG-WERKS DEFAULT  'NB01' OBLIGATORY NO INTERVALS
                                                    NO-EXTENSION .
         SELECT-OPTIONS: P_STLOC FOR MSEG-LGORT NO INTERVALS NO-EXTENSION.
    SELECTION-SCREEN END OF BLOCK X.
    INITIALIZATION.
       REPID = SY-REPID.
       PERFORM FILL_FLDCAT USING IT_FLDCAT.
       PERFORM FILL_EVENTS USING IT_EVENTS.
       PERFORM FILL_LAYOUT USING GS_LAYOUT.
    START-OF-SELECTION.
      CONCATENATE P_DATE-LOW6(2) '.' P_DATE-LOW4(2) '.' P_DATE-LOW+0(4)
      INTO FRM_DATE.
      CONCATENATE P_DATE-HIGH6(2) '.' P_DATE-HIGH4(2) '.' P_DATE-HIGH+0(4)
      INTO TO_DATE.
      CONCATENATE TEXT-003 FRM_DATE' TO : ' TO_DATE INTO DISPTEXT.
      CONCATENATE TEXT-004 P_PLANT-LOW ' Storage Location : ' P_STLOC-LOW
      INTO DISPTEXT2.
      PERFORM FILL_HEADER USING IT_LIST_HEADER.
      SELECT  A~MATNR
              F~MAKTX
              A~CHARG
              A~BWART
              A~MENGE
              A~ZEILE
              A~WERKS
              A~SOBKZ
              D~BUDAT
              A~SHKZG
              A~DMBTR
              A~MBLNR
              A~LGORT
              INTO TABLE OPBAL
       FROM MKPF AS D JOIN MSEG AS A
               ON DMBLNR = AMBLNR  AND
                  DMJAHR = AMJAHR
            JOIN MARA AS E
               ON EMATNR = AMATNR
            JOIN MAKT AS F
               ON FMATNR = AMATNR
       WHERE   A~MATNR IN P_MATNR
         AND   A~WERKS IN P_PLANT
         AND   A~KZBEW IN (' ','B')
         AND   E~MATKL IN P_MGRP
         AND   A~BWART NOT IN ('541','542','321','322','121')
         AND   A~KZVBR NOT IN ('A')
         AND   D~BUDAT LE P_DATE-HIGH.
    LOOP AT OPBAL WHERE BWART EQ '544' AND LGORT EQ ''.
       TMP_OPBAL = OPBAL.
       APPEND TMP_OPBAL.
    ENDLOOP.
    DELETE OPBAL WHERE ( BWART EQ '309' AND DMBTR EQ 0  ).
    DELETE OPBAL WHERE ( BWART NE '543' AND LGORT EQ '' ).
    LOOP AT TMP_OPBAL.
       OPBAL = TMP_OPBAL.
       APPEND OPBAL.
    ENDLOOP.
    STOCKVAL = 0.
    SORT OPBAL BY MATNR BATCH BUDAT.
    LOOP AT OPBAL.
      SELECT SINGLE LBLAB INTO MSLB-LBLAB FROM MSLB
                            WHERE MATNR = OPBAL-MATNR.
      IF OPBAL-BUDAT LT P_DATE-LOW.
         IF OPBAL-SHKZG = 'H'.
            OPTOT = OPTOT - OPBAL-MENGE.
         ELSEIF OPBAL-SHKZG = 'S'.
            OPTOT = OPTOT + OPBAL-MENGE.
         ENDIF.
    For the duration   II part  *****************
      ELSEIF OPBAL-BUDAT IN P_DATE.
         IF OPBAL-SHKZG = 'H'.
            ISSTOT      = ISSTOT + OPBAL-MENGE.
         ELSEIF OPBAL-SHKZG = 'S'.
            RECTOT = RECTOT + OPBAL-MENGE.
         ENDIF.
      ENDIF.
    AT END OF BATCH. " modified for chek
       READ TABLE OPBAL INDEX SY-TABIX.
       CLEAR BAL_NOREF. REFRESH BAL_NOREF.
       SELECT MATNR SHKZG SUM( DMBTR )
         INTO TABLE BAL_NOREF
         FROM BSIM
        WHERE BUDAT LT P_DATE-LOW  AND
              MATNR EQ OPBAL-MATNR AND
              BWTAR EQ OPBAL-BATCH AND
              BWKEY IN P_PLANT     AND
              BLART IN ('RE','WE','WA','PR')
        GROUP BY MATNR SHKZG.
       LOOP AT BAL_NOREF.
          IF BAL_NOREF-SHKZG = 'H'.
             STOCKVAL = STOCKVAL - BAL_NOREF-DMBTR.
          ELSE.
             STOCKVAL = STOCKVAL + BAL_NOREF-DMBTR.
          ENDIF.
       ENDLOOP.
       CLEAR BAL_NOREF. REFRESH BAL_NOREF.
       SELECT MATNR SHKZG SUM( DMBTR )
         INTO TABLE BAL_NOREF
         FROM BSIM
        WHERE BUDAT IN P_DATE AND
              MATNR EQ OPBAL-MATNR AND
              BWTAR EQ OPBAL-BATCH AND
              BWKEY IN P_PLANT     AND
              BLART IN ('RE','WE','WA','PR')
        GROUP BY MATNR SHKZG.
       LOOP AT BAL_NOREF.
          IF BAL_NOREF-SHKZG = 'H'.
             ISS_STOCKVAL = ISS_STOCKVAL + BAL_NOREF-DMBTR.
          ELSE.
             REC_STOCKVAL = REC_STOCKVAL + BAL_NOREF-DMBTR.
          ENDIF.
       ENDLOOP.
       " MSLB-LBLAB (STOCK WITH SUBCONTRACTOR).
       CL_STKVAL       = STOCKVAL + REC_STOCKVAL - ISS_STOCKVAL.
       TOTALL =  OPTOT + RECTOT - ISSTOT.
       IF OPTOT = '0'   AND RECTOT = '0'  AND ISSTOT = '0'.
          FLG = 1.
       ENDIF.
       IF FLG = 1.
          CLEAR FLG.
       ELSE.
          SERNO = SERNO + 1.
          OPBAL2-SNO         = SERNO.
          OPBAL2-MATNR       = OPBAL-MATNR.
          OPBAL2-MAKTX       = OPBAL-MAKTX.
          OPBAL2-OP_BAL      = OPTOT.
          OPBAL2-REC         = RECTOT.
          OPBAL2-T_OPBAL_REC = OPTOT + RECTOT.
          OPBAL2-ISS         = ISSTOT.
          OPBAL2-T_ISS       = ISSTOT.
          OPBAL2-CL_BAL      = TOTALL.
          OPBAL2-BATCH       = OPBAL-BATCH.
          OPBAL2-SUBCON      = MSLB-LBLAB.
          OPBAL2-OP_STKVAL   = STOCKVAL.
          OPBAL2-ISS_STKVAL  = ISS_STOCKVAL.
          OPBAL2-REC_STKVAL  = REC_STOCKVAL.
          OPBAL2-CL_STKVAL   = CL_STKVAL.
          APPEND OPBAL2.
       ENDIF.
      OPTOT = 0.
      RECTOT = 0.
      ISSTOT = 0.
      STOCKVAL = 0.
      ISS_STOCKVAL = 0.
      REC_STOCKVAL = 0.
      CL_STKVAL    = 0.
    ENDAT.
    ENDLOOP.
      WA_SORT-SPOS = 1.
      WA_SORT-FIELDNAME = 'MATNR'.
      WA_SORT-UP = 'X'.
    WA_SORT-SUBTOT = 'X'.
    APPEND WA_SORT TO IT_SORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = REPID
          IT_FIELDCAT        = IT_FLDCAT
          IT_EVENTS          = IT_EVENTS
          IS_LAYOUT          = GS_LAYOUT
          IT_SORT            = IT_SORT
        TABLES
          T_OUTTAB           = OPBAL2.
    FORM FILL_FLDCAT USING P_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
       PERFORM FILL_PARAM_FLDCAT USING  1 'SNo'          'SNO'       ' ' 'X'
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  2 'Material No.' 'MATNR'     ' ' 'X'
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  3 'Description'  'MAKTX'     ' ' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  4 'Op.Bal'      'OP_BAL'     'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  5 'Op.Stock Val' 'OP_STKVAL' 'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  6 'Receipts'     'REC'       'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  7 'Total'     'T_OPBAL_REC'  'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  8 'Rect.Val.' 'REC_STKVAL'   'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING  9 'Issues'    'ISS'          'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING 10 'Iss. Val.' 'ISS_STKVAL'   'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING 11 'Cl. Bal.'     'CL_BAL'    'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING 12 'Cl.Stock Val' 'CL_STKVAL' 'X' ' '
       'OPBAL2' P_FLDCAT.
       PERFORM FILL_PARAM_FLDCAT USING 13 'BATCH '       'BATCH'     ' ' ' '
       'OPBAL2' P_FLDCAT.
    ENDFORM.
    FORM FILL_PARAM_FLDCAT USING VALUE(P_COL) VALUE(P_TEXT) VALUE(P_FLDNAME)
                           VALUE(P_DOSUM) VALUE(P_NOZERO) VALUE(P_TABNAME)
                           PP_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
       DATA : WA_FLDCAT TYPE SLIS_FIELDCAT_ALV.
       CLEAR WA_FLDCAT.
         WA_FLDCAT-COL_POS   = P_COL.
         WA_FLDCAT-SELTEXT_M = P_TEXT.
         WA_FLDCAT-FIELDNAME = P_FLDNAME.
         WA_FLDCAT-TABNAME   = P_TABNAME.
         WA_FLDCAT-DO_SUM    = P_DOSUM.
         WA_FLDCAT-NO_ZERO   = P_NOZERO.
       APPEND WA_FLDCAT TO PP_FLDCAT.
    ENDFORM.
    FORM FILL_HEADER USING P_IT_LIST_HEADER TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
      CLEAR LS_LINE.
      LS_LINE-TYP = 'S'.
      LS_LINE-INFO = TEXT-002.
      APPEND LS_LINE TO P_IT_LIST_HEADER.
      CLEAR LS_LINE.
      LS_LINE-TYP = 'S'.
      LS_LINE-INFO = DISPTEXT.
      APPEND LS_LINE TO P_IT_LIST_HEADER.
      CLEAR LS_LINE.
      LS_LINE-TYP = 'S'.
      LS_LINE-INFO = DISPTEXT2.
      APPEND LS_LINE TO P_IT_LIST_HEADER.
    ENDFORM.
    FORM FILL_EVENTS USING P_IT_EVENTS TYPE SLIS_T_EVENT.
       DATA LS_EVENT TYPE SLIS_ALV_EVENT.
       MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
       MOVE 'TOP_OF_PAGE' TO LS_EVENT-NAME.
       APPEND LS_EVENT TO P_IT_EVENTS.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         IT_LIST_COMMENTARY       = IT_LIST_HEADER.
    ENDFORM.
    FORM FILL_LAYOUT USING P_GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
       P_GS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
       P_GS_LAYOUT-ZEBRA             = 'X'.
       P_GS_LAYOUT-FLEXIBLE_KEY      = 'X'.
    ENDFORM.
    FOR TESTING PURPOSE.
    *SORT OPBAL BY BUDAT.
    *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM = REPID
         IT_FIELDCAT        = IT_FLDCAT
         IT_EVENTS          = IT_EVENTS
       TABLES
         T_OUTTAB           = OPBAL.
    *FORM FILL_FLDCAT USING P_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
      PERFORM FILL_PARAM_FLDCAT USING  1 'MBLNR'        'MBLNR'
      'OPBAL' P_FLDCAT.
      PERFORM FILL_PARAM_FLDCAT USING  2 'CREDIT/DEBIT' 'SHKZG'
      'OPBAL' P_FLDCAT.
      PERFORM FILL_PARAM_FLDCAT USING  3 'MOV.TYP.'     'BWART'
      'OPBAL' P_FLDCAT.
      PERFORM FILL_PARAM_FLDCAT USING  4 'ST.LOC.'     'LGORT'
      'OPBAL' P_FLDCAT.
      PERFORM FILL_PARAM_FLDCAT USING  5 'STOCK VAL'    'DMBTR'
      'OPBAL' P_FLDCAT.
      PERFORM FILL_PARAM_FLDCAT USING  6 'POS.DATE'     'BUDAT'
      'OPBAL' P_FLDCAT.
    *ENDFORM.

Maybe you are looking for