ABAP code to automatic generate an BW Report

HI Sap BW gurus,
Can anyone tell me if exists an abap code to automatic generate an report from a query and save it on an directory in HTML format?
Thanks in advanced,
Pedro Martins

You can use this tool...
/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
but then you would have to store it into an application server directory as HTML - there is also a how to paper by the same author which you can use... which talks about email query results in HTML
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b7658119-0a01-0010-39a9-b600c816f370;jsessionid=%28J2EE3414800%29ID1001478750DB10940138154678751341End

Similar Messages

  • How to insert abap code in LSMW generated program?

    hi,
    i m working on LSMW for loading data in SAP
    i would like to insert abap code into the generated program....
    it's because i have 1 BKPF segment (header data), 2 BSEG segments, but i cannot define rules by customizing for the second BSEG segment(LSMW doesn't permitt).
    i already tried to insert code directly into the program, but obviously it disapears at each time i generate the program.
    i saw that apparently a code insertion has already be made into this program and the subject of this insertion is to define rules for the second BSEG (exactly what i want to do....) and this modification doesn't disapear at new prog generation.....
    Any idea ?

    Hi
    Why dont you use the FORM provided by LSMW
    To use this please do the following
    1.Goto option <b>Maintain Field Mapping and Conversion Rules</b>
    2.Goto menu <b>EXTRAS->LAYOUT->Form Routines</b>
      Here you will now get many options like
       Global Data
       Begin of Transaction
    Begin of Processing
    Begin of Record
      like wise the End of these also.
    Please put a breakpoint and check where you want to insert your code.
    Note:
    This is only for the Conversion Program and does not affect the main program used to update the Standard Tables
    Hi , I was reading your earlier post .. It seems that you have worked on EMIGALL. Consider a similar situation, it is like writing the code in the events till CALL01...
    Thanks
    DOminic
    Message was edited by: Dominic  Pappaly

  • Automatically generating multiple pdf reports from single(*.rpt) report file

    Post Author: msam
    CA Forum: General
    I would like to be able to automatically pass a parameter list to a single report, and have it automatically generate multiple reports (as saved pdf files), based on the parameter list.
    Is this possible?  If so, could someone point me to some documentation?  Thanks.

    What you probably need to do is generate each bio
    individually with the
    <cfdocument...> tag just the way you want them. And
    then use some of
    the advanced <cfpdf...> functionality that allows you
    to append two or
    more individual PDF's into a single large PDF.
    Here are some resources that describe some of the
    <cfpdf...> functionality.
    http://www.coldfusionjedi.com/index.cfm/2007/7/9/ColdFusion-8-Working-with-PDFs-Part-1
    http://www.coldfusionjedi.com/index.cfm/2007/7/10/ColdFusion-8-Working-with-PDFs-Part-2
    http://cfpdf.blogspot.com/
    http://cfpdf.blogspot.com/2007/06/cfpdf-action-merge_27.html
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=cfpdf_02.html

  • ABAP Code example using "GENERATE DYNPRO"

    I am looking for ABAP code example who use the "Generate dynpro" dynamic generation of dynpro at runtime under SAP 4.6C version.
    Best regards,

    We have some programs that do:
    form %view.
    data: anz type i,
          prog like sy-repid.
      prog = sy-repid.
      perform init_download(rsaqexce).
      case %tab.
      when 'G00'.
        perform generate_view_dynpro(rsaqexce)
                using prog text-grl.
        describe table %g00 lines anz.
        tview100-lines = anz.
        perform init_view(rsaqexce) tables %g00 using tview100.
        call screen 100.
        perform reset_view_dynpro(rsaqexce).
      when others.
        message s860(aq).
      endcase.
    endform.
    I think they were copied from existing SAP programs. In any event, look at the relevant forms in program rsaqexce.
    And as Rich noted, SAP doesn't recommend this.
    Rob

  • ABAP Code for Key Figure selection in Report

    Hello Experts,
    I am working on one of the development request that requires following logic to be implemented at query execution. There will one KF column and based on valid combination of characteristics value from the cube, Key Figure value from the same cube will be selected and reported.
    If ((Plant = A1) and (Division = B1))
      OR ((Plant =A2 ) and (Division = B1))
      OR ((Plant = A3) and (Division = B2))
      OR ((Plant = A6) and (Division = B2)).
      Price = Moving Avg.
    Else
      Price = Standard.
    Can somebody please suggest, how to do this? Thanks in advance.
    Regards,
    Nimesh

    Nimesh,
    Step 1.Create a formula (say F1)variable with customer exit. In the customer exit code read the values of Plant and Division. If the Plant and Division combination is the one that you specified below return a 1 (for Moving Avg.) or return a 0 (for Standard).
    Step 2. Create a column with a formula having the following definition
             (F1=1)'Moving Avg.' + (F1=0)'Standard'
    So, if the combination satisfies Moving Avg will be shown else Standard will be shown.
    You can avoid customer exit coding by using  replacement variables and using them in a formula, this would make your calculation clumsy and confusing. Let me know if you cannot get the customer exit solution work.
    Hope it helps...

  • Automate generating and sending reports

    Hi All,
    Is it possible to automate the following steps in BPC 7.0?
    After uploading monthly actual SG&A to BPC...
    1. Refresh a report, say C1, by individual function (CTO, Finance, Sales & etc)
    2. Convert the above files into paste value format (maybe save the above reports in offline mode)
    3. Automatic send each report to a respected functional head each month
    If it's not possible in 7.0, is there an alternative? Like using BOBJ to access the BPC 7.0 db directly and formulate/format the reports in BOBJ?
    Thanks.

    Hi pkrishnas,
    Thanks for the info.
    I set up a distribution according to the documentation and also set up the appset parameters related to SMTP.
    When I want to distribute my report, I get an error something like "Cannot get email address from SQL xxx\myuserid" (where xxx is the BPC server name).
    The user myuserid has been entered with a correct email address and security. But the user is not a local user to the server xxx. The user has an email address at a different domain. Below is the user detail:
    UserID: xyz\myuserid
    User Name: John Doe
    Email: myuserid at xyz dot com <rewrite to avoid the forum auto filter>
    IM address: <blank>
    Do you or anyone else know the cause and how to resolve this issue? Do I have configure something else?
    Thanks.
    =Hamdy

  • Automatically generating PDF format Report

    Dear buddies
    can u tell me plzzz that how can I generate my report to PDF format while showing the output on screen isn't necessary. 2ndly is there any automated way to mail this file to a client or I'll have to mail it manually? be careful that I'm using Developer - 6i. hoping a positive response,thanx.

    Hi,
    As u said, while showing the output on screen isn't necessary.
    For the 1st one, u set the system parameters..
    MODE: bitmap (for pdf it should be bitmap).
    Destype: File
    Desname : give some name to the file in your local dir..
    For the 2nd one, u have to configure ur local mailing system..
    For eg: Microsoft Outlook..
    it's enough if u configure ur local mailing system and then
    give an option in the report calling form to send it to mail..
    and set the Destype to Mail.
    Hope this will clear your doubt..!

  • Automatic Generating of Reports

    Is there a way to make an Automatic Generating of Crystal Reports to PDF.

    hi Joe,
    you can look at crystal reports server as it has an ability to publish and distribute reports. one of the output formats is to pdf. there is also a trial here.
    or you can look at a 3rd party product that does scheduled exports. there are lots of them. a good place to start to look is here.
    or you can build your own solution using one of the sdks like the cr for visual studio sdk.
    -jamie

  • Generating an  html report based on table at sql 2005 db

    Hi
    I want to create an html report based on a table named inventory on sql server 2005 database.
    first code used to generate an output report
        try {
                // TODO add your handling code here:
                String s = "<html> <body> <table border=1><caption> Inventory Report </caption>";
                s += "<tr><td>Item_id<td>item_name<td>Existing quantity</td><tr><td>3<td>4<td> <td>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                    fs = new FileOutputStream("D:\\Report\\Report.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
    Second jdbc  code for connection and select all records in the table
    try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
         String s="";
    while(rset.next())
        s+=(rset.getString(1)+"\t\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+rset.getString(4)+"\n");
          st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
            }                             I want someone helps me to merge two codes into one code to generate an output html report.
    thanks in advance

    This is my trial but not the desired result ,it's displayed the title and a line only
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
                          String s = "<html> <body> <table border=1> <caption>Report title</caption>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
    while(rset.next())
                   s+=("<tr><td>"+rset.getString("Item_Code")+"</td><td>"+rset.getString("Item_Name")+"</td><td>"+rset.getString("item_cost")+"</td><td>"+rset.getString("item_quantity")+"</td></tr>");
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
         st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
        }

  • OPSI setting remain as ABAP code after client deletion

    Hi all,
    I'm just wondering if anyone face this problem before:
    1. I've created some test data in OPSI (validations of project system) in a test client (eg: 201)
    2. I perform client deletion on 201 and client copy from PRD to 201
    3. If I check the include statement, the test data still exist as ABAP code (and will generate an abap runtime error). However, if I go to OPSI, the test data no longer not exist.
    4. If I re-create the test data in OPSI, then this problem is solved.
    Regards.

    THere is nothign to worry about it. It is std.behaviour. Wheneven you trasport or Copy client with refrence to Validation. Even though validation is in place in congiuration but system not read that validation and behave as per last config of validation.
    You need to correct the same manually by Validation menu--> Simulate function, This will internally generate ABAP code according to your currnet validation. After that your system will behave correctly according to currnet config of validation.
    With regards
    Nitin p.

  • Adding methods to a automatic generated class

    Hello,
    I am currently working on an project where a part of the code is automatic generated from XML Schema, using Castor's SourceGenerator. The classes generated from these generic java-sourcecodes represents an hierachical tree structure (a composite pattern, with a composite as super class, and nodes and leafes as sub-classes), which I am using with JTree. My problem is that I cannot make Castor override the toString()-method, without changing some vital properties of my generated java-codes.
    One solution is to encapsulate the super-class and the two sub-classes in a identical class structure, mapping all the methods and adding a toString() method, but doing this by hand takes away the advantage of Castor. Somehow I think reflection could be a good solution, but I am not familiar with java-reflection and cannot say if it would solve my problem.

    It sounds like byte code manipulation (e.g., BCEL) may be what you need. Which is too bad because it's nontrivial.
    I don't think reflection would do what you want, but I'm not sure what you want.

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How to set a field that automatically generates a unique 'code'/'ID'  for fillable PDF form?

    Hi,
    I'm trying to create a PDF fillable form with Acrobat X Pro.
    Can Acrobat allow a function, so that it can automatically generate a 'number'/'code' which I could use as an 'identifier'?
    eg.  A hidden field named:  'DOC ID' and provide 100001 when added to response file as it's submitted and '100002' to another file when it another is submitted/added onto the response file etc...
    I am aware that Response files, if submitted correctly, could automatically generate numbers like 001, 002 etc...
    But I'd like to see if I could create a field, that 'numbers' the document for me automatically and uniquely.
    Any help and/or suggestions would be appreciated.
    Winnie

    Hi,
    to do this you need kind of interactivity in your form.
    You can achieve this either by:
    1) using JavaScript onchange-events on forename and surname items, or
    2) use the AJAX Computations option of ApexLib, see: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com

  • LKM SAP BW to Oracle (SQLLDR) generates sintax error in ABAP code.

    Hi Experts,
    We are installing a SAP BW KM's in ODI 11g.
    Actually, we are able to make reverse ingeneering succesfully.
    Now we want to use the LKM in order to extract SAP data.
    The KM fails, in step Generate ABAP Code. The code is uploaded to SAP system but with sintaxis errors.
    That's the beginning of the SAPAbapExecuteOpenTool_8001_7001.log.
    +##################################################+
    +############ Open Tool Logger ####################+
    +##################################################+
    +############ Upload value: 1+
    +############ Execute value: 1+
    +############ BASE RKM FLAG: 0+
    +############ ZRFC_RUN_INSTALL: 1+
    +############ Abap Function Name: ZODI_8001_7001+
    +############ Sap Host Name: XXXXXXXX+
    +############ Sap User Name: XXXX+
    +############ Sap password: ********+
    +############ Sap Client: 100+
    +############ Sap language: ES+
    +############ Sap system no: 00+
    +############ Sap Connection Pool Name: SAP_ODI_LKM_POOL_GLOBAL+
    +############ Sap Connection Pool Size: 10+
    +############ Sap Function group name: ZODIBW_LKM_FGRP+
    +############ File Delimiter:+
    +############ File Name: ZODI_8001_7001.txt+
    +############ FTP Host: XXXXXXXXX+
    +############ FTP User: ftpbi+
    +############ FTP Password: ********+
    +############ FTP Passive Mode: 1+
    +############ FTP Transfer Time out: 100000+
    +############ User abap parameter names: IV_DELIMITER,CHAR1;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_REQUID_L,RSSID;IV_REQUID_H,RSSID+
    +############ Abap rfc table parameters: RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2+
    +############ Log File Name: /tmp/SAPAbapExecuteOpenTool_8001_7001.log+
    +############ OpenHub Path: /tmp/+
    +############ Delta Extraction First Request ID : 0+
    +############ Delta Extraction Last Request ID : 0+
    +############ SAP Development Class : ZODIBW_PCKG+
    +############ Max Row Count :+
    +############ Fetch Batch Size :+
    +############ Hash Value Marker: HVM+
    +############ Generated Program:+
    *** ODS DSO extraction
    TYPES: BEGIN OF ty_final,
    +/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR+
    TYPE
    +/BIC/AZOFI_UTE00-/BIC/ZFI_SOCOR,+
    +/BIC/AZOFI_UTE00_SOURSYSTEM+
    TYPE
    +/BIC/AZOFI_UTE00-SOURSYSTEM,+
    END OF ty_final.
    In the SAP GUI shows a sintaxis error.
    Functions Module ZODI_8001_7001. line 25
    The name "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" is longer that allowed.
    +30 characters.+
    Really the TYPE "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" has 31 characters.
    The sufix "/BIC/" is the "NAMESPACE", a SAP grouping concept.
    AZOFI_UTE00 is a table name.
    ZFI_SOCOR is a column name.
    Are this sufix correct in the APAP code?
    Has anyone had that problem?
    Any comment will be wellcome.
    Thank's in advance.

    Hi Somchai,
    r U able to resolve ur issue ..........i'm also struck there at the same point.
    I am using shared folder for file transfer and my error message is
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset\\<hostname>\bi-interface$\ZODI_11001_12001_GLOBAL.txt
    Thanks.
    Edited by: Drona on Mar 26, 2012 7:25 AM

  • Tax code input for Automatically Generated Line Items

    Hi Guys,
    We want to input a tax code for the Automatically generated line item..for exchange rate differences in F-28.
    Once i simulate the F-28 , and i try to input the tax code in the Automatically generated line item for exchange rate difference,
    I cannot input the tax code in that screen..and it is greyed out.
    Is there a way we can assign a tax code for this GL account line item that is automatically generated by the system ?
    Thanks,
    Srikanth.

    Hello,
    you have to add the tax code in GL master data. if that's not possible (several codes possible), I would set up a substitution.
    kr
    Nico

Maybe you are looking for

  • HP LaserJet Professional M1217 nfw MFP

    Buonasera vorrei sapere come posso usare la stampante in oggetto con ePrint considerato che ha WiFi. Non riesco ha trovare  il suo indirizzo mail. Ho già un account  e vorrei aggiungere alla stampante All on one gia funzionante con eprint anche quell

  • VPD (Row Level Security) Implementation at Middle Layer

    Hi All, Is there any provison to implement Row Level Security at the Entity Object level? We have a table where in some rows need to be displayed based on the user logged in. We are aware of the VPD implementation using a function and adding a policy

  • The operation was cancelled because of locking conflicts.

    Hi All, We are facing a issue as below when we access the cube via excel. Can you please help with the reason and if possible how to solve it. Thanks, Tanmoy Santra

  • Upgrading BBM

    I upgrade my bmm and my screen turn blue with nothing on it I need help

  • Reconcillation issue

    Hello Guys, we recently carried out depreciation on our assets,but the depreciation posted is not reflecting in the G/L account and also in the asset balances.We have been doing depreciation posting without any issues,i would like to know how to solv