How to rerun the failed report subscription.

Hi,
Is there any way to rerun the report subscription jobs based on job status.
Version: SSRS 2008
Regards,
Vaishu

Hi Vaishu, I wrote this sp to make the job on our server. Hope this help people with the same problem.
USE [ReportServer]
GO
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Roberto Barcia
-- Create date: 04/17/2014
-- Description: Subscription failed control and re-running
-- =============================================
ALTER PROCEDURE [dbo].[sp_FailedSubscription]
-- Add the parameters for the stored procedure here
-- How to test this store procedure
EXEC [dbo].[sp_FailedSubscription]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Create temp table, control if exist
IF OBJECT_ID('tempdb..#Failed') IS NOT NULL 
BEGIN 
  DROP TABLE #Failed
END
CREATE TABLE #Failed (id int, NewJob nvarchar(100))
-- Insert Failed subscription into the temp table
INSERT INTO  #Failed (id, NewJob)
SELECT DISTINCT ROW_NUMBER() OVER(order BY j.Name) AS id, 
      'EXEC [msdb].[dbo].[sp_start_job] @job_name = ''' + CAST(j.Name AS varchar(40)) + ''''  AS NewJob
FROM  msdb.dbo.sysjobs j  
JOIN  msdb.dbo.sysjobsteps js ON js.job_id = j.job_id 
JOIN  [ReportServer].[dbo].[Subscriptions] s  ON js.command LIKE '%' + CAST(s.subscriptionid AS varchar(40)) + '%' 
WHERE s.LastStatus LIKE 'Failure sending mail%';
-- VAR Declaration
DECLARE @TotalFailed int = (SELECT COUNT(*) FROM #Failed)
DECLARE @CurrentFailed int = 1
DECLARE @FailedId int
DECLARE @SQL varchar(1000)
-- Executing Failed Subscription again
WHILE @CurrentFailed <  @TotalFailed + 1          
BEGIN 
 -- Get datta
 SET @FailedId = (SELECT Id FROM #Failed WHERE Id = @CurrentFailed)
 SET @SQL = (SELECT NewJob FROM #Failed WHERE Id = @CurrentFailed)
 -- Execute job
 EXEC (@SQL)
 -- test 
 -- PRINT @SQL
 -- next one
 SET @CurrentFailed = @CurrentFailed +1
END
    -- test
-- PRINT @TotalFailed
-- SELECT * FROM #Failed
-- Drop temp file
DROP TABLE #Failed
END
GO

Similar Messages

  • JNI - How to use the error reporting mechanism?

    I've developed a C++ DLL which is loaded from a commercial Win32 application (not written by me) as a plug-in for external calculations. On its initialization the C++ DLL launches the Java VM via the JNI invocation interface. When the DLL functions are called by the application, they forward the calls to Java objects inside the Java VM, again via JNI invocation interface.
    This works well, but I have encountered a weird error.
    From Java I open a JFrame containing a JTextArea as small console for debug output messages. If I turn output to this debug console off (my printToConsole routine checks whether a boolean flag is set), the string concatenation operator may lead to a crash of the Java VM.
    For example, if in one of the Java functions called from the
    DLL via JNI invocation interface the following is the first statement,
    it leads to a crash of the Java VM and the application that loaded the C++ proxy DLL.
    String test=""+Math.random(); // String test not used later
    Interestingly, if I comment this statement out, the Java code works fine WITHOUT any crash. I've already thought about potential races and synchronization issues in my code, but I don't see where this is the case. And the string concatenation error fails as well, if I insert sleep() statements in front of it and at other places in the code. However, if I turn on log messages printed to my JFrame debug console (containing a JTextArea), the String concatenation works without problems.
    So maybe the JNI interface has a bug and affects the Java VM; I don't see where my JNI code is wrong.
    One problem is that I do not get any stdout output, as the C++ proxy DLL is loaded by the Windows application, even if I start the Windows application from the DOS command line (under Windows).
    Does anyone know how to use the error reporting mechanism?
    http://java.sun.com/j2se/1.4.2/docs/guide/vm/error-handling.html
    Is it possible that the JVM, when it crashes, writes debug information about the crash into a file instead of stdout/stderr?
    My C++ proxy DLL was compiled in debug mode, but the commercial application (which loaded the DLL) is very likely not.
    I do not know hot to find the reason why the String concatenation fails inside the Java function called from the C++ DLL via JNI.

    Yes, I've initially thought about errors in the C++ code too. But the C++ code is actually very simple and short. It doesn't allocate anything on the C++ side. It allocates a couple of ByteBuffers inside the Java VM however via JNI invocation interface calls of env->NewDirectByteBuffer(). The native memory regions accessed via the ByteBuffers are allocated not by my own C++ code, but by the program that calls my DLL (the program is Metastock).
    The interesting thing is that everything works fine if output to my debug console is enabled, which means that in the Java print routine getConsoleLoggingState() returns true and text is appended to the jTextArea.
    static synchronized void print(String str)
    { MetaStockMonitor mMon=getInstance();
    if ( mMon.getFileLoggingState() && mMon.logFileWriter!=null) {
    mMon.logFileWriter.print(str);
    mMon.logFileWriter.flush();
    if ( mMon.getConsoleLoggingState() ) {
    mMon.jTextArea1.append(str);
    Only if output to the JTextArea is turned off (ie. getConsoleLoggingState()==false), the crash happens when the FIRST statement in the Java routine called via JNI invocation interface is a (useless) String concatenation operation, as described above.
    String test=""+Math.random(); // String test not used later
    Moreover, the crash happens BEFORE the allocated ByteBuffer objects are accessed in the Java code. But again, if console output is turned on, it works stable. If console output is turned off, it works when the (useless) String concatenation operation is removed in the Java routine called from C++.
    I've already thought about potential races (regarding multiple threads), but this can be ruled out in my case. It almost appears as if the JVM can have problems when called by the invocation interface (I tested it with Java 1.4.2 b28).
    All the calls between C++ and Java go ALWAYS in the direction from C++ code to Java. Unfortunately, there is no special JRE version with extensive logging capabilities to facilitate debugging. And the problem is not easily reproducible either.
    JNIEnv* JNI_GetEnv()
    JNIEnv *env;
    cached_jvm->AttachCurrentThread((void**)&env,NULL);
    fprintf(logfile,"env=%i\n",env);
    fflush(logfile);
    return env;
    // function called by Metastock's MSX plug-in interface
    BOOL __stdcall createIndEngine (const MSXDataRec *a_psDataRec,
    const MSXDataInfoRecArgsArray *a_psDataInfoArgs,
    const MSXNumericArgsArray *a_psNumericArgs,
    const MSXStringArgsArray *a_psStringArgs,
    const MSXCustomArgsArray *a_psCustomArgs,
    MSXResultRec *a_psResultRec)
    a_psResultRec->psResultArray->iFirstValid=0;
    a_psResultRec->psResultArray->iLastValid=-1;
    jthrowable ex;
    jmethodID mid;
    JNIEnv* env=JNI_GetEnv();
    jobject chart=getChart(env, a_psDataRec);
    if ( chart==NULL) {
    return MSX_ERROR;
    jobject getChart (JNIEnv* env, const MSXDataRec *a_psDataRec)
    jthrowable ex;
    jmethodID mid;
    int closeFirstValid, closeLastValid;
    closeFirstValid=a_psDataRec->sClose.iFirstValid;
    closeLastValid=a_psDataRec->sClose.iLastValid;
    long firstDate, firstTime;
    if (closeFirstValid>=1 && closeFirstValid<=closeLastValid) {
    firstDate = a_psDataRec->psDate[closeFirstValid].lDate;
    firstTime = a_psDataRec->psDate[closeFirstValid].lTime;
    } else {
    firstDate=0;
    firstTime=0;
    jclass chartFactoryClass = env->FindClass("wschwendt/metastock/msx/ChartFactory");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find class ChartFactory\n");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetStaticMethodID(chartFactoryClass, "getInstance", "()Lwschwendt/metastock/msx/ChartFactory;");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getInstance()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject chartFactory=env->CallStaticObjectMethod(chartFactoryClass, mid);
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getInstance()");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetMethodID(chartFactoryClass, "getChartID", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIIIII)F");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getChartID()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject symbolBuf=env->NewDirectByteBuffer(a_psDataRec->pszSymbol, strlen(a_psDataRec->pszSymbol) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate symbolBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityNameBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityName, strlen(a_psDataRec->pszSecurityName) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityNameBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityPathBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityPath, strlen(a_psDataRec->pszSecurityPath) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityPathBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityOnlineSourceBuf=env->NewDirectByteBuffer(a_psDataRec->pszOnlineSource, strlen(a_psDataRec->pszOnlineSource) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate onlineSourceBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    // Java Function call leads to crash, if console output is turned off and
    // the first statement in the Java routine is a (useless) string concatenation.
    // Otherwise it works stable.
    jfloat chartID=env->CallFloatMethod(chartFactory, mid, securityNameBuf, symbolBuf,
    securityPathBuf, securityOnlineSourceBuf, (jint)(a_psDataRec->iPeriod),
    (jint)(a_psDataRec->iInterval), (jint)(a_psDataRec->iStartTime),
    (jint)(a_psDataRec->iEndTime), (jint)(a_psDataRec->iSymbolType),
    (jint)firstDate, (jint)firstTime );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getChartID()");
    printSBufViaJava(sbuf);
    return NULL;

  • How to do the ALV report output in groups and caluculate the tOTALS(URGENT

    Hi
    In my ALV report output .I have to group the output based on the DAYS field
    0-10 days in one group
    10-30 days in one group
    above 30 days one group
    There is also a field by name "AMOUNT" in my output.
    I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
    Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
    Thanks in Advance

    Please don't repost your questions...
    Check out my answer in your other post.
    How to make the ALV report in groups  and caluculate the TOTALS
    Regards,
    Naimesh Patel

  • How to stop the "minority report" type of personalized ads triggered by one's google search and appearing in the firefox browser?

    Please advise how to stop the "minority report" type of personalized advertising apparently triggered by one's google search and appearing in the firefox browser.
    == This happened ==
    Every time Firefox opened
    == a few months ago

    If another uses the computer with their own user account, everything
    is kept separate in each users folder. Only if someone used your account
    would that be an issue.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/viruses/disinfection/5350 Anti-Rootkit Utility - TDSSKiller]
    * [http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner AdwCleaner] (for more info, see this [http://www.bleepingcomputer.com/download/adwcleaner/ alternate AdwCleaner download page])
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • How to get the link report of a swf file to the set of clases

    He  But How to get the link Report of the SwF File

    Here are some links with additional information:
    http://stackoverflow.com/questions/185252/optimizing-flex-when-multiple-modules-are-used
    http://livedocs.adobe.com/flex/3/html/help.html?content=modular_4.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
    If this post answers your question or helps, please mark it as such.

  • How to Enhance the Standard Report?

    Hi All,
    How to Enhance the Standard Report? :
    When I am trying to execute the query called ZTIMES in the user group SQ01 it is navigating the screen to selection-screen with some inputs to be given here on the selection screen company code is mandatory as an input. The company code field is having the search help and it is fetching the values for the company code from table called PROJ  Table (Project definition Table).But I want the company code should fetch the value from the  PRPS Table ( Work break structure(WBS Element) Level).
    Tables used are PROJ and PRPS.
    The company code in PROJ is PROJ-VBUKR
                                    In PRPS is PRPS-PBUKR
    In the coding part related to that selection screen I have to replace PROJ-VBUKR with
    PRPS-PBUKR.But it is standard report to enhance.
    What is suggestible solution for this issue?
    Thanks,
    M Raju

    Hi,
    Since this is an ABAP Query, You can change the infoset query in SQ02 and establish the join linkages between PROJ and PRPS
    Also on the selection screen of the Query make sure you provide company code from PRPS table and report output also from the same table reference.
    Once you have modified the ABAP Query, activate and generate it so that it will internally regenerate the a standard program.
    http://help.sap.com/erp2005_ehp_02/helpdata/en/d2/cb4256455611d189710000e8322d00/frameset.htm
    ABAP Query (Sq01)Modification
    Hope this helps
    Regards,
    Shiva

  • How to open the crystal reports 2008 in CRYSTAL REPORTS ENTERPRISE 4.0

    Hi All,
    Can you please let me know how can migrated the crystal reports from BO XI 3.1 to SAP BO 4.1 and after migrate how to open the crystal reports 2008 in CRYSTAL REPORTS ENTERPRISE 4.0.
    can you please help on this and if document please share.
    Thanks,
    Rajesh

    Use the upgrade management tool to move from 3.1 reports to BO 4.1. After migration, open the report in crystal enterprise 4.0, you will get a message saying that the report will be converted to latest version, will not be able to view from older version after converting. (Similar words- not sure exact words).

  • How to download the custom Reports to xls from the system?

    Hi
    How to download the custom Reports to xls from the system?
    I know the t code SE38 for reports.
    Vijay

    Hi
    Here the programa name is nothing but a report name???
    Vijay

  • How to do The quotes and subscripts in pages??

    Hi guys,
    I don't know how to do the quotes and subscripts in pages for iOS...
    Someone can tell me this??
    Sorry for my English, I'm not American...

    You can create left and right single quotes with option + }, and shift + option + }, respectively.
    Double quotes work the same way using the { character substituted above.
    Menu > Format > Font > Baseline:
    Superscript is control + command and +
    Subscript is control + command and -

  • Hi gurur's how we  do the interactive report in ALV

    hi gurur's how we  do the interactive report in ALV.
    PLZ HELP ME

    Hi Srivasu,
                    I will send a sample code along with Comments check it once ok.copy the below code and execute it and debug it ok..
    *& Report  YPURCHASEORDER_ALV_LISTDISP                                 *
    *&  DEVELOPER  : KIRAN KUMAR.G                                         *
    &  PURPOSE    : CREATING A PURCHASE ORDER BASED ON PURCHASE DOC NUMBER
    *&  CREATION DT: 22/11/2007                                            *
    *&  REQUEST   : ERPK900035                                             *
    REPORT  YPURCHASEORDER_ALV_LISTDISP.
    Tables
    TABLES : ekko, "Purchasing Document Header
             ekpo. "Purchasing Document Item
    Type pools
    TYPE-POOLS: slis.
    Internal Tables
    DATA: BEGIN OF gt_headerdat OCCURS 0,
           ebeln LIKE ekko-ebeln,        " Purchasing Document Number
           bukrs LIKE ekko-bukrs,        " Company Code
           bstyp LIKE ekko-bstyp,        " Purchasing Document Category
           bsart LIKE ekko-bsart,        " Purchasing Document LIKE
           aedat LIKE ekko-aedat,        " Date on which the recordwascreate
           ernam LIKE ekko-ernam,        " Name of Person who Created Object
           lifnr LIKE ekko-lifnr,        " Vendor's account number
           spras LIKE ekko-spras,        " Language Key
           ekorg LIKE ekko-ekorg,        " Purchasing Organization
           ekgrp LIKE ekko-ekgrp,        " Purchasing group
          END OF gt_headerdat.
    DATA: BEGIN OF gt_item OCCURS 0,
           matnr LIKE ekpo-matnr,        "Material Number
           werks LIKE ekpo-werks,        "Plant
           lgort LIKE ekpo-lgort,        "Storage location
           matkl LIKE ekpo-matkl,        "Material group
           menge LIKE ekpo-menge,        "Purchase order quantity
           meins LIKE ekpo-meins,        "Order unit
           netpr LIKE ekpo-netpr,        "Net price in purchasing document
           kunnr LIKE ekpo-kunnr,        "Customer Number 1
          END OF gt_item.
    Global Structures
    DATA: gt_header    TYPE slis_t_listheader, "For Headings
          wa_header    TYPE slis_listheader,
          gt_fieldcat  TYPE slis_t_fieldcat_alv, "Structure Defintion
          wa_fieldcat  TYPE slis_fieldcat_alv,
          gt_fieldcat1 TYPE slis_t_fieldcat_alv,
          wa_fieldcat1 TYPE slis_fieldcat_alv,
          wa_layout    TYPE slis_layout_alv,     "Layout
          gt_events    TYPE slis_t_event,        "For Events
          wa_events    TYPE slis_alv_event.
    Selection Screen
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS  : s_ebeln FOR ekko-ebeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    Initialization
    INITIALIZATION.
      PERFORM initial.
    Fetch Data
    START-OF-SELECTION.
      PERFORM fetch_data.
    END-OF-SELECTION.
    Bulid fieldcatalog
      PERFORM fieldcat.
    Change fieldcatalog
      PERFORM fieldcat_change.
    Events Triggering
      PERFORM place_events.
    Layout.
      PERFORM layout.
    Display Data
      SORT gt_headerdat BY ebeln.
      PERFORM display_list.
    *&      Form  initial
          text
    -->  p1        text
    <--  p2        text
    FORM initial .
      s_ebeln-sign    = 'I'.
      s_ebeln-option  = 'BT'.
      s_ebeln-low     = '3000000090'.
      s_ebeln-high    = '3000000166'.
      APPEND s_ebeln.
    ENDFORM.                    " initial
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .
      REFRESH gt_headerdat.  "Clear the Body of Internal Table
      CLEAR   gt_headerdat.  "Clear Header Line
      SELECT ebeln
             bukrs
             bstyp
             bsart
             aedat
             ernam
             lifnr
             spras
             ekorg
             ekgrp
        FROM ekko
        INTO TABLE gt_headerdat
       WHERE ebeln IN s_ebeln.
    ENDFORM.                    " fetch_data
    *&      Form  display_list
          text
    -->  p1        text
    <--  p2        text
    FORM display_list .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
        i_callback_program             = sy-cprog
      I_CALLBACK_PF_STATUS_SET       = ' '
        i_callback_user_command        = 'USERCOMMAND'
      I_STRUCTURE_NAME               =
        is_layout                      = wa_layout
        it_fieldcat                    = gt_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
        it_events                      = gt_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_headerdat
       EXCEPTIONS
        program_error                  = 1
        OTHERS                         = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " display_list
    *&      Form  place_events
          text
    -->  p1        text
    <--  p2        text
    FORM place_events .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = gt_events
        EXCEPTIONS
          list_type_wrong = 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.
      CLEAR wa_events.   "Clear Header Line
      READ TABLE gt_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_events-form = 'HEADING'.
        MODIFY gt_events FROM wa_events INDEX sy-tabix.
      ENDIF.
      CLEAR wa_events.   "Clear Header Line
      READ TABLE gt_events INTO wa_events WITH KEY name = 'END_OF_LIST'.
      IF sy-subrc = 0.
        wa_events-form = 'PAGEDOWN'.
        MODIFY gt_events FROM wa_events INDEX sy-tabix.
      ENDIF.
      CLEAR wa_events.    "Clear Header Line
      READ TABLE gt_events INTO wa_events WITH KEY name = 'USER_COMMAND'.
      IF sy-subrc = 0.
        wa_events-form = 'USERCOMMAND'.
        MODIFY gt_events FROM wa_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " place_events
    *&      Form  layout
          text
    -->  p1        text
    <--  p2        text
    FORM layout .
      CLEAR wa_layout.                   "Clear Header Line
      wa_layout-zebra = 'X'.             "Zebra Lines in the Output
      wa_layout-colwidth_optimize = 'X'. "Optimize the Column Width
    ENDFORM.                    " layout
    *&      Form  heading
          text
    FORM heading.
      WRITE:/6 'THIS REPORT DISPLAYS THE PURCHASE ORDER DETAILS'.
      WRITE:/6 'CLICK ON PURCHASE DOC NO FIELD(INTERACTIVE LIST)'.
    ENDFORM.                    "heading
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM fieldcat .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
        i_program_name               = SY-CPROG
        i_internal_tabname           = 'GT_HEADERDAT'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
        i_inclname                   = SY-CPROG
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
        ct_fieldcat                  = gt_fieldcat
       EXCEPTIONS
        inconsistent_interface       = 1
        program_error                = 2
        OTHERS                       = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " fieldcat
    *&      Form  fieldcat_change
          text
    -->  p1        text
    <--  p2        text
    FORM fieldcat_change .
      LOOP AT gt_fieldcat INTO wa_fieldcat.
        CASE wa_fieldcat-fieldname.
          WHEN 'EBELN'.
            wa_fieldcat-hotspot  = 'X'.
        ENDCASE.
        MODIFY gt_fieldcat FROM wa_fieldcat INDEX sy-tabix.
      ENDLOOP.
    ENDFORM.                    " fieldcat_change
    *&      Form  pagedown
          text
    FORM pagedown.
      WRITE:/35 'HAVE A NICE DAY...' COLOR 4.
    ENDFORM.                    "pagedown
    *&      Form  usercommand
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM usercommand USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
      READ TABLE gt_headerdat INDEX selfield-tabindex.
      CASE selfield-sel_tab_field.
        WHEN 'GT_HEADERDAT-EBELN'.
          REFRESH : gt_item.
          CLEAR   : gt_item.
          SELECT matnr
                 werks
                 lgort
                 matkl
                 menge
                 meins
                 netpr
                 kunnr
            FROM ekpo
            INTO TABLE gt_item
           WHERE ekpo~ebeln EQ gt_headerdat-ebeln.
    *Build a Field Catalog
          PERFORM fieldcat1.
    *For Heading in the Interactive List
          PERFORM heading1.
    *Display Interactive Data
          PERFORM display_data1.
      ENDCASE.
    ENDFORM.                    "usercommand
    *&      Form  fieldcat1
          text
    -->  p1        text
    <--  p2        text
    FORM fieldcat1 .
      REFRESH : gt_fieldcat1.
      CLEAR   : wa_fieldcat1.
      wa_fieldcat1-col_pos    = '1'.           "Column Postion
      wa_fieldcat1-fieldname  = 'MATNR'.       "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.   "Internal Table
      wa_fieldcat1-key        = 'X'.           "Blue Color
      wa_fieldcat1-seltext_l  = 'MATERIAL NO'. "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '2'.           "Column Postion
      wa_fieldcat1-fieldname  = 'WERKS'.       "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.   "Internal Table
      wa_fieldcat1-seltext_l  = 'PLANT'.       "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '3'.           "Column Postion
      wa_fieldcat1-fieldname  = 'LGORT'.       "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.   "Internal Table
      wa_fieldcat1-seltext_l  = 'STORAGE LOCATION'."Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '4'.            "Column Postion
      wa_fieldcat1-fieldname  = 'MATKL'.        "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.    "Internal Table
      wa_fieldcat1-seltext_l  = 'MATERIAL GRP'. "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '5'.            "Column Postion
      wa_fieldcat1-fieldname  = 'MENGE'.        "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.    "Internal TAble
      wa_fieldcat1-seltext_l  = 'PO QUANTITY'.  "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '6'.            "Column Pos tion
      wa_fieldcat1-fieldname  = 'MEINS'.        "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.    "Internal TAble
      wa_fieldcat1-seltext_l  = 'BASE UNIT MEASURE'."Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '7'.            "Column Postion
      wa_fieldcat1-fieldname  = 'NETPR'.        "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.    "Internal Table
      wa_fieldcat1-seltext_l  = 'NET PRICE'.    "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
      wa_fieldcat1-col_pos    = '8'.            "Column Postion
      wa_fieldcat1-fieldname  = 'KUNNR'.        "Field Name
      wa_fieldcat1-tabname    = 'GT_ITEM'.    "Internal Table
      wa_fieldcat1-seltext_l  = 'CUSTOMER NO'.  "Display Text Screen
      APPEND wa_fieldcat1 TO gt_fieldcat1.
      CLEAR wa_fieldcat1.
    ENDFORM.                                                    " fieldcat1
    *&      Form  heading1
          text
    -->  p1        text
    <--  p2        text
    FORM heading1 .
      REFRESH : gt_header.
      CLEAR   : wa_header.
      wa_header-typ  = 'H'.
      wa_header-info = 'THIS IS AN INTERACTIVE LIST'.
      APPEND wa_header TO gt_header.
    ENDFORM.                                                    " heading1
    *&      Form  top
          text
    FORM top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
        it_list_commentary       = gt_header
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    ENDFORM.                    "top
    *&      Form  display_data1
          text
    -->  p1        text
    <--  p2        text
    FORM display_data1 .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        i_callback_program                = SY-CPROG
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
        i_callback_top_of_page            = 'TOP'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
        it_fieldcat                       = gt_fieldcat1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_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
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
        t_outtab                          = gt_item
       EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " display_data1
    Reward points if helpful.
    Kiran Kumar.G.A
            Have a Nice Day..

  • How to display the alv report blocks wise with out using the blocked alv

    Hi
    How to display the alv report with out using the blocked alv function module.
    Thanks
    Chinnu

    see this Standard Program
    RPR_ABAP_SOURCE_SCAN

  • How will schedule the BW report in the Background ?

    Hi
    Small query, i have one management report in the BI, which should be run early morning and send mail to the GM,
    We can schedule the ABAP report but no the BW !!!!
    How will schedule the BW report in the Background ?
    How the mail send to the GM ?
    Please advise us
    REgards
    Anwer Waseem
    SAP BASIS

    Reporting Agent will be only supported in the 3.X runtime in 2004s,start using Bex Broadcaster.Reporting agent is going to be obsolete or is would say.
    All the new functionalities will be implemented in Broadcaster only.
    Advantage -The old Reporting Agent in BW 3.x could pre-calculate the data of a template and access it through the URL . It could not broadcast queries, workbooks or web templates by email or to KM folders.
    https://websmp203.sap-ag.de/~sapdownload/011000358700004219392005E/ERQA_INFOBROADCASTING.PDF
    http://csc-studentweb.lrc.edu/swp/Berg/articles/Reporting_Analytics_2006_Broadcasting_v10.ppt
    Note 760775 - Settings for Information Broadcasting
    Hope it Helps
    Chetan
    @CP..

  • How to Develop the ABAP Reports in Business One

    HI all;
    am New to SAP Business One,
    How to Develop the Z Reports in Business One ? like Normal ALV Reports and other??
    Can we have the ABAP Editor and Other Transaction in Business One.
    -Ravi

    Hi Sharma,
    Thanks for Your Replay,
    This is what my requirement !.
    Hi Experts,
    Here we are integrating SAP Business One with 3rd Party tool. !!
    We need to Develop Customize Report in Business one and These Reports Out Put Will Convert into XML Files (Third Party System Can Understand Only XML files) and stored in Application Server/ Presentation Server.
    How to Develop the u2018Z/Yu2019 Reports in Business one ? Can we use SE38 (R/3 ABAP Editor and other T-codes) in Business One.? Or  is there any tools to develop the Business One Reports ?  How to Convert the Report out put into XML File?
    Thanks,
    Upender.

  • How to obtain the alv reports in the dilog programing.

    how to obtain the alv reports in the dialog programming, that is when the push button in the screen in clicked it must be directed to the report, where to write the code for the report.

    Hi
    Use LEAVE TO LIST PROCESSING and develop your normal ALV dispaly as usual. System automatically takes care of this.
    I tried for normal report but try above even in the case of ALV reports
    Cheerz
    Ram

  • How to run the 9I report from the forms menue 9i

    how to run the 9I report from the forms menue 9i.
    Shehzad Latif

    Hi,
    1. create a Reports Object node in Forms. If you use teh same object node name then you can write generic code that works in all Forms
    2. Get the whitepaper about Forms/reports integrtion
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    Frank

Maybe you are looking for

  • How to upload a file in a secure manner.

    I've seen the Flex help examples on uploading files, but what if I have files that are confidential to the client, and I want them uploaded in the most secure manner possible. I'm new to security in Flex and on the web, so please understand that as y

  • ABAP webservices using XIF adapter in SAP CRM?

    Hi, We are going to invoke SAP CRM objects web services via SOAP. Do I need a J2EE engine? Can't I do it with ABAP engine? Without J2EE engine is it difficult to figure out the details of WSDLs to use? If so how.. Thanks, Vijay Edited by: Vijay Mudiv

  • How to create a URL in CRM 2007?

    Hi, Please guide me on how do I create a URL in SAP CRM 2007? Which transaction codes? Regards, Rohit

  • Nano skips downloaded songs

    My nano skips all the songs I downloaded in the iTunes Music Store.iTunes plays the songs in my libary but my iPod Nano doesn't play them and skips to the following song! It's very weird, and I'm about to get desprate! So if someone could help me?  

  • Federation gateway and ISP Change

    Hello...we have a federation gateway connection..through it  we look up free / busy information  between our two branch offices...exchange 2010 on both sides...one branch will be changing ISPs which means new external IP addresses...what affect will