EJB Transaction does not work

Hi,
I have a servlet, a session bean, and an entity bean. A servlet doesn't have any transaction attribute, a session bean has Required, and an entity bean has Required. I have the code like the following:
Servlet:
EJBDelegate ed = new EJBDelegate();
TwoPhaseSB sb = ed.getTwoPhaseSB();
sb.testTransaction();Session Bean:
public void testTransaction() {
    try{
        TestInfoLocal testInfo;
        TestInfoLocalHome testInfoHome = TestInfoUtil.getLocalHome();
        testInfo = testInfoHome.create("525252", "353535", "transaction test insert", "etc");
        testInfo.setElement_id("111111");
        //There's no item which has its primary key as 7777, so there's exception error occurs   
        testInfo = testInfoHome.findByPrimaryKey(new Integer(7777));
    }catch(Exception e){
         e.printStackTrace();
}Since the code in testTransaction is supposed to run in the same transaction, if there's exception occurrs, isn't it supposed to rollback? I mean, creation of item and update should be rollback. But, the data is inserted and created although there's exception. Could anyone can give me the idea why transaction doesn't work? FYI, I'm using Weblogic8.1.

Yes, you're right. I am using CMP. I added the following exceptions to my session bean but still the changes are updated:
     }catch(EJBException e){     
          e.printStackTrace();
     }catch (NamingException e) {
          e.printStackTrace();
     }catch (CreateException e) {
          e.printStackTrace();
     }catch (FinderException e) {
          e.printStackTrace();
     } I tried to insert "TransactionRolledbackException", but it's not thrown in any statement since my beans are managed by container. Could you tell me what exception should I use? Or should I add some exception to my entity bean? Finder methods are throwing FinderException currently.
Thanks,

Similar Messages

  • EJB annotation does not work but lookup does

    Hello, I am developing an application which has two modules: an EJB module and a WEB module. As I am using EJB 3 I would like to call the EJBs from the web module using the @EJB annotation.
    For example:
        @EJB(name = "GestioDeLlocsEJB")
        private GestioDeLlocsRemote gestioDeLlocs;
        public Collection<Lloc> getLlocs() {
            return gestioDeLlocs.findAllLlocs();
        }The problem is that the JEE container injects a null in the Remote interface ( gestioDeLlocs ) so it seems to fail when trying to match the name and the JNDI reference.
    I have added the following lines in sun-web.xml:
      <ejb-ref>
        <ejb-ref-name>GestioDeLlocsEJB</ejb-ref-name>
        <jndi-name>es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote</jndi-name>
      </ejb-ref>And I have added some lines in web.xml too:
       <ejb-ref>
            <ejb-ref-name>GestioDeLlocsEJB</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <remote>es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote</remote>
        </ejb-ref>I can test the EJBs by using the traditional lookup method:
    Context c = new InitialContext();
    return (GestioDeLlocsRemote) c.lookup("es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote");But I would like to use the @EJB annotation which seems not to work.
    What am I doing wrong?

    What kind of class are you putting the annotation on? Only certain managed classes like servlet classes,
    JSF managed beans, etc. support Java EE environment annotations. If it's a plain POJO the annotations
    will be ignored.

  • JTA Transaction does not work

    Hi,
    I am currently porting an application from Websphere 3.5 to Weblogic 6.1.
    I have an Oracle 8.1.7 database.
    I have a problem when rollbacking JTA transaction.
    I have a session bean manipulating Entity beans (CMP & BMP) within a single
    method.
    This method creates beans and then update them.
    The issue is that during the update, the application generates an exception
    (system or applicative). The method rollbacks the transaction, but if I look
    in the database, the insert requests are not rollbacked !
    I have tried two different approach:
    1) container manage transaction: I catch the exception and then call
    setRollbackOnly()
    2) bean manage transaction: I retrieve the user transaction, and apply the
    rollback on exception.
    What's wrong with that ? This actually works fine on Websphere.
    Regards
    Jacques Desmazieres

    Make sure that you are using a TxDataSource and not a plain DataSource.
    (This is configured in the console.)
    -- Rob
    Jacques Desmazieres wrote:
    Hi,
    I am currently porting an application from Websphere 3.5 to Weblogic 6.1.
    I have an Oracle 8.1.7 database.
    I have a problem when rollbacking JTA transaction.
    I have a session bean manipulating Entity beans (CMP & BMP) within a single
    method.
    This method creates beans and then update them.
    The issue is that during the update, the application generates an exception
    (system or applicative). The method rollbacks the transaction, but if I look
    in the database, the insert requests are not rollbacked !
    I have tried two different approach:
    1) container manage transaction: I catch the exception and then call
    setRollbackOnly()
    2) bean manage transaction: I retrieve the user transaction, and apply the
    rollback on exception.
    What's wrong with that ? This actually works fine on Websphere.
    Regards
    Jacques Desmazieres

  • EJB transaction isolation not working

    I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB test application
    with no success so far.
    The environment is Windows NT, WebLogic 6.1, Informix DB (which, according to
    its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx Data Source on
    a JDBC pool.
    I have an CMP Entity EJB with the following definitions:
    <container-transaction>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <transaction-isolation>
    <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    The entity EJB is used by a servlet that uses JTA to establish a transaction that
    the EJB methods should share ("Required" transaction attribute). The servlet is
    as follows:
    // Establish a transaction
    UserTransaction trn =
    (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    trn.begin();
    trn.setTransactionTimeout(20);
    // Get the EJB
    SdrFA fFA = home.findByPrimaryKey( fFAPK );
    // Update an attribute
    fFA.setSomeAtt("someData");
    // Sleep to control concurrency
    Thread.currentThread().sleep(t * 1000);
    // commit
    trn.commit();
    I expected this setup to prevent concurrent updates and even accesses to the same
    DB table row, but this is not the case: when I invoke the servlet from a session
    and then invoke it again from another session while the first one is sleeping,
    the second one completes all right and is visible in the DB before the first one
    commits.
    Just in case TRANSACTION_SERIALIZABLE is not supported after all, I tried TRANSACTION_REPEATABLE_READ
    instead whith the same results.
    Is there something I'm missing, or any error in my setup?
    Thanks for any suggestion,
    Pere Torrodellas

    Hi Pere,
    AFAIR delay-updates-until-end-of-tx is set to True by default, so the
    actual update is not issued untill TX is commited. I'd try setting it to
    false and running the test again.
    Here are some documentation references:
    http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1048164
    http://e-docs.bea.com/wls/docs61/ConsoleHelp/wls_ejb_jar_dtd.html
    Regards,
    Slava Imeshev
    "Pere Torrodellas" <[email protected]> wrote in message
    news:[email protected]...
    >
    I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB testapplication
    with no success so far.
    The environment is Windows NT, WebLogic 6.1, Informix DB (which, accordingto
    its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx DataSource on
    a JDBC pool.
    I have an CMP Entity EJB with the following definitions:
    <container-transaction>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <transaction-isolation>
    <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    The entity EJB is used by a servlet that uses JTA to establish atransaction that
    the EJB methods should share ("Required" transaction attribute). Theservlet is
    as follows:
    // Establish a transaction
    UserTransaction trn =
    (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    trn.begin();
    trn.setTransactionTimeout(20);
    // Get the EJB
    SdrFA fFA = home.findByPrimaryKey( fFAPK );
    // Update an attribute
    fFA.setSomeAtt("someData");
    // Sleep to control concurrency
    Thread.currentThread().sleep(t * 1000);
    // commit
    trn.commit();
    I expected this setup to prevent concurrent updates and even accesses tothe same
    DB table row, but this is not the case: when I invoke the servlet from asession
    and then invoke it again from another session while the first one issleeping,
    the second one completes all right and is visible in the DB before thefirst one
    commits.
    Just in case TRANSACTION_SERIALIZABLE is not supported after all, I triedTRANSACTION_REPEATABLE_READ
    instead whith the same results.
    Is there something I'm missing, or any error in my setup?
    Thanks for any suggestion,
    Pere Torrodellas

  • F1 help does not work in transaction SE80

    Hi Experts!
    A strange error occurred in our ECC 6.0 SR3 system (Windows 2003 SE 64 bit based, MaxDB 7.6.03.009). F1 help does not work in transaction SE80. Either nothing is shown when a keyword as SELECT is marked and F1 key is pressed, or a strange popup appears with title u201CABAP Keyword Documentationu201D and root u201CHit List of Index Searchu201D - [screenshot|http://i43.tinypic.com/aox7d.jpg]. No matter what I choose in the tree it always closes, no help is displayed and SAP GUI returns in the main screen in transaction SE80.
    I found this thread [Re: SAP F1 Help and SE80 issue|Re: SAP F1 Help and SE80 issue] but it did not help me. This is my system information:
    SAP PC VERSION INFORMATION: saplogon.exe
    MAIN MODULE INFORMATION:
       saplogon.exe
       SAP Logon за Windows
       Final Release 710
       7100.3.12.1042
       1046700
    SYSTEM INFORMATION:
       Operating system: Microsoft Windows XP 5.1 (2600) Service Pack 3
       Internet Explorer v. 7.0
    Application help works perfect - I checked the configuration in transaction SR13 too.
    Any ideas will be appreciated!
    Thanks!

    Hi Presu,
    As it is seen from my previous post SAP GUI version is 7.10 SP 12. I downloaded the last SP 13 and installed it. Now SAP GUI information looks like this:
    SAP PC VERSION INFORMATION: saplogon.exe
    MAIN MODULE INFORMATION:
       saplogon.exe
       SAP Logon за Windows
       Final Release 710
       7100.3.13.1045
       1063164
    The problem is not resolved.
    This happens from different workstations with different versions and sub-versions of SAP GUI, so the problem is not caused from the GUI I think. It happens using different logon users and in all SAP system cliens.
    Any other suggestions?
    Best regards,
    Pit

  • BATCH-INPUT On transaction VT02 does not work.

    Greetings, colleagues!!!
    I have written BATCH-INPUT on transaction VT02. I try to remove delivery from transportation. But for me does not work BATCH-INPUT because function of "Positioning" does not work in BATCH-INPUT. Prompt please. How I can remove delivery from transportation in my program using functionality of transaction VT02?
    Thanks for the help.
    Sergey Kozymaev.

    I used this in a program a while ago, worked like a charm.
    s_header-shipment_num = <shipment #>.
      i_item-delivery = <delivery #>.
      APPEND i_item.
      i_itemaction-delivery = 'D'.
      i_itemaction-itenerary = 'D'.
      APPEND i_itemaction.
      CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
        EXPORTING
          headerdata       = s_header
          headerdataaction = s_headeraction
        TABLES
          itemdata         = i_item
          itemdataaction   = i_itemaction
          return           = i_return.

  • Em.merge does not work while em.persist does?

    Hello,
    I have a stateless session bean with code snippets below.
        @PersistenceContext
        private EntityManager em;
        public void setList(ContainerList list, int key) {
            ContainerList stored = (ContainerList)em.find(ContainerList.class, key);
            list.setId(key);
            if (stored == null) { em.persist(list); }
            else {
                em.merge(list); // 1st alternative
    //            stored.copy(list); // 2nd alternative
    ...When I call the method setList for a non existing key, the entity is stored in the database. When I call the method for an existing key, the old value is not updated by the new, i.e. the merge method has no effect. If I comment out the 2nd alternative, it has no effect either. Does anyone has an idea why this does not work? I am using Netbeans 5.5 and 5.5.1 release candidate 1. (With the included application server.)

    Hello,
    I will try to summarise my knowledge of the JAVA persistence API as the documentation is not always clear and may be misleading.
    In SQL you have 4 main statements: INSERT, SELECT, UPDATE and DELETE.
    with
    @PersistenceContext
    private EntityManager em;some documentation appears to make the following associations:
    em.persist(Object entity) -> INSERT
    em.find(Class entityClass, Object primaryKey) -> SELECT
    em.merge(Object entity) -> UPDATE
    em.remove(Object entity) -> REMOVE
    However, practice shows that this is NOT the case!
    em.merge(Object entity) does exactly the same thing as em.find(Class entityClass, Object primaryKey)! The only difference is that the em.merge(Object entity) method takes a detached object of the entity class as argument with the same primary key as the attached object you are loading.
    Detached objects are objects of the entity class the database manager is not aware of. Attached objects are objects in the database and are managed by the persistence context. Every newly created object of an entity class is detached. You can attach them to the database with the em.persist(Object entity) method call. Attached objects can be retrieved with the em.find(Class entityClass, Object primaryKey) or with the em.merge(Object entity) method. All changes made to attached objects are automatically stored in the database. There thus is no explicit method for the UPDATE statement. You just make changes to attached objects and the entity manager copies the changes to the database (at the end of the persistence context). An easy way to make all the changes you need at once is to have a detached object that contains the right values and then copy all these values to the associated attached object with a self defined copy method in the entity class as in
       Entity detached;
    // --> begin persistence context
       Entity attached = em.merge(detached);
       attached.copy(detached);
    // <-- end persistence contextIf you are working with session beans, the persistence context standard begins with the beginning of a transaction and ends with the end of a transaction. A transaction standard begins with the start of a session bean method and ends with the session bean method. If you choose to, you can make the persistence context of type extended with
    @PersistenceContext(type=PersistenceContextType.EXTENDED)
    private EntityManager em;In this case, the persistence context ends when the session bean is removed from the EJB container. (Can be useful to keep attached entities in the state of an stateful session bean.)
    Without session beans, you have to declare explicitely the start and end of a persistence context or transaction, but I refer to existing documentation for this, as I do not actively know how to handle things without session beans.
    Finally, the methods em.persist(Object entity) and em.merge(Object entity) use a detached object as argument, while em.remove(Object entity) uses an attached object as argument (using a detached object results in an Exception thrown).
    I hope this makes some things clear

  • SUBMIT does not work in background...

    Hi guys,
    We have a copy program of a standard transaction and once we use this copy program in the main program via SUBMIT... it does not work in background...
    Why is this so,,, Please advice...
    THanks!

    Hi,
    When executing some program using the statement like SUBMIT prog_2 WITH parameters and RETURN.
    In foreground PROG_2 is executed, and once you click on the BACK button the code written after this SUBMIT statement will be executed.
    If you are executing the same in the BACKGROUND mode, no feasibility of clicking on BACK button, hence control will remain in the PROG_2 only after executing its logic.
    Please code accordingly.

  • I was billed for a renewal with eHarmony that does not work. Eharmony said itunes claims the charge didnt go through but I have already been billed. How do I get my money back or get my subscription working??

    I was billed for a renewal with eHarmony via iTunes that does not work. Eharmony said itunes claims the charge didnt go through but I have already been billed it is on my bank statement. How do I get my money back or get my subscription working?? I have all transaction ID's and invoice numbers. Please help this has been very frustrating, thanks.

    Yes, I reported the problem using that exact sequence immediately after discovering the problem with the app.  When I submitted my complaint and request, Apple redirected me the website of the app manufacturer where I submitted the same complaint/request for refund.  I have not heard back from either, and was still charged, so I can only assume that is not the correct way to "Report a Problem" even though Apple would have you believe otherwise.

  • In FB60, duplicate invoice check does not work if invoice date is different

    In FB60, duplicate invoice check does not work if invoice date is different
    This issue is in FB60 and not MIRO.
    Duplicate invoice check is activated in vendor master.
    I posted an invoice for a vendor with amount $ 100, Reference 1234 Invoice date Nov 01, 2011
    I tried posting for same vendor (and also Co Code) with amount $ 100, Reference 1234 Invoice date Nov 01, 2011. System does not allow. This is fine.
    Now I change only date, from Nov 01 to Nov 02, and system allow posting.
    Why I don't get the error message when date is different ? It should not be treated as a different invoice since invoice reference, amount, Vendor and Co Codes are same.
    SAP documentation says that it checks document date during duplicate invoice check even for FI invoices, then why does it allows in this case.
    Is this a bug ?
    I already tried changing settings in SPRO under LIV, this does not impact FB60 invoice booking.
    Thanks
    Sandeep

    Hi,
    Use BTE - 1110 - (Check on Invoice Duplication) for FB60. Take the help of your ABAPer to make a coding in Function module mentioned in BTE.
    Need to make a copy of the FM and then you can do relevant coding.
    refer the link.
    [http://www.thesapconsultant.com/2006/10/sap-business-transaction-events.html]
    Regards,
    Shridhar

  • 1KEK Transfer payables/receivables does not work

    Hello all,
    The 1KEK report does not work. Though it says "data was copied from co code" it does not reflect in the PCA reports. Nor does it show any log. No document is created.
    Are there any config settings to make this happen ?
    We have new GL but documnet split is not activated and we don't want to. We want to use classic PCA to derive Balance sheet.
    Thanks
    Sandeep

    Dear Sandeep,
    Did you execute transaction F.5D. If NO then execute.

  • Bapi_document_create2 does not work correctly with attached file.

    Hi all.
    I hava a problem with bapi. I programmed below.
            ls_docdata-documenttype = 'BBS'.
            ls_docdata-description  = 'JJW test'.
            ls_file-documenttype = 'BBS'.
            ls_file-ORIGINALTYPE = 1.
            ls_file-storagecategory = 'ZSTW_KPRO'.
            ls_file-wsapplication = 'TXT'.
            ls_file-docfile = entity_filename.
            append ls_file to lt_files.
            CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
              EXPORTING
                documentdata       = ls_docdata
                PF_FTP_DEST = 'SAPFTP'
                PF_HTTP_DEST = 'SAPHTTP'
              IMPORTING
                documenttype               =      lv_documenttype
                documentnumber           =     lv_documentnumber
                documentpart                =     lv_documentpart
                documentversion           =     lv_documentversion
                return                           =     ls_return
              tables
                documentfiles     = lt_files.
            call function 'BAPI_TRANSACTION_COMMIT'.
    If I don't attach the file, DIR is created but if attach some files, it does not work. What should I do??
    regards.

    Hi,
    You can use the below to attach the file from BSP to SAP. But it doesnt use the BAPI - 'BAPI_DOCUMENT_CREATE2'. It works perfectly for me. Let me know if you have any questions.
    Note: This code put the file into SAP Directory "/userapps/master_data/" as well as it upload the file into Transaction WTY since i am using Business object:BUS2222. You may need to modify the Business object if you ahve the one, otherwise you can just put it into SAP DIR.
    FUNCTION ZATTACH_CREATE.
    *"*"Update function module:
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(FILE) TYPE  SAPB-SAPFILES
    *"     VALUE(STR_FILE_CONTENT) TYPE  XSTRING
    *"     VALUE(OBJECT_KEY) TYPE  BAPIBDS01-OBJKEY
      DATA: LOGICAL_SYSTEM TYPE BAPIBDS01-LOG_SYSTEM,
            CLASSNAME TYPE  BAPIBDS01-CLASSNAME,
            CLASSTYPE TYPE  BAPIBDS01-CLASSTYPE.
      DATA:  IT_FILES TYPE TABLE OF  BAPIFILES,
            IT_SIGNATURE TYPE TABLE OF  BAPISIGNAT,
       FILES TYPE  BAPIFILES,
      SIGNATURE TYPE   BAPISIGNAT.
      DATA: I_TOADD TYPE TOADD,
            FILENAME_ALL TYPE SAPB-SAPFILES,
            FILE_PATH TYPE SAPB-SAPFILES,
            FILE_PATH_MEMORY(250) TYPE C,  " path für SAP memory
            FILE_PATH_LENGTH TYPE I,       " length of the file_path
           FILE_CONTENT_LENGTH TYPE I,       " length of the file_CONTENT
           FILE_NAME TYPE SAPB-SAPFILES,
            FILE_EXTENSION TYPE TOADD-DOC_TYPE.     " file-extension.
      DATA: I_FILE_CONTENT TYPE TABLE OF BAPICONTEN.
      DATA: WA_FILE_CONTENT TYPE  BAPICONTEN,
       STRING_CONTENT TYPE STRING,
       STRING_CONTENT1 TYPE STRING.
      DATA:
       I_FILES TYPE TABLE OF BAPIFILES ,
            I_SIGNATURE TYPE TABLE OF BAPISIGNAT ,
            I_COMPONENTS TYPE TABLE OF BAPICOMPON ,
           COMPONENTS TYPE BAPICOMPON ,
            I_PROPERTIES TYPE TABLE OF SDOKPROPTY ,
            I_PROPERTIES2 TYPE TABLE OF BAPIPROPER ,
            I_PROPERTIES_DEL TYPE TABLE OF BAPIDPROPT ,
           MIMETYPE TYPE TOADD-MIMETYPE,
      COMPID TYPE BAPICOMPON-COMP_ID,  " compid for popup
            COMPID_FLAG(1) TYPE C,           " compid can't be changed
            MODIFY_FLAG(1) TYPE C,           " document is modified
            ATTRI_FLAG(1) TYPE C,            " attri can't be changed
            TITLE_FLAG(1) TYPE C,            " titel of the popup
            CANCEL_FLAG(1) TYPE C,           " cancel button Yes/No
            BUTTON_TEXT(10) TYPE C,
            INFO_TEXT(100) TYPE C,
      VERSION_NR TYPE BDN_CON-DOC_VER_NO,     " version_nr for popup
            VERSION_LANGU2 TYPE T002T-SPTXT, " language field in POPUP
            VERSION_LANGU TYPE BDN_CON-LANGU," SPRAS language field
            TITLE_TEXT(100) TYPE C,          " title of the popup
            DESCRIPTION TYPE BDN_CON-DESCRIPT.      " descr. for popup
    *FILENAME_ALL = fileUpload_event->file_name.
    * Transfering into SAP File server.
      FILE_CONTENT_LENGTH = XSTRLEN( STR_FILE_CONTENT ).
      FILENAME_ALL = FILE .
      STRING_CONTENT = STR_FILE_CONTENT.
      DATA: OUT_LINES TYPE TABLE OF XSTRING.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = STR_FILE_CONTENT
    *   APPEND_TO_TABLE       = ' '
    * IMPORTING
    *   OUTPUT_LENGTH         =
        TABLES
          BINARY_TAB            = I_FILE_CONTENT.
      DELETE DATASET '/userapps/master_data/claim1.txt'.
      OPEN DATASET '/userapps/master_data/claim1.txt' FOR APPENDING
        IN TEXT MODE ENCODING DEFAULT.
    *  LOOP AT I_FILE_CONTENT INTO WA_FILE_CONTENT.
    *    TRANSFER STR_FILE_CONTENT TO '/userapps/master_data/claim1.txt'.
      TRANSFER STRING_CONTENT TO '/userapps/master_data/claim1.txt'.
    *  ENDLOOP.
      CLOSE DATASET '/userapps/master_data/claim1.txt'.
      OPEN DATASET '/userapps/master_data/claim1.txt' FOR INPUT
           IN TEXT MODE ENCODING DEFAULT.
      READ DATASET '/userapps/master_data/claim1.txt'  into STRING_CONTENT1.
    * -- split filename                                                 -- *
        DATA: LENGTH TYPE I.
      DATA: PATH2(1200).  " LIKE sapb-sapfiles.
      DATA: L_FILE(1200),
            L_DIR(1200),
            L_DELIMITER        TYPE C,
            L_OFFSET           TYPE I,
            L_BYTES            TYPE I,
            L_DELIMITER_OFFSET TYPE I,
            L_DELIMITER_BYTES  TYPE I,
            L_CHAR             TYPE C,
            L_PREVIOUS_CHAR    TYPE C,
            L_LAST_CHAR        TYPE C.
      PATH2 = FILENAME_ALL.
      LENGTH = STRLEN( PATH2 ).
      L_OFFSET = 0.
      WHILE L_OFFSET < LENGTH.
        L_LAST_CHAR = L_CHAR. "remember last character
        L_BYTES = CHARLEN( PATH2+L_OFFSET ).
        L_CHAR = PATH2+L_OFFSET(L_BYTES). "get current character
        IF L_CHAR = '/' OR L_CHAR = '' OR L_CHAR = ':'.
          IF L_DELIMITER IS INITIAL OR L_DELIMITER = ':'.
            "Typically we deal with absolute paths, so the first
            "delimiter is best. This allows for UNIX paths with
            "'' in the directory or file name
            L_DELIMITER = L_CHAR.
          ENDIF.
          IF L_CHAR = L_DELIMITER.
            L_DELIMITER_OFFSET = L_OFFSET.
            L_DELIMITER_BYTES = L_BYTES.
            "remember character in front of delimiter:
            L_PREVIOUS_CHAR = L_LAST_CHAR.
          ENDIF.
        ENDIF.
        L_OFFSET = L_OFFSET + L_BYTES.
      ENDWHILE.
      IF NOT L_DELIMITER IS INITIAL.
        L_OFFSET = L_DELIMITER_OFFSET + L_DELIMITER_BYTES.
        L_FILE = PATH2+L_OFFSET.
        IF L_PREVIOUS_CHAR = ':' OR L_DELIMITER = ':'.
          "path ends with or after drive identifer, include the delimiter
          L_DIR = PATH2(L_OFFSET).
        ELSEIF NOT L_DELIMITER_OFFSET IS INITIAL.
          "do not include a trailing delimiter for compatibility reasons
          L_DIR = PATH2(L_DELIMITER_OFFSET).
        ELSE.
          CLEAR L_DIR.
        ENDIF.
      ELSE.
        L_DIR = SPACE.
        L_FILE = PATH2.
      ENDIF.
      FILE_PATH = L_DIR.
      FILE_NAME = L_FILE.
    * -- set new file_path to SAP memory                                -- *
      FILE_PATH_LENGTH = STRLEN( FILE_PATH ).
      IF FILE_PATH <> SPACE AND FILE_PATH_LENGTH < 250.
        FILE_PATH_MEMORY = FILE_PATH.
        SET PARAMETER ID 'OAP' FIELD FILE_PATH_MEMORY.
      ELSE.
        FILE_PATH_MEMORY = SPACE.
        SET PARAMETER ID 'OAP' FIELD FILE_PATH_MEMORY.
      ENDIF.
    * -- data declaration ------------------------------------------------ *
      DATA:
            SINGLE_C TYPE C.
      CLEAR: SINGLE_C.
      LENGTH = STRLEN( FILE_NAME ).
      IF LENGTH > 0.
        WHILE LENGTH > 0.
          SINGLE_C = FILE_NAME+LENGTH(1).
          IF SINGLE_C CO '.'.
            LENGTH = LENGTH + 1.
            EXIT.
          ELSE.
            LENGTH = LENGTH - 1.
          ENDIF.
        ENDWHILE.
        IF LENGTH > 0.
          FILE_EXTENSION = FILE_NAME+LENGTH.
        ELSE.
          FILE_EXTENSION = SPACE.
        ENDIF.
      ELSE.
        FILE_EXTENSION = SPACE.
      ENDIF.
      IF FILE_EXTENSION <> SPACE.
        SET LOCALE LANGUAGE SY-LANGU.
        TRANSLATE FILE_EXTENSION TO UPPER CASE.              "#EC TRANSLANG
        SET LOCALE LANGUAGE SPACE.
      ENDIF.
    * TR001++
      DATA: I_TOADV TYPE TABLE OF TOADV.
      DATA: WA_TOADV TYPE TOADV.
      DATA: OBJECT TYPE SAEOBJART.
      SELECT * FROM TOADV INTO CORRESPONDING FIELDS OF TABLE
              I_TOADV WHERE STANDARD = 'X'.
      DELETE I_TOADV WHERE AR_OBJECT CS 'BDS' OR AR_OBJECT CS 'ZSEST'.
      READ TABLE I_TOADV INTO WA_TOADV WITH KEY DOC_TYPE = FILE_EXTENSION.
    * -- get name and description for the document                      -- *
      CLEAR: COMPID,
             DESCRIPTION,
             VERSION_NR,
             MODIFY_FLAG,
             COMPID_FLAG,
             ATTRI_FLAG,
             TITLE_FLAG.
      COMPID_FLAG    = ' '.              " -> compid can't be changed
      MODIFY_FLAG    = 'S'.              " -> popup in save modus
      ATTRI_FLAG     = 'X'.              " -> attri's can be changed
      COMPID         = FILE_NAME.
      VERSION_NR     = '00000001'.
      VERSION_LANGU2 = SY-LANGU.
      TITLE_FLAG     = '1'.              " -> BDN
    * -- get the mimetype of the docuclass                              -- *
    *PERFORM MIMETYPE_GET(OAALL) USING FILE_EXTENSION
    *                            CHANGING I_TOADD.
      DATA: I_DOCUMENTCLASS TYPE TOADD-DOC_TYPE.
      MOVE FILE_EXTENSION TO I_DOCUMENTCLASS.
      SET LOCALE LANGUAGE SY-LANGU.
      TRANSLATE I_DOCUMENTCLASS TO UPPER CASE.               "#EC TRANSLANG
      SET LOCALE LANGUAGE SPACE.
      SELECT SINGLE * FROM TOADD INTO I_TOADD WHERE
                                 DOC_TYPE EQ I_DOCUMENTCLASS.
      IF SY-SUBRC NE 0.                    " nothing found -> default!
        I_TOADD-DOC_TYPE = I_DOCUMENTCLASS.
        I_TOADD-MIMETYPE = 'application/x-docType'.             "#EC NOTEXT
      ENDIF.
      MOVE I_TOADD-MIMETYPE TO MIMETYPE.
    * -- fill file and signature structure                              -- *
      CLEAR: I_FILES, I_SIGNATURE.
      REFRESH : I_FILES, I_SIGNATURE.
      DESCRIPTION = FILE_NAME.
      FILES-DOC_COUNT = 1.
      FILES-DIRECTORY = FILE_PATH.
      FILES-FILENAME  = FILE_NAME.
      FILES-MIMETYPE  = MIMETYPE.
      APPEND FILES TO I_FILES.
    * -- fill components and signature structure                        -- *
      COMPONENTS-DOC_COUNT  = 1.
      COMPONENTS-COMP_COUNT = 1.
      COMPONENTS-MIMETYPE   = MIMETYPE.
      COMPONENTS-COMP_ID         = FILE_NAME.
      APPEND COMPONENTS TO I_COMPONENTS.
      SIGNATURE-DOC_COUNT  = 1.
      SIGNATURE-PROP_NAME  = 'BDS_DOCUMENTCLASS'.
      SIGNATURE-PROP_VALUE = FILE_EXTENSION.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME = 'BDS_CONTREP'.
    *IF BDS_DOCTYPE_LIST-CONTREP = SPACE.
      SIGNATURE-PROP_VALUE = ' '.                               "#EC NOTEXT
    *ELSE.
    *  I_SIGNATURE-PROP_VALUE = BDS_DOCTYPE_LIST-CONTREP.
    *ENDIF.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'BDS_DOCUMENTTYPE'.
      SIGNATURE-PROP_VALUE = WA_TOADV-AR_OBJECT. "'ZSRVCXLS'."TR001+
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'DESCRIPTION'.
      SIGNATURE-PROP_VALUE = DESCRIPTION.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'LANGUAGE'.
      SIGNATURE-PROP_VALUE = VERSION_LANGU.
      APPEND SIGNATURE TO I_SIGNATURE.
      CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
        EXPORTING
    *   LOGICAL_SYSTEM        =
          CLASSNAME             = 'BUS2222' "classname_select
          CLASSTYPE             = 'BO'" classtype_select
        CLIENT                = SY-MANDT
          OBJECT_KEY            = OBJECT_KEY
        BINARY_FLAG           = 'X'
    * IMPORTING
    *   OBJECT_KEY            =
        TABLES
          SIGNATURE             = I_SIGNATURE
          COMPONENTS            = I_COMPONENTS
        CONTENT               = I_FILE_CONTENT
    *   ASCII_CONTENT         =
    * EXCEPTIONS
    *   NOTHING_FOUND         = 1
    *   PARAMETER_ERROR       = 2
    *   NOT_ALLOWED           = 3
    *   ERROR_KPRO            = 4
    *   INTERNAL_ERROR        = 5
    *   NOT_AUTHORIZED        = 6
    *   OTHERS                = 7
      COMMIT WORK AND WAIT.
      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.
    Message was edited by:
            Raja T

  • "Quit" in ITS Header does not work properly

    Hello,
    we have a self-made ESS Service in use (http://itshost:port/scripts/wgate/zmfa/!). In this service the "Quit" Link in the ESS header does not work.
    When we start e.g. the pz04 transaction on the ITS (http://itshost:port/scripts/wgate/pz04/!) the "Quit" button does work properly, and ends the ITS Session.
    I already tried to set the ~exiturl to a close_window.html file, but still it doesn't work in the self-made service.
    This line is included in the service:
    `include(~service="system", ~language="", ~theme="dm", ~name="TemplateLibraryDHTML.html")`
    I guesss changing the templatelibrarybasis.html won't work, since the pz04 also uses this template, and there it works. We don't want to remove these "Quit" and "Help" links in the header, since they are still being used (due to older Release of R/3, no Portal App).
    It's a standalone ITS 6.20, latest patch, newly installed.
    Anybody have an Idea?
    Thanks.
    Regards,
    Daniel

    Usually the profiler gives higher execution times than is true, since it is using resources itself. Make sure the profiler is started before starting the program (while in edit mode vs run time mode). Wait for the completion of all vis, then stop the profiler.
    Of course, the sub vis may actually execute faster than the profiler can discriminate (eg faster than a microsecond), which happens frequently.
    2006 Ultimate LabVIEW G-eek.

  • Substitution does not work

    Hi,
    I create substitution using exit by copy RGGBS000 to ZRGGBS000 and activated it in tcode OBBH. When I test using Tcode F-02, saves as complated, it is work.
    My questions:
    1. When I changes my parked document, why my substitution does not work ?
    2. When I create document using Tcode F-65 and save as complate, why my substitution does not work ?
    Thanks,

    HI,
    Note 158739 describes in detail the standard program behaviour. It's not a bug! It's the designed system behaviour.
    The requirement can be fulfilled by a substitution when the document is posted. Or you can work with the ENJOY transactions, which enable substitutions when a document is saved as complete or posted. In case of just parking the substitutions don't work in ENJOY either.
    Regards
    Ravinagh Boni

  • Sending by mail an Invoice with VF02 does not work

    Hi guys,
    When using VF02 to send by mail an invoce form, the functional consultant is in trouble since it does not work. I am ABAP consultant, and before starting to debug the huge amount of lines of code behind this transaction, I think there might be a more straight solution. When setting the invoice number and entering this transaction, we accessed Goto->Header->Output. The output table to enter our fields appears. Here we set ZXXX as output type and External send like the Medium. When I press enter, the line is automatically filled with the rest of fields. Then we go to Further Data and choose the Send Immediatelly (when saving the application) option. Get back and press Save button. After it, a message "Please enter a communication strategy" is shown and the SD consultant told me that the correct option is MAIL (in fact, this option is part of the F4 help, with "email" as descriptive text) in the Communication strategy field. She told me it should be all to send a mail with the invoice. We did not fill the Logical destination nor checked "Print immediatelly" or "Release after output" checkboxes since they are not useful in this case. So when finally Save button is pressed, a message appears: " ", and then a dialog box appears with the following message: " Express document "Update was terminated" received from author "GILBERTO PARGA"". The mail received in my inbox is only a error message with title "Update was terminated" and the content is the following:
    Update was terminated
    System ID....   XXX
    Client.......   999
    User.....   SOMEBODY
    Transaction..   VF02
    Update key...   XXXXXXXXXXXXXXXXXXXXXX
    Generated....   12.05.2011, 20:37:27
    Completed....   12.05.2011, 20:37:27
    Error Info...   Output device not defined.
    The system is SAP ECC 6.0. Note that the message indicates no output device was defined, but since we are using email instead of print output, it does not matter. I have filled the field with the same result. I have read from Internet it could be a configuration trouble (the SD consultant checked it before, according herself) or even a Basis issue. Anyway, do you know the possible causes and possible solutions (like OSS Notes) for this trouble? The print output works fine, by the way.  Thank you all for your help.

    Hi,
    If you maintain method EXTERNAL SEND then in communication method you have to specify Communication strategy as CS01(Internet/letter)
    If you maintain method simple mail then in communication method you have to maintain RECIPIENT and RECIPIENT TYPE
    Also check the number range assignment for billing type for error "Update was terminated"
    you might be assigned numbers which are already consumed.
    kapil

Maybe you are looking for

  • BAPI Error: No account assignment exists for service line 0000000000

    I am using BAPI : BAPI_PO_CREATE1 to create a PO. I am getting this error while creating PO  "No account assignment exists for service line 0000000000" Please help.

  • IPod Clas. 80GB - What kind of dock to connect to home stereo (Audio only)

    Hi Everyone, I've been reading all sorts of threads about problems people have been having with the iPod classic (80GB) and dock compatibility. Do you have any recommendations for docks that will actually work ($50-$100 range)? I'm not that technolog

  • Systemd-fsck complains that my hardware raid is in use and fail init

    Hi all, I have a hardware raid of two sdd drives. It seems to be properly recongnized everywhere and I can mount it manually and use it without any problem. The issue is that when I add it to the /etc/fstab My system do not start anymore cleanly. I g

  • Wildcards in the class definition

    I have a class which extends java.util.Hashtable. The Key is String and value is a HttpClient object, but in future I can have Values as objects other than HttpClient. I was thinking to use a wildcard for storing the value, but the syntax isn't right

  • Video and game performance Satellite P100-434

    I got myself a nice new P100-434 just 2 weeks ago, When tring to play a game or a DVD It starts of ok but after a short time the frame rate drops right of then comes back up then back down.. I took it back to the shop and they gave me a new one but t