How to code this : LE_SHIPMENT_BADI : method : At_Save

Hi Friends:
I'm working on LE_SHIPMENT_BADI. In the method At_Save, I've written the following code:
METHOD if_ex_badi_le_shipment~at_save.
This is just an additional check to ensure the following requirement:
If the ship-to-party begins with XX, then Shipment type should be 'ZSTO'.
If the ship-to-party doesn't begins with XX, then Shipment type should be '0001'.
  CONSTANTS : c_zsto  TYPE vttkvb-shtyp VALUE 'ZSTO',  "Constant for shipment type ZSTO
              c_0001  TYPE vttkvb-shtyp VALUE '0001',  "Constant for shipment type 0001
              c_xx(2) TYPE c            VALUE 'XX'.    "Constant for the first 2 characters of Ship-to-party
  DATA : v_kunwe TYPE vtrlk-kunwe,
         v_shp   TYPE vttkvb-shtyp,
         v_vttk  TYPE vttkvb.
  FIELD-SYMBOLS : <fs>    TYPE vtrlk.
This provision is made if the internal table CHA_SHIPMENTS_AT_SAVE
is initial, which is generally not the case. If such case is observed
the the below mentioned code can be used.
*if CHA_SHIPMENTS_AT_SAVE is initial.
*CHA_SHIPMENTS_AT_SAVE = IM_shipments_AT_SAVE.
*endif.
  READ TABLE cha_shipments_at_save-new_vtrlk ASSIGNING <fs> WITH KEY kunwe+0(2) = c_xx.
  IF sy-subrc = 0.
    v_shp = c_zsto.
  ELSE.
    v_shp = c_0001.
  ENDIF.
  v_vttk-shtyp = v_shp.
  MODIFY cha_shipments_at_save-new_vttk
         FROM v_vttk TRANSPORTING shtyp
         WHERE shtyp <> v_shp.
ENDMETHOD
Now I have to put one more check in it. There is a field LFART in table VTRLK . I want the above coding to work only when LFART = LF, ZLF, LR and ZLR. Please help me in implementing this.
Suitable points will be Rewarded.
Regards:

Hello,
If you have the values for LFART then simply check loke:
CHECK ( lfart = 'XX'  or lfart = 'YY').
and here check for the other condition,
Regards,
Sandeep

Similar Messages

  • How to code this?

    Hi All,
    Our application development will need to come up with a solution to update table B and tables C whenever a value in table A is changed to a certain value. Since I am new to Oracle stored procedures, I would like get some help on this. Can someone advice as to how to code the following? I greatly appreciate your ideas. Thanks!
    Scenario:
    Whenever the value on the column DCMTN_RCPT_STUS_CD is changed to "C" for table supplier_documentation (Table A), the value on the column BID_STUS_CD for table dmepos_bid will need to be updated to "01" (Table B), at the same time the column on BID_STUS_CD for supplier_application (Table C) will also
    need to be updated to "01".
    Table A:
    SQL> select SUPLR_ID, BIDDER_NUM, NSC_NUM, DCMTN_RCPT_STUS_CD from
    supplier_documentation where DCMTN_RCPT_STUS_CD='C';
    BIDDER_NUM DCMTN_RCPT_STUS_CD
    1000000 C
    1000003 C
    Table B:
    SQL>select BIDDER_NUM, BID_STUS_CD from dmepos_bid order by bidder_num;
    BIDDER_NUM BID_STUS_C
    1000000
    1000003
    Table C:
    SQL> select BIDDER_NUM, APLCTN_STUS_CD from supplier_application;
    BIDDER_NUM APLCTN_STUS_CD
    1000000
    1000003

    See Oracle row-level triggers:
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg13trg.htm#376
    SQL> create or replace trigger tr_01
      2  after update of DCMTN_RCPT_STUS_CD on supplier_documentation
      3  for each row
      4  when (new.DCMTN_RCPT_STUS_CD = 'C')
      5  begin
      6   update dmepos_bid set BID_STUS_C = :new.DCMTN_RCPT_STUS_CD
      7   where BIDDER_NUM = :new.BIDDER_NUM;
      8   update supplier_application set BID_STUS_C = :new.DCMTN_RCPT_STUS_CD
      9   where BIDDER_NUM = :new.BIDDER_NUM;
    10  end;
    11  /
    Trigger created.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> update supplier_documentation set DCMTN_RCPT_STUS_CD = 'B'
      2  where BIDDER_NUM = 1000000;
    1 row updated.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000 B
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000
       1000003
    SQL> update supplier_documentation set DCMTN_RCPT_STUS_CD = 'C'
      2  where BIDDER_NUM = 1000000;
    1 row updated.
    SQL> select * from supplier_documentation;
    BIDDER_NUM DC
       1000000 C
       1000003
    SQL> select * from dmepos_bid;
    BIDDER_NUM BI
       1000000 C
       1000003
    SQL> select * from supplier_application;
    BIDDER_NUM BI
       1000000 C
       1000003Rgds.

  • How to code this one?

    Please try to code the following:
    1. If payment end date (PA0014-ENDDA ) = '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) < Sept.01 of the current fiscal year.
    2. ELSEIf payment end date (PA0014-ENDDA ) = '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) > Aug 31 of the current fiscal year.
    3. ELSEIf payment end date (PA0014-ENDDA ) <> '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) > Aug31.
    4. ELSEIf payment end date (PA0014-ENDDA ) <> '12.13.9999' (Delimited) AND 1st Payment date (PA0014-ZDATE) < Sept.01 of the current fiscal year.
    5. ELSE.
       EXIT.
      ENDIF.
    NOTE: I have a problem on how you can determine if that particular date lies on that particular fiscal year or not. Please help me code this one.
    II. This are conditions between of each code.
    PAYMENT DATE is a variable should be used to store each successive payments.
    For Scenario 1, set (PAYMENT DATE ) = 1st payment date occuring after Aug 31 (Fiscal YEar)
    For Scenario 2, set (PAYMENT DATE ) = 1st payment date (SCREEN field: P0014-ZDATE)
    For Scenario 3, set (PAYMENT DATE ) = 1st payment date (SCREEN field: P0014-ZDATE)
    For Scenario 4, set (PAYMENT DATE ) = 1st payment date occuring after Aug 31 (Fiscal YEar)
    IF  the [Payment date] is <= to the infotype 0014 record end date (PA0014-ENDDA), do
    If the [Payment date] is in between the start and end date of the current Fiscal year
         If the unit (PA0014-ZEINH) is “Days”,
               [Payment date] = [Payment date] + (# of days)
               Add recurring payment (PA0014-BETRG) to total compensation counter
               Endif
         If the unit (PA0014-ZEINH) is “Weeks”, then {
                  [Payment date] = [Payment date] + (# of weeks)
               Add recurring payment (PA0014-BETRG) to total compensationcounter
         Endif
         If the unit (PA0014-ZEINH) is “Months”, then {
                  [Payment date] = [Payment date] + (# of months)
                Add recurring payment (PA0014-BETRG) to total compensation counter
         Endif
         If the unit (PA0014-ZEINH) is “Years”, then {
                   [Payment date] = [Payment date] + (# of years)
                Add recurring payment (PA0014-BETRG) to total compensation counter
         Endif  
    Endif
    Endif
    Repeat for next payment
    Repeat for the next infotype 0014 record (if it exists)
    I really need help! So guys whos expert in SAP. Thanx in Advance.

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

  • LE_SHIPMENT_BADI : method : At_Save, modify fields

    Hi,
    We can not change the vtrlk-trmtyp field.
    We can use the LE_SHIPMENT_BADI, method is at_save.
    Where is fault ?
    if CHA_SHIPMENTS_AT_SAVE is initial.
       CHA_SHIPMENTS_AT_SAVE = IM_shipments_AT_SAVE.
       loop at cha_SHIPMENTS_AT_SAVE-new_vtrlk into waa_vtrlk .
         waa_vtrlk-trmtyp = 'Z700'.
         modify CHA_SHIPMENTS_AT_SAVE-new_vtrlk from waa_vtrlk.
       endloop.
    endif.
    Thanks.

    Hi,
    Check & Pass the correct indicators in FLAG_TRA_COMPLETE.
    A     Shipment data incomplete
    B     Changed shipment data complete, incomplete data missing
    C     All shipment data complete and available
                   No statement on completeness
    Check & Pass correct vaue in TRA_SAVE_CALLER
    FC     Update of shipment costs
    MASS     Mass change for shipment VT06
    LREG     Register list
    LCOM     Complete list
    IDOC     IDoc inbound
    TPS     Transportation planning interface
    CFP     Freight planning by forwarding agent
    IAC0     Tendering (old)
    IAC     Planning and tendering via Internet
    MOB     Status message via mobile devices
    DIA     Shipment dialog
    DIA0     Shipment dialog (old)
    COLR     Collective processing for shipment
    BAPI     BAPI access
    APO     APO transportation planning
    MOB_RF     Radio frequency in shipment

  • How to code this - Please advise

    Dear friends,
         Please advise as how to code the below scenario in order to obtain the best performance.
    I've an internal table IT_BSAD.Now I've to check if in the combination of bukrs,augbl,auggj,kostl,prctr,gsber,aufnr, if there is a single record in IT_BSAD, then it should be appended to IT_BSAD1 & if there are multiple records, then those should be appended to IT_BSAD2. In any case IT_BSAD1 & IT_BSAD2 should not contain duplicate records & records in IT_BSAD = records in IT_BSAD1 + Records in IT_BSAD2. I coded it somehow but it hangs in case of million of records. Please advise me the best way of doing it.
    I'll appreciate any help in this regard.
    Thanks:
    Gaurav

    prepare a sorted table with key bukrs,augbl,auggj,kostl,prctr,gsber,aufnr
    loop it_basd assigning <fs_basd> .
    at new sufnr.
    lv_index = 0.
    endat.
    " move the fields to it_basd1 work area
    "append it_basd1
    lv_index = lv_index + 1.
    if lv_index > 1.
    if lv_index = 2.
    read it_basd1 into iwa_basd2 with key  bukrs,augbl,auggj,kostl,prctr,gsber,aufnr.
    append iwa_bsad2 into it_bsad2.
    delete from  it_basd1 where  bukrs,augbl,auggj,kostl,prctr,gsber,aufnr.
    endif.
    " move the fields of <fs_basd> to it_basd2 work area
    append iwa_bsad2 into it_bsad2.
    endif.
    endloop.
    hope this will help
    Nafran

  • Need help on how to code this SQL statement! (one key has leading zeros)

    Good day, everyone!
    First of all, I apologize if this isn't the best forum.  I thought of putting it in the SAP Oracle database forum, but the messages there seemed to be geared outside of ABAP SELECTs and programming.  Here's my question:
    I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    Unfortunately, I don't have a lot of experience coding SQL, so I'm not sure how to resolve this.
    Please help!  As always, I will award points to ALL helpful responses!
    Thanks!!
    Dave

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

  • How to Code this Query

    Hello, I'm using Access and need to code this query on SQL and I have this problem:
    I have 3 tables: Movie, Actor, Acts_In
    Movie table has fields: Movie_ID, movie_name, actor_1, actor_2, director
    Actor table has fields: Actor_ID, first_name, last_name
    Acts_IN table has fields: Movie_ID, Actor_ID
    * actor_id and movie_id are primary keys
    I have to create a query that allows me to search for a director, giving me a list of actors that have worked with that director, and all the movies they have acted in.
    so far I have come up with this code, however:
    select actor.first_name, actor.last_name, movie_name
    from (actor inner join acts_in ON acts_in.actor_ID=actor.actor_id) inner JOIN movie
    ON acts_in.movie_ID=movie.movie_id
    group by actor.first_name, actor.last_name, movie_name;
    This code gives me a list of all actors and all movies they acted in, but it does not give me specific actors in respect to a specific director, adding
    where director="XYZ"
    does not work as it gives me all actors that have worked with director XYZ but not all movies they have acted in. 
    Thanks!

    Grump. You should have provided us example data and DML, like this:
    DECLARE @movies TABLE (movie_ID INT, movie_Name VARCHAR(50), director VARCHAR(75))
    DECLARE @actors TABLE (actor_ID INT, first_name VARCHAR(50), last_name VARCHAR(50))
    DECLARE @acts_in TABLE (movie_ID INT, actor_ID INT)
    INSERT INTO @movies (movie_ID, movie_Name, director) VALUES
    (1, 'Batman Returns', 'Tim Burton'),
    (2, 'Charlie and the Chocolate Factory', 'Tim Burton'),
    (3, 'Sweeney Todd', 'Tim Burton'),
    (4, 'Alice in Wonderland', 'Tim Burton'),
    (5, 'Edward Scissor Hands', 'Tim Burton'),
    (6, 'From Hell', 'Albert Huges')
    INSERT INTO @actors (actor_ID, first_name, last_name) VALUES
    (1, 'Danny', 'DeVito'),
    (2, 'Freddie', 'Highmore'),
    (3, 'Helena', 'Bonham-Carter'),
    (4, 'Johnny', 'Depp'),
    (5, 'Mia', 'Wasikowska'),
    (6, 'Micheal', 'Keaton'),
    (7, 'Winona', 'Ryder')
    INSERT INTO @acts_in (movie_id, actor_ID) VALUES
    (1, 1),(1, 6),
    (2, 2),(2, 4),
    (3, 3),(3, 4),
    (4, 4),(4, 5),
    (5, 4),(5, 7),
    (6, 4)
    Which would have allowed us to come up with this:
    SELECT m2.director, a.first_name, a.last_name, m2.movie_Name
    FROM ((((@movies m
    INNER JOIN @acts_in ai
    ON m.movie_ID = ai.movie_ID)
    INNER JOIN @actors a
    ON ai.actor_ID = a.actor_ID)
    INNER JOIN @acts_in ai2
    ON a.actor_ID = ai2.actor_ID)
    INNER JOIN @movies m2
    ON ai2.movie_ID = m2.movie_ID)
    WHERE m.director = 'Tim Burton'
    GROUP BY m2.director, a.first_name, a.last_name, m2.movie_Name
    IIRC the primary difference between TSQL and the "Access SQL" is the freakin parens. So that *should* run in access, which you appear to be using.
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Need help - how to run this particular method in the main method?

    Hi all,
    I have a problem with methods that involves objects such as:
    public static Animal get(String choice) { ... } How do we return the "Animal" type object? I understand codes that return an int or a String but when it comes to objects, I'm totally lost.
    For example this code:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            TestAnimal ta = new TestAnimal();
            ta.get(); // error
            // doing Animal a = new Animal() is horrible... :(                   
        public static Animal get(String choice) {
            Scanner myScanner = new Scanner(System.in);
            choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }Out of desperation, I tried "Animal a = new Animal() ", and it was disastrous because an interface cannot be instantiated. :-S And I have no idea what else to put in my main method to get the code running. Need some help please.
    Thank you.

    Hi paulcw,
    Thank you. I've modified my code but it still doesn't print "roar" or "trumpet". When it returns a Lion or an Elephant, wouldn't the soundOff() method get printed too?
    refactored:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            Animal a = get();
        public static Animal get() {
            Scanner myScanner = new Scanner(System.in);
            System.out.println("Meat eater or not?");
            String choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }The soundOff() method should override the soundOff(); method in the interface, right? So I'm thinking, it should print either "roar" or "trumpet" but it doesn't. hmm..

  • How to access this.getNewNode() method within addTreeSelectionListener??

    Dear friends,
    I met anoother problem as follows:
    I defined a method called
    setNewNode(NewNode nn){
    getNewNode(){
    return nn;
    I tried to make regerence to this method:
    this.getNewNode();
    if I put this reference this.getNewNode(); outside of following code such as:
    this.getNewNode();
    tree.addTreeSelectionListener(new TreeSelectionListener() {
    everything fine,
    but If I put this.getNewNode(); within following code,
    so cannot pass compile, get error,
    tree.addTreeSelectionListener(new TreeSelectionListener() {
    this.getNewNode();
    now get error,
    How to make a successfule access to this method this.getNewNode() ??
    Thanks a lot.
    sunny
    //this.getNewNode();  // access ok
    tree.addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent evt) {
               // this.getNewNode();  // error, can not refer to this method.
                // Get all nodes whose selection status has changed
                TreePath[] paths = evt.getPaths();
                // Iterate through all affected nodes
                for (int i=0; i<paths.length; i++) {
                    if (evt.isAddedPath(i)) {
                        // This node has been selected
                    } else {
                        // This node has been deselected
        });

    good point, but it seems that
    OuterClassName.this.getNewNode() did not work,
    only OuterClassName.getNewNode() is acceptable.
    thanksThat indicates you must have made getNewNode() static. Glad it's working though...

  • How to code the ejbCreate() method without initailizing primary key?

    Hi all,
    I've just started learning about EJBs, and now am at the stage of learning how to create, deploy and test a CMP Entity Bean.
    Ran into a problem which I'm hoping someone can help out with.
    I'm using SQL Server 2000 as my backend database, and have created a simple table called TEST with 2 fields, id and name. id is set as the primary key, and as an identity conlumn. What this means is that when we do inserts, we don't need to specify a value for the id column. SQL Servers automatically generates that value.
    Here's my ejbCreate method in my bean class:
    public Integer ejbCreate(String name) throws CreateException {
        this.setName(name);
    }When I tried to run the create method from a web client, I got this error:
    javax.ejb.CreateException: [EJB:010148]In EJB 'SampleEJB', the primary key field 'id' was not set during ejbCreate. All primary key fields must be initialized during ejbCreate. at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244) at everbright.ejb.SampleEJB_uzc4wg_HomeImpl_813_WLStub.create(Unknown Source) at jsp_servlet.__index._jspService(__index.java:152) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    So it seems like I can't leave the id field uninitialized in the ejbCreate method. However I don't know what to initialize it with either, because in order to know what value I need to initialize it to, I'll need to run a db query to retrieve the next primary key value for the id field. This doesn't sound very efficient to me.
    I tried to initailize it to null, but that gave me a NullPointerException.
    Why do we need to initialize the primary key field in ejbCreate? Should the container do the insert and then get it from the table accordingly?
    Is there any other way I can get this set-up working?
    Thanks!

    Hi Fusion777,
    Ya, I've been searching around forums for an answer also. Apparently this is indeed a problem that has no general solution. It depends on 2 factors:
    1) Whether or not the database supports autogenerate key (which most does) and how (Oracle does it by sequences while SQL Server by identities)
    2) Whether or not the application server supports 1).
    In my case, I'm using SQL Server and Weblogic Server 8.1 and most fortunately, Weblogic does support identities and sequences. Just define the <auto-key-generation> stanza in your weblogic-cmp-rdbms-jar.xml deployment descriptor, as follows:
    <automatic-key-generation>
         <generator-type>ORACLE</generator-type>
         <generator-name>test_sequence</generator-name>
         <key-cache-size>10</key-cache-size>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>SQL-SERVER</generator-type>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>NAMED_SEQUENCE_TABLE</generator-type>
         <generator-name>MY_SEQUENCE_TABLE_NAME</generator-name>
         <key-cache-size>100</key-cache-size>
    </automatic-key-generation>I've tried that and it works :-)
    I gather from your reply that those who are using JBoss are equally fortunate :-)
    So I thought I'll share this in case some other poor fellow is facing the same problem as we are. At least worse come to worse, he'll have the option of switching to either JBoss or Weblogic and know that it works in both :-)
    Some other users seem to be against the idea of using auto-generated keys for precisely the reason that it is not a standard across database and application servers. See this thread:
    http://forum.java.sun.com/thread.jspa?forumID=13&threadID=329896
    I've in fact stopped working on EJB 2.0 and am exploring something called Hibernate, which seems to have a more generic way of dealing with the auto-generated key issue. In fact, I've heard news that EJB 3.0, which is the upcoming standard for EJB, will be heavily inspired by Hibernate as far as CMP Entity Beans are concerned.
    You can check out Hibernate at http://www.hibernate.org.

  • How to code this logic?

    I have an internal table with two fields FLD1 & FLD2(flag). I have to make sure that for same FLD1, there has to be only one FLD2 flag:
        FLD1           FLD2
           A            X
           A           
           B            X
           B            X
           B
    For example in the above example, 'B' has two 'X' therefore, I have to give an error message saying " Maintain only one 'X' value for  B"
    How do I do this?
    Thanks
    Sg

    try the code given below. It may help to code occording to ur desired logic.
    DATA: BEGIN OF it  OCCURS 10,
          fld1 TYPE c,
          fld2 TYPE c,
          END OF it.
    PARAMETERS: pfld1 type c .
                pfld2 type  c.
    data temp type i.
    start-of-SELECTION.
    loop at it.
      if it-fld1 = pfld1 and it-fld2 = pfld2.
      temp = 1.
       STOP.
      endif.
       ENDLOOP.
    end-of-SELECTION.
    if temp = 0.
    it-fld1 = pfld1. it-fld2 = pfld2.
    append it.
    write: / 'data append'.
    sort it by fld1.
    loop at it.
    write: / it-fld1, it-fld2.
    ENDLOOP.
    else.
    WRITE / 'Maintain only one',pfld2, 'value for',pfld1.
    it-fld1 = pfld1. it-fld2 = ''.
    APPEND it.
    sort it by fld1.
    loop at it.
    write: / it-fld1, it-fld2.
    ENDLOOP.
    endif.
    regards
    Vijaykumar Reddy. S

  • How to code this...please help

    Hi Friends:
       Please help me in coding the following scenario:
       I've the following checkboxes on selection screen:
    1. inventory quantity current period-unrestricted (mard-labst)
    2. inventory quantity current period-restricted use stock (mard-einme)
    3. inventory quantity current period-in quality inspection(mard-insme)
    4. inventory quantity current period - blocked (mard-speme)
    5. inventory quantity current period - returns (mard-retme)
    6. inventory quantity current period- stock in transfer (mard-umlme)
    now the scenario is like this. The user may check 1/2/3/4/5/6 checkboxes while executing this program. Now what all checkboxes are checked, only those values to be fetched from MARD. E.g. 1 & 2 are checked. Then I'll fetch labst & einme from MARD. Then I'll add it up. Please help me in coidng this. How to decide it at runtime.
    Thanks:

    Hi use this logic.
    if c1 = 'X.
    select single labst from mard into corrseponding table it_mard where..
    endif
    if c2 = 'X.
    select single einme from mard into corrseponding table it_mard where..
    endif.
    if c3 = 'X.
    select single insmefrom mard into corrseponding table it_mard where..
    endif.
    if c4 = 'X.
    select single spemefrom mard into corrseponding table it_mard where..endif.
    endif
    if c5 = 'X.
    select single retme from mard into corrseponding table it_mard where..
    endif.
    if c6 = 'X.
    select single umlme from mard into corrseponding table it_mard where..endif.
    endif
    Regards,
    Prasad.

  • How to code this with serial communication?

    Here's What I Want To Do.
    There are two computers A and B. I send some variational data, 1.2,3.4 for example, from A to B once per second. If B has received the right data, he will send "Yes" to A, otherwise he will say "No". If received "Yes", A will get ready for the next data-sending. If "No", A will send the data again.
    The examples with LabVIEW for VISA communication are all like that one computer is listening and the other one is writing all the time. So can you help me with two simple VIs for computer A and B?
    Regards.

    You need to connect the two computers' serial ports with a Null Modem Cable (Tx/Rx, CTS/RTS, DTR/DCD reversed). The put the attached vi on computer A. It will send a command from an array, and wait for a response from computer B. If the response is Yes, then the next command will be sent. If not Yes then A will send the same command again and wait for a response. There is an Abort button if you want to abort, but it will only abort the current command. You can modify it to abort the whole thing by using a while loop to replace the for loop, and using the abort button to exit the while loop. I'll leave the coding up to you. You will have to write a vi to reside on B. I'll describe it but you can code it, good practice. Computer B should start off initializing the com port, like in the attached vi. Then loop at Bytes at Port until some bytes come in, then read the bytes. Use a comparison (equal) to check if the data is good. Use a case structure to define what to send back to computer A (Yes or No). Then write it back using Visa Write. Loop around the entire thing except for the com port init. Close the Visa after the main loop.
    - tbob
    Inventor of the WORM Global
    Attachments:
    COM_AtoB.vi ‏50 KB

  • How bad is this recursive method?

    Ignore the variable names.
         public static int reverse(int blah)
              String temp ="";
              String remaining = "";
              String number = Integer.toString(blah);
              if(number.length() == 1)
                   return (Integer.parseInt(number));
              else if(number.length() != 1)
                   temp = number.substring(number.length()-1, number.length());
                   remaining = number.substring(0, number.length()-1);
                   temp+=reverse(Integer.parseInt(remaining));
                   return(Integer.parseInt(temp));
         }

    Hello,
    The code wont end if its length is >2.
    Will not be recursive.
    ex:
    234
    it will return 423
    thats the only issue...
    Edited by: amit.khosla on Mar 1, 2009 8:52 PM

  • How to code this using FIELD SYMBOL ?

    Hello All,
    I never used field symbols before and I think this is where I should use field symbols in my program.
    I have a selection parameter period (p_period) and based on the p_period value(XX), I need to display the HSLXX, KSLXX from table GLT0 using field symbols. Can anyboby help me?
    Thanks,
    Chandni Reddy

    Right, you can use field-symbols,  here is a example.
    report zrich_0002.
    data: xGLT0  type  GLT0 .
    data: field_name(20) type c.
    field-symbols: <fs> .
    parameters: p_per(2) type n.
    * Read a line from table
    select Single * from glt0 into xglt0.
    * Build the field name that you want to access
    concatenate 'XGLT0-HSL' p_per into field_name.
    * Assign it
    assign (field_name) to <fs>.
    * Write it
    write:/ <fs>.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Where is Network Diagnostics program?

    When I am having network problems, I find the most useful program is the network diagnostics program that automatically pops up when safari is having problems with the connection. It usually pop ups after a minute or two, but I would like a way to qu

  • Can't watch videos or listen to radio

    I just bought this macbook and i'm having some trouble whenever i try to play videos on the internet or listen to radio stations/programs. eg: won't let me watch highlights on the fifa world cup website or listen to audio taped interviews. If anyone

  • Can't update Mac OS X 10.7 to 10.7.1

    I have Mac OS X Lion 10.7 on my late 2008 MBP; last night, I downloaded the 10.7.1 update but when it was time to select the disk, I got... "Mac OS X Update can't be installed on this disk. This volume does not meet the requirements for this udate."

  • Zune Error Code COOD11E4 (8ooCOOOE) Lumia 800 Down...

    Hi Please help I'm going mad.. My Lumia 800 has recently stopped downloading photos to my PC however will download videos! error code as above appears for non downloaded photos. I have tried reinstalling Zune and also going into regedit to check HKEY

  • Lenovo PLEASE HELP!! G570 total slowdown

    I have a G570(Ci3/500gb HDD/4gb RAM/Amd Radeon 1gb), its waranty just expired 1 month ago. it was running perfectly till last week. but suddenly it became massively slow in performing any task, I use avast, winoptimizer and spybot for system maintena