Fill Multiline container from multi records in source XML ?

Hi,
scenario: File-XI-RFC-File(BPM).
Read company id from source file, call BAPI(company_get_detail) using RFC receiver adapter and then write response to another file.
This works fine for one record(one RFC call to BAPI) using the BPM.
Now, I would like to implement the process for multiple records using block(forEach) to make multiple RFC calls in BPM.
<i>I understand that i have to create multiline container and map 1:n from input xml into that container.</i>  I need help here.
BPM Steps:
<b>Receive source file - fill multicontainer ?</b>
Open block step (forEach)
   send sync RFC call
   save Response in another multiline container
close block
send step - write response to file(receiver)
file structure:
<ns0:MT_compRqst_multi xmlns:ns0="http://abc.com/FileToRFCBPM">
   <DT_record>
      <companyID>000001</companyID>
   </DT_record>
   <DT_record>
      <companyID>000002</companyID>
   </DT_record>
</ns0:MT_compRqst_multi>

Hi -
For your requirement, as Bill implied, you need a multi-mapping (Transformation step) that maps your single message with multiple records to multiple, <i>complete</i> messages with one record each. 
To get you started, basically, for the multi-mapping, create a message mapping with your source and target MTs the same (as the one you posted).    Then in "Messages" tab, for your Target message, change the occurance to "0..unbounded".   Now if you go back to the "Design" tab, you see that both your source and target messages have a "Messages/Messages1" wrapper around them.  In the end, the target message would look like the following and would correspond to your multi-line container element:
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
        <ns0:MT_compRqst_multi xmlns:ns0="http://abc.com/FileToRFCBPM">
            <DT_record>
                <companyID>000001</companyID>
            </DT_record>
        </ns0:MT_compRqst_multi>
        <ns0:MT_compRqst_multi xmlns:ns0="http://abc.com/FileToRFCBPM">
            <DT_record>
                <companyID>000002</companyID>
            </DT_record>
        </ns0:MT_compRqst_multi>
    </ns0:Message1>
</ns0:Messages>
You'll need further steps - Interface Mapping, ccBPM (Transformation step, adjusting your Block settings, container element for multi-line element, etc.).   There are some blogs on multi-mapping within ccBPM that will help you - just do a search.
Note that if your scenario has a large number of records, this approach is not performance friendly.
Regards,
Jin

Similar Messages

  • Updating data from multi record blocks and database

    Hi
    when the user presses a button, records are retrieved from the database and put into multi record item. User can change the data that is retrieved from the database by pushing update button.I tried this code inside update button but it isnt working...
    Begin
    go_block('PRODUCTS');
    first_record;
    LOOP
    update products
    set PRODUCTS.PRODUCT_ID=:PRODUCTS.PRODUCT_ID
    where PRODUCTS.PRODUCT_ID=:CUSTOMER.CUSTOMER_ID;
    exit when :system.last_record = 'TRUE';
    next_record;
    END LOOP;
    forms_ddl('commit');
    clear_block(no_validate);
    End;

    Hi
    when the user presses a button, records are retrieved
    from the database and put into multi record item.
    User can change the data that is retrieved from the
    database by pushing update button.I tried this code
    inside update button but it isnt working...
    Begin
    go_block('PRODUCTS');
    first_record;
    LOOP
    update products
    set PRODUCTS.PRODUCT_ID=:PRODUCTS.PRODUCT_ID
    where PRODUCTS.PRODUCT_ID=:CUSTOMER.CUSTOMER_ID;
    exit when :system.last_record = 'TRUE';
    next_record;
    END LOOP;
    forms_ddl('commit');
    clear_block(no_validate);
    End;Are you getting an error?, what is it that it isn't working?
    One thing you need to understand about the basics of a block:
    If it is a block based on a database table you do not need an external INSERT/UPDATE/DELETE statements from a button or anything.
    Users can change the data retrieved from the database and just press save (which includes only commit_form built in).

  • Multiline container element in workflow

    Dear all,
    I am using a multiline container element in workflow container.  Can anybody suggest how I can see the values of that element?  After workflow execution is COMPLETED and I go to SWI1, it shows only simple elements.  It doesn't show any of my multiline elements.
    Please help.
    Thanks in advance,
    Regards,
    Pranav.

    Hi Pranav,
    It does work in 6.20. I am not sure about 4.6C.
    Display Technical Details from the Workflow log for your WF instance. You can examine the Container values for each of the steps. See if the values show up (are you certain your multiline container has been populated?). If you are populating the multiline container from an object method, verify by testing your object method that the parameter are correctly defined and it is getting populated.

  • Multiline Container

    Hi All,
    I have a requirement where i have to pass a multiline container from a BO method to workflow. I created an export parameter and also i select option "multiline" also. But i am not getting the syntax "how to export it".
       SWC_SET_TABLE CONTAINER 't_container[]' ACCOUNT_ID.
    t_container[] is a container that i declare in the BO method, and Account_id is the export parameter.
    please reply if anyone has any idea.
    Thanks & Regards.
    Raman.

    Hi Raman,
    U r doing little wrong in your last statement.
    SWC_SET_TABLE CONTAINER 't_container[]' ACCOUNT_ID.
    The correct one wil be :
    *SWC_SET_TABLE CONTAINER  'ACCOUNT_ID'  t_container[].
    To overcome this confusion and error ...always follow below steps while creating method with export or import parameters.
    1> create method ztest
    2> Now go to parmeters and create export or import parametrs as per ur requirement...i.e zvar1 (multiline)
    3> Click on PROGRAM buttom to geenrate template for this method.
    4> U will see for all the import and export parameters given by  u ....the macro and data decalartion is automatically generated.
    5> In my case it would display code like..
    data: ZVAR TYPE WFCS_IMELD-MSGNR OCCURS 0.-------> same type given by u in export parameters
         SWC_SET_TABLE CONTAINER 'zvar1' zvar1.----> here variable under quotes id from *export parameter*                                                                               
    and other zvar1 without quotes u can replace from BO side varibale                                                                               
    to pass data.

  • How to pass values one by one from Multiline container in workflows

    Hi,
    I have used a structure in my workflow as multiline container.
    I want to pass values 1 by 1 to the workflow but not all the three values..so how do i pass the values 1 by 1 rather all at a time..
    kindly suggest me
    Thanks,
    Shanky

    Hi,
    Create a new container with type I and set the initial value as 1.  EX : Index.
    Pass your Multi-line container and this index container to a new method. Get the multi line container data's into an internal table
    and read the data based on the index and append the data's to a new multiline container.
    Second time increment the index container by 1. So now the value of index container will be 2.
    Pass the multiline container value and index to method. now it will read the second record from the internal table.
    Call the method using the loop step type.
    Thanks,
    Viji.

  • How to call a report with a bind variable from a multi-record block

    Hi,
    I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
    My SQL Query has 2 bind variables.
    I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
    I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
    I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
    It seems it does not work as my report stays empty. (also XML file stays empty).
    Am I trying the wrong way?
    Thanks for any advice,
    Kris

    hi khadeer,
         create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name  and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
    i think this solves ur problem...
    any queries revert back..
    pls reward points if helpful,
    shylaja

  • Writing waveforms from Ch. 0 of niSCOPE to binary file in a multi-record setup?

    Hello,
    I am not very experienced with niSCOPE and writing waveform records, so I need some expert help here.
    Here is my application:
    I am generating a pulse train using a 6602 counter/timer. Each rising edge of this pulse train triggers an niFGEN to generate a single sawtooth waveform output to another device and, at the same time, acquiring data from Ch. 0 of an niSCOPE. I am fetching one record per rising edge of the pulse train for the niSCOPE (multi-record setup).
    The attached VI is where I am at thus far. All triggering and reading/fetching of the waveforms seems to be working just fine when testing with an oscilloscope. I now need to save each waveform record along with the timestamp of its rising edge trigger to a binary file. The bottom of the VI is where my attempt is at saving the waveforms to a binary file, so the attention should be there when looking at it.
    I am running LabVIEW from a computer connected to the NI PXI-Chassis using a cross-over cable.
    Questions:
    1.) Do I need to convert the data coming in on Ch. 0 of the niSCOPE to digital? Does it come in as analog from an oscilloscope? If I need to do this, how can I accomplish this?
    2.) When I try to run an example VI to write a waveform to a binary file by choosing "My Computer" in the bottom left of the VI window, it works it saves the file just fine. When I change this to run on "PXI2", a file is not even created and I get an error on File Dialog (code# 7, I think) each time the file is attempted to be closed. This may be a stupid question, but why can I not save data to a file on my computer if running the VI on "PXI2"?
    3.) Assuming the saving of each waveform to a binary file is working (read: (2) is successfully addressed), how can I also write the timestamp of the starting trigger for the waveform along with the waveform in the binary file? An example VI of how I can accomplish this would be fantastic, but I haven't been able to find one thus far.
    4.) When I was messing around and trying to accomplish this, it seemed that doing this writing may slow down the entire process too much. I need to record data to the extent of the sawtooth waveform generated by the niFGEN AWG for each trigger. Is there any changes I should make to my acquisition process in the niSCOPE section so that I can read each waveform, along with keeping the timestamp for each, and write this information to a binary file?
    I need to get this working quickly, so any help on this is greatly appreciated. Thanks in advance.
    Attachments:
    5124_update.vi ‏157 KB

    Thank you so much for your reply, David. Let me try and explain my
    situation and setup a little better, as well as discuss the points you
    made in your reply. Beware, you may want to refill your coffee as this
    post is long .
    I am using an embedded controller in a PXI-1044 chassis. I now have the
    chassis hooked up to our local network, and I am deploying my project
    to the chassis over the network as I am also connected to the local
    network. I have an oscilloscope next to me that takes as input the
    pulse train for a trigger and the generated sawtooth from the niFGEN
    for each trigger (rising edge of the pulse train from the 6602
    counter). Just to make sure synchronization is taking place, the
    sawtooth is also fed as input to the niSCOPE for acquisition.
    "PXI2" is what shows up when I choose to run a VI on the PXI chassis
    rather than "My Computer"; not sure why the 2 is there either, but that
    is what it says. I may have tracked down the issue I was having with
    writing, but more about that a little later...
    The attached VI is an update, although not much has changed. My
    application design is like this (keep in mind that some values for VI's
    are still constants in the block diagram while others are controls on
    the front panel): I am using the 6602 to generate a 1 KHz pulse train
    and routing this pulse train to PXI_Trigger0/RTSI0. I am also using the
    PXI_Clock (10) as a sample clock for this, and also using this same
    clock as the reference clock for both the 5422 and the 5124 (as per the
    synchronization help file mentioned for synchronizing multiple
    devices). Both the 5422 and the 5124 are triggered by a digital rising
    edge (from the pulse train) on PXI_Trigger0/RTSI0 (as it was routed
    there). For each trigger, the niFGEN generates a sawtooth waveform
    using a stepped trigger mode and outputs it. For each trigger, the
    niSCOPE acquires data. They are both synchronous, which is tough to see
    since one has its trigger source on the front panel and the other has
    its trigger source on the block diagram. All devices use PXI_Clock so
    they are synchronized.
    The expected behavior is to only generate a single sawtooth waveform
    per trigger with a certain number of sample points. I want to acquire
    the same number of samples using the niSCOPE, which is what I meant by
    "the extent of the waveform" in my previous post. So, should I change
    the 8192 to 1000 for the number of samples for the niSCOPE? What would
    you recommend for the sampling rate? I have been using 5 MHz for the
    niFGEN and 5 MHz for the niSCOPE...this is how it should be done,
    correct? If it is different in the VI, please let me know. For some
    reason, I have to adjust all of the values each time I open it since
    the default values are not the ones I want.
    I want to generate and acquire one waveform per trigger (one waveform
    per record). However, I want to be able to record a large number of
    records so I have enabled the circular buffer-like treatment of the
    acquired waveforms. The 100 or 1000 records is actually just a number I
    am giving it for now to make sure it is working before recording many
    more records.
    As for saving the niSCOPE data, I would like to save all data in a
    single file that is NOT ascii (to save space). I have been looking at
    the HWS file format, and would like to use it. I think the attached VI
    includes this at the bottom of the while loop. For each trigger, I
    would like to save the time (as accurate as possible) that the trigger
    occurred for the record/waveform, which appears to be (absoluteInitialX
    - relativeInitialX) as you said in your post (thanks!). I just need to
    store as much information about the waveform and time information for
    it as possible with the waveform in the file. So it looks like I will
    need to use the wfm info for that information, providing portions of it
    as waveform attributes in the HWS VI's?
    What format of data do you recommend I fetch, and will I be fetching a
    "Single waveform" or "Multiple waveforms"? Should I use I32, DBL, WDT,
    or other for the format? A balance between good precision in values and
    time it takes to fetch/record would be best.
    Given all of the above, I am having one troube with saving data to a
    file. As a reminder, I am deploying the project to the chassis over the
    network. When I choose a location and/or file to save the HWS data to,
    I only get choices that are on the PC's hard disk (such as C:\Documents
    and Settings\cgifford\...) NOT the chassis's hard disk. When I choose
    something other than "C:\" I get an error that the file could not be
    opened. However, when I choose "C:\" everything goes fine. The saved
    data is nowhere to be found on my PC though, so I am assuming that it
    is being stored on the internal 60G hard disk in the chassis that must
    be named "C" by default or something!?
    I have been told by phone support that I should be able to make a
    direct connection with the chassis just like another PC, and should be
    able to access the information on its internal hard disk in a drag and
    drop fashion. I however cannot directly connect to the PXI chassis to
    get the data that has been saved on the hard disk. We are running
    Windows XP on the PC. We did some poking around and noticed that the
    chassis is not running Windows file sharing, and only has ftp and http
    running. We tried to access it using ftp, but we didn't have a username
    and password to supply it. So, how can we enable Windows file sharing
    on the chassis? How can I connect to it to do drag and drop to get
    saved waveform data off of it? This is the main problem I am now
    facing. Eventually we would like to store data to an external hard disk
    connected to the chassis, which assumes that I can have access to the
    internal storage to tell it to save files to the external hard disk.
    For now saving it to the internal hard disk is just fine until
    everything is proven to work, but I would like to get the data off of
    the internal hard drive to put on another computer.
    Any answers/suggestions on my above questions are greatly appreciated.
    I also want to thank you for reading this long post . I eagerly await
    a reply. Thanks again in advance.
    Chris
    Attachments:
    5124_update.vi ‏143 KB

  • How to send message from multiline container to same webservice or bus. sys

    Hi All,
    I want to send message from multiline container to a syn web service sequentially.
    I am getting that multiline container after a transformations step (1: n mapping).
    where i dont known what will be the value for n (number of message in multiline container). This will vary; depend upon input message to BPM.
    Scenario is like this.
    1. Receive step
    2. Transfromation to 1: n
    3. Want to send message from multiline container to a web service (business service),default loop and block step doesn’t give desirable result.
    any help will be appreciable
    Regards,
    Adish

    Adish Jain wrote:>
    > where as, if I will use block, it will send the same message to multiple receivers which are present in multiline receiver container. So need to think in different manner.
    Not necessarily.
    When you use block step in ForEach mode, you can select the container variable from:
    - a receiver container;
    - an interface container;
    The line element can then be either a receiver or an interface.
    The problem is that for this to work, the interfaces need to be async (since they are to be used as containers) and hence you won't be able to make your scenario work.
    But again, explain why your scenario with loop step didn't work.
    The only gap here is how to determine the number of loops (defining the counter variable value). But that can be easily solved if you include a new message with occurrence 1 as a target message of your mapping and as a container in your bpm.
    This new message needs only 1 single field, that should be filled with the number of messages you've created in the mapping (you could use count standard function, f.ex.).
    In your bpm, make sure to pass this fields value into the counter container right after your transformation step.
    Regards,
    Henrique.

  • Passing values from multiline container

    Hello Gurus,
    I am new to workflow and I have a requirement wherein I have a multiline container element (DiscDocStatus of type EDISCDOC-STATUS) filled with the status values.
    If all the values in container DiscDocStatus are 10 or 11, then I need to execute certain steps (step A and step B) and if any other value than 10 or 11, then I have to wait for 10 days and then do step A and step B.
    Could you please how to do it?
    P.S. I know...I am asking tooo silly thing...but do not have any option but to ask...apologies....
    Thanks

    Hi..
    In that case you can try as below & i checked the same. it works for me..
    1. Create a block step in your workflow... In local container tab of block step create a single value container element which has
    data type as line type of your multiline container...
    Say for eg: your multiline container has datatype as (char10) with multiline checkbox enabled then create this container element in
    local container tab with datatype as (char10) without multiline checkbox (ideally you can compare multiline container as internal table
    and this single line container as workarea)..
    2. In control tab of block step do the binding from multiline container to single line container. Leave the Block type dropdown in control tab as standard.
    3. Put a condition step within block with condition as single line container NE 10 and NE 11. (So in case the multiline element has even a single value which is not 10 or 11 then workflow control will enter this condition). Place a container step in outcome True of condition step to set a flag variable as X (Note: Create this flag variable in workflow container)
    4. Now outside the block again put a condition step which checks whether this flag variable is set as 'X' (if it has value X then it means that multiline container has atleast 1 value other than 10 & 11. If not it means all values are either 10 or 11). So If flag is X you have to wait for 10 days and then do step A and step B. If not you can execute steps A & B. For waiting for 10 days you can go for requested start deadline which will send the workitem to the inbox of approver only if the mentioned time period/deadline (in your case - 10 days) expires.
    Let me know in case of any issues.
    Regards,
    Bharath

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • HELP:  0 from 0 records: Initialization Option of source system

    I executed an 'Initialization option for source system' on the scheduler and no data is coming from the source system.
    Steps taken:
    1.  Delete data from target DSO
    2. Picked InfoPackage and selected it returns back 'Initialization option for source system'  on the scheduler
    3.  Deleted the initialization setting
    4. Executed InfoPackage
    Result:  "0 from 0 records" found. How do I fill the queue table in the source system if not records are available?  T
    5. I go to delete the request in the PSA to retry: "No data in the PSA".
    This is to resolve a HIGH status ticket because I stopped delta process of other Infoproviders until this situation is resolved.
    Can you provide detail steps to properly create a trigger delta data from R/3 from a "Initialization Option of source system".  We have cancelled delta undates until this is resolved.

    Hi
    Now that you have run the init once, there is no need to delete the init flag
    The delta pointer is set now, you can run the delta Ip from now onwards.
    But if there were already some previous deltas done for this, and the delta had failed, because of which you have to initialise the delta again, then you need to delete the previous initialisation.
    To delete the init flag.
    Open your delta IP in RSA1(or in the PC)
    Goto the scheduler menu option
    initialization option for source system
    There you will see that a window will pop up which will show a succesful load, and you will see a tick mark in the first column.
    If you see a cross mark that would mean that the initialization has failed.
    this mark whihc you see is called the init flag.
    If you need to reinitialize the delta, then you have to delete this .
    Select the entire row and click the third button at the bottom.
    This will delete the initialization for source system( i.e init flag)
    now, before running the delta, you have to run the init IP again.
    it depends on the scenario whether you hav to run with data transfer or without data transfer.
    Hope this clarifies the query
    Regards
    Shilpa

  • How to use data of multiline element from workflow container

    Hi,
    Can you please tell me how to access rows of multiline element of workflow container.
    Scenario is like below.
    I have values in a multiline container(table) of workflow container.
    Now inside Fork branches  i need to check for specific data in the above table and with that condition i have to send workitem.
    I hope u can understand,otherwise please revert.
    Thanks in advance,
    Madhu

    You cannot didrectly check the condition...
    what you have to do is.. write a inside the method as below and set the flag...and use the flag in condition editor...
    SWC_GET_TABLE CONTAINER 'AGENTS'  lt_agents.
    loop at lt_agents ino wa_agents.
    if wa_agents = 'A'.
    lv_flag = X.
    endif.
    endloop.
    SWC_SET_ELEMENT CONTAINER 'FLAG' lv_flag.
    Create an export parameter FLAG as char1 with export marked.
    Do the neccesary bindings from task to workflow.
    Then in workflow check this flag in condition editor.

  • CcBPM extract data from query input (muliple row) to multiline container.

    Hi XI Expert,
    I have ccBPM scenario JDBC -
    > RFC.
    JDBC Sender contain multiple rows, how can i extract the muliple rows into multiline container so i can use for looping and send to RFC one by one.
    Thank you and Best Regards
    Fernand

    Hi,
       Your scenario is JDFC to RFC, where u have to extract the multiple records and apeend to RFC.
      first thing, in order to bundle multiple rows
       is there any time constraint ?(like with in 24 hours), in that situation use block step and append mode.
    also use activate corelarion step in receive.
    as u know, we need loop, recive, transformation out of loop send and block.
    plese check the following blog related to BPM.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2034. [original link is broken] [original link is broken] [original link is broken]
    warm regards
    mahesh.

  • BPM - Remove container from multiline container??

    Hi all,
    i can append a container object to a same type multiline container object.
    Is it possible to remove a container object from  a same type multiline container object?
    If yes, how?
    Thanks

    Not possible in standard.
    One option would be to use a Block and then for each of the container element decide if another container operatin to a new Container Element should be done.
    This way you will segeregate the Container Elements you want into a new MultiLine Container Element.
    Regards
    Bhavesh

  • Fill a multi record block with a for-loop

    Hi
    I've got a simple question but I couldn't find a solution yet.
    I have a multi record block and behind this i wrote a post-query-trigger with a cursor and a for-loop. Now I try to show each record of the for-loop in the multi record block. The loop works correctly, but the problem is that I only see the last found record of the loop in the first multi record and I'm not able to go to the next multi record when the loop finds more then one record.
    I tried to use NEXT_RECORD but then I got the error message "100500: non-ORACLE exception".
    May someone help me? Thanks a lot!

    What exactly are you trying to do? If you are simply trying to display the result of a query in a Multi-Record Block (MRB), I would recommend basing your block on the query (From Clause Query) or if you are simply displaying the contents of a table or a view in the block, base your MRB on the table or view and let Forms handle displaying the records.
    The Post-Query (PQ) trigger will execute for each record displayed in the MRB, which I'm sure is not what you intended. Since the trigger fires for each record, your loop is essentially assigning the value of each row in the cursor to the same row in the MRB.
    Hope this helps.
    Craig...

Maybe you are looking for