Skip to Content
author's profile photo Former Member
Former Member

Execute 3 bapis and manipulate data ?


I have made some webdynpro examples with easy functionality: execute 1 bapi and show results in a table.

Now I need to do real things: execute the first bapi, read a value from a field and put it in a variable, then execute the 2nd. bapi with that parameter (variable), and so forth.. =(

Anybody could give me a clue ? some general steps, or code,etc.

I really appreciate your help !!!!

Thanks and regards from Mexico ! =)


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 05, 2004 at 12:36 PM

    Hi Diego,

    as far as I understand you problem, you can just execute the first BAPI, then you will have the result values in the according context elements. From there you can retrieve them and use them to call the next BAPI.

    Is this what you mean?



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2005 at 06:14 AM


    To pass an input to a BAPI you need to do the following

    If the proxies generated while importing your Model are say "Bapi_Input" and "Bapi_Output"

    Code Snippet :

    Bapi_Input inp = new Bapi_Input();

    //Bind input to the model


    //Set Parameter Name


    After binding the Input to the Model we need to use the instance object "inp" in our case and then use the set<Parameter> method.

    II . Passing input to a BAPI containing a Structure

    If your Import Parameters to the BAPI are in the form of a Structure then you will have a separate proxy class generated for that Structure when you import the model.

    In that case we need to instantiate that class and then set the Parameter values.

    Say if the Structure name is "ZStruct", the proxy class generated would be "ZStruct".We can then instantiate the structure as shown.

    ZStruct s = new ZStruct();

    //Set the Parameter name


    Then add the Structure back to the input instance that was bound.


    Hope that gives you some understanding on how to pass values to the BAPI.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      I am not quite understand executing the BAPI for n number of times.

      I built an example, where it retrieves orders from SAP using a BAPI. For each click on order by the user, it calls second BAPI to retrieve order details. The number of times BAPI executed depends on the number of times user chooses order (different order).

      In case you have to call a BAPI n number of times to retrieve all the data once, I may create a bespoke RFC and calling BAPI and storing the information in a table. Finally I can get the results through export.

      The above way, I am calling BAPI only once from WD side and within R/3 it loops through the number of times the BAPI is requested.

      Can you explain once again your case.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.