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.

Similar Messages

  • I have installed mountain lion on my macbook pro ,but it made my mac very slow. Would someone please tell me how  to uninstall this one and reinstall snow leopard?

    Hello,
    I have installed mountain lion on my macbook pro ,but it made my mac very slow. Would someone please tell me how  to uninstall this one and reinstall snow leopard? I tried to do it by my original CDs but macbook  pro didn't let me to do it.
    Thanks

    It would be easier to just fix whatever is making your machine slow.
    I wrote a little diagnostic program to help show what might be causing these problems. Download EtreCheck from http://www.etresoft.com/download/EtreCheck.zip, run it, and paste the results here.
    Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

  • 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?

    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 - 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

  • 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.

  • 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 move code from one class to other?

    I have a .fla file.
    There i have some keyframes with labels.
    On .fla file in property in Class field i adde MyMatching class.
    Also i have main code:
    package
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         public class MyMatching extends MovieClip
              var play_btn:MyButton = new MyButton();
              var kyky:MyTimer;
              public function MyMatching():void
                   welcomeScreen();
              public function welcomeScreen():void
                   stop();
                   trace("working");
                   play_btn.x = 210;
                   play_btn.y = 300;
                   addChild(play_btn);
                   play_btn.addEventListener(MouseEvent.CLICK, goToLevel_1);
              public function goToLevel_1(event:MouseEvent)
                   trace("level 1");
                   play_btn.visible = false;
                   gotoAndStop('Level1Screen');               
                   if (kyky==undefined) {
                        kyky = new MyTimer();
    And i have other class:
    package
         import flash.display.MovieClip;
         import flash.display.Stage;
         import flash.utils.getTimer;
         import flash.text.TextField;
         public class MyTimer extends Stage
              import flash.utils.getTimer;
              var gameStartTime:uint;
              var gameTime:uint;
              var gameTimeField:TextField;
              function mainFunction():void
                   gameTimeField = new TextField();
                   addChild(gameTimeField);
                   gameStartTime=getTimer();
                   gameTime=0;
                   addEventListener(Event.ENTER_FRAME,showTime);
              function showTime(event:Event)
                   gameTime=getTimer()-gameStartTime;
                   gameTimeField.text="You plaing: "+clockTime(gameTime);
              function clockTime(ms:int)
                   var seconds:int=Math.floor(ms/1000);
                   var minutes:int=Math.floor(seconds/60);
                   seconds-=minutes*60;
                   var timeString:String=minutes+":"+String(seconds+100).substr(1,2);
                   return timeString;
    Ho i can play code from class MyTimer in goToLevel_1 function(this function stand in my main class MyMatching) ?
    Thank you.

    First of all your MyTimer class is written wrong and sloppy.
    Why does it extend Stage? The most compact class to extend under the circumstances is Sprite.
    Also, it is very important to get into habit of datatype declarations. Not only it is good practice, in your case good compiler will throw error because although you return String, function doesn't return anything.
    In addition, it is important to declare namespaces like private public and protected inside classes. Not function clickTime():String but private function clockTime():String or public function clickTime():String.
    As for how to show your time elsewhere - you just need to create instnace of it and add it to disaply list:
    var myTimer:MyTimer = new MyTimer();
    addChild(myTimer);
    With that said, your class should look like this:
    package 
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.display.MovieClip;
         import flash.utils.getTimer;
         import flash.text.TextField;
         public class MyTimer extends Sprite
              private var gameStartTime:uint;
              private var gameTime:uint;
              private var gameTimeField:TextField;
              public function MyTimer()
                   gameTimeField = new TextField();
                   addChild(gameTimeField);
                   gameStartTime = getTimer();
                   gameTime = 0;
                   addEventListener(Event.ENTER_FRAME,showTime);
              private function showTime(event:Event):void
                   gameTime = getTimer() - gameStartTime;
                   gameTimeField.text = "You playing: " + clockTime(gameTime);
              private function clockTime(ms:int):String
                   var seconds:int = Math.floor(ms / 1000);
                   var minutes:int = Math.floor(seconds / 60);
                   var timeString:String = minutes + ":" + String(seconds + 100).substr(1, 2);
                   return timeString;

  • 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

  • I HOPE SOMEONE KNOWS HOW TO SOLVE THIS ONE! =] i tried

    WELL I HAD A PROBLEM WITH MY COMPUTER AND HAD TO COMPLETELY START IT OVER. SO WHEN I WENT ON ITUNES IT SAID MY IPOD CAN ONLY BE SYNCED WITH ONE COMPUTER. IT SAID I COULD ERASE AND SYNC BUT I CANT DO THAT BECAUSE I HAVE NO MUSIC IN THE ITUNES LIBRARY BECAUSE LIKE I SAID...I HAD TO START THE COMPUTER OVER AND EVERYTHING WAS RENEWED. THERES ANOTHER OPTION TO TRANSFER PURCHASES BUT THAT DOES NOT WORK FOR SOME REASON. SO I NEED A WAY TO MAYBE PUT ALL THE MUSIC FROM THE IPOD INTO MY COMPUTER... THEN ERASE THEM FROM IPOD AND SYNC. SO I CAN ALWAYS UPLOAD EVERYTHING BACK. IM REALLY NOT SURE BUT I WAS JSUT HOPING SOME ONE WAS SMART ENOUGH TO EVEN UNDERSTAND WHAT IM EXPLAINING, IM KIND OF CONFUSING. THANKS TO ANYONE WHO HELPS, IT WILL BE VERY APPRECIATED. =]

    read this thread
    http://discussions.apple.com/thread.jspa?threadID=1098054&tstart=0

  • 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

  • C'mon u must know how to solve this one..PLEASE

    If I have this class, how do I memorize the "john" variable in another variable (say the "color" variable) situated in another class?
    public class Colours extends Panel
    Checkbox black, red, blue, green;
    int john;
    CheckboxGroup group = new CheckboxGroup();
    public Colours()
    setLayout(new GridLayout(4,1));
    black =new Checkbox("Black",group,true);
    add(black);
    red = new Checkbox("Red",group,false);
    add(red);
    blue = new Checkbox("Blue",group,false);
    add(blue);
    green = new Checkbox("Green",group,false);
    add(green);
    public int itemStateChanged (ItemEvent e)
    if (e.getItemSelectable() == black)
    john=1;
    if (e.getItemSelectable() == red)
    john=2;
    if (e.getItemSelectable() == blue)
    john=3;
    if (e.getItemSelectable() == green)
    john=4;
    return john;
    }

    Ok, is this correct? because the john variable still never changes to zero.
    public class Colours extends Panel implements ItemListener
         Checkbox black, red, blue, green;
         private int john=0;
         CheckboxGroup group = new CheckboxGroup();
              public Colours()
                   setLayout(new GridLayout(4,1));
                   Checkbox black= new Checkbox("Black",group,true);
                   black.addItemListener(this);
                   add(black);
                   Checkbox red= new Checkbox("Red",group,false);
                   red.addItemListener(this);
                   add(red);
                   Checkbox blue= new Checkbox("Blue",group,false);
                   blue.addItemListener(this);
                   add(blue);
                   Checkbox green= new Checkbox("Green",group,false);
                   green.addItemListener(this);
                   add(green);
              public void itemStateChanged(java.awt.event.ItemEvent itemEvent)
                   if (((Checkbox)itemEvent.getSource()).getLabel()== "Black")
                        john=1;
                   else if(((Checkbox)itemEvent.getSource()).getLabel()== "Red")
                        john=2;
                   else if(((Checkbox)itemEvent.getSource()).getLabel()== "Blue")
                        john=3;
                   else if(((Checkbox)itemEvent.getSource()).getLabel()== "Green")
                        john=4;
              public void setJohn(int john)
                        this.john=john;
              public int getJohn()
                        return john;
    and in the main class:
    other = new Colours();
    int col = other.getJohn();
    Thanks

  • Does anyone out there know how to solve this one?

    I have no music on my computer. All of the music that used to be there is still on my ipod, however. I don't want to put the music back on the computer from the ipod but I would like to put songs into my itunes, transfer them to the ipod without losing the music that is currently on the ipod. Can I do that? Or when I hook up the ipod will it erase everything that is currently on there? thanks to anyone who can answer!

    First this:
    How to Stop the iPod from Autosyncing (and Deleting My Music)
    Then this:
    Manually Managing Music
    But I would not recommend syncing this way as the iPod could need to be restored if it ever encounters problems and you would be out of an entire library.
    JC

  • 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