Using a dynamic variable in the Import command of a Method call

Hi,
I am trying to make a Method call fully dynamic.
I have found out how to make the Method name dynamic, but I am having trouble figuring out how to make the Importing statement dynamic.
in my code below:
      CALL METHOD o_main->(v_call)
        IMPORTING
          it_ekko = i_ekko.
I would like to know if it's possible to make both "it_ekko" AND "i_ekko" dynamic so I can use this same call for various tables.
Hope that makes sense...thanks for your help.
Andy

Hi Andrew,
The method call is fully dynamic; not only the parameters can be specified dynamically but also the method name.
This is a help extract:
DATA: line     TYPE c LENGTH 80,
      text_tab LIKE STANDARD TABLE OF line,
      filename TYPE string,
      filetype TYPE c LENGTH 10,
      fleng    TYPE i.
DATA: meth  TYPE string,
      class TYPE string,
      ptab TYPE abap_parmbind_tab,
      ptab_line TYPE abap_parmbind,
      etab TYPE abap_excpbind_tab,
      etab_line TYPE abap_excpbind.
DATA: exc_ref TYPE REF TO cx_sy_dyn_call_error,
      exc_text TYPE string.
class    = 'CL_GUI_FRONTEND_SERVICES'.
meth     = 'GUI_DOWNLOAD'.
filename = 'c:\temp\text.txt'.
filetype = 'ASC'.
ptab_line-name = 'FILENAME'.
ptab_line-kind = cl_abap_objectdescr=>exporting.
GET REFERENCE OF filename INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'FILETYPE'.
ptab_line-kind = cl_abap_objectdescr=>exporting.
GET REFERENCE OF filetype INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'DATA_TAB'.
ptab_line-kind = cl_abap_objectdescr=>changing.
GET REFERENCE OF text_tab INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'FILELENGTH'.
ptab_line-kind = cl_abap_objectdescr=>importing.
GET REFERENCE OF fleng INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
etab_line-name = 'OTHERS'.
etab_line-value = 4.
INSERT etab_line INTO TABLE etab.
TRY.
    CALL METHOD (class)=>(meth)
      PARAMETER-TABLE
        ptab
      EXCEPTION-TABLE
        etab.
    CASE sy-subrc.
      WHEN 1.
    ENDCASE.
  CATCH cx_sy_dyn_call_error INTO exc_ref.
    exc_text = exc_ref->get_text( ).
    MESSAGE exc_text TYPE 'I'.
ENDTRY.
BR,
Valentin

Similar Messages

  • Using a dynamic file path with the import command

    In one of the BI Publisher blog entries it was mentioned that the curly braces tell the parser that it needs to evaluate this value first before executing the import statement. The example provided was using the built-in parameter CURRENT_SERVER_URL, but it also mentioned that this could be done with any parameter.
    I am trying to import a subtemplate using a parameter that will hold the relative path. I am using the following import command in my report template:
    <?import:file:///{$P_SERVERPATH}/Report Path/Subtemplate.rtf?>
    as well as the following declaration statement:
    <?param@begin:P_SERVERPATH?>
    It appears that the P_SERVERPATH parameter is not being evaluated before the import statement. Am I missing anything?
    Any help is greatly appreciated, we are a little over a week from migrating to a new environment and I need to nail down a solution ASAP.
    Thanks,
    John

    I believe that you cannot have a dynamic path in the import statement as it is not allowed by xsl.

  • Dynamic publishing not enabling the use of dynamic variables (flashvars)

    I'm have having issues with my website [url removed by moderator].  The Dynamic publishing is not enabling the use of dynamic variables.  Standard magento 1.8.1 install.

    Dear Yugandhar,
      It's work. Thanks. This is a work around way to avoid retrieve list of values Error. I was suspected 2 reasons to cause this issues: 1. prompt option. 2. LOV option.  So, the cause is not prompt option. The main cause could be LOV( list of values ).
    After disable LOV, Republish universe, reset query filter in report, re-query report, restart server(Core, Webi) from CMC.
    I restore LOV option back to universe and republish universe to server.
    Run Query again. The report not retrieve list of values.  The error not show up.
    I try delete the cause problem dimension(year dim), add others dimension and add  the cause problem dimension to query filter with prompt option back. The error not come up.
    Query will not retrieve list of values.
    Finally, the report come back normal status.
    But. I doubt why only year dim will cause LOV retrieve problem but others dim.
                                                                                                                                                  Sam Sheen

  • My bookmarks have vanished. I want to re-import from Safari. But the "Import" command in the File menu is not available. What's up?

    Firefox works fine. However, my bookmarks toolbar is marked as <empty>. Didn't used to be. I have no idea where they've gone.
    So rather than dwell on the loss, I thought I'd move ahead by importing the bookmarks I have in Safari over to Firefox. No luck, the "import" command on the File menu is de-highlighted. I cannot select it.

    * Make sure that you not run Firefox in (permanent) [[Private Browsing]] mode
    * In Private Browsing mode some menu items are disabled (grayed) and features like visited links are disabled and not showing
    * You are in Private Browsing mode if you see "Tools > Stop Private Browsing", possibly grayed
    * You enter Private Browsing mode if you select: Firefox > Preferences > Privacy > History: Firefox will: "Never Remember History"
    * To see all History and Cookie settings, choose: Firefox > Preferences > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Automatically start Firefox in a private browsing session"

  • I want to import my favourites from IE but the import command in Firefox is greyed out

    I've just moed over from IE to Firefox and want to import my favourites from IE using the Firefox import command. But whatever I try I cannot get the import command under the File tab to "ungrey".

    In IE: <br />
    File > Import/Export - Export to HTML file
    ''then in Firefox:'' <br />
    Bookmarks > Organize Bookmarks -> Import & Backup - Import HTML... = From HTML file

  • How do I use an array variable in the assignment target?

    Hi,
    I am creating a BPEL process in which I have to use an array variable. The array variable needs to be initialized based on some condition.
    The issue is I cannot find a way to set the value of the array variable. There are ways to GET the value of an array variable indexing into it.
    But how do I set the value by using the Array variable in the <to> tag?
    Any help is appreciated. I am using BPEL 10.1.2.0.2.
    Thanks.

    You can declare a variable of type integer which will server as your index. Figure out based on some condition in your process which index of array to update. Assign to your integer variable you created.
    And have Assign copy operation like this -
    <copy>
    <from variable="Var_Output_FetchDueDate"
    part="OutputParameters"
    query="/ns18:OutputParameters/ns18:DUEDATE"/>
    <to variable="outputVariable" part="payload"
    query="/client:GetCustomerAccountInformationProcessResponse/client:customer/client:accounts/client:account[$Var_Counter]/client:dueDate"/>
    </copy>
    I have been using this in my processes.

  • Error while using selection option variable in the selection screen

    Hi All,
    I am facing an issue while using selection option variable in the selection screen for one of my reports.
    Scenario: For the field "Region From" we need to have wild card logic () in tes selection screen, for example if we put "BE" in the selection screen for the field Region From then the query should be executed only for those "Region From" values which begin from "BE".
    Approach: For the above requirement I have made a selection option variable for "Region From". This allows use wild card
    But when the report is executed we get the following error:
    "System error in program CL_RSR_REQUEST. Invalid filter on ETVRGNFR".
    (ETVRGNFR is technical name of the info object Region From)
    Though the report is executed it displays all the values for the field "Region From" irrespective of the selection given in the selection screen.
    Please give suggestions / alternate solutions to crack this issue.
    Thanks in advance
    Regards
    Priyanka.

    Hi,
    Try to use a variable of type Customer Exit and do the validation inside the exit to display according to your request.
    This is just my view, i am not sure if u are already using this or Char. Variable.
    Cheers.
    Ranga.

  • [svn:bz-trunk] 20976: bug fix BLZ 602 IPv6 address isn' t properly resolved when used in dynamic url in the proxy service

    Revision: 20976
    Revision: 20976
    Author:   [email protected]
    Date:     2011-03-28 09:20:34 -0700 (Mon, 28 Mar 2011)
    Log Message:
    bug fix BLZ 602 IPv6 address isn't properly resolved when used in dynamic url in the proxy service
    checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/messages/HTTPMessage.java

    Firstly, there's no such thing as Apache 9.3, there's Apache 1 (and subversions) and Apache 2 (and subversions). Your error message -
    Oracle-HTTP-Server/1.3.28Shows you're using Apache 1.3.28
    Secondly, I'm confused by your comment -
    I do not have Apache 9.3 or higher but I think oracle should offer this in its companion CDOracle does offer the Apache server, if you're saying you didn't get it from Oracle then where did your Apache server come from?
    Thirdly, I notice from your config file -
    ErrorLog "|E:\oracle\product\10.1.0\Companion\Apache\Apache\bin\rotatelogs logs/error_log 43200"That you're piping the logs through rotatelogs, are you sure the logfiles haven't just been renamed?

  • I'm trying to import my bookmarks from Safari, but under File, the "Import" command is greyed out. How can I import those bookmarks from Safari?

    I'm trying to import my bookmarks from Safari, but under File, the "Import" command is greyed out. How can I import those bookmarks from Safari?

    In IE: <br />
    File > Import/Export - Export to HTML file
    ''then in Firefox:'' <br />
    Bookmarks > Organize Bookmarks -> Import & Backup - Import HTML... = From HTML file

  • How do I use a dynamic variable from a prolog script?

    I have my test broken in to three scripts, a login, an update, and a logout. There is a dynamic variable, SERVICE_VIRTUAL_CLIENT, from the login script that I need to use in the update script, but I can't figure out how to do it. Any help would be appreciated.
    Edit: I forgot to mention that the login script is only run in the prolog portion of the UDP.
    Scott
    Message was edited by: scottmorgan

    Scott,
    You would do this the same way you would in a stand-alone script. Create the variable pattern in the login in script and name the variable. Save the login script and open the other script and select the parameter where you need the value. Set the parameter value to {{variableNameFromLogin}} (Variables are transferred from one script to the next in a UDP).
    I hope this makes sense

  • Write to a file using a system variable in the path

    I got an error when I used the following command to write a file
    OdiOutFile "-FILE=<%=System.getProperty("LOG")%>\test.log" -APPEND "-CHARSET_ENCODING=ISO8859_1" "-XROW_SEP=0D0A"
    The "LOG' is an environment variable.
    The error is
    java.lang.Exception: Oracle Data Integrator Function does not exist
    It looks like ODI treat System.getProperty as ODI function instead of java method. I use SUNOPSIS API as technology in the command

    At this moment I can't give a source code example because I'm writing it :) and I'm trying to see the cases where I may have some problems.
    But my idea is to access the file at any time and to write into it with differenent threads in a differenet places in this file. In fact the problem I'm trying to solve is :
    I have a objects called Data that are generated by some other thread independent of my application. This thread puts the Data objects in some kind if buffer. When the buffer is full, I'm creating a few threads fo every object Data in this buffer (the data objects in its own is some collection of floats and doubles) So I'm trying to position the new created threads over the file but in different places and then make them write the data collected in the object Data.
    To position de threads over the file, I'm accessing it by some synchronous method to undestand where it can write in this file and the writing is not synchronous because I'm trying to calculate the exact place and number of bytes of writing and in this way to avoid (may be) the eventuality of errors.
    Regards,
    Anton

  • Using custom environment variables in the profile path

    Hi,
    I've created a custom environment variable that I've setup on two computers and the domain controllers.  I want to use this in the profile path in user properties.  However when users log in the variable is taken literally rather than being converted
    into the value.  For example
    \\fileserver\share\user\%myenv%.v2 is generated rather than \\fileserver\share\user\envdata.v2
    If I add in another built-in variable such as %OS%, that converts properly but any time I use a custom variable Windows just doesn't use it during the logon process.  If I open up Explorer and type in the path to my data as it should be it works fine
    so Windows is definitely picking up the variable, just not using during the logon process.  I can't seem to find a TechNet article that states custom variables can't be used in profile paths.
    Has anyone else come across this?
    Thanks,
    Tim

    Hi,
    Thanks for your post.
    So did you create the environment variable using group policy? If yes, i would suggest you use 'Create' and not 'Update', the variable is then held through reboots.
    Please refer to this blog, hope it will be helpful
    http://blogs.technet.com/b/askds/archive/2013/07/31/roaming-profile-compatibility-the-windows-7-to-windows-8-challenge.aspx
    Regards.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to use customer exit variable in the report

    Dear All,
    i want to use a standard customer exit variable in the report properties.
    In the Bex Query Designer right hand bottom you will find two buttons "Properties" and "Task". Click on task you will get different option. Choose properties from there and then select "variable sequence tab".
    I need to add a standard variable there. How can i achieve it?
    Appreciate your early help.

    You need to add variable to corresponding charctertic then you can get that varaible for sorting the sequence....
    If 0CUST is the varaible then you need to assign it 0CUSTOMER then 0CUST will be available for the sequence.
    Edited by: shanthi bhaskar on Apr 2, 2009 5:41 PM

  • Using BPS numberic variables in the FOX formula???

    Hi all,
    Can someone tell me how to use one variable (<b>the variable type is 'numberic'</b>) in the FOX formula? Thank you.
    FOX formula example:
    <b>Inventory $= inventory unit * inventory (per unit) * depreciation monthS (<u>this is a numberic variable</u>.</b>
    J.

    Hi John,
       You can use the VARV function to get the value of the numeric variable in FOX.
       Lets say your variable for depreciation months is ZDEPMTS.In your FOX, you
       can say: Inventory $= inventory unit * inventory (per unit) * VARV(ZDEPMTS).
       Hope this helps.
    Cheers
    Srini

  • Can I use a javascript variable for the ID of a module ?

    I want to use a javascript variable to pull up the related media downloads.
    So instead of using a hard coded
    <div id="media">
      {module_literature,c,45243}
    </div>
    I want to use jQuery to render the right category of media downloads ... Something like:
    <div id="media">
         new text would go here
    </div>
    <script language="javascript">
         var id = 45243
         $('#media').html({module_literature,c,id})
    </script>
    Ive also Tried the following
    <script language="javascript">
        var id = 45243
        var str = '{module_literature,c,'+id+'}"
         $('#media').html(str)
    </script>
    Niether seems to work ?

    Hi Brad
    I want to eventually change the id to a variable that is changed elsewhere on the page via jquery
    But I can seem to get either of the above to work ?
    I seem to get Unexpected token illegal messages when using the above script

Maybe you are looking for

  • (SD-ABAP-IDOC) Delivery Quantity change

    Hi, We have two material types i.e., Finished good and packaging material. we receive an inbound IDoc for picking with batch numbers for only finished goods. The incoming IDoc will have only finished goods, but not packaging materials. Once we receiv

  • Acrobat 8.1 Invalid Serial Number

    How do I activate Acrobat 8.1 when I get the error "Invalid Serial Number" although the number  I use matches the number listed in my Adobe on-line account?

  • Old PC crashed - Will new PC delete songs if I sync?

    My old PC crashed and I bought a new one. My iTunes file says my iPod is in use under a different folder. It has brought back up all of my purchases, so I am safe there if I sync. However, I have a ton of music from CD that it won't bring back up and

  • How to stop sapscript calling MS word when I want to edit the elemets...

    Hello Experts, In SE71, when I want to edit the element/codes of a particular window, I click on the 'edit text elements' window but it calls MS word and the code is displayed there. I want the 'original' editor wherein I can see the '/E', '=', etc.

  • SVG Objects

    Is there an SVG library that we can download on the internet from either SAP or any that are on a free site?