Commit work not working in Routine for Transaction because of LUW

Hi all,
i have req to send adobe PDF as attachement by email.
Basically i am calling adobe from output type of VL02n .
Inside this i can not use commit work because of LUW.Please suggest what should i do.
so not able to send email in green status.
i am using below code
TRY.
      zlcl_send_request->set_document( zlcl_document ).
    CATCH cx_send_req_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
Email sender
  TRY.
      zlcl_sender =  cl_sapuser_bcs=>create( sy-uname ).
    CATCH cx_address_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
  TRY.
      CALL METHOD zlcl_send_request->set_sender
        EXPORTING
          i_sender = zlcl_sender.
    CATCH cx_send_req_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
Create the Reciever address
  TRY.
      zlcl_recipient = cl_cam_address_bcs=>create_internet_address(
                                         gv_email ).
    CATCH cx_address_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
  TRY.
      zlcl_send_request->add_recipient( EXPORTING i_recipient =
      zlcl_recipient ).
    CATCH cx_send_req_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
  TRY.
      zlcl_send_request->set_send_immediately( gc_x ).
    CATCH cx_send_req_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.
Send the mail
  TRY.
      zlcl_send_request->send( ).
    CATCH cx_send_req_bcs INTO zicl_oref_cast.
      CLEAR gv_text_cast .
      gv_text_cast = zicl_oref_cast->get_text( ).
  ENDTRY.

Hi
From abap help:
SY-ONCOM
On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of u2018Pu2019 is guaranteed. If at all, SY-ONCOM must only be queried for u2018Pu2019.
The value 'P' means that the program is already executing a subroutine started using PERFORM u2026 ON COMMIT and therefore a
further subroutine call using PERFORM ... ON COMMIT would cause a runtime error.
That means the variable SY-ONCOM has the information if a process "ON COMMIT" is working and so it determines if a dump has to be raised.
Now it's clear the meaning of that correction: if before calling a new commit the value of SY-ONCOM is changed the dump will be avoided.
I've done the following texts:
REPORT  ZCOMMIT.
WRITE: 'Calling routine on commit'.
PERFORM DO_SOMETHING ON COMMIT.
COMMIT WORK.
FORM DO_SOMETHING.
  DATA: ONCOM TYPE SY-UCOMM.
  MOVE SY-ONCOM TO ONCOM.
  SY-ONCOM = 'S'.
  COMMIT WORK.
  MOVE ONCOM TO SY-ONCOM.
ENDFORM.
The code above is very dangerous, because it triggeres a ricorsive loop: no dump, but the form is continuously called, just as help says SY-ONCOM is equal to P
REPORT  ZCOMMIT.
WRITE: 'Calling routine on commit'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
COMMIT WORK.
FUNCTION Z_MAX_COMMIT.
  DATA: ONCOM TYPE SY-UCOMM.
  MOVE SY-ONCOM TO ONCOM.
  SY-ONCOM = 'S'.
  COMMIT WORK.
  MOVE ONCOM TO SY-ONCOM.
ENDFUNCTION.
I expected the same behavior as above, but here no dump and no infinite loop, SY-ONCOM = V
Now your process working in update task, but probably many function are called, I mean the system creates a queue of functions to be run in update task, so what happens here?
I've tried this:
FUNCTION Z_MAX_COMMIT.
*"*"Function module di reg.:
*"*"Interfaccia locale:
*"  IMPORTING
*"     VALUE(NO_COMMIT) TYPE  FLAG DEFAULT SPACE
  CHECK NO_COMMIT IS INITIAL.
  DATA: ONCOM TYPE SY-UCOMM.
  MOVE SY-ONCOM TO ONCOM.
  SY-ONCOM = 'S'.
  COMMIT WORK.
  MOVE ONCOM TO SY-ONCOM.
ENDFUNCTION.
REPORT  ZCOMMIT.
WRITE: 'Calling routine on commit'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
  EXPORTING
    NO_COMMIT = 'X'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
  EXPORTING
    NO_COMMIT = 'X'.
COMMIT WORK.
Here no dump and no infinite loop too, but also no impact on the rest of the functions,
I can suppose the impact will be on the saving of data on database only, because your COMMIT ends the LUW, so it's very important the routine for printing is called at the end, after all saving routines.
Max

Similar Messages

  • I put ios7.1 to my ipad it was working not it is asking for activite for developer and allready registered to my developer for devices but now it does not actived

    I put ios7.1 to my ipad it was working not it is asking for activite for developer and allready registered to my developer for devices but now it does not actived

    If you are an authorized member of Apple's developer program, you have forums and resources through which you can address issues with seed versions of Apple's software. Posting here or in any public forum is a violation of your NDA with Apple. The developer forums can be found here:
    https://developer.apple.com/devforums/
    If you are not an authorized developer, then you have an illegal copy of the software.
    Either way, we cannot help you with questions about unreleased Apple software in these forums.
    Regards.

  • [svn] 4375: Previous commit did not fix whitespace issue for FxTextArea as advertised.

    Revision: 4375
    Author: [email protected]
    Date: 2008-12-22 09:24:42 -0800 (Mon, 22 Dec 2008)
    Log Message:
    Previous commit did not fix whitespace issue for FxTextArea as advertised. The [CollapseWhiteSpace] metadata has to be on the text getter for FxTextArea. It does not work on the getter for FxTextBase, although it does work for FxTextInput.
    QE Notes:
    Doc Notes: None
    Bugs: SDK-17683
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17683
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextArea.as

    Revision: 4375
    Author: [email protected]
    Date: 2008-12-22 09:24:42 -0800 (Mon, 22 Dec 2008)
    Log Message:
    Previous commit did not fix whitespace issue for FxTextArea as advertised. The [CollapseWhiteSpace] metadata has to be on the text getter for FxTextArea. It does not work on the getter for FxTextBase, although it does work for FxTextInput.
    QE Notes:
    Doc Notes: None
    Bugs: SDK-17683
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17683
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextArea.as

  • Comm.jar not working in Applet but works in Eclipse

    Hello,
    Please help me to read serial port data from Java Applet.
    The below code working well and get data from weighing machine when we run in eclipse(Run Applet). But it now working when we use class file in Applet.
    I think its security issue, but i still could not understand what we need to do.
    I put the JOptionPane.showDialog and found that the code is crashing in line CommPortIdentifier.getPortIdentifiers(); (Not understood why try catch not working.)
    I am using in Windows 7 environment.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.logging.Logger;
    import javax.comm.*;
    import javax.swing.*;
    public class SimpleApplet extends JApplet {
    public void init() {
    JButton button = new JButton("Click me!");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {                 
         JOptionPane.showMessageDialog(SimpleApplet.this, "hello");
    JOptionPane.showMessageDialog(SimpleApplet.this, Getdata());
    add(button, BorderLayout.CENTER);
    setBackground(Color.GRAY);
    public String Getdata()
         try
              String drivername = "com.sun.comm.Win32Driver";
    try
    CommDriver driver = (CommDriver) Class.forName(drivername).newInstance();
    driver.initialize();
    catch (Exception e) { //just do nothing, it doesn't really matter
         Enumeration portList=null;
    CommPortIdentifier portId;
    SerialPort serialPort;
    OutputStream outputStream;
    try
         portList = CommPortIdentifier.getPortIdentifiers();
    }catch(Exception ex)
         JOptionPane.showMessageDialog(SimpleApplet.this, "erorr:" + ex.getStackTrace().toString());
    JOptionPane.showMessageDialog(SimpleApplet.this, "get port lsit");
              while(portList.hasMoreElements())
                   portId = (CommPortIdentifier) portList.nextElement();
                   if(portId.getPortType()== CommPortIdentifier.PORT_SERIAL)
                        if(portId.getName().equals("COM1"))
                             try
                                  serialPort = (SerialPort) portId.open("WeightMachine",200);                              
                                  serialPort.setSerialPortParams(1200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                                  outputStream = serialPort.getOutputStream();
                                  InputStream mInputFromPort = serialPort.getInputStream();
                                  outputStream.write("W".getBytes());
                                  outputStream.flush();
                                  Thread.sleep(500);
                                  byte mBytesIn [] = new byte[20];
                                  mInputFromPort.read(mBytesIn);
                                  //mInputFromPort.read(mBytesIn);
                                  String value = new String(mBytesIn);
                                  mInputFromPort.close();
                                  serialPort.close();
                                  return value.replace("+00", "").replace(" Kg", "");
                             }catch(Exception ex)
                                  return ex.getMessage();
              }catch(Exception ex)
                   JOptionPane.showMessageDialog(SimpleApplet.this, "erorr last:" + ex.getStackTrace().toString());
              return "Not found";
    Thanks in advance.
    Avinash

    959817 wrote:EJP wrote:959817 wrote:
    it now working when we use class file in Applet.Define 'not working'.But when i run applet from browser from same machine its not working.That's not an answer. That's just a vague and pointless restatement of the original vague and pointless statement that I asked you to clarify.
    When you take your car to a mechanic, do you just tell him it's 'not working'?

  • An update statement followed by a commit does not work

    Hi all,
    When I have these two statements executed together, it does not work.
    update booking set arrival_date = sysdate - 1
    where booking_no = '200500000018';
    commit;
    But when I first execute the first update statement, then comment it out, and then execute the commit statement, it works. Is that a bug or do I do something wrong or is it supposed that way? Oracle 9.2.0.7, Raptor on XP SP2.
    Thanks.
    ben

    Thanks Donal. I tried and it did not work. Maybe I missed something? I used the same script file that works in SQL+. When I did that in Raptor by clicking the exceute script button, I did not see any thing in the script output window. I verified that by selecting * from user_objects (I was trying to create a sproc) and no sproc was created. Then I ran the script in SQL+, and then ran the select * from user_objects again in raptor, I got one row back.
    ben

  • USB working, not working, working?

    Hello,
    i own a 2008 Mac Pro and have some problems with my USB Ports. I tried to find information on the internet but i was not able to solve the problem. I did everything from smc Reset to Parameter Ram Reset, Installing a New System, Reinstalling the Combo Update but nothing worked at long sight.
    The trouble is, that some external USB Devices do not work on some of my USB Ports at my MAC Pro. Yesterday for example my original Apple Keyboard which was attached to the USB Hub at my DELL Screen stopped working while other devices still did their work. I plugged off all devices and tried different USB Ports and got the Keyboard to work on another port but afterwards my mouse did not work any more. The same problem occurs with my external WD passport USB Drive, my Iomega REV Drive and any other device. Some USB Ports work, some do not work. Some only work when they want to. The external WD USB drive used to be plugged into the front USB ports, where it worked perfectly until some months ago. I had to use another USB Port to get it to work but it also stopped working with the HDD some time later. Both of the Ports still work with my Ipod or Iphone but not with the HDD or other devices. I also tried to use a powered USB Hub which did not solve the problem on long sight. After setting a brand new leopard system, the WD HDD worked on one of the front usb ports but stopped doing so some time later.
    Can anyone help me with this issue? I am really desperate and annoyed ... i do not understand why this expensive machine does not work as it should.
    Thanks and best regards,
    tm

    I have an IMac (intel) and I am having the same problem. Since i updated the bluetooth firmware my bluetooth and usb ports do not work. Any clue?

  • List of features will work/not work in SRST

    Hello Team,
    Can I get the link from the Cisco site which will work and will not work( A complete feature list) to refere and inform to the business teams who can take the decision for a Migration Project, Thanks!!!
    Regards,
    Bala                  

    There are two modes of SRST - SRST itself (1) and Unified CME in SRST mode (2). Mode (2) provides more features for call-processing. Mode (1) is a bit simplier to configure.
    According to SRND:
    Unified CME in SRST Mode
    When Unified CME is used in SRST mode, it provides more call processing features for the IP phones
    than are available with the SRST feature on a router. In addition to the SRST features such as call
    preservation, auto-provisioning, and failover, Unified CME in SRST mode also provides most of the
    Unified CME telephony features for the SCCP phones, including:
    • Paging
    • Conferencing
    • Hunt groups
    • Basic automatic call distribution (B-ACD)
    • Call park, call pickup, call pickup groups
    • Overlay-DN, softkey templates
    • Cisco IP Communicator
    • Cisco Unified Video Advantage
    • Integration with Cisco Unity with MWI support at remote sites, with distributed Microsoft Exchange or IBM Lotus Domino server
    You can find additional information about SRST modes and features in SRND.
    Kind regards,
    Andrew C.

  • FaceTime worked not working on Mac Air

    FaceTime is not working on Mac Air version 10.9.4. Was working fine before. When logging in with Apple ID it will not Verify. Seems like it is corrupt. I can't reinstall app because when I throw it in the trash I get a message "FaceTime can't be modified or deleted because its required by OS X".

    You posted in the iPad forum instead of the OS X 10.9 forum. To get answers to your question, next time post in the proper forum. See https://discussions.apple.com/welcome I'll request that Apple relocate your post.
     Cheers, Tom

  • Worker not working on android device.

    Hi all.
    I'm trying to build multithreaded app for mobile but my initial test showed something like this:
    on desktop emulator:
    WorkerDomain.isSupported returns true and everything is working fine.
    same app on device (htc one x and nexus 7):
    WorkerDomain.isSupported returns true but
    WorkerDomain.current.createWorker(new WorkerSWF()) returns null and as a result worker.createMessageChannel(Worker.current) throws an error.
    In both cases Capabilities.version = "AND 11,4,400,252"
    Am I doing something wrong?

    Adobe Reader does support 'Submit' button in forms. There are two ways to achieve the same:
    Button action to submit an entire PDF document via email. You can add the same while creating the form by following these steps:
    Add the "Submit a form" action to your Submit button.
    Enter "mailto:" (including a colon) followed by email recipient(s).
    Select "PDF The complete document".
    JavaScript submitForm to Adobe FormsCentral (Doc - JavaScript for Reader Mobile API Reference (Android))
    If you are still observing issues with the Submit button in PDF forms after following the above two options, please send the form to [email protected] so that we may investigate the same.
    Thanks,
    Adobe Reader Team

  • Dictation works not working

    There are a lot of phrases that are supposed to make key commands possible with dictation, that do not work. Such as caps lock, caps, and the @ sign, often does not work. Sometimes the @ sign works, though... But caps NEVER works.
    Are there any others, and are there any fixes?
    Thanks!

    *words
    I thought dictation would get that right!

  • Email working not working

    I've noticed from the status page bt is showing email login issues as solved, is it still addressing issues this whole fiasco haso brought about?
    Yes I can get into my account now....but that's about it.
    No emails since Friday night apart from bt apology email.
    Cannot get ipad, I phone to work at all, they don't fault out on password issue as before just not sending or recieving.
    I have just managed in the last 10-15 mins to send myself a test email from one account to another which I can see if I of into my email via bt website., but these are not available on I pad or iphone only if I log into website, so 1 out of my 3 is back so I'm really hoping they don't think it's all fixed and have stopped working on the issues seems tho it says resolved.....it's quite clearly not .
    Usually I would of had maybe 40-60 emails in 1 of my accounts, and there's nothing even when I log on via website so there's something clearly not working....cominon bt get announcements up on the forum stop making people have to write posts like this keep us informed.
    1 getting very disgruntled customer

    My email account is still not working and I have just about had enough with the idiots at BT. It's been 12 days now and not once have I received anything close to constructive assistance with fixing whatever the problem is at BT's end. So far as I am concerned BT is now in breach of its contract with me in so far as continuation and quality of service is concerned. I bitterly regret renewing the annual phone line contract and will not do so again with this shambolic entity.

  • Perform ... ON COMMIT is not working

    Hello,
    I have to change Exclusion/Inclusion Flag in Invoice document after pressing SAVE button. I wrote code in FM 'RV_INVOICE_DOCUMENT_ADD'. I used implicit enhancement and put my logic at the end of FM. In Development server, since data is very less, so my code is running without using PERFORM.. ON COMMIT but is testing server, since data is very huge. So, my logic is not getting triggered.
    Actually, I am calling table VBRP and EIKP in this FM and at the time of selecting records from VBRP and EIKP, records are not present in these tables. But in Development, since data is very so it works fine. But in testing, it is getting failed.
    So, I used PERFORM.. ON COMMIT. But this is not calling my code even in Developemnt server.
    Please, help me, how to use PERFORM.. ON COMMIT. Or is there another place where in, I can put my code. BTW this FM is the last place where I am getting values in VBRP and EIKP tables. Before this FM, we don't get any values in VBRP and EIKP.
    Regards
    Arpit

    Hi Arpit,
    Can't you use another condition like import parameter WITH_POSTING to determine the execution of the code?
    And maybe placing your code in a function and call it with starting new task instruction where you can wait for the table updates.
    regards,
    Arpit

  • Java comm api not working in j2sdk1.4

    am doing a sms project in java..
    my code is works fine in jdk1.3 ,but when i tried in j2sdk1.4 it failed
    1.classpath used
    c:\j2sdk1.4.2_08\lib\comm.jar;
    2.copied win32 dll to j2sdk1.4.2_08\ bin
    3.comm.jar and java.properties toj 2sdk1.4.2_08\lib
    also in policy tool,grant allpermissons set
    thkx
    arvind

    i cant run the program in j2sdk1.4
    port is not opening.
    iam using comm.jar,javax.comm.properties ,win32 dll

  • Cfselect default value containing comma does not work

    I have a drop down list of Countries stored in a table as
    defined by UPS. These are used to calculate shipping charges.
    When a customer record is brought up and their country is
    "Ireland, Republic Of", the country displayed ends up being the
    first country in the list, which is Albania. Of course, when the
    user saves the record, they did not intentionally change the
    country, Albania is their new country. So I did not know there was
    a city of Dublin in Albania.
    Does the reporting of bugs feature on Adobe work? I posted
    this there a couple of weeks ago and did not hear anything.

    It just sort of seems to defeat the purpose of typedefs when you cannot use many of the property nodes.
    To me the purpose of typedefs is to make it easier to add / remove controls without having to replace all the clusters.
    On reading http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/1b04fd6a11e6f17286256c6300588bfa?OpenDocument
    carefully, the key point is
    "The only properties available for a strict type definition control are those that affect the appearance of the control such as Visible, Disabled, Key Focus, Blinking, Position, and Bounds."
    It is also annoying that the properties that are not available can still be used with no effect, without any compile error / warnings, runtime errors etc...
    So I modified the set VI by wirin
    g a property node to the strict type def reference. I used the control references propetry to get an array of references to the controls in the cluster. I then indexed the array to get to one of the boolean controls and set the value signaling property on the reference to the boolean button. This did generate an event.
    Dispite what it says above the value signaling property did update the values on the type def controls on the front panel without generating an event. I also tried the value property and that updated the value of the type def control.

  • Wired Keyboard - Comma Key not working

    I have the older model keyboard that came with my system and my comma key suddenly isn't working. Is there any fix to this? I've popped the key off - cleaned it - tested the little button inside using a pencil tip to press it down - restarted my computer - and nothing. Still doesn't work. All other keys work fine.
    Any thoughts on how I can fix this problem or do I have to purchase a whole new keyboard? BTW - there's no Apple Store within 100 miles to take it in and I can't ship it in for repair (have to have it for work). Any help or ideas??

    Keyboards as recent as yours tend to have a large rubber mat that provides the key "feel" and spring-back. The key "switches" are all printed on a circuit-board-like layer inside the keyboard, and there is no such thing as replacing a keyswitch.
    I think your most practical option is to obtain a spare keyboard and then send yours for repair. When it comes back, you will have a spare in case of emergency.
    Because new Macs come with a keyboard, and some users insist on a different keyboard, there is some traffic in new/lightly-used keyboards on eBay and similar venues. Really old keyboards (like ADB keyboards) go for US$10 plus about that much again for shipping. I have no idea what the market in recent keyboards is like.

Maybe you are looking for