Incorrect logical expression: Comparison / SELECT-OPTION can only be follow

Hi,
I'm new to ABAP, please help me with the below code. When i check the code i get the message "E:Incorrect logical expression: Comparison / SELECT-OPTION can only be followed by "AND", "OR" or ")".
data: pphd(7) type p decimals 2,
          ppha(7) type p decimals 2,
          abs_pphd(7) type p decimals 2.
    if pphd >= 0.
      if pphd < 1.
        ppha = 0.
      elseif 1 <= pphd <= 4.
        ppha = '0.16'.
      elseif 4.01 <= pphd <= 8.
        ppha = '0.32'.
      elseif 8.01 <= pphd <= 12.
        ppha = '0.50'.
      elseif 12.01 <= pphd <= 16.
        ppha = '0.66'.
      elseif 16.01 <= pphd <= 20.
        ppha = '0.83'.
      elseif 20.01 <= pphd <= 24.
        ppha = '1.00'.
      elseif 24.01 <= pphd <= 28.
        ppha = '1.16'.
      elseif 28.01 <= pphd <= 32.
        ppha = '1.32'.
      elseif pphd >= 32.
        ppha = '1.50'.
      endif.
    else.
      abs_pphd = abs( pphd ).
      if abs_pphd < 1.
        abs_ppha = 0.
      elseif 1 <= abs_pphd <= 4.
        ppha = '-0.16'.
      elseif 4.01 <= abs_pphd <= 8.
        ppha = '-0.32'.
      elseif 8.01 <= abs_pphd <= 12.
        ppha = '-0.50'.
      elseif 12.01 <= abs_pphd <= 16.
        ppha = '-0.66'.
      elseif 16.01 <= abs_pphd <= 20.
        ppha = '-0.83'.
      elseif 20.01 <= abs_pphd <= 24.
        ppha = '-1.00'.
      elseif 24.01 <= abs_pphd <= 28.
        ppha = '-1.16'.
      elseif 28.01 <= abs_pphd <= 32.
        ppha = '-1.32'.
      elseif abs_pphd >= 32.
        ppha = '-1.50'.
      endif.
    endif.
Thanks,
AM

Hi Raj,
Thanks a lot for the reply. i modified the code as you suggested but i get the error "E:Incorrect logical expression: Only "... BETWEEN  AND ..." is expected."  Below is the modified code.
data: pphd(7) type p decimals 2,
      ppha(7) type p decimals 2,
      abs_pphd(7) type p decimals 2.
if pphd >= 0.
  if pphd < 1.
    ppha = 0.
  elseif pphd between 1 and 4.
  ppha = '0.16'.
  elseif pphd between 4.01 and 8.
    ppha = '0.32'.
  elseif pphd between 8.01 and 12.
    ppha = '0.50'.
  elseif pphd between 12.01 and 16.
    ppha = '0.66'.
  elseif pphd between 16.01 and 20.
    ppha = '0.83'.
  elseif pphd between 20.01 and 24.
    ppha = '1.00'.
  elseif pphd between 24.01 and 28.
    ppha = '1.16'.
  elseif pphd between 28.01 and 32.
    ppha = '1.32'.
  elseif pphd >= 32.
    ppha = '1.50'.
  endif.
else.
  abs_pphd = abs( pphd ).
if abs_pphd < 1.
    ppha = 0.
  elseif abs_pphd between 1 and 4.
    ppha = '-0.16'.
  elseif abs_pphd between 4.01 and 8.
    ppha = '-0.32'.
  elseif abs_pphd between 8.01 and 12.
    ppha = '-0.50'.
  elseif abs_pphd between 12.01 and 16.
    ppha = '-0.66'.
  elseif abs_pphd between 16.01 and 20.
    ppha = '-0.83'.
  elseif abs_pphd between 20.01 and 24.
    ppha = '-1.00'.
  elseif abs_pphd between 24.01 and 28.
    ppha = '-1.16'.
  elseif abs_pphd between 28.01 and 32.
    ppha = '-1.32'.
  elseif abs_pphd >= 32.
    ppha = '-1.50'.
  endif.
endif.

Similar Messages

  • Incorrect Logical Expression for Include Program

    Hi All
    thank you very much for all the support...
    I managed to get through that error - however, now I m coming up with a different error:
    Incorrect logical expression: Comparison / SELECT-OPTION can only be
    followed by "AND", "OR" or ")".
    Where should I add the ''and" "or" on the below code?
    IF sy-subrc NE 0.
        MESSAGE e002(zsqts_sqts)
           INTO l_dummy
           WITH lv_host.
        PERFORM msg_add USING probclass_very_high.
      ENDIF.
    Zu der gewunschten FTP Ordner navigieren
      REFRESH result.
      IF lv_path IS NOT INITIAL.
        CONCATENATE 'cd' lv_path INTO lv_path SEPARATED BY space.
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = lv_handle
            command       = lv_path
          TABLES
            data          = result
          EXCEPTIONS
            tcpip_error   = 1
            command_error = 2
            data_error    = 3.
    Thank you very much
    Rukshana
    Moderator message: please try solving this yourself first, do not post each single error message to the forum. SCN forums cannot replace proper training.
    locked by: Thomas Zloch on Oct 6, 2010 1:04 PM

    On 3/20/2015 3:48 PM, leosucksatc wrote:
    if(Grade ='A'||'a')
    = is assignment. == is equality comparison. You had that right in your previous post.
    Also, the || operator doesn't work the way you think it does. Make it
    if (Grade == 'A' || Grade == 'a')
    Igor Tandetnik

  • SELECT-OPTIONS can u use it to read internal table ?????

    Hello All,
       I am trying to read an internal table with the select-options statement. I am getting a syntax error so i am hoping i am just coding it incorrectly. Can someone tell me what is wrong here is the if statement :
    if p_begdte in t_rpt-datab and
           p_enddte in t_rpt-datbi.
        else.
           exit.
        endif.
    thanks scott

    This is not working?
    tables: a916.
    * Beg valid date *
    data text021(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-021 for field p_begdte.
    selection-screen position 32.
    select-options: p_begdte for a916-datab default '20041101' to
    '99991231'.
    selection-screen end of line.
    * End valid date *
    data text022(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-022 for field p_enddte.
    selection-screen position 32.
    select-options: p_enddte for a916-datbi default '20041101' to
    '99991231'.
    selection-screen end of line.
    start-of-selection.
    <b>Loop at t_rpt.
    if t_rpt-datab in p_begdte
      and t_rpt-datbi in p_endte.
    * do something
    else.
    exit.
    endif
    Endloop.</b>
    Regards,
    Rich Heilman

  • Logic Express  Split Point Option Help

    I have Logic Pro 7. I can set a split point in the score editior.
    Does anyone know if this can be done in the Logic 7 Express as well. The older Logic cheaper versions do not allow this option. One of my piano students wants to upgrade to get this option if it's available. If anyone could look in the score window to see if this option is available I'd appreciate it
    Thanks

    Hi Jack.
    I would ask this question in the Logic Express forum if you haven't already.
    X

  • I have logic express 9.1.7, can i upgrade to logic pro

    I have Logoc Express 9.1.7, can I upgrade this to the latest Logic Pro app? If not, will all my plug ins, instruments etc work if I am forced to purchase the new app?

    I think you'll be able to run okay in the new version. The other features you'll get are: Better mastering tools, a new synthesizer (sculpture) and the Space designer reverb. I think they are all
    Best wishes

  • Help with Logic Express 8 - Mastering Options

    Hi All,
    A week ago I was trying to master a track I just finished. The options were there and read something like "final hip hop...", "final electronic...", etc. I recent deleted and reinstalled Garageband (GB) as I noticed all of my GB loops and templates were gone.
    When I re-entered Logic Express and tried to master my track, I noticed all of the options were gone and replace with fewer, less appealing options such as, "Enhance Deepness", "Soft Enhancer", etc.
    Does anyone have any idea what is causing this or +more importantly, how to fix it???+
    Please let me know.
    Thanks!!!

    Thanks Fox. I'm gonna actually try to Time Machine it and see if that helps. Before I did so I just wanted to see if there was a check the box time option first...
    Thanks again...

  • Using isight microphone with logic express 7.0? Can this be done?

    Hey I'm not new to Logic, but I AM new to using this macbook pro. I can't seem to use coreaudio as my input, and choose the built-in mic as my input source. I have gone to system preferences > sound > input > built in mic and it is selected. Coreaudio is selected as my driver in Logic. Please help, or just tell me "you can't do that."
    Thank you so much!

    Try making a aggregate device that contains your isight in "Audio MIDI setup" and go from there. I did this briefly a few weeks ago just to see if it could be done and it worked.

  • Do I need to uninstall Logic Express 8 before I can install Logic Studio?

    - NOT the upgrade version. Any issues I need to be aware of. Presumably my projects and associated files (which I have on a separate) will open up automatically in Logic Pro?

    Fear not, Logic Studio is just a full version of Logic. It will install additional AU instruments, Main Stage application and over 40 Gb of loops (if you choose so). But I am sure your preferences will remain the same. As it is the same 8th version, then there's nothing to be worried about, I suppose.
    Well, back up your projects though, just in case

  • How to create an ABAP Query with OR logical expression in the select-where

    Hi,
    In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
    Please help me on this.. Points will be rewarded.
    Thanks a lot.
    Regards,
    Question Man

    Hi Bhupal, Shanthi, and Saipriya,
    Thanks for your replies. But that didn't answer my question.
    Bhupal,
    You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
    Shanthi,
    Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
    Saipriya,
    Like what I have said, this is a standard SAP code so we can't do your suggestion.
    I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
    Thanks a lot.
    Points will be rewarded.
    Regards,
    Question Man

  • Doubt in select options

    Hi frnds,
    Normally select option allowing only 8 charactor in declaration part, but i want to display with morethan 8 charator. i think some text id formet is there, how to do that.
    for ex,
    s_org for vbak-vkorg  .
    for this i want to give sales organisation.
    how to do this.
    plz its urgent.
    Gowri

    SELECTION-SCREEN BEGIN OF LINE.
    [SELECTION-SCREEN POSITION pos [ldb_additions]].
    SELECTION-SCREEN END OF LINE.
    Effect
    The first and last statements define a new line below the existing elements on the selection screen.
    All the screen elements within these statements that are defined with PARAMETERS SELECT-OPTIONS and SELECTION-SCREEN statements are placed in this line one after the other without spaces.
    Several SELECTION-SCREEN POSITION statements can be listed within the definition of a line. The SELECTION-SCREEN POSITION statement can be used to define the output position for the following screen element. The position pos can either be specified directly as a number between 1 and 83 or using pos_low or pos_high expressions. The expression pos_low specifies the position in which the input field for a parameter or the first input field for a selection criterion is displayed as standard. The expression pos_high specifies the position in which the second input field for a selection criterion is to be displayed as standard. If you make a different specification of the position in the statement defining the following element, this is taken into account. The statement SELECTION-SCREEN POSITION is only possible within the definition of a line. If there are conflicts with existing screen elements, the selection screen cannot be generated.
    The additions ldb_additions can only be used in a selection include for a logical database.
    The following applies in the definition of a line:
    Output fields are not created for selection texts for the parameters displayed in these kinds of lines. Instead, these can be created by specifying a SELECTION-SCREEN COMMENT.
    You cannot define other lines with SELECTION-SCREEN BEGIN OF LINE.
    You cannot define blocks or tabstrip controls with SELECTION-SCREEN BEGIN OF [TABBED] BLOCK.
    Within a line, only one selection criteria should be defined with SELECT-OPTIONS whose description can be specified in advance using SELECTION-SCREEN COMMENT. Other combinations, especially definitions of elements according to the selection criteria, can lead to an undefined behaviour.,
    The backslash (/) is not allowed when giving format specifications.
    You can omit the position specification pos in formatting specifications.
    Note
    If a screen element is assigned a position greater than 83 or is positioned outside a block with a frame, the selection screen is not generated. In the case of input and output fields that were positioned beforehand but have a length that extends beyond the end of the line, the visible length is shortened accordingly and the content is displayed in the visible length and can be scrolled. In this case, pushbuttons and horizontal lines are cut off at position 83 or where the frame of the block ends.
    Example
    A pushbutton, an input field, and an output field in a line in the standard selection screen for an executable program.
    SELECTION-SCREEN: BEGIN OF LINE,
                      PUSHBUTTON 2(10) push USER-COMMAND fcode,
                      POSITION 16.
    PARAMETERS para TYPE c LENGTH 20.
    SELECTION-SCREEN: COMMENT 40(40) text,
                      END OF LINE.
    INITIALIZATION.
      push = 'Push'.
      text = '<--- Fill field, then push button!'.

  • Using roadmap and select-options

    I'm new to abap web dynpro, i'm using a roadmap with 4 views. This is working fine but, when I try to use select options in view1 they don't show. When I set view1 as default view the select options are working fine.
    this is how my current web dynpro looks like:
    Main view -> roadmap with viewcontainerUIElement
        view1 -> viewContainerUIElement + table (in the window I embedded the select options in the viewContainerUIElement)
        view2
        view3
        view4
    In view1 I'm using wddoinit to initialise the select options.
    Thanks in advance!

    Hi Srinivas,
    According to you mail, I will provide some solution please try them. It will definitely works.
    ---> Create a attribute which holds the lead selection values of the RADIO_GROUP.
    ---> When you click on the Next View, You will fire the plug. Right. Just before firing the Plug, update the above
          attribute with update information.
    > Do the same code for Select-options code in the WDDOINIT except the passing the values to the select-options.
    > Please pass the attribute information to Select-options with updated information in the method WDDOMODIFYVIEW every time. Without creating a attribute also you can approach the same method. Just for simple access we can create a attribute. Otherwise without that we can do the same.
    So Just populate the values into Select-options depending on the value of RADIO_GROUP you will do the same coding WDDOMODIFYVIEW. But initialization of SELECT-OPTIONS can be only done in the method WDDOINIT method only. WDDOINIT method only execute first time once you go through it and go back and move forward then this method won't execute.
    I hope this logic will work for you. If not Please send me the Code related to SELECT-OPTIONS and RADIO_GROUP Button information.
    I will be in office today up to 4.45 PM (IST). You can contact me in this time otherwise we will discuss on webex tomorrow morning at 9 AM.
    Warm Regards,
    Vijay

  • Restrict select options

    I am using a logical database in HR.I use the selection screen of the logical database but i want to restrict a select options for only permit introduce one value.
    I restrict in abap to only use values ,nor intervals by example and other conditions.Now i have to restrict to only one value.
    it must be work like a parameter

    Hi,
    U can use No-extension to restrict multiple selcet option button.
    See this link
    http://www.sapdevelopment.co.uk/reporting/selscr/selscr_restrictso.htm
    *: Report:  ZRESTRICT_SELOPT                                           :
    *: Author:  www.SAPdev.co.uk                                           :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to restrict select options to only    :
    *:              allow specific restriction options:                    :
    *:                                     i.e.. EQ, NE, BT etc..          :
    REPORT ZRESTRICT_SELOPT.
    * Include type pool SSCR
    TYPE-POOLS sscr.
    TABLES: EKPO.
    * Selection-screen
    select-options : so_ebeln for ekpo-ebeln,
                     so_ebelp for ekpo-ebelp.
    * Variables for populating restriction data
    DATA: gd_restrict TYPE sscr_restrict.   "structure containing 2 tables
    DATA: gd_optlist  TYPE sscr_opt_list,   "header line for table 1
          gd_***      TYPE sscr_***.        "header line for table 2
    *INITIALIZATION.
    INITIALIZATION.
    * Restrict SO_EBELN to only except EQ, BT and NE.
      gd_optlist-name = 'KEY1'.      "Can be anything
      gd_optlist-options-eq = 'X'.
      gd_optlist-options-bt = 'X'.
      gd_optlist-options-ne = 'X'.
      APPEND gd_optlist TO gd_restrict-opt_list_tab.
      clear: gd_optlist.
      gd_***-kind = 'S'.
      gd_***-name = 'SO_EBELN'.
      gd_***-sg_main = 'I'.
      gd_***-sg_addy = SPACE.
      gd_***-op_main = 'KEY1'.       "Must be same as above
      APPEND gd_*** TO gd_restrict-***_tab.
      clear: gd_***.
    * Restrict SO_EBELP to only except CP, GE, LT.
      gd_optlist-name = 'KEY2'.      "Can be anything
      gd_optlist-options-cp = 'X'.
      gd_optlist-options-ge = 'X'.
      gd_optlist-options-lt = 'X'.
      APPEND gd_optlist TO gd_restrict-opt_list_tab.
      clear: gd_optlist.
      gd_***-kind = 'S'.
      gd_***-name = 'SO_EBELP'.
      gd_***-sg_main = 'I'.
      gd_***-sg_addy = SPACE.
      gd_***-op_main = 'KEY2'.       "Must be same as above
      APPEND gd_*** TO gd_restrict-***_tab.
      clear: gd_***.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
       EXPORTING
    *    PROGRAM                      =
        restriction                  = gd_restrict
    *    DB                           = ' '
       EXCEPTIONS
         TOO_LATE                     = 1
         REPEATED                     = 2
         SELOPT_WITHOUT_OPTIONS       = 3
         SELOPT_WITHOUT_SIGNS         = 4
         INVALID_SIGN                 = 5
         EMPTY_OPTION_LIST            = 6
         INVALID_KIND                 = 7
         REPEATED_KIND_A              = 8
         OTHERS                       = 9.
      IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Kindly reward points for the answer which helped u and close the thread if ur problem got solved.
    Message was edited by: Judith Jessie Selvi

  • To add select-options to MB26

    How can we add select-options to t. code mb26? I want to add purchasing group as a select-options in mb26.
    How to put data extraction logic for the same?
    Regards,
    Sachin 11

    Hi Sachin,
    The only way you could do this is by copying the program PP_PICK_LIST to a Z program & then later in the include INCLUDE PPPLSEL you have to put your Select-option for Purchasing group by copying the include to a Z program.
    Also you have to debug & understand the flow of the program & find out the exact place where you can add logic for your select options.
    Regards
    Abhii

  • Add Select Options To ViewContainerUIElement in a TabStrip

    Hello,
    Finally, I have been able to add select options progammatically. But what I would like to do is to split them up using tabstrips.  I have searched the forum but have not seen a way to place select options into the ViewContainerUIElement.  I have seen where you can embed a view.
    I mean I sould be able to take the object and apply the same code for adding the select options.
    Can anyone provide me with some assisance?
    Regards, Dean.

    Hi Sachin,
    The only way you could do this is by copying the program PP_PICK_LIST to a Z program & then later in the include INCLUDE PPPLSEL you have to put your Select-option for Purchasing group by copying the include to a Z program.
    Also you have to debug & understand the flow of the program & find out the exact place where you can add logic for your select options.
    Regards
    Abhii

  • No Audio from Logic Express

    I was using an outdated sound card in my Mac G4, I was only hearing sounds out of the little built in Mac speaker, I was told I needed an Audio Interface, so I got a fast track USB pro from M-Audio. Installed everything, now the Mac recognizes it because I was able to switch the "built in Audio" to "Fast Track USB". Even his the "test" button and it works. I now select a sound from the esx24 sample player, and before, i could only hear sound from the built in mac speaker, now however, nothing plays. I see the meter going in logic and it is recignizing the midi input notes but still no Audio sound. This leads me to believe its something within Logic Express 7.2. Can anyone throw out any suggestions?
    Regards all
    Cheers and thanks for listening
    Daniel

    When you switched from "built in audio" to "fast Track" that must have been in the Audio Midi setup of the utilities folder?
    You have to do it in Logic as well places.
    In case you haven't done that in Logic I will go through the steps.
    Inside Logic go to the Audio menu at the very top (not the smaller audio on the arrange screen), then Audio Hardware and Drivers, then you will see the tab for drivers there and should be pretty much the same as you did before. Fast Track should show up there. Notice you can also set the buffer size here as well as a tab for 24 bit recording. Or at least you can in Logic Pro. I don't actually have Logic Express, but I know your issue is were it is in LP.
    Best
    Robyn

Maybe you are looking for

  • Press and hold on a Surface pro touch screen

    Hi, I am having some problems with my Surface Pro, trying to control a relay 'press-and-hold'. When I connect a mouse to the Tablet, Windows registers the left mouse up and down events perfectly, allowing the user to control the relay exactly the way

  • Running C3 and Ultradev side-by-side on an XP machine

    Hi, I would like to run the good, old Ultradev on my Windows XP machine, with the very latest patches and such, alongside C3. I re-installed Ultradev, but nothing happens upon start up. The start-up form appears and then it just hangs. I would imagin

  • BAPI call in java through jco destination defined in content Administration

    Hi All, Is it possible to use JCO destination defined in Content Administration  to execute BAPI in a java DC class file rather than creating a jco client through code. Any pointers for the same? regards Radhika Kuthiala

  • OO Design for Property type

    We are currently in the design process for an application that will use an ORM and are trying to create an object model that will make the most sense for using the ORM to save data to the database. At this time, we will not be using the ORM to instan

  • Problem with 9.3 Reader when opening files from internet

    I keep receiving the message 'There is a problem with Adobe/Acrobat Reader.  Please exit Adobe Acrobat/Reader and try again' when trying to open come files on the internet.  I am able to open files from my hard drive and some files from the internet.