How to read an APO table from excel in place using Visual Basic ?

We have enhanced some APO reports using layouts that use excel in place with custom visual basic (VB) code. For example, the VB code can append the data with additional columns that perform specific calculations and then proceed to create pivot table reports in excel..That is working fine.
The challenge is to see if that VB code could read specific APO tables (e.g. product master tables) to bring additional elements into excel and thus expand the report content. We know that additional fields can be added to the reports, but having the flexibility to read tables from VB could be more flexible.
Can that be done?. If so, would it be possible using exclusively the VB code attached to the layout, i.e. no ABAP?

Hello Anselmo,
I am assuming you are doing this either using BeX analyzer or by reading the planning book using the RFC ActiveX component and a BAPI.
I think it's possible to retrieve the data from the product master table. Here are my thoughts on how can this be done:
1) You can create a generic datasource (transaction RSO2) for the product master table, connect that to a BW remotecube and use a BeX query to retrieve that values. You can then join the queries using VBA. Alternatively, you can build a muti-provider that connects your current InfoCube to the new RemoteCube and build a query from there. The multi-provider, in this case, joins the data (no more VBA).
2) If you have already loaded your product master data into master data carrying InfoObjects then you can try the same technique as #1 but this time there is no need to create the generic datasource. You can use the InfoObjects for your master data as the InfoProviders for your query.
3) You can try the ActiveX component from SAP which can  connect to any emote enabled function in SAP system. SAP already provided some BAPIs (check transaction BAPI for a list) which might be able to provide the data. You can also create your own function modules (be sure to make it remote enabled) using ABAP. (transaction SE37).
Hope this helps

Similar Messages

  • How do i import a table from excel into dw8?

    I want to import a table from excel into a table in dw8, i
    just want the data inside the excel table to be imported to the
    table in dw8.
    The tables has the same stracture - number of rows and
    columns.
    is it possible?
    btw special paste is no good, since it copies the stracture
    of the table from excel which contains <td height="17">,
    which is not good coding - td doesn't support the height
    option.

    table without special paste:
    <table width="90%" border="1">
    <tr>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    <th scope="col"> </th>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    </table>
    table with special paste(Text with structure):
    <table width="90%" border="1">
    <tr height="17">
    <td height="17" dir="rtl"
    align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td dir="rtl" align="right"> </td>
    <td> </td>
    </tr>
    <tr height="17">
    <td height="17" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr height="17">
    <td height="17" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr height="17">
    <td height="17" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr height="17">
    <td height="17" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr height="17">
    <td height="17" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr height="18">
    <td height="18" align="right"> </td>
    <td align="right"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    </table>

  • How do you join two tables from different Oracle schemas using a subquery

    I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
    The query is as follows:
    sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
    + "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
    + "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
    + "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
    The format of the query is copied from a SQL programming manual.
    I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
    Edited by: user11338343 on Oct 19, 2009 6:55 AM

    I believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
    If you want to do a straight join without a subquery you could do the following
    SELECT  DD_12809.PDTABLE_12_1.LINE_ID
    ,       FAB.MAT_DESCRIPTION
    FROM    DD_12809.PDTABLE_12_1
    JOIN    RA_12809.PDTABLE_201    AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS  HTH!

  • How to read and write data from Excel to TestStand without using LabVIEW VIs

    Hi,
    How can I read in columns of data from Excel into a TestStand array and write columns of data to Excel from TestStand without using LabVIEW VIs?
    I don't think the Property Loader custom step type in TestStand will work because the data I would like to read in from Excel is in a column that is thousands of rows long and the data has to be in the proper format to use the Property Loader to load in an array from Excel.
    Thanks for your help.

    That example does not use LabVIEW and it does about 40% of what you need to do by calling Excel through ActiveX. If you don't know how to use Excel through ActiveX then you'll need to brush up on that.
    http://www.microsoft.com/en-us/download/details.aspx?id=16250
    http://support.microsoft.com/kb/141759
    http://support.microsoft.com/kb/302084
    CTA, CLA, MTFBWY

  • How to read only particualr columns from excel sheet to internal table

    Hi,
    I have and excel sheet which has around 20 columns, in which i want to read only 6 columns. They are at different column positions, means the 1st column, 6thcolumn, 8th column so on..
    Can we do this in sap? do we have any FM to do this?
    Thanks.
    Praveena.

    hi,
    Use the below logic to fetch the data into internal table..You need to read the data cell by cell and update the internal table,
    DATA l_count TYPE sy-tabix.
       CONSTANTS: lc_begin_col TYPE i VALUE '1',
                  lc_begin_row TYPE i VALUE '2',
                  lc_end_col   TYPE i VALUE '2',
                  lc_end_row   TYPE i VALUE '3000'.
      CLEAR p_i_excel_data. REFRESH p_i_excel_data.
    * Function module to read excel file and convert it into internal table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = p_p_file
           i_begin_col             = lc_begin_col
           i_begin_row             = lc_begin_row
           i_end_col               = lc_end_col
           i_end_row               = lc_end_row
         TABLES
           intern                  = i_data
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 2
           OTHERS                  = 3.
    * Error in file upload
       IF sy-subrc NE 0 .
         MESSAGE text-006 TYPE 'E'.
         EXIT.
       ENDIF.
       IF i_data[] IS INITIAL .
         MESSAGE text-007 TYPE 'E'.
         EXIT.
       ELSE.
         SORT i_data BY row col .
    * Loop to fill data in Internal Table
         LOOP AT i_data .
           MOVE i_data-col TO l_count .
           ASSIGN COMPONENT l_count OF STRUCTURE p_i_excel_data TO <fs_source> .
           MOVE i_data-value TO <fs_source> .
           AT END OF row .
    * Append data into internal table
             APPEND p_i_excel_data.
             CLEAR p_i_excel_data.
           ENDAT .
         ENDLOOP .
       ENDIF .

  • How to build semantic model table from excel 2013 budget table?

    I have an excel 2013 budget table produced by finance department. The title of the table is <<Year 2015 Resource Budget>> with columns such as (Item, Budget). There is line of business app which tracks daily usage. It is SQL database which
    I can access. The SQL table has columns such as Date, Item, Usage. I am asked to produce some PowerView reports using DAX.
    I am thinking about using Excel 2013 PowerPivot. The following is the step of my plan.
    Add excel 2013 Budget table to PowerPivot
    Transform the budget table using DAX to a new table with includes date. For each item budget, the value can be evenly divided by 365. I don't know if this is possible with DAX and need advice from you
    Import daily usage from SQL database into PowerPivot
    Merge the imported SQL daily usage table with the transformed budget table with daily breakdown.  The output table has 4 columns (Date, Item, ValueType, Value). The ValueType can be either Budget and Usage. (I also do not know if it is possible to
    use DAX to merge two PowerPivot table into anther table with added new columns. If it is possible, I would love to hear from you on how to do this)
    Finally, I can produce BI reports based on the newly merged table
    Update: Here are more sample data.
    Input Budget
    <<Year 2014 Resource Budget>>
    Item
    Budge
    Pen
    365
    Paper
    1095
    <<Year 2015 Resource Budget>>
    Item
    Budge
    Pen
    1825
    Paper
    1095
    Bag
    365
    I am thinking to expand the Budget as follow but I don't how to use DAX to do it
    Date
    Item
    Budge
    31/12/2014
    Pen
    1
    31/12/2014
    Paper
    3
    1/01/2015
    Pen
    5
    1/01/2015
    Paper
    3
    1/01/2015
    Bag
    1
    Here is the Daily Usage table
    Date
    Item
    Usage
    31/12/2014
    Paper
    2
    31/12/2014
    Pen
    6
    1/01/2015
    Paper
    10
    1/01/2015
    Pen
    2
    1/01/2015
    Bag
    1
    I was thinking to merge the expanded Daily Budget and Daily Usage as follow for BI reporting. This was my thinking, may not a good solution using DAX
    Date
    Item
    Type
    Value
    31/12/2014
    Paper
    Usage
    2
    31/12/2014
    Pen
    Usage
    6
    1/01/2015
    Paper
    Usage
    10
    1/01/2015
    Pen
    Usage
    2
    1/01/2015
    Bag
    Usage
    1
    31/12/2014
    Pen
    Budget
    1
    31/12/2014
    Paper
    Budget
    3
    1/01/2015
    Pen
    Budget
    5
    1/01/2015
    Paper
    Budget
    3
    1/01/2015
    Bag
    Budget
    1
    Off course, I need to build dimension tables for Date, Item, Item Category, and Value Type
    jl

    Hi JL,
    Just for consideration, I'd:
    Keep budget and actuals separately - create Fact_Y2015Budget and Fact_Actuals;
    Hook both tables to same dimesnions (time; if there is no time for budget, assign it all to the first day of your 2015; line item etc. - whatever you are asked to report about)
    If you can, pull usage not only for 2015, but for prior year(s) too
    Create measures like [Usage Budget Atteinment YTD]:=TotalYTD(SUM([Usage]),your_time)/([Budget]*PriorYear(TotaYTD(SUM([Usage]),you_time)/CALCULATE(SUM([Usage]),DATESBETWEEN(your_first_day_of_year2015,your_last_day_of_2015))))
    The calculation in #4 compares actual ("usage") to portion of budget that would have been used up if 2015 had the same seasonality as 2014... If you couldmshare specific sample, I'd buuild exact formula...
    Daniel

  • How to read the TEXT TABLES (Or) .CSV in HSQLDB using JAVA

    Hi,
    I want to use the HSQLDB instead of mdb in our application. I am using the HSQLDB Engine Standalone mode, and given a file name "TEMP" in URL along with the "jdbc:hsqldb:file:". Then a I created a TEXT TABLE, that table was created as a .CSV file in the Disk. But I am unable to read that CSV, I tried that file in the database URL. But its not working. Can anubody give me the suggestions.
    Thankyou,
    Regards,
    Vinay.

    Hi Rajeshreddy.k,
    To add multiple users to one group, I wouldn't use a .csv file since the only value you need from a list is the users to be added.
    To start create a list of users that should be added to the group, import this list in a variable called $users, the group distinguishedName in a variable called $Group and simply call the ActiveDirectory cmdlet Add-GroupMember.
    $Users = Get-Content -Path 'C:\ListOfUsernames.txt'
    $Group = 'CN=MyGroup,OU=MyOrg,DC=domain,DC=lcl'
    Add-ADGroupMember -Identity $Group -Members $Users

  • How can I run a BW Function from EXCEL-IN-PLACE (BPS)??? Please give any ex

    How can I run a BW Function from EXCEL-IN-PLACE (BPS)using VBA??? Please give any example.
    I would like to run my function module ZMY from EXCEL-IN-PLACE using VBA and get a result.

    if you are using excel in place in the web application environment I doubt you can, you've never really had any macro functionalty there.
    If you are in the gui environemnt (Planning folders) it will depend on how you want to invoke the module...

  • How to update (add new data in different tab) existing table from Excel

    i've an existing table, for instance User Profile table, it consists of few tab in the table which contains different data... recently i've added new tab to the existing table and i would like to upload a particular data for this new tab... is there any way to upload (insert new data for the tab on existing data) this particular data into the existing table from Excel file?
    could it be done by using lsmw?
    Edited by: Yeong Kang Liew on Apr 5, 2010 4:35 AM

    Check HELP on MODIFY & UPDATE statements.

  • How to read a table from a word file, using HWPF

    How can I read a table from a Word file using HWPF?
    I looked in API and Table class doesn't seem to have a constructor... very very strange for me. pls help

    the constructor is HWPFDocument = new HWPFDocument(/*file*/)
    Here is the API for that
    http://poi.apache.org/apidocs/org/apache/poi/hwpf/HWPFDocument.html
    Also here is another link to something that might help you more with tables
    http://www.aspose.com/Community/forums/thread/79182.aspx

  • Readind APO tables from ECC ABAP program

    Hi,
    I want to know if it is possible to read APO tables from a ABAP program in ECC 6.0.
    If it is possible , please lt me know how?
    Regards

    Hi,
    There's a remote-enabled function module (think it's either RFC_READ_TABLE or RFC_TABLE_READ) which you can pass a table name, some selection criteria and a list of fields to be returned.  That should allow you to read those table entries from the remote system.
    Regards,    Andy

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • How to read an internal table with more than  one (2 or 3) key field(s).

    how to read an internal table with more than  one (2 or 3) key field(s). in ecc 6.0 version

    hi ,
    check this..
    report.
    tables: marc,mard.
    data: begin of itab occurs 0,
          matnr like marc-matnr,
          werks like marc-werks,
          pstat like marc-pstat,
          end of itab.
    data: begin of itab1 occurs 0,
          matnr like mard-matnr,
          werks like mard-werks,
          lgort like mard-lgort,
          end of itab1.
    parameters:p_matnr like marc-matnr.
    select matnr
           werks
           pstat
           from marc
           into table itab
           where matnr = p_matnr.
    sort itab by matnr werks.
    select matnr
           werks
           lgort
           from mard
           into table itab1
           for all entries in itab
           where matnr = itab-matnr
           and werks = itab-werks.
    sort itab1 by matnr werks.
    loop at itab.
    read table itab1 with key matnr = itab-matnr
                              werks = itab-werks.
    endloop.
    regards,
    venkat.

  • How to display a oracle table from a java program?

    How to display a oracle table from a java program.
    Hello friends, I have written a Java program, using oracle 10g as backend.
    I want to display a oracle table as output. Im not getting how to display oracle table as a output table.. Pls help me
    Thank you

    jayanthds, you're not going to get a satisfactory
    answer to this here. it's too big a task to justbe
    quickly outlined in a forum - the reply "all youneed
    to do is to query you table and return it asJTable"
    is worthless, for example, since the solution to
    any problem can be distilled to such a
    soundbite, if need be. doesn't make the solutionany
    simpler
    essentially you're asking "how do I write adatabase
    application?". all you'll get is snippets of code
    that, when fitted together, will eventually helpyou
    do this, but you'll spend days and days comingback
    saying "right, I've done that, now what?" until
    either you or the forum gets frustrated with the
    whole affair and the process stops
    there are entire books written about this subject,
    and countless tutorials and guides on theinternet.
    you're better off going down that routehehehe.well, it's true! I used to have a manager that would outline the solution to a problem in a few lines of pseudocode, and then firmly believe that the actual solution would be just as brief and simple. shame his pseudocode included such lofty abstractions as "reformat all data"

  • How do i print to pdf from excel? I am using Windows 8.1 and Office 365 (new)

    How do i print to pdf from excel? I am using Windows 8.1 and Office 365 (new)

    Please see Huge lag in games on bootcamp as a reference. The linked thread is for a GT750m.
    Since there are no mid-2013 Retina models (as per Apple - Support - Technical Specifications), assuming this is your Mac - MacBook Pro (Retina, 15-inch, Late 2013) - Technical Specifications - the same should work for you.

Maybe you are looking for