Passing a context value to BAPI Import parameter in WebDynpro!

Hi All,
I have a small doubt here!
I am trying to create a sales order using Webdynpro through BAPI.
There i want to hard code the value of order type like, i want to fix the value before running the porgram itself i.e., statically i want to pass the value.
What i have done is,
created a Context variable and has assigned the value in the init() of view like,
<b>wdContext.currentUIElementsElement().setDocType("ZORD")</b>
and also changed the value attribute of InputField to the context variable called "DocType".
But now we need to pass this context value to the BAPI Structure called ORDER_HEADER_IN  i.e, to the class "Bapisdhd1". with out the hardcode value it is working, but i want to pass the value before executing it self. so What i can do, can any body pls give sample line of coding.
Thanks in advance,
Regards,
Sireesha.B

Hi
Have you bound instantiated the Bapi class?If not then do like this.
BapiClass input = new BapiClass();
wdContext.node<BAPINODE>.bind(input);
Above code can be written in your Custom Controller or View's doinit.
Then you write the code for doctype as given in the post above.
Regards,
Ajay

Similar Messages

  • How to pass multiple MDX values for a single parameter into a drill-through report?

    I'm thinking this will be an easy question for any experienced SSRS/MDX developers, at least I hope so!  I've created a report that gives the user the option to choose viewing data for the current/active week, or YTD.  Depending on which link the
    user selects, the report simply calls itself and needs to pass in the parameter value for Active week.  If it's active week, the parameter value will simply be "true".  If it's YTD, the parameter value needs to be both "True" and "False" so the current
    week's data is accounted for as well.  I've set everything up except for the final step, and I have no idea what to type into the Value field below.  I've tried different things: false, as you see below (it errors saying I'm missing the parameter
    value), the value in MDX format: =[School Dates].[Active Week].&[True] (it said I was missing a bracket), a 1 instead of the word true (again, missing a parameter value).  Nothing is working.
    So my question is kindof two-fold: 1) how do you pass in the value at all and 2) more specifically, how do you pass in multiple values (both true & false) ??

    I'm sorry for being so dense, but I'm not quite following, although what I've tried makes me think if I can follow you, it will work :)
    To answer your initial questions, you are correct with both your assumptions:
    1) detailType is the parameter that specificies YTD/Weekly, this is a "report defined" parameter that I am using to determine which Row Group to display (either YTD or Weekly)
    2) SchoolDaysActiveWeek is the parameter that is being set to either true or false -- this is a field in the cube that states whether that record is for the current week or not
    So in following your instructions, well that's the problem I'm not quite following :)
    1) When you say Delete the SchoolDaysActiveWeek parameter from the report only, do you mean to mark the parameter as Hidden?  If so, I've done this.
    2) I'm not quite sure where to use the statement you provided me.  You said to put it in the dataset, but I don't know which dataset.  I assume you mean the "main" dataset (as opposed to the hidden dataset that gets generated when you mark a field
    as a parameter).  If this is the case, the only place I could see that would allow you to use such a statement is in the Filter section of the properties.  I tried this, and it did not generate any errors, but it also kept my report groups from displaying
    -- it just showed a blank report, so I think it probably wasn't bringing back any rows to populate them with.
    I also tried going into the Expression section for the SchoolDaysActiveWeek parameter in the second screenshot and placing the statement there.  When I did this and ran the report, I would get the following error:
    The 'SchoolDaysActiveWeek' parameter is missing a value
    So what am I missing!? 
    Also, thanks for taking the time to respond!!

  • Passing single/multiple values to stored proc parameter from crystal report

    I tried below solution posted on this forum to pass either a single value or multi-value to a sql server stored procedure parameter (varchar datatype) from crystal report XI R2.
    In my crystal report , I am displaying all the available parameter values to the user  and the user will select either a single value or multi value.
    This worked when I select single value and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product  1')}
    But this did not worked when I selected multiple values and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product 1,Product 2')}
    I think it might work if it is as below:*
    For multiple values:
    {CALL "xyz"."dbo"."storedprocedurename";1('Product 1', 'Product 2')}
    Please advise.
    Solution Posted on this forum is as follows:
    Hi,
    As you must be aware of that a crystal report created of a stored procedure will allow only a single value for inserting a multiple value as a parameter in your report and pass those values to your stored procedure please follow the below work around which will be helpful for you.
    Symptom
    In Crystal Reports, you want to pass a multi-value parameter to a stored procedure. The problem with doing so is that Crystal Reports considers the multi-value parameter to be an array.
    How can you pass a multi-value parameter to a stored procedure?
    Resolution
    Here are the steps to pass a multi-value parameter to a stored procedure:
    1. Create a Crystal report, and add a multi-value parameter.
    2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
    //Formula: @JoinFormula
    Join ({?Multi-value parameter array},";")
    ====================
    NOTE:
    In the formula above, a semi-colon (";") is the delimiter.
    ====================
    3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
    4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
    Doing so passes a multi-value parameter to the stored procedure.
    Regards,
    Vinay

    Hi Vinay,
    First you need to make sure the stored procedure accepts multiple values in the fashion 'a','b','c'.
    Then, create this formula in the Main Report:
    numbervar i;
    stringvar s;
    for i:= 1 to ubound({?Parameter}) do
        s := s + "'" + {?Parameter}<i> + "'" + ",";
    left(s,len(s)-1);
    Link this formula to the sub-report's parameter.
    Hope this helps!
    -Abhilash

  • How to pass a form value  as a url parameter??

    I have following form and I want to pass the selected value of the drop down choice in as one of the parameter in the URL. How can I do that ??
    something like proposalid that I have done in the url, I want to pass the selected value of the variable doc_id, when I click the Link button
    <form name = "link" method="POST" enctype="multipart/form-data" action="<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/add_doc.jsp">
    <table>
         <tr> <td class="tableContent"> Doc Identifier: </td>
    <td class="tableContent"> <SELECT name="doc_id">
    <%
         Vector v = iddata.getDocumentIdList(tabName);
         //out.println(v);
         if (v != null && v.size() > 0) {
              for (int i = 0; i < v.size(); i++) {
              Hashtable hash = (Hashtable) v.elementAt(i);
    %>
    <OPTION selected name="id " value="<%=(String)hash.get("DOCUMENT_ID")%>"> <%=(String)hash.get("DOCUMENT_NAME")%></OPTION>
    <% } } else {%>
         <OPTION selected name="id " value="test"> No DocIDs</OPTION>
    <%}%>
    <tr> <td colspan = "2">
         <table border="1" width="200">
              <tr> <td> <input type="text" name="link_file" size="30" value=""/></td><td> <INPUT TYPE=button VALUE="Link..." onClick="window.open('<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/link.jsp?proposalid=<%=proposalID>','mywindow','toolbar=no,location=no,directories=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20');"></td> </tr>
              <tr> <td colspan = "2">
                   To Create Links: <br>
                   * Select Doc Identifier
                   * Click on Link...to select file within eFile. <br>
                   * Click Add to create the Link <br>
              </td> </tr>
         </table>
         </tr>

    if - in your form declaration - you change your method to GET from POST, it will append the form data onto the URL string instead of putting it in the request header. For instance, if you have a form with an input called THE_INPUT, and you submit to a servlet (or script of some kind or whatever) when the value of that text box is "foo", the URL will be:
    http://www.yourdomain.com/yourservlet?THE_INPUT=foo
    But, if you use the POST method, the URL will just be:
    http://www.yourdomain.com/yourservlet
    Is that what you meant?

  • How to pass checkbox multiple value in URL as parameter?

    Hello,
    I have a checkbox in two page. The checkbox is based on a LOV and user can check more than one value at a time. The return value of the checkbox is like "ID1:ID2".
    I want to call another page with the same checkbox item and want to pass the checked value via the URL.
    This cause problem because checked value are separated with : that not work in URL.
    So, how can I pass checkbox multiple value in parameter via an URL?
    Thanks
    Jean

    Jean,
    Why pass it in a URL instead of just using what's in session state? On your second page, set the Source Type of the check box item to ITEM and enter the name of the check box item on the first page.
    Sergio

  • Problem with retrieving a value from the import parameter of a method

    Hi Friends,
    I have a problem accessing the field.
    I have a import paramter in the method of my Z class. The import paramter is of type ANY.
    In my method I get the value of this import paramter as
    . In this I have a field Catalog Id which is a z field.
    How should I retrieve the value of this catalog Id from this importing parameter?
    Regards,
    Raju

    Hi Friends
    Can anyone tell me whether this is a structure or a Class refernce, so that I can access the field in that.
    Regards,
    Raju

  • To access context values in java util methods in webdynpro java

    My requirement is to access the wdcontext values in the my util classes.
    kindly  suggest how to access the context value in my util class
    Regards
    Priya

    The context reference must be passed to the .java class in order to access same in the .java
    for example,
    Change MyUtil.java - get the reference to this file.
    public class MyUtil {
    //make a local variable of context element type.
    private IPrivateCompView.IHashContextElement local_context;
    //add context type in Constructor
    public MyUtil (IPrivateCompView.IHashContextElement local_context, /*rest of params*/){
            this.local_context = local_context;
            //.... rest of initialization
    In Webdynpro, initialize the call by passing the context reference.
    IPrivateCompView.IHashContextElement hashmap = wdContext.currentHashContextElement();
    //initialize my class
    new MyUtil( hashmap, /*rest of params*/);
    regards,
    Nikhil

  • How to pass value in Table import parameter of an RFC

    Hi all,
    I have an RFC in which import parameters are in the form of a table
    so now when i imported that RFC in my webdynpro application and Apply Service Template to it, it created the structure but when i applied form template to it all the inputfields were readonly
    and also when i tried to set the input parameter of that table like:
    wdContext.currentBAPI_CREATEElement.set<field>("value");
    it shows null pointer exception
    MY Context structure created after service template is as follows:
    Model Node Zcreate_rfc, it icludes another model node
    BAPI_CREATE, and it then includes the input parameters
    Please tell me how to solve the problem

    Suppose the RFC is called ZRFC, and the table structure is called TableStruct, then this works for me (in execute method before calling execute):
    ZRFCInput input = wdContext.currentZRFCElement().modelObject();
    // these are regular import parameters
    input.setAaa(aaa);
    input.setBbb(bbb);
    if (input.getTableStruct()!=null) {
          input.getTableStruct().clear();
    // In this loop table rows are added
    for (int i=0; i<sourcList.size(); i++) {
         ZTableStruct table = new ZTableStruct();
         table.setDdd(((SomeBean) sourcList.get(i)).getDdd()); // for property ddd
         input.addTableStruct(table);
    Good luck, Roelof
    Edited by: R. Knibbe on Jan 23, 2008 3:25 PM

  • Passing Deployment Descriptor value to transformation - Important

    All,
    Version: 10.1.3.4
    I have a requirement to get run time value and access it inside transformation (xslt). Hence I used deployment descriptor, but I'm stuck on how to access this value inside transformation. I tried ora:getPreference to use it inside Assign activity and successfully done this, but cudn't do the same inside transformation. Any pointers would be of great help.
    rgds
    sen

    Hi,
    Ya, i'm looking for such doc. Can you please share it if you have?
    I followed this (http://soacrux.blogspot.com/2010/08/passing-bpel-variable-contents-into.html) blog. For bpel 10g, is it mandatory to keep the XSLTParameters.xsd? If i use this xsd and create a variable of the xsd type, during deployment jdev throws an error
    Error(64):
    *[Error ORABPEL-10010]: unresolved element*
    *[Description]: in line 64 of "D:\Application1\BPELProcess1\bpel\BPELProcess1.bpel", XML element "{http://schemas.oracle.com/service/bpel/common}parameters" of variable "Variable_3" is not defined.*
    *[Potential fix]: Make sure the XML element "{http://schemas.oracle.com/service/bpel/common}parameters" is defined in one of WSDLs that are referenced by the deployment descriptor.*
    rgds
    sen
    Edited by: Sen2008 on Jan 22, 2012 12:58 AM

  • How to pass multiple single values to parameter in planning function?

    Hi!
        I can not pass the variables (multiple single Values) from Input Layouts(BexAnalyzer) to Planning Function Types...Anyone have any idea for setting the parameter in the function types. I use the exit class CL_RSPLFC_BPS_EXITS.
    My Parameter Type is Elementary and also use variables allowed

    If you want to use the class as in a planning function type, proceed as follows:
    1. Create an InfoObject that accepts the name of the function module as a characteristic value. We recommend that you create an InfoObject of type character with length 30 and indicate that this InfoObject is "Without Master Data".
    2. In transaction RSPLF1, create a new function type. Chose the "Reference Data" option and enter the name of the class. This does NOT imply that reference data is read automatically, but results from the requirements for implementing the class.
    3. On the "Parameter" tab page, create two parameters - one for the exit module and one for the init module. The parameters should be "elementary". Chose the InfoObject you created in step two as the dedicated InfoObject. The names of the parameters are determined from the values of constant P_C_NAME_EXIT_PARAM and P_C_NAME_INIT_PARAM.
    4. If you require additional parameters in your function module (called exit parameters), you create these parameters as elementary parameters (with appropriate InfoObjects). Note an additional predefined parameter here - in many function modules, the name of the area is used from which the module is called. The area is not used in BI Integrated Planning but it may be the case that an area was created in BPS which only uses the current InfoCube. For this reason, you can create a parameter with the name specified in constant P_C_NAME_AREA_PARAM by specifying the name of this area to the function module. The value of this parameter is passed on to the function module in the interface as the value of the importing parameter I_AREA. Note that this technology can generally only by used for Basis InfoCubes and simple planning areas (not multi- planning areas or MultiProviders).
    You can create additional elementary parameters as long as the names do not correspond to the predefined names. The class automatically recognizes the additional parameters and transfers them to table IT_EXITP in the function modules.
    5. After you have activated the planning function type, you can create planning functions and fill the parameters accordingly.

  • How to pass multiple values to a single parameter in BW report URL

    Hi Experts,
    I am new to EP and learning .... i am stuck at one point where we need to pass multiple parameters to a BW report URL, this is the URL that we launch from BSP.... Suppose i have to pass different multiple values to a single parameter, how to do it....
    i m getting many answers to pass parameters to iviews, reports, but not specific to my case.. can u plz help me....
    Thanks in advance
    Priya Rai

    What is the prolem you are facing if you split the single date param as two parameters say startdate and enddate?
    If you pass as single string then you might have to split the same at reciever end.
    Are you trying any thing specific?

  • Assigning a timestamp to an Import Parameter in eCATT

    I am trying to assign a value to an Import parameter that will be unique every time the eCATT script runs.  I have inserted a piece of Inline ABAP code that looks like this:
    ABAP.
       DATA: BEGIN of wa,
          time_stamp TYPE P,
       END OF wa.
       GET TIME STAMP FIELD wa-time_stamp.
       I_DATETIME = wa-time_stamp.
    END ABAP.
    This only assigns a time stamp to I_DATETIME is the parameter is type V.  Unfortunately, the script produces an error unless I_DATETIME is type I, however the Inline ABAP produces a syntax error when I_DATETIME is type I. 
    For example, when I_DATETIME is type V I see in my
    LOG I_DATETIME statement that the value 20050518200719 or something similar has been assigned to that parameter.  However, in the SAPGUI command interface where I deleted the original number value and replaced it with parameter I_DATETIME it reads: Value = I_DATETIME = '
    Why can't I use parameters of type I and V interchangeably in the script and Inline ABAP?  Is there an easier way to go about getting a time stamp or unique value for an Import Parameter?
    Message was edited by: Ben Weisberg

    Ben,
    there are two issues here:
    <b>Parameter visibility in inline ABAP</b>
    In inline ABAP, <b>only</b> local variables (visibilty V) can be used. The reason for this was to minimize the amount of data that has to be transferred to the target system of the script when the inline ABAP is generated.
    <b>Avoiding inline ABAP where possible</b>
    You said yourself that you suspect your approach is inefficient. I always tell people that inline ABAP can be fun, using the eCATT script language is better
    You can generate yourself a timestamp in eCATT like this:
    First, declare a parameter with type C. Since you are going to fill it in the script, there is no need for it to be an importing parameter - local variable (V) will do - let's call it V_TIMESTAMP.
    Fill the field using <b>either</b>
    V_TIMESTAMP = &DATE & &TIME
    <b>or</b>
    V_TIMESTAMP = sy-datum & sy-uzeit
    <i>What's the difference?</i>
    If you use the eCATT variables &DATE and &TIME, you will always get the date and time of the <b>current target system</b>. If you use the ABAP system fields sy-datum and sy-uzeit, you will always get the date and time of the <b>local eCATT system</b>. Obviously, if you are working locally in a system, these two sets of values will be the same. However, if you start working remotely - possibly against app servers in different time zones - you will have to decide which you want to use.

  • Field symbol as import parameter in class method ???

    Hi everyone,
    is it possible to pass a field symbol as an import parameter to a method in a class? If yes, how do I define the data type of the import parameter? I'm trying to work with field symbols as the program doesn't know what kind of structure the program parameter p_srcdso has. Coding example would be something like this:
    PARAMETERS: p_srcdso TYPE rsdodsobject DEFAULT '/BIC/AKVI0001'.
    DATA: lr_srcpkg TYPE REF TO data.
    FIELD-SYMBOLS: <fs_table> TYPE ANY TABLE.
    CREATE DATA lr_srcpkg TYPE TABLE OF (p_srcdso).
    ASSIGN lr_srcpkg->* TO <fs_table>.
    SELECT *
    FROM (p_srcdso)
    INTO TABLE <fs_table>.
    CALL METHOD cl_ref->create_somethign
    EXPORTING
        i_source_package = <fs_table>.
    Thanks,
    Alex

    Halo Alexander,
    You can use TYPE REF TO DATA( say the parameter name is i_data) as the importing parameter of the method create_somethign and inside the method you need to dereference it using data reference variable again.
    data: dref type ref to data.
    field-symbols: <fs_table> type table.
    create data dref like i_data.
    assign dref->* to <fs_table>.
    Regards
    Arshad

  • Modify import parameter of FM

    I have a FM called during an SAP event. here, under a certain condition, i need to replace the old value of an import parameter.
    Can any one suggest some means to change the import parameter values of the FM.

    Hi Arindam,
    If you are using classes method in function module, yes u can do this. But you must use the field symbols.
    this is a sample..
    it_condition is import param.
    method set_new_values.
       data : ls_diffcond  type ztrm_s_vtbfinko_type,
              ls_condition type vtbefinko.
       data : lv_text type string.
       field-symbols : <fs_text> type any,
                       <fs_text2> type any,
                       <fs_condition> type vtbefinko.
       loop at gt_diffcond into ls_diffcond.
         if ls_diffcond-cond_type eq '+'.
           move-corresponding ls_diffcond to ls_condition.
           append ls_condition to it_condition.
         elseif ls_diffcond-cond_type eq '-'.
           move-corresponding ls_diffcond to ls_condition.
           delete it_condition from ls_condition.
         elseif ls_diffcond-cond_type eq 'C'.
           move-corresponding ls_diffcond to ls_condition.
           loop at it_condition assigning <fs_condition>
             where rkond    eq ls_condition-rkond and
                   dguel_kp eq ls_condition-dguel_kp..
             concatenate '<fs_condition>-' ls_diffcond-field_name into lv_text.
             assign (lv_text) to <fs_text>.
             concatenate 'ls_condition-' ls_diffcond-field_name into lv_text.
             assign (lv_text) to <fs_text2>.
             if <fs_text> is assigned.
               <fs_text> = <fs_text2>.
             endif.
             exit.
           endloop.
         endif.
       endloop.
    endmethod.

  • Passing a Context Node to a BAPI

    Hi All,
       I need to pass a Context Node(1...an) from a view to a BAPI Table parameter. We are able to pass import parameters one by one, but is there any way to pass the entire node at one go. Considering that the node may have some 100 fields.

    Pavan
    I assume that the context node in your view is mapped to corresponding context node in your controller.
    To pass the table parameter to the BAPI you need to do something as follows.
    public void Save_tabledata( ) /* mthod in controller */
    //@@begin Save_tabledata()
    ZSave_tabledata_Input obj1 = null;
    try
      obj1 = new ZSave_tabledata_Input();
      int size = wdContext.nodeZcontrollernode().size();
      for(int i=0;i<size;i++)
       ZControllerTable objtab = new ZControllerTable();
       WDCopyService.copyCorresponding(W dContext.nodeZcontrollernode().getZControllernodeElementAt(i),objtab);
       obj1.addRfctableparameter(objtab);     
      WdContext.nodeZSave_tabledata_Input().bind(obj1);
    /* bind other parameters of the RFC*/
      wdContext.currentZSave_tabledata_InputElement().modelObject().execute();
    The idea is to fill the RFC table parameter by looping at the node in the controller and then bind this to the RFC parameter.
    In order to copy the elements the structures of the temp structure and the RFC table parameter structure should be identical. Also use WDcopyservice for faster performance.
    Let me know whether this helps.

Maybe you are looking for