Designing the scenario of multiple BAPI call in a loop in BPM

All,
I need some help in designing this scenario. I do not have the luxury to write a custom BAPI. Here is my scenario. A typical async>sync>async with little modification
1. Async call to BPM with input payload
2. BPM calla BAPI_SALESORDER_GETLIST with customer number and sales organization from input payload and returns a list sales order items (Sync)
3. I need to call the BAPI_SALESORDER_GETSTATUS for each sales order number that I got from the first call (Sync?). Not sure how this has to be designed
4. Transfer the  data through HTTP adapter (Async)
I am able to perform step 1, 2 and 4 (of course only line item data). I need some pointer help on how to incorporate it in step 3 of BPM.

3. I need to call the BAPI_SALESORDER_GETSTATUS for each sales order number that I got from the first call (Sync?). Not sure how this has to be designed
for this the BPM should have a block after the Sync send.......in the block have your send step....the mode of the block will be ForEach....
Check this blog for more info: /people/milan.thaker/blog/2008/08/05/modes-in-block-step-of-bpm
Check this similar example from help: http://help.sap.com/saphelp_nw70/helpdata/en/11/13283fd0ca8443e10000000a114084/content.htm
Edited by: abhishek salvi on Jul 1, 2009 10:57 AM

Similar Messages

  • Multiple BAPI calls in RFC Adapter

    Hi, Dear Friends!
    I have asynchronous scenario File to RFC(BAPI).
    File contains raws. For each raw I need to execute BAPI.
    With the help of each raw I need to construct one document in R/3 database with the help of BAPI.
    But now my scenario provide only one document (only one BAPI is executed).
    I read file to xml structure. This structure contains elements. The elements represent raws of file. But BAPI is executed only for the first element.
    How to explain to XI that I want it impement BAPI <b>N times</b> - as number of raws in file (or elements in xml structure).
    So how to implement multiple BAPI calls. Have you any idea?
    Thank you in advance.
    Natalia Maslova.

    Hi Natalia
    have a look on these links
    http://help.sap.com/saphelp_nw04/helpdata/en/43/b46c4253c111d395fa00a0c94260a5/frameset.htm
    Best Design : for a SOAP -XI - BAPI ( Multiple )
    Re: RFC adapter...How it handles multiple calls...
    Re: Multiple BAPIs and COMMIT in BPM
    Re: Is it possible to compose XML in BPM from responses of multiple BAPI calls?
    Multiple BAPI calls in RFC Adapter
    may be helpful
    Thanks !!!

  • Can we design the scenario with Business service

    Hi,
    I have IDOCXIFile Scenario
    Can we design the scenario with Business service for SAP R/3 and As well as for File system also????
    I dont have details abt the SAP R/3 system to create the Tech system in SLD
    Regards
    Suman

    Hello Suman,
    Go through this Blog..
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    These are the steps which u have to do
    STEPS IN DESIGN
    1. Import idoc from the SAP System (SAP02) through imported objects.
    2. Create Data Type, Message Type, Message Interface for the Outbound File.
    3. Create Message Mapping with file Message and idoc (Matmas04)
    5.Create Interface mapping between File Interface and the idoc.
    Steps to be followed in Creation of Technical and Business System
    Technical System
    In SLD, click on technical landscape->New Technical System->WebAS ABAP.
    Business System.
    1.Goto Business Landscape->New Business System->Name the business system.
    2. Choose the technical system that needs to be attached->WebAS ABAP->Technical System Name.
    Preconfiguration steps for transfer of data to IDOCS
    1.Create a RFC Destination in SM59 of XI Server of type.
    2.In transaction IDX1 ,create a port for the client of XI server.
    3. The port has to be displayed in the idx2 transaction and we should be able to view the idoc’s which we imported through integration repository.
    Steps in Configuration
    1. Goto service without party, right click->Assign a business system.
    2. Choose the business system to be added.
    3. Create a File Sender Service with communication channel for the same.
    4. Create an idoc receiver channel under the business system.
    7. The Idoc type( which data is to be written) is mentioned as inbound parameter.
    8. Mention the logical Name in the Service->Adapter Specific Parameters of both the File Sender Service as well as the business system.
    9. Make the Sender Agreement for theFile Sender with communication channel.
    10.Create the Receiver Determination and Interface Determination for the business system.
    11.Create the Receiver Agreement for the Business system.
    Step for Configuration fo IDOC in R/3
    SM59-rfc destination
    IDX1-port
    IDX2-load metadata
    we05-IDoc status records
    BD54-Create Partner Number
    We20-Create Partner Profile
    WE19-Testing IDoc Processing
    Do these configurations in R/3 and in XI...
    SAP XI
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (IDX1)
    a) Select create new button
    b) Enter the port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Load Meta Data for IDOC (IDX2)
    a) Create new
    b) IDOC Message Type
    c) Enter port created in IDX1.
    SAP R/3
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (We21)
    a) First Select Transactional RFC and then click create button
    b) Enter the destination port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Create Partner Profile (WE20)
    a) Create New
    b) Create the Partner no. name as same the logical system name of the destination system.
    c) Select Partner type LS
    d) Enter details for Type: US/USER, Agent, and Lang.
    e) Click on the + button to select the message type.
    f) Select Partner no. and LS which ever create above.
    g) Select Message type
    h) Select Process code related to the Message type.
    I) save.
    Reward Points if it is useful..
    Thanks,
    Satya Kumar

  • The returned value of BAPI call

    Hi, experts,
    I have a question about returned value of BAPI call.
    when the returned value is mapped as an attribute and this return value itsself is of the type: table of a certain structure. Is there any possibility that the value of this table still can be extracted from the mapped attribute? If it is possible, how?
    If not, how should this kind of situation be handled:
    when the returned value of the function at the backend has more one layer structure?
    Thanks and best regards,
    Fan

    In my experience you shouldn't use the service wizard to generate the context of such deeply nested structures. They don't generate or map correctly because it tries to put the table type as the type of the context attribute.
    Instead you should propery model the relationship in the context using nested nodes. Here is an example of address <-> address text where you can have multiple address texts per address.  From the service this was a returned nested table.
    ****BP Address and Address Text
      data lo_nd_bp_addr type ref to if_wd_context_node.
      data lo_nd_bp_addr_text type ref to if_wd_context_node.
      data lo_el_bp_addr type ref to if_wd_context_element.
    * navigate from <CONTEXT> to <BP_ADDR> via lead selection
      lo_nd_bp_addr = wd_context->get_child_node( name = wd_this->wdctx_bp_addr ).
      lo_nd_bp_addr->bind_table( wd_this->gt_bp_addr ).
    ****Add the Address Text Table as Child of each Address Context Record
      data element_set type wdr_context_element_set.
      field-symbols <wa_set> like line of element_set.
      field-symbols <wa_bp_addr> like line of wd_this->gt_bp_addr.
      element_set = lo_nd_bp_addr->get_elements( ).
      loop at element_set assigning <wa_set>.
        read table wd_this->gt_bp_addr index sy-tabix assigning <wa_bp_addr>.
        lo_nd_bp_addr_text = <wa_set>->get_child_node( name = if_componentcontroller=>wdctx_bp_addr_text ).
        lo_nd_bp_addr_text->bind_table( <wa_bp_addr>-t_text ).
      endloop.

  • Is it possible to compose XML in BPM from responses of multiple BAPI calls?

    Hi guys!
    I want to send into BPM an XML document, which will be parsed and it will call some BAPIs more times. And I need to get response. Is it possible, to compose an XML document from these BAPI return codes to be sent back as response? Concretely I will use SOAP->XI->SAP and response SAP->XI->SOAP...  I will use it as asynchronous call..
    Thanx, Peter
    Message was edited by: Peter Jarsunek

    Hi Peter,
    It depends:
    - what kind of bapi is it? (does it have some sort of number?) like delivery number or something else?
    if not you'll have to add something
    so you can correlate your bapi with bapi response
    if you want to know which response corresponds to which bapi call
    but you can do it with a bapi wrapper
    >>>>Is it possible, to compose an XML document from these BAPI return codes to be sent back as response?
    you you can collect message in a BPM - standard pattern
    (but remember about the "correlation")
    Regards,
    michal

  • Suppress the Information message during BAPI Call

    Hi, I am getting the information message pop up during the BAPI Call "BAPI_BUS2054_CREATE_MULTI". Is there any possiblity to suppress the message?

    Hi,
    use call function with destination. Here is a short example:
    REPORT  zhabitest.
    DATA:
      et_return LIKE bapiret2 OCCURS 0.
      CALL FUNCTION 'ZTEST'
        DESTINATION 'NONE'
        TABLES
          et_return = et_return.
    DATA:
      ele_return LIKE bapiret2,
      rc LIKE sy-subrc.
    CLEAR rc.
    LOOP AT et_return INTO ele_return.
      IF ( ele_return-type = 'E' )     "error
         OR ( ele_return-type = 'A' ). "abort
        rc = 8.
        EXIT.
      ENDIF.
    ENDLOOP.
    IF rc IS INITIAL.
      WRITE: / 'Call OK'.
    ELSE.
      WRITE: / 'Call error'.
    ENDIF.
    And the function is here:
    FUNCTION ztest.
    *"*"Lokale Schnittstelle:
    *"  TABLES
    *"      ET_RETURN STRUCTURE  BAPIRET2 OPTIONAL
      MESSAGE i208(00) WITH 'Separate I/O and processing!'.
      GET TIME.
      DATA:
        ele_return TYPE bapiret2.
    * return error randomly
      IF sy-uzeit+5(1) CA '13579'.
        ele_return-type = 'E'.
        APPEND ele_return TO et_return.
      ENDIF.
    ENDFUNCTION.
    Pay attention to the documentation of call with destination (db commit).
    Regards
    Walter Habich

  • Need help in design the scenario sending data to web service

    Hello All,
    I need to send data to web service and get the response back.
    i want to use HTTP to soap Scenario.Please let me know the necessary steps in the scenario.
    Thanks and Regards,
    Chinna

    Hi Chinna,
    > i want to use HTTP to soap Scenario.Please let me know the necessary steps in the scenario.
    Split this into 2 scenarios
    1. HTTP to SOAP (Request) treated as Asynchronous.
    2. SOAP to HTTP (Responce) treated as Asynchronous.
    For HTTP to SOAP synchronous scenario
    Here the receiver side request and responce structures no need to create, the receiver client will provide you the XSD file, on that XSD file having the request and responce message structures, so you have to import that to XI server as External definition.
    For sender HTTP you have to create 2 data types, 2 message types as well as 2 message interfaces, 2 message mappings for request and responce messages and 2 service/Message interfaces (HTTP is outbound and SOAP is inbound).
    Configuration objects are same.
    Regards
    Ramesh

  • Using transactions in a scenario where multiple function calls are involved

    I have a scenario and was contemplating on how to implement transactions.
    I have a method A in the BO that calls the main functionB that updates the DB. This second function B inturn calls other functions.
    Each of these functions have their own connection objects. I was thinking how to implement transactions in this scenario.
    Thanks,
    Sree

    I have a scenario and was contemplating on how to
    implement transactions.
    I have a method A in the BO that calls the main
    functionB that updates the DB. This second function B
    inturn calls other functions.
    Each of these functions have their own connection
    objects. I was thinking how to implement transactions
    in this scenario.That's the problem: "Each of these functions have their own connection objects".
    Either you'll need to use XA drivers and JTA two-phase commit or have a single Connection that is instantiated by the service that knows about the unit of work and passes it around to all the interested parties.
    I'd recommend one Connection to be passed around.
    %

  • How to design the scenario? i have process files sequentially with timegap

    Hi Folks,
    I am really looking for one requirement like, Sender file adapter has to pick multiple files by file name based with some time gap? Can we?normally i am getting 40 files in the source directory with some time gap like 1hr and 2 hours.but my in some situations like system got down and if the server stopped for some refresh work then 2 days files will come to source directory and after system is sap pi try to process files at a time but the source side can,t process more than 4 files at a time
    in tht case the messages are not processed they are in schedule mode only.
    I have got one BPM in this, I have tried with Process mode : Name and Date, with wait step on BPM, but no use. The way how PI behaving, if 40 files in file directory, it is picking all files in one shot. Start processing but not in order. if it is process also the SNC system can't process 4 at time.it will process files with some time gap.
    The problem is on Receiver system side. The receiver system is SNC system, if old data receives later than earlier date data; we get data obsolete application error.
    Ex: If I receive 25th and 26th files, first I need to process 25th first on PI sends to SNC, I need to give some time gap and pick another file or even PI picks and process 26th file, no problem but I need to give some time gap to send SNC to this 26th date file?
    Please how guys, throw me your great ideas
    Thanks in advance!!
    Regards
    SG

    Hi Seshagiri,
    first problem is to process the files sequentially by XI- Is it posiible to put a sequence number at end of each file as its last line? This number you can process within XI and hold on messages in a container unless all files with lower sequence number has already been processed thus you can also prevent receiver SNC system to receive files out of order. The sequence number has to be put before posting the file in XI.
    regards
    Anupam
    Edited by: anupamsap on Nov 25, 2010 7:48 AM

  • Problem with mutiple BAPI calls during the commit

    Hi all,
    I am trying to create accounts for a given partner i the transaction F9K1 using the BAPI BAPI_BKK_ACCNT_CREATE. After calling the BAPI I am committing it too.
    The problem is if I try to create multiple accounts like RCA, ACA, MCA, IOE and so on, the first time the BAPI is called to create RCA account it is successful an it is even committing. When I call the BAPI to create the the ACA account the return table from the BAPI shows success message but the commit fails. If I restart the program and try creation of accounts now the RCA will throw a error msg saying account already exist, ACA account will be created and then the MCA account creation fails in the same manner explained above.
    I see the issue is with multiple BAPI calls and I tried using all sort of methods like clearing buffers, start new task in local and wait command and all.  But none of them seems to be working for me.
    Can anyone please guide me on how I can overcome this problem.
    Thanks.

    BAPI :
    BAPI BAPI_BKK_ACCNT_CREATE
    Functionality
    Use this method to create an account in Bank Customer Accounts. This method returns the following values:
    Identification details for the newly created account such as the internal and the external account number, and the bank area details
    A table containing error messages
    To create an account by using this method, you must specify values for the import parameters Bank Area (BANKAREA) and Product (PRODUCTNAME).
    Note: You must also specify a value in the External Account Number (EXTERNALACCOUNTNR) parameter if you have defined an external number range for the bank .
    REgards,
    Jayan.

  • BAPI call from Process Chain

    Hi,
    in our system , a Program runs everyday in R3 system to fill the customized delta tables and we run the process chain to load the data in BW from Delta tables in R3 system.But problem in the above scenario, after completion of R3 Job in R3 system the BW system does not aware of R3 job status so we have schedule the process chain in such a way that the process chain start after 2 Hours of completion of R3 jobs.
    to overcome this, i need to implement either of the below requirement.
    a BAPI call so that the R3 job can be triggered from BW from a process chain, and then the BW metachains can start once it is finished.
    Or
    we are using a ABAP program in R3 system to fill Delta table. So at the end of the ABAP code, send an RFC message to BW, which can trigger a job in BW which will start 1 meta chain.
    please tell me which is the better option and how can i
    Regards
    Atul

    hi
    i have tried below logic in R3 side
    Create a Customized FM with Remote Enabled in BW system
    call that FM with RFC destination and Event name as Export parameter from a ABAP program in R3 Side
    i have given the Event name in Variant  as same as i have created in BW system SM62
    when i had run the Program in R3 side the program run successfully but the process chain did not run in BW system.
    please let me know what is the reason behind this.
    below code i have written in ABAP program in R3 side
    parameters: rfcdest like rfcdisplay-rfcdest,
                zevent type char32.
    CALL FUNCTION 'Z999B_CB_F_EVENTRAISE' destination rfcdest
      EXPORTING
        EVENTID                      =  ZEVENT
    EXCEPTIONS
       BAD_EVENTID                  = 1
       EVENTID_DOES_NOT_EXIST       = 2
       EVENTID_MISSING              = 3
       RAISE_FAILED                 = 4
       OTHERS                       = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Below FM i have developed in BW system with Remote Enabled in Attribute tab page of  FM.
    FUNCTION Z999B_CB_F_EVENTRAISE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(EVENTID) TYPE  CHAR32
    CALL FUNCTION 'BP_EVENT_RAISE'
      EXPORTING
        eventid                      = eventid
      EVENTPARM                    = ' '
      TARGET_INSTANCE              = ' '
    EXCEPTIONS
       BAD_EVENTID                  = 1
       EVENTID_DOES_NOT_EXIST       = 2
       EVENTID_MISSING              = 3
       RAISE_FAILED                 = 4
       OTHERS                       = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFUNCTION.
    Regards
    Atul

  • Session between multiple Webservice calls from PI7.0

    Hello XI SDNers,
    I am unable to overcome my Webservice session problem using SOAP (Axis) adapter. My scenario is as follows:
    I am calling a external Webservice deployed in Axis webservice engine from PI7.0, during my first call:  I call synchronous "Login" webservice and I became the response "User is Logged in"
    during my second synchronous call "GetItem", the webservice returns "The user doesn't have valid session". The two synchronous calls are executed from same scenario one after another!
    I lost my session after the "Login". Is there any way in PI 7.0 to maintain the session?
    Note: I tried the same scenario using XML SPY SOAP client, it is working!!!  it is maintaining the session between multiple webservice calls.
    Is there any suggestions to overcome this problem?
    Thanks and regards,
    Satish.

    Hi Satish,
       We are working on the same sort of scenarios, where we have to call more than one webservice in a sequential fashion using the same session id details.
        What we did was we built new xsds adding session details node using the webserive request and response xsds. And we are maintaining a sessions table which contains session id and  status fields in PI. So we send webservice request with the session id details. We wrote an UDF to get the session details from PI and set the status field as busy so that no other request uses the same session details.
       Webserive response again contains the sessions details which can be used for the next webservice request.
      Finally after all the calls set back the status to Active in PI table.
    Webservice Calls From a User Defined Function
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Hope this helps.
    Thanks,
    Vijaya.

  • Keep alive a session between 2 BAPI calls

    Hi -
    I am calling several BAPIs to maintain data. I am calling from an outside system as I published the BAPIs as Web Services.
    I would like that the session between 2 BAPI calls is kept, so I don't miss some session info between call #1 and call #2.
    Anyone knows a way of keeping alive a session between 2 BAPI calls?
    Thanks !

    Try this..
    <b>ARFC with Resource Management (Parallel Remote Function Call)</b>
    CALL FUNCTION 'MYFUNC'
    STARTING NEW TASK 'T1'
    DESTINATION IN GROUP 'PRFC'
    EXPORTING ...
    TABLES ...
    EXCEPTIONS ...
    communication_failure = 100
    system_failure = 101
    resource_failure = 200.
    IF sy-subrc= 102.
    wait and retry...
    ENDIF.
    <b>Define ‘PRFC’via RZ12</b>
    Amandeep

  • Minimal Authentication for BAPI calls

    Hi,
    We use SAP Jco Library to connect SAP systems in our applications. Within the aplication we make BAPI calls to the SAP system for various operations. A typical BAPI calls we make are BAPI_DOCUMENT_CREATE, BAPI_DOCUMENT_GETLIST, BAPI_EQUI_GETLIST etc.
    For these BAPI calls it is must that the user needs SAP_ALL and SAP_NEW profile added to his profile. I would be interested to know what is the minimal profile the user needs to make these BAPI calls?
    Is there a document/link which talks about the minimum roles\profile needed for different BAPI calls byt the user.
    Regards,
    Naveen

    there's a couple of notes on that:
    [452508|https://service.sap.com/sap/support/notes/452508] describes RFC-connects coming from a portal.
    [129795|https://service.sap.com/sap/support/notes/129795] does the same for connect via Session Manager
    ... there are a couple of others - a quick search in SMP will reveal the others.
    as for your BAPIs: obviously you will need the authorizations for whatever the BAPI wants - some BAPI's require transaction code, several organisational values - e. g. creating CS-orders uses most of the I_* objects as well as the t-code for IW31.
    But that is about all - you do not need SAP_ALL and/or SAP_NEW - in fact: try to avoid it - reduce the RFC-users to what they need and no more. Keep to using BAPIs for your development, as they are much more trustworthy (securitywise) than other RFC-FM's/methods.
    In the SDN security forum are some sticky threads where you might find additional information in that direction. Its worth a look, Julius goes to great length of pain to make them interesting.

  • Best Design : for a SOAP -XI - BAPI ( Multiple )

    Hi all,
    Need your suggestion on best design to implement a SOAP -XI - BAPI ( Multiple calls ) scenario.
    NON SAP Application will make a SOAP service call to XI. This service need to call 2 BAPI's ( 1st call to get some reqd params for second BAPI call ). Also secon call need a commit.
    Whats the best design :
    1. ABAP server proxy
    2. BPM ( to handle multiple calls )
    Thanks and cheers,
    Anisha.

    <b>>>>>>( 1st call to get some reqd params for second BAPI call ). Also secon call need a commit.</b>
    <i><u>1. ABAP server proxy</u></i>
    Here u can have explicit coding and have better control over the process interms u will call the first bapi and the result of it will be passed to exporting parameter of the second bapi as required.
    <u><i>2. BPM ( to handle multiple calls )</i></u>
    performance hinders as pointed out.

Maybe you are looking for

  • How does presentation server cache shared by users and roles in OBIEE 11.1.1.6.7

    We are running through a scenario where user1 is assigned to role1 and run a report and after couple minutes user1 is assigned to role2 and run the same report, in 2nd run i see an error in saw log, even though there is presentation server cache that

  • Playing music from external hard drive, iTunes

    Hello all, After years of wanting to own a MacBook Pro, I finally have one.  This is the first Mac computer that I have owned so I am still new to everything.  One issue that I  am having is an issue that I have had over the years on Windows, that al

  • Confusing Service Control in Workshop Tutorial

    When you are adding a Service Control, Workshop Tutorial recommends to drug-and-drop the control descriptor – the .ctrl file from another project – onto your Service Component in the Design View. This operation confuses me because it contradicts the

  • Bridge Freezes when Show Items From Sub Folders

    Hi all. I am trying to create a portfolio of past works. Using Adobe Bridge and Show Items From Sub Folders makes it easy to go through thousands of files. One major problem though; Bridge is not stable. When I try to view a folder with thousands of

  • Error ID = -199

    When trying to open one particular Digital Performer file I get the following message: An error occurred while reading from disk The file ... was not loaded ID = -199 I know this is a mapReadErr but I want to know if there is a solution so that I can