Call EPM Functions (EPMSelectMember) using Excel Button

Hi all,
I am trying to call EPMSelectMember in VBA code but keep on having error.
Below is my Code in VBA, I think I had put the incorrect member.
The member name should be the dimension name ?
Can anyone advise me on what parameter I should pass in the function ?
A sample code would be really appreciated.
Sub Button1_Click()
    Dim b As New FPMXLClient.TechnicalCategory
    b.EPMSelectMember("RESOURCE_PLAN","A5")
End Sub
Regards,

Hi Kang,
If you are trying to access the member name from a cell, you may try not to use the double quotation sign, such as:
EPMSelectMember("RESOURCE_PLAN",A5)
The parameters which you are passing during the call to EPMSelectMember is correct with the assumption that the "RESOURCE_PLAN" is referring to the connection while A5 is the cell which contains the member name which you intend to get.
I assume you understand that the EMPSelectMember is used to retrieve a specified dimension member. So, just for demo purpose, I have modifed the codes to assign the dimension member to another cell for display:
Sub Button1_Click()
Dim strTest As String
strTest = "=EPMSelectMember(""RESOURCE_PLAN"",A5)"
Cells(1, 1).Formula = strTest
End Sub
The written codes are exactly same as how you copy
=EPMSelectMember("RESOURCE_PLAN",A5)
and paste to the excel cell.
Hope the information helps.

Similar Messages

  • Calling Package Function dynamically using Forms_DDL

    I am trying to write a validation trigger which will validate entries within a text field. It will call a packaged function based on an entry within the Rule form field. As the data within the text field will vary (sometimes numeric, date, text etc), the validation function will also vary accordingly. Example details are shown below (this example will force the entry of a Y or an N):
    FORM FIELDS
    ARG_DEFAULT1 X (This is the parameter to be submitted to the function)
    RULE1 VAL_CHK_0001 (Function to be called).
    FUNCTION CODE
    FUNCTION VAL_CHK_0001 (P1 VARCHAR2) RETURN NUMBER IS
    SQL_RESULT NUMBER;
    ALERT_ID ALERT;
    ALERT_OK NUMBER;
    BEGIN
    IF UPPER(P1) NOT IN ('Y', 'N') THEN
    :GLOBAL.MSG := 'You must enter either "Y" for Yes or "N" for No - please re-enter';
    SQL_RESULT := '1';
    ALERT_ID := FIND_ALERT('VAL_ERROR_ALT');
    SET_ALERT_PROPERTY(ALERT_ID, TITLE, 'Validation Error');
    SET_ALERT_PROPERTY(ALERT_ID, ALERT_MESSAGE_TEXT, :global.msg);
    ALERT_OK := SHOW_ALERT(ALERT_ID);
    RAISE FORM_TRIGGER_FAILURE;
    RETURN SQL_RESULT;
    ELSE
    SQL_RESULT := '0';
    RETURN SQL_RESULT;
    END IF;
    END VAL_CHK_0001;
    VALIDATION TRIGGER CODE (CURRENT)
    DECLARE
    PKG_RUN VARCHAR2(200);
    BEGIN
    IF :PARAMETER_BK.RULE1 IS NOT NULL THEN
    PKG_RUN := ENV_VALIDATE_PKG.VAL_CHK_0001(:PARAMETER_BK.ARG_DEFAULT1)):
    FORMS_DDL(PKG_RUN);
    END IF;
    END;
    When the Rule1 field data is hard coded in (as shown above), it all runs fine and the Alert box is displayed as expected.
    I need the function name to refer to the rule1 parameter (and not a specific value) as shown below:
    PKG_RUN := 'ENV_VALIDATE_PKG.'||:PARAMETER_BK.RULE1||'('||:PARAMETER_BK.ARG_DEFAULT1||')';
    The form compiles without any errors but when the trigger runs, it completely ignores the Forms_ddl call and does nothing.
    I have hunted through this forum, Metalink, Ask Tom etc and have had no success in finding any solution. I have followed the instructions within NOTE:1017160.6 (How to programmatically call a procedure or function using Oracle Forms) which has got me this far. Nothing that I have read so far has suggested that what I am attempting to do is impossible.
    We are using Oracle Forms 10G with an Oracle 9.0.4 database.
    Any suggestions or advice will be greatly received!
    Thanks

    Like the others have said, Forms_DDL is a one-way street. You can only pass values to it, nothing can be returned. But you could probably get Forms_DDL to work if you wrote your validations as stored procedures that had only IN parameters. Then if the edit ran ok, just terminate normally, but if there is an edit error, to a Raise_application_error.
    Then you could use Forms_DDL to call the procedure, and check for Form_Success after the call. If it failed, you might be able to retrieve the error message from the Raise_application_error by checking SQLERRM. But that is completely untested, so I do not know whether it would work.
    The more sure method would be to call a package procedure on the database that calls Execute_Immediate, and then returns the result back to the calling form.
    Now a little advice: For generic routines such as this, pass dates and numbers as text, and you could cut down on the number of procedures you need to create and use.
    And last note: Do NOT define numeric variables, like SQL_Result, and then set the value using quotes. You are forcing the PL/SQL process to convert text to number. Always set numeric values like this:
    SQL_Result := 1;
    Now the question I am almost afraid to ask: What problem are you solving by creating these generic edit routines? I am wondering if you could just as easily write simple edit processes faster. ...the only way to completely parameterize editing would be to call a process on the database for each column value, passing the column name and value.

  • Repeating Call Library Function Node uses up all my CPU

    Hi,
    I'm not very proficient at labview or programming so any help would be gladly appreciated.
    I bought a USB Digital Input/output hobby kit (one of those things you build yourself). I have got it made and i have managed to get labview talking to it. It was supplied with a .dll to control it and the digital output works a treat.
    However, i want to monitor the ditital input channels (as fast as possible), but if i get a vi to repeatedly call the dll then all my CPU usage goes with it. I don't really understand what the dll does and how exactly labview interacts with it. Can i monitor the digital input channels without using up all my resources?
    I wasn't able to attach the dll that i'm using so i renamed it .jpg instead. You can rename it to .dll to look at it if you want.
    Thanks
    Attachments:
    K8055D.jpg ‏46 KB

    By putting a small wait (of a few milliseconds) you can decrease CPU usage without affecting your performance too badly. However, it really depends on how long a single call to your DLL actually takes. Have you measured this? If it takes, say, a half-second for a single DLL call to execute, then small delays are not going to help because the bulk of the CPU usage is taken up by your DLL.
    By the way, a CIN is not likely to help at all. There's not much difference in terms of overhead for a CIN vs Call Library node anyway.
    Joe

  • Problem  by using EXCELL button to export query results

    PLS try to assist me. By using this SAP  option I got a message saying : "The following template is missing  - SAP-SM.XLS" (see the attached file) Our basis people fixed the problem in the development environment The are very responsible people - and they are aware to update the QA and PROD environment with it . It is comfortable SAP option  and I am really interested to have it  in the Production environment. PLS inform me what  can be corrupted and  what  should be checked  to be on the sure side before updating the PROD. Thank You in Advance Sincerely,  Ronna

    Hi mallorz,
    According to your code, a computed column is a virtual column that is not physically stored in the table, unless the column is marked PERSISTED. I recommend you can use a common table expression (CTE) as a temporary result set,
    a CTE can be self-referencing and can be referenced multiple times in the same query. You can refer to the following T-SQL statement.
    ;with cte as(
    SELECT ItemID, Price, DiscountAmount,ItemPrice - DiscountAmount AS TotalCost
    FROM MyItems )
    select * from cte
    WHERE TotalCost > 500
    ORDER BY TotalCost DESC
    Or you can add a new computed column to the existing table, then you can specify an expression for a computed column in T-SQL.
    For more information, you can review the article about specify computed columns in a table.
    http://technet.microsoft.com/en-us/library/ms188300.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Can I call a function using array index?

    I've defined an array which stores the function name, like this:
    var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);  
    Then I have a button named"btnresetTop" which when clicked will call one of the five functions stored in the above array(aresetButtonTop). The functions are called at run-time depending upon some conditions. I need to figure out how I can call those functions using the array index. I'm using the following code to call the function. The value of i has been already calculated.
    btnresetTop.addEventListener(MouseEvent.CLICK, aresetButtonTop[i]);
    After doing this I'm getting the following error when I click the button:
    TypeError: Error #2007: Parameter listener must be non-null.
        at flash.events::EventDispatcher/addEventListener()
        at gallerytest_fla::MainTimeline/thumbTopClick()
    Note: thumbTopClick() is a function inside which all these codes are written.
    I need to find out whether it is posible in AS3 to call a function name using the array index or not. If yes, could you pleas ehelp me out.

    Thanx Andrei1, you were right, i was out of range.The value of i will obviously expire outside the for loop. Now I have corrected my mistake by assigning the value of i to a variable index inside the for loop and then use the following code:
    btnresetTop.addEventListener(MouseEvent.CLICK, aresetButtonTop[index])
    It was a silly mistake but I was not able to figure it out for the last 2 hours. Thanks once again for your help

  • Call to Function module doesnt refresh

    Hi
    We called a ABAP BDC FM in our VC model.
    This is triggered by clicking a button.
    But for any reason we want to call the FM again using the button, it doesnt refresh the result.
    How to clear the previously called session of the FM to get new results.
    The same logic works fine for BAPI FM..
    Please suggest

    Are you making sure in the beginning of the ABAP within your FM you are clearing any shared memory variables?  If VC keeps the connection alive you may find your data from the first call is still in memory within the FM.
    Gareth.

  • How to call an ABAP FM using WS adapter?

    Hi guys,
    I need to develop a SOAP to PROXY scenario, where in the target I'll be calling a function module. Is it possible to call the function module using the WS adapter? What would the steps of setting this up look like?
    Thank you, Andrzej

    Hello,
    Yes, is possible. You need to publish a WS related to Function that you want to call.
    To expose the FM WebService: SE37 trans -> Enter FM name -> Modify
    Than, in Menu -> Utilities -> Other Utilities -> Generate WebService -> From Function Module.
    Than, follow the wizard!

  • Call library function and path

    Hallo,
    I want to use a Call library function to use some .dll functions.
    Now that call library wants me to give a path to where the dll is stored.
    Do I have to put in an absolute path, or can I use some relative path, so
    that the call library searches relative to its own position.
    That function has no input for path, so it would be hard coded, that's very
    unflexible, because the dll would have to be in the same directory structure
    on every machine. How can I use a relative path?
    Oliver Friedrich

    Oliver;
    LabVIEW will look first at the path you specified. Then, it will look at the "VI Search Path", which you can see at Tools -> Options -> Paths.
    In general, you will not need to write the full path to the dll if you vi is located in the same directory, or if the dll is located in the Windows/System directory or any path indicated in "VI Search Path".
    You can also set the path in the "autoexec.bat" file by using the "set path" command.
    Regards;
    Enrique
    www.vartortech.com

  • Call function and call customer function

    Hi
    Can anybody let me know what is the difference between CALL FUNCTION AND CALL CUSTOMER- FUNCTION .
    i know call customer- function is used while we r working on user exits .
    but is their any specific reason of difference ...
    Thanks

    CALL CUSTOMER-FUNCTION function_exit parameter_list.
    Effect
    This statement can be used in programs delivered by SAP. It includes the function module exit specified in function_exit . The function module exit is a customer exit. In an SAP program, it enables you to call a function module provided by SAP and implemented by the customer.
    The indicator function_exit must be a three-digit text field literal. A function module exit is specified by SAP using the transaction SMOD and can be activated using the transaction CMOD in customer systems.
    Specifications by SAP
    An empty or partly implemented function module must be assigned to the function module exit using the transaction SMOD. The name of the function module consists of EXIT_, the program name, which contains the statement CALL CUSTOMER-FUNCTION, and the three-digit indicator in function_exit. The interface of the function module is completely defined by SAP.
    Activation in the customer system
    The transaction CMOD enables the customer to implement the source code of the function module within an enhancement project and to activate the function module exit. If the function module exit is not activated, the statement CALL CUSTOMER-FUNCTION is ignored. If the function module is activated, the corresponding function module is called in the same way as the general function module call.
    Syntax and meaning of the parameter_list for the assignment of the actual parameters to formal parameters and for the exception handling are the same as in a general function module call. It is not possible to dynamically fill the interface.
    CALL FUNCTION func
    Syntax
    CALL FUNCTION func { parameter_list
                       | parameter_tables }.
    Effect
    This statement calls the function module specified in func. The identifier func must be a character-type data object, which contains the name of a function module in uppercase letters during the statement execution. Each function module of an SAP system has a unique name, which is why you need not specify the function group.
    Use additions parameter_list or parameter_tables (as of release 6.10) to statically or dynamically assign actual parameters to the formal parameters of the function module and return values to the non-class-based exceptions.
    Note
    If the name of a function module is specified by a constant or as a literal, the extended syntax check can check the statement.
    Exceptions
    Catchable Exceptions
    CX_SY_DYN_CALL_ILLEGAL_FUNC
    Cause: The called function is known but not active.
    Runtime Error: CALL_FUNCTION_NOT_ACTIVE
    Cause: The called function is unknown.
    Runtime Error: CALL_FUNCTION_NOT_FOUND
    CX_SY_DYN_CALL_ILLEGAL_TYPE
    Cause: The type of the actual parameter does not fulfill the requirements of the function interface.
    Runtime Error: CALL_FUNCTION_CONFLICT_GEN_TYP
    Cause: The actual parameter does not have the length expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_LENG
    Cause: The actual parameter does not have the type expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_TYPE
    Cause: Only those functions can be called in the update task that are intended for it.
    Runtime Error: CALL_FUNCTION_NO_VB
    Cause: An actual parameter does not fulfill the alignment requirements of the respective formal parameter.
    Runtime Error: CALL_FUNCTION_WRONG_ALIGNMENT
    CX_SY_DYN_CALL_PARAM_MISSING
    Cause: The function expects a parameter, which has not been passed by the caller.
    Runtime Error: CALL_FUNCTION_PARM_MISSING
    CX_SY_DYN_CALL_PARAM_NOT_FOUND
    Cause: The caller has passed a parameter, which is not known to the function.
    Runtime Error: CALL_FUNCTION_PARM_UNKNOWN
    plz reward points if it helps

  • MNU_* Macro for calling a pakagelink using an excel button

    Hi all,
    is it possible to call a pakagelink with using an excel button? We use this "MNU_eDATA_SELECTPACKAGE" to call several pakages via excel buttons, but I didnt find any macro to call a hole pakagelink.
    Thanks in advance
    Christian Weber

    Hi,
    Running the entire package link through MNU function is not feasible. Kindly take a look at the below link from help.sap for the list of the supported MNU commands:
    http://help.sap.com/saphelp_bpc75_nw/helpdata/en/f7/715647fa774763827084cd28ef3aff/content.htm
    Hope this helps.

  • Upload data from excel with vba by calling a function module

    Hello all,
    i have a problem with the function module "ALSM_EXCEL_TO_INTERNAL_TABLE". I will call this function module with vba to load data from excel to sap with a Buttonclick. I have copied this function module and set it remotable. But i can´t call it from excel.
    Can you give me some tips how can i
    upload data from excel with vba by click a button.
    The problem seems the function: call method cl_gui_frontend_services=>clipboard_import in the function module, because when i comment this function call the vba-call is true but no results. 
    How can I call the function module correct with vba?
    Thanks a lot for your tips!!!!
    Chris
    Message was edited by:
            Christoph Kirschner

    HI
    Uploading data directly from Excel file format
    * Upload data direct from excel.xls file to SAP
    REPORT ZEXCELUPLOAD.
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    * Tick don't append header
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    * No of columns
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS: <fs1>.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = '*.xls'
                static    = 'X'
           CHANGING
                file_name = filename.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = filename
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/ 'Upload Error ', SY-SUBRC.
      ENDIF.
    END-OF-SELECTION.
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
    *                          Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    *-- End of Program
    <b>Excel Upload Alternative - KCD_EXCEL_OLE_TO_INT_CONVERT</b>
    *Title : Excel Uploading
    TYPES:   BEGIN OF t_datatab,
             col1(25)  TYPE c,
             col2(30)  TYPE c,
             col3(30)  TYPE c,
             col4(30)  TYPE c,
             col5(30)  TYPE c,
             col6(30)  TYPE c,
             col7(30) TYPE c,
             col8(30)  TYPE c,
             col9(30)  TYPE c,
             col10(30)  TYPE c,
             col11(30)    TYPE c,
           END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
          wa_datatab TYPE t_datatab.
    Data : p_table type t_datatab occurs 0 with header line.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA: it_tab TYPE filetable,
          gd_subrc TYPE i.
    field-symbols : <fs>.
    *Selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename
                   DEFAULT 'c:test.xls' OBLIGATORY.   " File Name
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      REFRESH: it_tab.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title     = 'Select File'
          default_filename = '*.xls'
          multiselection   = ' '
        CHANGING
          file_table       = it_tab
          rc               = gd_subrc.
      LOOP AT it_tab INTO p_file.
    *    so_fpath-sign = 'I'.
    *    so_fpath-option = 'EQ'.
    *    append so_fpath.
      ENDLOOP.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    * END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3,
                wa_datatab-col4,
                wa_datatab-col5,
                wa_datatab-col6,
                wa_datatab-col7,
                wa_datatab-col8,
                wa_datatab-col9,
                wa_datatab-col10,
                wa_datatab-col11.
      ENDLOOP.
    *&      Form  UPLOAD_EXCEL_FILE
    *       upload excel spreadsheet into internal table
    *      -->P_TABLE    Table to return excel data into
    *      -->P_FILE     file name and path
    *      -->P_SCOL     start column
    *      -->P_SROW     start row
    *      -->P_ECOL     end column
    *      -->P_EROW     end row
    FORM upload_excel_file TABLES   p_table
                           USING    p_file
                                    p_scol
                                    p_srow
                                    p_ecol
                                    p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    * Has the following format:
    *             Row number   | Colum Number   |   Value
    *      i.e.     1                 1             Name1
    *               2                 1             Joe
      DATA : ld_index TYPE i.
    * Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = LT_INTERN
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
         MOVE lt_intern-col TO ld_index.
         assign component ld_index of structure
         p_table to <fs>.
    move : lt_intern-value to <fs>.
    *     MOVE lt_intern-value TO p_table.
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "UPLOAD_EXCEL_FILE
    Regards
    Pavan

  • Can I  use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Can I use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Let me tell you what I am sure about and what I am not sure about:
    I am sure that I want to be able to sell my products online. The industrial market that I sell to usually do not allow the maintenance people that find me on the web, do not have the ability to use credit cards in a typical shopping cart format due to the higher prices that the equipment I sell costs and that most people call me up to 'request a formal quotation' to give to their purchasing depart. So, my bright idea is to create numerous pdf files with very specific url's to match the very specific items that I sell. (1) item per pdf. I am thinking that the advantage to skipping the shopping cart approach and allowing the customer to fill in the qty of items, which would be mulitpled by the price of the item (a constant #) and then hitting a apply button, that would calculate subtotal price. Discounts for the qty the customer inputs (qty of items inputted by customer would be discounted on a percentage x base price) and a refresh the screen. It would allow for SEO advantages from what I have seen in the past in my very vertical market. All forms would be setup using the same functionality, just images, alt text, urls, and readable text would change.
    What I don't know- which is alot, then how to calculate shipping costs. I have a weight per item, which can be added up. I saw an Adobe blog that allows UPS shipping cost to be programmed in. I don't know how dreamweaver works, which was what the blog mentioned would allow for this updated, instantanious interface with UPS and calculating real shipping costs to a specific zip code. Shipping cost would be fluff to this page. The main thing would be to do allow the customer to be able to fill in a qty of the specific item on the page, calculate a discount if / then type thing, be able to have customer email to purchasing dept or print. I would date stamp it with verbage that pricing is valid for XX days and if I could get a copy emailed to me that would be icing on the cake. I believe that this non static pdf would be something different then the current competion and that it would allow for 100's of quotes to be generated without customers having to wait 15 minutes to an hour for me to process the exact document that they are looking for.
    Hajeks

  • Timeout when using  ALV build-in functionality: exporting to Excel

    Hello,
    I have the following problem within one of my web dynpro abap applications:
    I need to be able to display data in a table that preferably should be via alv component.
    Then I shall also be able to download the displayed data via Excel.
    So I have embedded the ALV component I added to the component within a view and activated the export to excel button.
    Downloading small amount of data does no lead to any problem, but when trying to process a larger amount of data (in this case 22500 entries), I get a timeout.
    Does anybody have any idea if it is possible to increase performance here without reducing the amount of data to be downloaded?
    thanks a lot ion advance!
    Ana

    Hello,
    coming back to the UI element download.
    I managed to get the data being saved to the desktop, but unfortunately, the data remains being displayed as in chines letters.
    Anybody got an idea, what parameters I might have set wrong? Or if I have to do an additional encoding before generating the XString?
    Here is the supply method code and the parameters I have set in the UI element:
    The Supply method
    method GEN_EXCEL_DOWNLOAD_DATA .
      data: wa_cmx_line type zksb_cmxshowline.
      data: lt_excel type zksb_cmx_excel_download_t.
      data: wa_excel type zksb_cmx_excel_download.
      data: l_guid type guid_32.
      data: l_url type string.
    * read context-------------------------------------------------------------------------------------
      data lo_nd_z_ksb_get_prcm type ref to if_wd_context_node.
      data lo_nd_exporting type ref to if_wd_context_node.
      data lo_nd_rt_zksb_cmx_show type ref to if_wd_context_node.
      data lo_el_rt_zksb_cmx_show type ref to if_wd_context_element.
      data lt_rt_zksb_cmx_show type table of wd_this->element_rt_zksb_cmx_show.
      data wa_rt_zksb_cmx_show like line of lt_rt_zksb_cmx_show.
    *   navigate from <CONTEXT> to <Z_KSB_GET_PRCM> via lead selection
      lo_nd_z_ksb_get_prcm = wd_context->get_child_node( name = wd_this->wdctx_z_ksb_get_prcm ).
    *   navigate from <Z_KSB_GET_PRCM> to <EXPORTING> via lead selection
      lo_nd_exporting = lo_nd_z_ksb_get_prcm->get_child_node( name = wd_this->wdctx_exporting ).
    *   navigate from <EXPORTING> to <RT_ZKSB_CMX_SHOW> via lead selection
      lo_nd_rt_zksb_cmx_show = lo_nd_exporting->get_child_node( name = wd_this->wdctx_rt_zksb_cmx_show ).
    *   @TODO handle not set lead selection
      if lo_nd_rt_zksb_cmx_show is initial.
      endif.
    * get static attributes table
      lo_nd_rt_zksb_cmx_show->get_static_attributes_table( importing table = lt_rt_zksb_cmx_show ).
    * reduce data to only the data that shall be displayed----------------------------------------
      loop at lt_rt_zksb_cmx_show into wa_rt_zksb_cmx_show.
        move-corresponding wa_rt_zksb_cmx_show to wa_excel.
        append wa_excel to lt_excel.
      endloop.
    * populate data as tab separated strings-----------------------------------------------------
      data l_str  type string.
      data lv_struct type extdfiest.
      data itab type ref to zksb_cmx_excel_download_t.
      data r_xstring type xstring.
      data s(256) type c.
      field-symbols <wa_desc> like line of lv_struct.
      field-symbols: <tab> type table.
      field-symbols:  <wa> type any.
      field-symbols:  <f> type any.
    * populate the column headers----------------------
      get reference of lt_excel into itab.
    * assign lt_excel to <tab>.
      assign itab->* to <tab>.
      lv_struct = wd_this->get_table_structure( itab = itab ).
      loop at lv_struct assigning <wa_desc>.
        concatenate wa_cmx_line
                    <wa_desc>-coltitle
                    cl_abap_char_utilities=>horizontal_tab
                    into wa_cmx_line.
      endloop.
      concatenate wa_cmx_line
                  cl_abap_char_utilities=>cr_lf
                  into wa_cmx_line.
    * loop through the data table-----------------------
      loop at <tab> assigning <wa>.
        loop at lv_struct assigning <wa_desc>.
          assign component sy-tabix of structure <wa> to <f>.
          check sy-subrc = 0.
          if <wa_desc> is assigned and <wa_desc>-convexit is not initial.
    *  Process any output conversion routines
            concatenate 'CONVERSION_EXIT_' <wa_desc>-convexit '_OUTPUT' into wa_cmx_line.
            call function wa_cmx_line
              exporting
                input  = <f>
              importing
                output = s.
          else.
            concatenate wa_cmx_line
                     <f>
                      cl_abap_char_utilities=>horizontal_tab
                      into wa_cmx_line.
          endif.
        endloop.
        concatenate wa_cmx_line
                    cl_abap_char_utilities=>cr_lf
                    into wa_cmx_line.
      endloop.
    *Convert the strings to Binary strings (UTF-16le)------------------------------------------------
      call function 'SCMS_STRING_TO_XSTRING'
        exporting
          text     = wa_cmx_line
          mimetype = ''
        importing
          buffer   = r_xstring.
    *Add the UTF-16 Little Endian Byte Order Mark to the begining of the file
      concatenate  cl_abap_char_utilities=>byte_order_mark_little
                   r_xstring
                   into r_xstring in byte mode.
    * set context
      DATA lo_nd_excel_download TYPE REF TO if_wd_context_node.
      DATA lo_el_excel_download TYPE REF TO if_wd_context_element.
      DATA ls_excel_download TYPE wd_this->element_excel_download.
      DATA lv_excel_download_data LIKE ls_excel_download-excel_download_data.
    * navigate from <CONTEXT> to <EXCEL_DOWNLOAD> via lead selection
      lo_nd_excel_download = wd_context->get_child_node( name = wd_this->wdctx_excel_download ).
    * get element via lead selection
      lo_el_excel_download = lo_nd_excel_download->get_element(  ).
    * set single attribute
      lo_el_excel_download->set_attribute( name =  `EXCEL_DOWNLOAD_DATA`  value = r_xstring ).
    endmethod.
    and the parameters to the UI are as follows
    behaviour: allowSave
    data: <data that was created by supply method>
    fileName: CMX.xls          also tried CMX.cvs
    mime-type: ms-excel     also tried  /vnd.ms-excel
    text: $OTR:SOTR_VOCABULARY_BASIC/DOWNLOAD
    textDirection: inherit
    type: navigation
    visible: Visible
    Any suggestion of what I might have to change would be great!
    Tx
    Ana

  • ALV downloaded to EXCEL -using standard button-how to modify the EXCEL ???

    hey guys,
      i have developed an ALV (with dynamic itnernal table,with HTML top of page,using FMs)
    Now ,i ahd problems with downlaod to excel(which i partly overcame by using &XXL fcode button instead of other 'donwload to excel button' )..
    now the data is downloading to excel fne..
    but i need to customise the EXCEL with HEADING (with bold letters in colour).. and also adding a line in ALV COLOUMN HEADINGS part of EXCEL...

    Hi,
    Kindly go through the below link to download a file in Excel format from ALV,
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bcheckbox%252bto%252bprocess%252bselected%252brecords%252bat%252bruntime
    Note:  In the function module ->GUI_DOWNLOAD
    You have to give Field Separator as 'X'.
    Hope it helps You.
    Regards
    Mansi

  • Call javascript function using parameters cause a immediate execute at load

    Hello.
    I recognized a strange behavior if I try to use parameters to javascript in af:clientListener method property.
    Using syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="OnInitControl1" type="click"/>
    </af:commandButton> and javascript function OnInitControl1() {
      alert('OnInitControl1 called');
    } the method OnInitControl1 is called first with the click of the button.
    But with the syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="InitCtrl('Control1')" type="click"/>
    </af:commandButton> and javascript function InitCtrl(frameName) {
      alert('InitCtrl(' + frameName + ') called');
    }the function InitCtrl is called immediate at load of the page.
    In both cases the javascript file is inserted in af:document using<af:resource type="javascript" source="/ScriptHelper.js"/>Is my syntax for "method" property of the af:clientListener wrong?
    Paul.

    Hi,
    I am using Oracle JDeveloer version 11.1.1.0.2. I have gone through your discussion. Since i am new to ADF, just wanted to request you to share the code related to <af:resource type="javascript" source="/ScriptHelper.js"/>. Also, the Tag included for the same. In my Environment, if i use <af:resource, it shows, "element af: resource is not expected".
    My requirement is similar to your as you explained in details. I need to push all the client side validation to Javascript file and need to call in the ADF pages wherever it is required (re-usable). Also, is there any specific formate for JS file to be maintained from the point of view of ADF calling the JS file.
    Your help will be greatly appreciated.
    Thanks in Advance,
    --Mahesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Mb1b movement 453 - profit center not from material but from sales order

    Dear All, we have the problem that by return process from sales order stock to free stock (453 movement) we would like to have the original Profit center from sales order, but as SAP standard it moves PC from material master. we have implemented alre

  • Report to view the per unit of Production Order Actual cost

    Dear All, As we see the per unit cost of FG materail,when we estimate the cost by CK11N for FG materail, Is there any standard report available to view the per unit ACTUAL cost  of FG Materrial (Primary & Secondary Cost Element wise ) either from CO

  • Commons-Fileupload question

    Hi, I'm trying to use the commons-fileupload-1.1.jar file and I've placed it in my WEB-INF/lib folder. When I try to compile my java though, I get an error that reads: package org.apache.commons.fileupload does not exist. I'm importing like this: imp

  • Captivate 8 responsive designs: only one 100% width object per slide?

    I've been customizing some responsive themes to use two or more 100% width objects. As I work with the project, I find that some of these objects fall short of the right edge at some break points or, more commonly, at intermediate browser widths betw

  • Sedn report output to mail in d2k 10g

    Hi i want to send report output to mail . i set DESTYPE = mail DESNAME = i gave mail id in initial values I put the rdf in server and ran cucurent request from application but i am not getting the mail any one help me tell what other steps i have to