I need tips about queued message handler

Hello, I have to use, for the first time a queued message handler. I'd like to know what is the best way to share data between cases in a loop and from a loop to another, I think with local variables  isn't  the best way...
However all the tips on the queued message handler are welcome!!!
Thanks

smilegv wrote:
I'd like to know what is the best way to share data between cases in a loop
Shift registers.  Doesn't matter if QMH, State Machine, Producer-Consumer, etc.
smilegv wrote:
I'd like to know what is the best way to share data ...from a loop to another
Well, now that completely depends on what you are passing around.  Streaming data?  Use a Queue or User Event.  Last known value (ie Tag)?  Global Variables, Action Engine.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Where to store data (queued message handler)

    Hello,
    i'm developing an image processing application. As a template i'm using the 'queued message handler'. In my app I need to store some images, arrays, and so on in RAM. Now the question is  if i should store that data in the message loop's shift register (in a cluster) or somewhere else.
    At the moment i have hidden front panel indicators where i store all my data. This isn't good practise, is it?
    thanks alot
    MN

    nollMarvin wrote:
    Hello,
    i'm developing an image processing application. As a template i'm using the 'queued message handler'. In my app I need to store some images, arrays, and so on in RAM. Now the question is  if i should store that data in the message loop's shift register (in a cluster) or somewhere else.
    At the moment i have hidden front panel indicators where i store all my data. This isn't good practise, is it?
    thanks alot
    MN
    No that is not good practice.
    A Shift register is a much better place to store data in memory it does that without creating copies the OS must interperate for display.  (Yeah the displaying of data to a user is a different concept than having data in memory) Ben's famous Action Engine Nugget is always a good read. http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801
    And a basic concept to LabVIEW that attending a training session (or asking questions on these forums) will help you master
    Jeff

  • Queued Message Handler Project Template

    Hello,
    Currently prepping for CLD exam.
    I was told we could use LV 2012 Professional Version.  Is it OK during exam to use Project template for Queued Message Handler to generate VIs and block diagram code?  Or must a QMH be generated from scratch?  
    I assume there will be a main VI which we must modify, but the thought was to reuse the generated template code into this VI.
    Thank you,

    You can use templates, examples etc that ships with LabVIEW. I am sure I read this somewhere, will post a link if I find it.
    Here is one tip offered by one of the experts: http://forums.ni.com/t5/Certification/Car-Wash-REV​IEW/m-p/2267688#M540
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • How best to decouple the UI in the LV 2012 Queued Message Handler Template?

    If you create a new "Queued Message Handler" from the new LV 2012 Template, you'll see a blue box in the "Update Display" case which says the following:
    Code Recommended - If you wish to decouple the Message Handling Loop from your user interface, consider creating User Events (like the "Stop" event in this VI) to message the Event Handling Loop whenever the user interface needs updating.
    I'd like to give this suggestion a shot but I'm struggling to find the best way to do this and still keep the code modular.  The template creates a "User Event - Stop.lvlib" with Create/Destroy/Fire SubVI's.  I would like to create a similar "User Event - Update UI.lvlib" library with similar Create/Destroy/Fire SubVI's to keep this new user event separate and modular.  The problem I'm hitting is that there can only be one Dynamic Event Terminal in the Event Structure so how do I modularlize creating user events into separate SubVIs and still maintain this one Dynamic Event Terminal?
    As a follow on question, would it be best to have one user event library per indicator that needs updating or just one single UI update user event and then pass a cluster as the message which contains the name of the control to update (to be used with a case structure) and then the data to go along with it?
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    CLD.png ‏10 KB

    Instead of having the Register Events in the "Create Methods" you could do that part outside your "create" SubVIs and then simply bundle them. Then you create your individual User Event handling. See snippet where i created a "Create User Event - Update" vi in front of the Stop.
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • Advantages of Using Queued Message Handler vs. Standard State Machine

    Hello,
    What are the advantages of using a Queued Message Handler?  Also, why are they more powerful than using Standard State Machines?
    Thanks!

    They are really just sort of an extension of a state machine.  The general idea is that you have one loop doing a specific job.  You then use a queue to tell it how/when to do this job.  For instance, I might have a log file loop.  I will send it commands to open a file, write some data, write some more data, and finally close the file.  Each of those commands are coming from the queue.  The beauty with this setup is that anybody that can get a reference to that queue can send the command to that loop.
    So the QMH is "better" than a state machine mostly because of the decoupling of functions.  In a given application, I will have a loop for log file writing, GUI updates, reading of a DAQ, instrumenet communications, server communications, etc.  Trying to do all of that in a single loop state machine is a major pain in the rear end.  Seperating them out makes life so much easier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Build applicatio​n based on queue message handler template

    I programmed an application, using QMH template in LV and made a build out of it. The build has the "main.vi" and it is always included. But, after build is complete, the application starts by clicking on my apllication.exe and immediately terminate itself !!!! any idea about why? (I have one global function ("exit" which set to false at initialize state of the application" and shared variables, but both seem not the items to be blamed !!

    I recently (about two years ago) started using the QMH fairly heavily, "re-inventing" my usage of it several times (that means taking a LabVIEW Real-Time project of several hundred VIs and almost "starting over").  I've attached a Demo Snippet to illustrate some Lessons Learned.
         First, an admission -- see all of those Queue wires?  I've gotten rid of most of them by using a Queue Action Engine that handles all of the Queue actions except Dequeue.  In place of the Obtain Queue, Enqueue, and Release Queue calls, I have a Message Queue VI that takes an Enum (Obtain, Enqueue, or Release) and (optional) inputs (such as the Element to Enqueue).  The only Queue wire in my diagram is the one from the call to Enqueue Initialize to the (necessary) Dequeue Element (but I don't need the Queue wire coming out of Dequeue Element as I use my VI instead of Release Queue).  Not only don't I need a Queue wire going into the parallel Event Handling loop, but I don't need a wire going into a sub-VI that needs to "send a Message", which makes spawning asynchronous parallel loops easy.
         You'll notice my Messages are Strings, not an Enum.  I'm a little conflicted here -- I like the "error-checking" feature of Enums, but especially when designing, it is so much easier to say "Hey, I need another State here to do this" and simply name it and add it.
         The Event Handling Loop, for the most part, should do nothing except generate a message, passing the Event New Value (if needed) as the Data part of the message.  In particular, the Exit message is just another Message -- it doesn't need to be "filtered out" for special handling.
         To stop all of the loops, I use a Local Shared Variable (you could use a Global or FGV/VIG as well) -- the TimeOut case in the Event Handling Loop wires this variable to the loop Stop, and as you can see, the Exit message sets it;
         You may notice the 500 msec timeout on the Dequeue -- this allows you to catch cases where no messages come in.  Here I "do nothing".  But you'll notice that this makes my Stop code work.  The User pushes Stop, generates an Event, calls the Stop Message, sets the Stop Shared Variable to True, but that (probably) does not stop the lower loop, as the earlier False value was probably read and "connected" to the Stop indicator when the loop was entered.  200 msec later, the Event Timeout fires, sees the Stop Shared Variable = True, and stops the Event loop.  After another 300 msec, the Dequeue times out, enters the True Case and does nothing, but now the Shared Variable is True and the lower loop stops.
         You are correct that if you want to do repetitive things with this model, you need to repeatedly call the State you want to run.  It depends how much of your code you want to put into a single QMH -- it might be just as simple to have yet another parallel loop do the same thing every 100 msec, and use the State Machine to handle the User Interface (I've done it both ways, depending on circumstances).
         Have fun!
    BS

  • How to treat error handling in the consumer loop in the queue message handler structure?

    Hi,
    I'd like to know how to stop the producer loop(event loop) in the QMH structure when the error happened in the consumer loop.
    I've construct a demo code by myself as the attached image, but it's a pity that I have to create a recdundant indicator "End" to trigger the value change event to stop the program. This is not a good way to do it. Could someone give me some better idea how to deal with it? Very appreciated to you sharing ideas.

    Concerning your doubts about the "traditional" implementation of this pattern, I hear you. As I have written many times before, its main benefit is that it is easy to explain in a training class. It unfortunately has a lot of drawbacks.
    Tim's suggestion about User Events, is a good one. But to use it to the best advantage, you will need to get away from having everything on one block diagram. If you think about it there is no real need for the two loops to be on the same block diagram and a lot of really good reasons for them not to be. For example, if they are in separate VIs, they can both be event driven and any communication problems between loops evaporates.
    Its also more modular, easier to maintain, more reusable, etc...
    Check the link in my signature.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to Handle Queue Message with NO expiration

    I come across a situation where i need to dequeue same message multiple times and upon reaching valid condition only i can discard the message. For this situation i can create a queue that has message expiration set to NEVER. But i didn't find the way to delete the message that has expiration NEVER.
    Can anybody help me what will be the best approach to delete messages that has no expiration. My business case allow me to delete that message only after reaching a particular condition.
    Regards

    In what version?
    SELECT * FROM v$version;

  • Web service client needs to share data with a SOAP Message Handler

    I have a web service client that is built using WebLogic 10 clientgen. I also have a Soap Message Handler configured that will create the required Soap Headers for the web service call.
    Creating these Soap Headers works great as long as the header data is static but the problem comes up when I need to place some dynamic data in these headers. The web service client has this data and somehow needs to pass it to the Soap Message Handler. It looks like I need to somehow have the client place this data in the MessageContext before the call so the data can be accessed by the Soap Message Handler.
    How do I get access to the MessageContext from the client or is there a better way to do this?
    Thanks in advance for any help you can give.

    You may want to check the response to this previous post to see if it yields any ideas for you:
    Not able to Pass header info to Microsoft MapPoint WebService using WLS10

  • Did anyone tried Rejection Message Handler via Queue based method?

    Dear All,
    I am presently doing a Rejected Message Handler process and successfully implemented with File based and Web Service based. But I am not getting the clue for Queue based. We can enqueue the rejected message into queue as a JMS message via this method. But the URI format they have given is *"jdbc:oracle:thin:@<host>:<port>:<sid>#<un>/<pw>#queue"*. Format includes jdbc connection string along with queue name. For this I have created JMS module with JDBC Persistent store and created queue in it. But still I am not able to enqueue the message inside the queue. Also, is there anyway to see the queue names inside the DB. Did anyone tried this method? Could you please share the info??

    WL JMS Queue consume>BPEL1 (One way) invoke>Mediator service (one way) route> BPLE2 (one way). Also I have added transaction properties in BPEL1 and 2 + References + Services.
    Now, if there is a fault in BPEL2 the transaction should be rolled back in BPEL1 and the message should be seen in the WL queue itself. But that is not happening in my case. Everything is getting rolled back upto a point just after the >recieve activity in BPEL1 except the message is not getting rolled back to queue.There will be 2 transactions in this scenario : 1) jms queue to soa hydration store 2) soa-hydration to bpel execution.
    This is the behaviour for 1 way or async interfaces , jms adapter thread completes its transaction work after persisitng to dehydration store and another bpel system thread starts work executing the bpel code after retrieving the message off the db in a separate transaction. So the rollback you are seeing is only applicable for 2nd transaction which roll backs to the dehydration store instead of the queue.
    For synchronous interfaces, the same adapter thread will be involved for complete message processing including bpel code execution. So I think if you want to get the jms queue within the same transaction you can try set up the interfaces to be sync, even with dummy responses. This might make jms adapter thread to start a transaction --> read message off queue within the same transaction --> execute bpel code within same transaction --> complete/rollback transaction based on bpel code execution.

  • Need help about the SHA Message Digest ? & what is use of Message Diagest ?

    need help about the SHA Message Digest ? & what is use of Message Diagest ?
    1>i have one program of making message digest
    2>which requires two files name
    3>one for input like txt
    4> second is out put file of message digest
    can any one tell what is the use of second generated file .

    MessageDigest md = MessageDigest.getInstance("SHA");
    FileInputStream fis = new FileInputStream(args[0]);
    byte[] b = new byte[1024];
    int readed = -1;
    while((readed = fis.read(b)) > 0)
         md.update(b, 0, readed);
    fis.close();
    FileOutputStream fos = new FileOutputStream(args[1]);
    byte[] d = md.digest();
    StringBuffer sb = new StringBuffer();
    for(int i = 0; i < d.length; i++) {
         String str = Integer.toHexString(d[i] & 0xff);
         sb.append(str.length() < 2 ? "0" + str : str);
    fos.write(sb.toString().getBytes());
    fos.close();

  • SOAP APIs needed to extract SOAP request arguments for message handler implementation

    1. I am facing problem in using the Message Handler approach for the implementation
    of webservices using SOAP on BEA weblogic 8.1. A SOAP request(XML format) can
    be interrupted using the message handler and hence can be modified before it invokes
    the webservice method. I have been able to successfully extract the SOAP Name
    space xml format as a part of the SOAP request using the APIs given below
    APIs:
    SOAPBody body = env.getBody();
    Name Spaces format:
    <m:sayHello xmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic/statelessSession">
    <intVal xsi:type="xsd:int">100</intVal>
    <string xsi:type="xsd:string">vikas</string>
    </m:sayHello>
    The above is a Hello world example which invokes the sayHello method with arguments
    as an integer and a string. I have not been able to find the SOAP APIs to extract
    these arguments from the SOAP Body.
    2. But there are XML apis which can extract the tag data from the SOAPBody e.g
    NodeList nl = body.getChildNodes();
    for(int i = 0; i < nl.getLength(); i++)
    Node node = (Node)nl.item(i);
    if(node instanceof SOAPElement){
    SOAPElement se = (SOAPElement)node;
    String operationName = se.getLocalName();
    String value = se.getValue();
    The SOAPBody interface implements the following interfaces (Ref : http://java.sun.com/j2ee/1.4/docs/api/index.html
    javax.xml.soap > SOAPBody )javax.xml.soap.Node, javax.xml.soap.SOAPElement(SOAP APIs)
    org.w3c.dom.Node, org.w3c.dom.Element (XML Parser APis)
    3. But webservice implementation of Weblogic Application server 8.1(webservice.jar)
    doesn't support the XML parser APIs and only supports the SOAP APIs.
    i.e. The SOAPBody Interface of Weblogic Application Server only implements the
    javax.xml.soap.Node, javax.xml.soap.SOAPElement (SOAP APIs) and not the XML APIs
    (org.w3c.dom.Node, org.w3c.dom.Element)
    So the code snippet written as a part of point 2 will not be compiled(give compilation
    error) using the webservice.jar of Weblogic 8.1.
    4. I have tried to compile the same code using the saaj-1_2-fr-api.jar (SOAP 1.2
    apis jar) which I have downloaded from java.sun site. And the code got successfully
    compiled.
    In this latest version of SOAP APIs jar the SOAPBody interface implements both
    the SOAP as well as XML parser Apis.
    5. I was not able to run this code on the Weblogic server , bcoz at the runtime
    weblogic 8.1 is using its webservice.jar instead of saaj-1_2-fr-api.jar. And
    this code was giving me runtime error as
    java.lang.NoSuchMethodError: javax.xml.soap.SOAPBody.getChildNodes()Lorg/w3c/dom/NodeList;
    (see Fault Detail for stacktrace)</faultstring>
    So now I need to find out the version of the webservice.jar of Weblogic 8.1 which
    supports SOAP Apis as well as XML parser apis.
    Otherwise I have to find out the SOAP apis which can extract the tag data from
    the SOAP body.
    Please Help.

    You can use the SAAJ APIs to get the child nodes.
    Example here:
    http://manojc.com/tutorial/sample4/ServerHandler.java
    so instead of using body.getChildNodes(), you have to use
    body.getChildElements() which returns an iterator of SOAPElements.
    Regards,
    -manoj
    http://manojc.com
    "Vikas Garg" <[email protected]> wrote in message
    news:40dfb5e0$1@mktnews1...
    >
    1. I am facing problem in using the Message Handler approach for theimplementation
    of webservices using SOAP on BEA weblogic 8.1. A SOAP request(XML format)can
    be interrupted using the message handler and hence can be modified beforeit invokes
    the webservice method. I have been able to successfully extract the SOAPName
    space xml format as a part of the SOAP request using the APIs given below
    APIs:
    SOAPBody body = env.getBody();
    Name Spaces format:
    <m:sayHelloxmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic
    /statelessSession">
    <intVal xsi:type="xsd:int">100</intVal>
    <string xsi:type="xsd:string">vikas</string>
    </m:sayHello>
    The above is a Hello world example which invokes the sayHello method witharguments
    as an integer and a string. I have not been able to find the SOAP APIs toextract
    these arguments from the SOAP Body.
    2. But there are XML apis which can extract the tag data from the SOAPBodye.g
    >
    NodeList nl = body.getChildNodes();
    for(int i = 0; i < nl.getLength(); i++)
    Node node = (Node)nl.item(i);
    if(node instanceof SOAPElement){
    SOAPElement se = (SOAPElement)node;
    String operationName = se.getLocalName();
    String value = se.getValue();
    The SOAPBody interface implements the following interfaces (Ref :http://java.sun.com/j2ee/1.4/docs/api/index.html
    javax.xml.soap > SOAPBody )javax.xml.soap.Node, javax.xml.soap.SOAPElement(SOAP APIs)
    org.w3c.dom.Node, org.w3c.dom.Element (XML Parser APis)
    3. But webservice implementation of Weblogic Application server8.1(webservice.jar)
    doesn't support the XML parser APIs and only supports the SOAP APIs.
    i.e. The SOAPBody Interface of Weblogic Application Server only implementsthe
    javax.xml.soap.Node, javax.xml.soap.SOAPElement (SOAP APIs) and not theXML APIs
    (org.w3c.dom.Node, org.w3c.dom.Element)
    So the code snippet written as a part of point 2 will not be compiled(givecompilation
    error) using the webservice.jar of Weblogic 8.1.
    4. I have tried to compile the same code using the saaj-1_2-fr-api.jar(SOAP 1.2
    apis jar) which I have downloaded from java.sun site. And the code gotsuccessfully
    compiled.
    In this latest version of SOAP APIs jar the SOAPBody interface implementsboth
    the SOAP as well as XML parser Apis.
    5. I was not able to run this code on the Weblogic server , bcoz at theruntime
    weblogic 8.1 is using its webservice.jar instead of saaj-1_2-fr-api.jar.And
    this code was giving me runtime error as
    java.lang.NoSuchMethodError:javax.xml.soap.SOAPBody.getChildNodes()Lorg/w3c/dom/NodeList;
    (see Fault Detail for stacktrace)</faultstring>
    So now I need to find out the version of the webservice.jar of Weblogic8.1 which
    supports SOAP Apis as well as XML parser apis.
    Otherwise I have to find out the SOAP apis which can extract the tag datafrom
    the SOAP body.
    Please Help.

  • Message Handler chain in ALSB2.6

    We need to move WLI webservices to ALSB2.6. Webservices used message handler chain which did lots of custom work.
    ALSB seems to have java callout but making methods in java call out sysnchronized means performance hit.
    Is there anything equivalent to handler chain in ALSB which can be applied to ALL the deployed proxy services?
    Thanks.

    ALSB is not a web service container, simply an intermediary. Therefore there is nothing equivalent to the JAX-RPC handler chain.
    Java callout looks like a reasonable alternative. What is your concern about performance? Why would you synchronize the java callout methods and not the message handler chain?
    As a best practice, I would suggest you create a local proxy containing the implementation you want to share across ALSB services. The invocation af a local proxy is optimized and as fast as simply replicating an action across every services.
    Gregory Haardt
    ALSB Prg. Manager
    [email protected]

  • I Need Navigation about BDC Upload

    Need Navigation about BDC Upload

    Hi
    <b>the BDC program should be in this format</b>
    Transaction Recorder (SHDB)
    How to Upload Presentation Server Flat file to SAP R/3 system???
    How to upload application server file to R/3 system?
    Definition
    <b>Example - Call Transaction Method</b>
    <b>Transaction Recorder (SHDB)</b>
    Before you work with the Batch Input methods, you should know the purpose of the tool
    Transaction Recorder.
    <b>Use:</b>
    You can use the transaction recorder to record a series of transactions and their screens.
    <b>Features:</b>
    You can use the recording to create
    Data transfer programs that use batch input or CALL TRANSACTION
    Batch input sessions
    Test data
    Function modules.
    Note: It doesn’t record F1, F4 and Scrollbar movements
    <b>Upload Flat file from Presentation Server to SAP R/3</b>
    CALL FUNCTION ‘GUI_UPLOAD'
    EXPORTING
    CODEPAGE = ‘IBM'
    FILENAME = P_UFILE
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = INT_TAB
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10 .
    IF SY-SUBRC NE 0.
    MESSAGE E999(FR) WITH 'ERROR IN FILE UPLOAD'.
    ENDIF.
    <b>Upload file from application server to SAP R/3</b>
    Open the the application server file
    OPEN DATASET <dsn> FOR INPUT <mode>
    Read the data from application server file
    READ DATASET <dsn> INTO <wa>
    And then close the application server file
    CLOSE DATASET <dsn>
    Definition- Declaring BDC Table
    DATA: BDC_TAB LIKE STANDARD TABLE OF
    BDCDATA INITIAL SIZE 6
    WITH HEADER LINE .
    The internal table used to collect the transaction’s information must be declared “LIKE BDCDATA”.
    <b>Filling BDC Table – Method #1</b>
    FORM FILL_BDC_TAB.
    REFRESH BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = ‘SAPMF02K’.
    BDC_TAB-DYNPRO = ‘01016’.
    BDC_TAB-DYNBEGIN = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘RF02K-LIFNR’.
    BDC_TAB-FVAL = ‘TEST1’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘RF02K-D0010’.
    BDC_TAB-FVAL = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = ‘SAPMF02K’.
    BDC_TAB-DYNPRO = ‘0110’.
    BDC_TAB-DYNBEGIN = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘LFA1-STRAS’.
    BDC_TAB-FVAL = ‘123 Main St.’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘BDC_OKCODE’.
    BDC_TAB-FVAL = ‘/11’.
    APPEND BDC_TAB.
    ENDFORM.
    <b>Filling BDC Table – Method #2</b>
    FORM FILL_BDC_TAB.
    REFRESH BDC_TAB.
    PERFORM POPULATE_BDC_TAB
    USING:
    ‘1’ ‘SAPMF02K’ ‘0106’,
    ‘ ‘ ‘RF02K-LIFNR’ ‘TEST1’,
    ‘ ‘ ‘RF02K-D0010’ ‘X’,
    ‘1’ ‘SAPMF02K’ ‘0110’,
    ‘ ‘ ‘LFA1-STRAS’, ‘123 Main St.’,
    ‘ ‘ ‘BDC_OKCODE’, ‘/11’.
    ENDFORM.
    FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.
    CLEAR BDC_TAB.
    IF FLAG = ‘1’.
    BDC_TAB-PROGRAM = VAR1.
    BDC_TAB-DYNPRO = VAR2..
    BDC_TAB-DYNBEGIN = ‘X’.
    ELSE.
    BDC_TAB-FNAM = VAR1.
    BDC_TAB-FVAL = VAR2.
    ENDIF.
    APPEND BDC_TAB.
    ENDFORM.
    This two subroutine method to fill the BDC table is preferable because the “POPULATE_BDC_TABLE” subroutine is reusable throughout all batch input programs.
    Example #1 - Change Vendor (Call Transaction Method)
    <b>Example #1- Declaration Section</b>
    REPORT Y180DM10.
    DATA: BDC_TAB LIKE STANDARD TABLE OF
    BDCDATA INITIAL SIZE 6 WITH HEADER LINE.
    INFILE(20) VALUE ‘/tmp/bc180_file4’.
    DATA: BEGIN OF INREC.
    VENDNUM LIKE LFA1-LIFNR.
    STREET LIKE LFA1-STRAS.
    END OF INREC.
    PARAMETERS: DISPMODE DEFAULT ‘A’,
    UPDAMODE DEFAULT ‘S’.
    START-OF-SELECTION.
    OPEN DATASET INFILE
    FOR INPUT IN TEXT MODE.
    DO.
    READ DATASET INFILE INTO INREC.
    IF SY-SUBRC < > 0. EXIT. ENDIF.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE DISPMODE
    UPDATE UPDAMODE.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    CLOSE DATASET INFILE.
    <b>synchronous updating</b>
    DO.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE ‘N’
    UPDATE ‘S’.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.
    <b>asynchronous updating</b>
    DO.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE ‘N’
    UPDATE ‘A’.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.
    <b>Error Handling</b>
    Write an error report.
    Send the record(s) in error to an error file.
    Create a batch input session with the record(s) in error.
    To store error messages ( CALL TRANSACTION )
    data: begin of Tab_Mess occurs 0.
    include structure bdcmsgcoll.
    data : end of Tab_Mess,
    CALL TRANSACTION ‘FK02’ USING BDC_TAB MODE ‘N’ UPDATE ‘S’
    MESSAGES INTO TAB_MESS.
    IF SY-SUBRC NE 0.
    WRITE: / Tab_MESS-TCODE, Tab_MESS-DYNUMB, Tab_MESS-MSGTYP ,
    Tab_MESS-MSGID.
    ENDIF.
    <b>i am giving you example for Change Vendor you practice for ur tcode</b>
    For our example, we will use the “Change Vendor” transaction (“FK02”) to add a street address to an already existing vendor.
    <b>Step #1</b>
    Use “System&#61664;Status” menu path to determine online program name (SAPMF02K), screen number (0110)
    <b>Step #2</b>
    Use “F1” key and “Technical Info” pushbutton in each screen field to be filled to determine the field name.
    <b>Step #3</b>
    Determine how to proceed in the transaction
    (save the record by clicking on the ‘Save’ pushbutton or pressing the ‘F11’ key).
    <b>BDC Table Contents</b>
    After researching the transaction we can determine the contents of the BDC table.
    PROGRAM DYNPRO DYNBEGIN FNAM FVAL
    SAMPF02K 0106 X
    RF02K-LIFNR TEST1
    RF02K-D0110 X
    SAMPF02K 0110 X
    LFA1-STRAS 123 Main St.
    BDC_OKCODE /11
    <b>Batch Input Methods</b>
    “CALL TRANSACTION USING”
    STATEMENT
    <b>Call transaction - for data transfer</b>Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended data transfer methods. In this method, legacy data is processed inline in your data transfer program.
    Syntax:
    CALL TRANSACTION <tcode>
    USING <bdc_tab>
    MODE <mode>
    UPDATE <update>
    A Display all
    E Display errors only
    N No display
    S Synchronous
    A Asynchronous
    L Local update
    <b>The process flow of CALL TRANSACTION</b>
    A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:
    Prepare a BDCDATA structure for the transaction that you wish to run.
    Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.
    With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:
    CALL TRANSACTION ‘MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.
    IF SY-SUBRC <> 0.
    <Error_handling>.
    ENDIF.
    <b>Overview of Batch Input Session</b>
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program.
    <b>Reward if usefull</b>

  • Queues not handling delays...

    Question:
    If the parameter that enables the Queue Monitor to handle delay intervals on queues (i.e., AQ_TM_PROCESSES) is not set to > 0, then no Queue Monitor background processes (ora_aqtm_<SID>) will be created and queues will not be able to handle delays?
    Or, to put in another way, if AQ_TM_PROCESSES = 0, setting a delay on a queue for a payload will not work correctly, correct?

    Still seems to be some debate between the developers and DBAs on whether or not AQ_TM_PROCESSES = 0 causes an issue in Oracle 10g 10.2.
    This is what the Oracle Advanced Queueing Manual says:
    ===========================================
    Prior to Oracle Database 10g, Oracle Streams AQ time manager processes were controlled by init.ora parameter AQ_TM_PROCESSES, which had to be set to nonzero to perform time monitoring on queue messages and for processing messages with delay and expiration properties specified. These processes were named QMNO-9, and the number of them could be changed using:
    ALTER SYSTEM SET AQ_TM_PROCESSES=X
    Parameter X ranged from 0 to 10. When X was set to 1 or more, that number of QMN processes were then started. If the parameter was not specified, or was set to 0, then queue monitor processes were not started.
    Beginning in Oracle Streams AQ 10g Release 1 (10.1), this was changed to a coordinator-slave architecture, where a coordinator is automatically spawned if Oracle Streams AQ or Streams is being used in the system. This process, named QMNC, dynamically spawns slaves depending on the system load. The slaves, named qXXX, do various background tasks for Oracle Streams AQ or Streams. Because the number of processes is determined automatically and tuned constantly, you no longer need set AQ_TM_PROCESSES.
    Even though it is no longer necessary to set AQ_TM_PROCESSES when Oracle Streams AQ or Streams is used, if you do specify a value, then that value is taken into account. However, the number of qXXX processes can be different from what was specified by AQ_TM_PROCESSES.
    QMNC only runs when you use queues and create new queues. It affects Streams Replication and Messaging users.
    No separate API is needed to disable or enable the background processes. This is controlled by setting AQ_TM_PROCESSES to zero or nonzero. Oracle recommends, however, that you leave the AQ_TM_PROCESSES parameter unspecified and let the system autotune.
    Note:
    If you want to disable the Queue Monitor Coordinator, then you must set AQ_TM_PROCESSES = 0 in your pfile or spfile. Oracle strongly recommends that you do NOT set AQ_TM_PROCESSES = 0. If you are using Oracle Streams, then setting this parameter to zero (which Oracle Database respects no matter what) can cause serious problems.
    ===========================================
    Seems to me that AQ_TM_PROCESSES is no longer used as before but if used, and set to 0, it can cause issues and / or turn off the Oracle Queue Monitor....
    Anybody's final vote on this matter??? Based on the manual and the responses I have heard so far, AQ_TM_PROCESSES = 0 does still matter in Oracle 10.2.

Maybe you are looking for

  • A lot of threads getting created on weblogic 10.3.2

    Hi here is the thread dump. can you help me in solving this Full thread dump Java HotSpot(TM) Server VM (14.0-b16 mixed mode): "scheduledJobsListenerContainer-55" prio=6 tid=0x4e7aac00 nid=0x2fac waiting on condition [0x51aaf000] java.lang.Thread.Sta

  • How do I disable your annoying screen urging an update to a newer version of firefox?

    You are annoying me and it may cause me to delete Firefox and use another browser if you do not frankly and forthrightly answer my question and not skirt the issue and pretend you are addressing a question about auto-updates because that is not my qu

  • Exception Description: No conversion value provided for the attribute

    Hi!, The following is printed when I try to persist an entity with a an enum attribute in it. It deployted succuessfully and mapped fine a table, my configuration is, Windows2003, SJSAS 9 FCS, Derby DB. Exception [TOPLINK-115] (Oracle TopLink Essenti

  • How do I have commas in spreadsheet

    My numbers look like this 1.234 instead of 1,234. Formating started the same but some cells have a dot instead of a comma. Retyping does not help. Must be an option somewhere to choose commas within cell.

  • How do I get rid of a Plug-In?

    I'm having some problems with FCP and trashed the preferences. Since then an audio filter that I tried but didn't purchase keeps popping up when FCP is booting up and asks if I want to purchase it. I searching my computer for the filter and deleted i