Multi-choice parameters with "like" condition

Hi,
I defined a parameter, multi-choice, using a "like" condition.  It always works for the first value of the LOV and ignores the rest of the values chosen.
Is there any way that the "like" condition can be used for more than one parameter value?
In other words, if someone chooses values A,B,C from the LOV, I would like the condition to be interpreted as:
Field like 'A' or Field like 'B' or Field like 'C'.
--Further explanation--->
The reason that I need to use LIKE is that the field contains, e.g. A-1, A-2, A-3, B-1,B-2...
Instead of having the LOV list the variations, it would be much easier for the user to choose A and then get all the A's that exist.
Thanks.
Leah

What I am still understanding is defining the calculated field as a predefined length which I don't think will work since some of the values are shorter and some longer.
However, you gave me another idea (unless this is what you really meant).  I can define the calculated field similar to how I defined the list of values, i.e. take the value of the field until the '-' sign (if it exists).  If the actual field value is "permit medical-2", then in the LOV it only says "permit medical".  If the original field is "surgery" then the LOV  is "surgery.  I can do the same thing in the calculated field.  Then the condition would be calculated field = LOV.
Thank you!  Now my only problem is that I will not be at work for 10 days so I will have to wait until then to try it.
I will let you know how it worked out.
Thanks.
Leah

Similar Messages

  • Passing parameters to like condition

    hi all,
    i am trying to pass a parameters from a form to a report and use this parameter
    in a where condition of the sql query , my problem is that i need to use this parameter in a like statment to bring all the records which are like this parameter
    its not working...
    function AfterPForm return boolean is
    V_WHERE VARCHAR2(200);
    begin
    --:P_called is the parameter sent from the form
    IF :P_called IS NOT NULL THEN
         V_WHERE := '%'||:P_called||'%';
    END IF;
    :P_where := 'AND CALLED like' || V_WHERE;      
    return (TRUE);
    end;
    ----- this is the query----
    SELECT *
    FROM VOIP_CDR
    where substr(VOIP_CDR.CALL_INITIATION_TIME,1,8) between :f_date and :t_date
    &p_where

    What if you change the code like:
    :P_where := ' AND CALLED like' || V_WHERE;
    so add an additional space in front of the AND statement

  • List of Like condition from one Lookup table.

    Hi,
    I have 2 tables.
    SourceData table and LookUp table .
    SourceData table has one column called SName
    SName
    Jayesh  Krishnan
    Karthik Kumar
    Liju    Sharma
    Kumar Jayesh
    Kumar Pradeep
    Lookup table has one column called LName(Lookup table is the one which is required to look up with "like" condition)
    LNamne
    Kumar%
    %Krishnan
    I need to query SourceDate table with the like condition mentioned in lookup table.
    So my result based on above two tables should look like
    Jayesh  Krishnan
    Kumar Jayesh
    Kumar Pradeep
    Please help me in this regard.

    Try this,
    create table sourcetable (SName varchar(200))
    insert into sourcetable values('Jayesh Krishnan')
    insert into sourcetable values('Karthik Kumar')
    insert into sourcetable values('Liju Sharma')
    insert into sourcetable values('Kumar Jayesh')
    insert into sourcetable values('Kumar Pradeep')
    create table lookuptable (LName varchar(200))
    insert into lookuptable values('Kumar%')
    insert into lookuptable values('%Krishnan')
    go
    declare @sql nvarchar(max)
    declare @temp table ([where] nvarchar(max))
    declare @where nvarchar(max)
    set @sql = 'SELECT Substring(COLS,4, LEN(COLS)) FROM (
    SELECT Stuff((SELECT '' OR SName like '''''' + LName + ''''''''
    FROM lookuptable
    FOR xml path('''')), 1, 1, '''') COLS
    ) X'
    insert into @temp exec sp_executesql @sql
    select @where = [where] from @temp
    set @sql = 'SELECT * FROM sourcetable WHERE ' + @where
    exec sp_executesql @sql
    go
    drop table sourcetable
    drop table lookuptable
    Regards, RSingh

  • Multi-value parameters and strings with leading zeros

    I have invoice number as a multi-value parameter. Invoice is a string,10 (VBRP.VBELN) .
    Invoice number is my group. If I enter invoices 100 and 200 as parms, then I only get data for invoice #100 (the lowest value entered). But if I enter 100, 0000000100, 200, 0000000200 as parms, then I get data for both invoices. Is there a way to get around having to enter the invoice number in both formats. BTW, if I only enter 0000000100 and 0000000200 then I get no data.
    Selection criteria is (VBRP.VBELN) = ?invoiceno --- parms are defined as allow muliple values and allow discrete values.

    Oops, that's not gonna work with multi-value parameters.  How about:
    if IsNumeric((VBRP.VBELN)) then
      ToText(Val((VBRP.VBELN)), "0") in {?invoiceno}
    else
      (VBRP.VBELN) in {?invoiceno}
    end if
    BTW, the reason why your original formula didn't work was because the "=" should have been "in".  The above is needed only if the (VBRP.VBELN) field might contain leading zeroes.
    HTH,
    Carl

  • SQL Performance tuning with wildcard Like condition

    Hi,
    I have performance issue with SQL query.
    When I am using "where emp_name like '%im%' " query is taking longer time than when I use "where emp_name like 'im%' " .
    With former condition query takes 40 sec , with later it takes around 1.5 sec.
    Both returns almost same no. of rows. We have function based index created on emp_name column.
    With wildcard at both ends query goes for full table scan.
    Can any one please suggest way so that query responce time can be reduced.?
    I even tried using hints but still it is going for full table scan instead of using index.

    >
    Hi Mandark,
    <I've rearranged your post>
    When I am using "where emp_name like '%im%' " query is taking longer time than when I use "where emp_name like 'im%' " .
    With wildcard at both ends query goes for full table scan.
    I even tried using hints but still it is going for full table scan instead of using index.
    With former condition query takes 40 sec , with later it takes around 1.5 sec.
    Both returns almost same no. of rows. We have function based index created on emp_name column.You are never going to be able to speed things up with a double wild card - or even 1 wild card at the beginning
    (unless you have some weird index reversing the string).
    With the double wild-card, the system has to search through the string character by character to see
    if there are any letter "i's" and then see if that letter is followed by an "m".
    That's using your standard B-tree index (see below).
    Can any one please suggest way so that query responce time can be reduced.?Yes, I think so - there is full-text indexing - see here:
    http://www.dba-oracle.com/oracle_tips_like_sql_index.htm and
    http://www.oracle-base.com/articles/9i/full-text-indexing-using-oracle-text-9i.php
    AFAIK, it's an extra-cost option - but you can have fun finding out all that for yourself ;)
    HTH,
    Paul...

  • Report Parameters with a space between, not working

    I have a problem with a report in SQL Server 2012 that uses cascading multi-valued parameters. I am using AdventureWorks2012DW as a sample, and all parameters work except for one with a space in this case its SalesTerritoryCountry and the parameter is 'North
    America' which has a space. How do i get it to return data? here is my Stpre procedure for you to try.
    Create Procedure dbo.uspReportParams
    @Region varchar(15),
    @Country varchar(60)
    AS
    BEGIN
    SET NOCOUNT ON
    Select st.SalesTerritoryGroup [Region], st.SalesTerritoryCountry [Country], r.BusinessType [Business Type], SUM(rs.SalesAmount) [Sales Amount]
    from DimReseller r join FactResellerSales rs on r.ResellerKey = rs.ResellerKey
    join DimDate d on rs.OrderDateKey = d.DateKey
    join DimProduct p on p.ProductKey = rs.ProductKey
    join DimSalesTerritory st on rs.SalesTerritoryKey = st.SalesTerritoryKey
    where st.SalesTerritoryGroup IN (Select [splitdata] FROM dbo.fnSplitString (@Region,', '))
    --AND st.SalesTerritoryGroup <> 'NA'
    AND st.SalesTerritoryCountry IN (Select [splitdata] FROM dbo.fnSplitString (@Country,', '))
    Group by st.SalesTerritoryGroup, st.SalesTerritoryCountry, r.BusinessType
    END
    IF i check it with other parameters it works except for North America
    EXEC dbo.uspReportParams @Region = 'Europe,Pacific,North America', @Country = 'Germany,France,United Kingdom,Australia,Canada'

    Thanxs for the reply i will explain more. The Issue is on parameter region which is 'North America', it should return data for United states and Canada.... the spaces for the SalesTerritoryCountry dont matter but for the SalesTerritoryGroup. 
    I have made another discovery which has puzzled me more: If i place paramater 'North America' as the first value when executing the procedure, everything works well but if i place it elsewher ther is a problem here is a example to show what im saying
    EXEC dbo.uspReportParams @Region = 'North America,Europe,Pacific', @Country = 'Germany,France,United Kingdom,Australia,Canada'
    The results for Region 'North America' and Countries 'United States' + 'Canada' Show 
    Its working as expected
    You're using an AND condition in the filter so it will only return the countries which are included in @Country filter as it is the lower level
    I guess may be what you want is this??
    Create Procedure dbo.uspReportParams
    @Region varchar(15),
    @Country varchar(60)
    AS
    BEGIN
    SET NOCOUNT ON
    Select st.SalesTerritoryGroup [Region], st.SalesTerritoryCountry [Country], r.BusinessType [Business Type], SUM(rs.SalesAmount) [Sales Amount]
    from DimReseller r join FactResellerSales rs on r.ResellerKey = rs.ResellerKey
    join DimDate d on rs.OrderDateKey = d.DateKey
    join DimProduct p on p.ProductKey = rs.ProductKey
    join DimSalesTerritory st on rs.SalesTerritoryKey = st.SalesTerritoryKey
    where (st.SalesTerritoryGroup IN (Select [splitdata] FROM dbo.fnSplitString (@Region,', '))
    --AND st.SalesTerritoryGroup <> 'NA'
    OR st.SalesTerritoryCountry IN (Select [splitdata] FROM dbo.fnSplitString (@Country,', ')))
    Group by st.SalesTerritoryGroup, st.SalesTerritoryCountry, r.BusinessType
    END
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Passing multiple URL parameters with same name

    Hi,
    I have a question which is not entirely related to Java. But although its related HTTP calls, so I thought I might get some ideas here.
    Background:
    I am making HTTP URL call from SAP ABAP code. Its pretty much similar to Java (creating URL connection, setting HTTP headers, connecting, receiving response and everything)
    For example,
    http://service_server:8080/a7/extension.services.SearchRequirements.a7x?RequestStatus=CR&RequestStatus=RR
    Now, this service_server runs a query to database where it uses both these values of "RequestStatus" to form 'OR' condition for a field.
    Issue:
    When I run this URL from browser, it shows XML response containing results for both values. In short, this is the ideal response.
    (I am using getParameterValues(string) at service_server to read multiple values for same parameter)
    But when I see response in SAP system, I see that it is returning data for only one value of 'RequestStatus'.
    I checked the logs of service_server, and I see that it has received only one parameter, not two.
    Question:
    It seems like SAP systems web server is truncating both parameters with same name and passing just one of them to outside server(??)
    Is there any configuration at Web Server side or any HTTP headers to be set so as to avoid this?
    Can anybody suggest something on this?

    I managed to resolve this issue by using HTTP 'Post' method to send the data.
    CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
        EXPORTING
          URL                = L_URL
        IMPORTING
          CLIENT             = L_HTTP_CLIENT
        EXCEPTIONS
          ARGUMENT_NOT_FOUND = 1
          PLUGIN_NOT_ACTIVE  = 2
          INTERNAL_ERROR     = 3
          OTHERS             = 4 .
    "STEP-2 :  AUTHENTICATE HTTP CLIENT
    CALL METHOD L_HTTP_CLIENT->AUTHENTICATE
      EXPORTING
        USERNAME             = 'name'
        PASSWORD             = 'password'.
    "STEP-3 :  SET HTTP HEADERS
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING NAME  = 'Accept'
                    VALUE = 'text/xml'.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
        EXPORTING NAME  = '~request_method'
                   VALUE = 'POST' .
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_CONTENT_TYPE
        EXPORTING CONTENT_TYPE  = 'application/x-www-form-urlencoded' .
    "SETTING REQUEST DATA FOR 'POST' METHOD
    IF L_PARAMS_STRING IS NOT INITIAL.
       CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
         EXPORTING
             TEXT   = L_PARAMS_STRING
         IMPORTING
               BUFFER = L_PARAMS_XSTRING
         EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_DATA
        EXPORTING DATA  = L_PARAMS_XSTRING  .
    ENDIF.
    "STEP-4 :  SEND HTTP REQUEST
      CALL METHOD L_HTTP_CLIENT->SEND
        EXCEPTIONS
          HTTP_COMMUNICATION_FAILURE = 1
          HTTP_INVALID_STATE         = 2.
    "STEP-5 :  GET HTTP RESPONSE
        CALL METHOD L_HTTP_CLIENT->RECEIVE
          EXCEPTIONS
            HTTP_COMMUNICATION_FAILURE = 1
            HTTP_INVALID_STATE         = 2
            HTTP_PROCESSING_FAILED     = 3.
    "STEP-6 :  READ RESPONSE DATA
    CALL METHOD L_HTTP_CLIENT->RESPONSE->GET_CDATA
            RECEIVING DATA = L_RESULT .
    "STEP-7 : CLOSE CONNECTION
    CALL METHOD L_HTTP_CLIENT->CLOSE
      EXCEPTIONS
        HTTP_INVALID_STATE = 1
        OTHERS             = 2   .
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Multi-choice question - go back and re-answer?

    Hello there,
    cp5.
    Request was to build an activity where learner is presented 4 questions each with two options.  After answering the question, return to the list of 4 questions where their responses are measured accumulatively.  After seeing the sum of their answers they should be able to go back into the questions and re-answer them to increase their sum.
    So to accomplish this, I have 4 multi-choice slides and one 'menu' slide.  the menu slide has 4 buttons to each of the question slides.  Each question slide has an adv action for the on success and on failure which sets a couple variables (basically saving what their answer was).  I have an On Enter adv action for the menu slide which checks this variable and display an image based on their sum.
    This all works great in preview, but when I publish or preview in browswer, I'm not able to re-answer the quesion.  When I return to an answered slide, the multi-choice buttons are greyed out.
      I have 'allow backward movement' enabled.  This is not the first quiz question in the project.  Not reporting to LMS.  I'm trying to avoid writing a bunch of adv actions (more than I already have) so I was hoping to use the built in question slides.
    Sorry, I'm unable to share the project file or provide screen shots (corporate policies)
    The 'works in preview, not in publish' is frustrating.  Any suggestions or ideas on what's happening? 

    Thank you both.
    Yes, I ended up ditching the CP quiz and used a couple buttons on each slide.  Mostly I was concerned about throwing out the adv actions I'd already written, but I was able to massage them with little effort to make them work.
    What was happening when I was previewing, it seemed, I was jumping back to the 'menu' slide which was before the first question slide.  When I'd hit that menu slide, it was essentially resetting the quiz and letting me re-answer everything.  The whole interaction was 5 slides so I was easily able to use the 'preview next 5 slides' option and didn't consider that in the full project I'd be within the quiz scope.
    I ended up playing with it a little to understand it better myself.  I moved that 'menu' slide to slide 2 of my full project (with question #1 on slide 38) and used navigation to move back and forth.  Slide 2 was outside the quiz scope and then jumped to slide 38 within the scope and it worked great.
    But... that seemed like a nightmare to maintain going forward... What happens if one of my team mates has to update the project, sees that slide strangely placed and moves it?  Boom - activity broken.
    Anyway, again, thank you for your replies.  I ended up adding 2 buttons on the slide, one for each 'answer' and attached the 'on success' and 'on last attempt' adv actions I had on the question slide to the respective buttons.  Seems to all work correctly.

  • Select-options with where condition

    Hello ABAPers,
    I want to create a select-options like s_operid for vbpa-kunnr but with a condition specified is VBPA-KUNNR where VBPA-PARVW = 'WE'.
    Thanks in advance. Pls reply asap. Points will definitely be rewarded.
    Ritu

    hi,
    use this
    PARAMETERS : TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR TAB_ID.
    DATA : BEGIN OF INT_TAB_ID OCCURS 0,
                TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID,
             END OF INT_TAB_ID.
      DATA : LOC_MAX TYPE ZALOAD_PROD_COMB-TAB_ID.
      CLEAR INT_TAB_ID.
      REFRESH INT_TAB_ID.
      SELECT MAX( TAB_ID) INTO (LOC_MAX) FROM ZALOAD_PROD_COMB.
      COUNT = LOC_MAX + 1.
      DO 10 TIMES.
        MOVE COUNT TO INT_TAB_ID-TAB_ID.
        APPEND INT_TAB_ID.
        COUNT = COUNT + 1.
      ENDDO.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
         RETFIELD            = 'TAB_ID'                        u201C Internal table field name
         DYNPPROG         = 'PROG_NAME                  u201C Program name
         DYNPNR              = SY-DYNNR
         DYNPROFIELD   =  'TAB_ID'                        u201C Field where u need F4 help
         VALUE_ORG       = 'S'
       WINDOW_TITLE  = u2018Any descriptionu2019
        TABLES
          VALUE_TAB      = INT_TAB_ID.                   u201C Internal table name
    Mark the post answered once ur problem is solved ....

  • Difference between FILTER and PARAMETERS SETS and CONDITION

    Hi to all,
    Please can anyone tell me what difference is between?
    FILTER and PARAMETERS SETS and CONDITION in Planning Function.
    With example?
    I have gone via SAP help, but cant get clear idea.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Hi Rana,
    Filter -  restriction of data to be read/changed/locked by a planning function
    Condition - acts like a dynamic filter ,once the data is read ,condition will restrict the records that are to be processed by the function ,e.g the filter is on jan.2012 to dec.2012 ,i can restrict in the condition to process only jan.2012 to 6.2012.this can be used if a certain condition is only known during run time.
    Parameter set - each planning function acts like any ususal function in program language where import parameters are needed for proper functionality ,parameter set acts like this ,e.g if the planning function of Copy requiers a parameter set of FROM and TO then this should be supplied to the function in order to copy for example FROM '2012' TO '2013', in this case the filter is restricted to 2013 (because this is the only data that is changed and locked)
    Regards.

  • If..then..else statement in SQL with 'generalized' conditions in the if sta

    it is possible to write something approaching an if..then..else statement in SQL with 'generalized' conditions in the if statement.
    Attached is the query for the payment register, in which I've written a series of decode statements, one for each possible value of the payment code. The query works OK - however, its specific and as the number of paycodes expand (and they do), the report won't pick up the new paycode until the code is changed. More importantly, the report won't be correct until someone 'discovers' that a paycode is missing, which might take months.
    If I were writing the equivalent of this series of decode statements in Focus, it would be something like this:
    DEFINE.......
    PAYMED/D12.2 = IF PAYMENT_CD LE 18
                   THEN PAYMENT_AMT
                   ELSE 0 ;
    PAYIND/D12.2 = IF PAYMENT_CD GE 19 AND PAYMENT_CD LE 49
                   THEN PAYMENT_AMT
                   ELSE 0 ;
    PAYEXP/D12.2 = IF PAYMENT_CD GE 70
                   THEN PAYMENT_AMT
                   ELSE 0 ;
    PAYREC/D12.2 = IF PAYMENT_CD GE 50 AND PAYMENT_CD LE 69
                   THEN PAYMENT_AMT
                   ELSE 0;
    END
    IN SQL/PLUS:
    SELECT ACCOUNT_NAME,
    LOCATION_1,
    CLMNT_LAST_NAME,
    CLAIM_NBR,
    DATE_OF_INJURY,
    DATE_CHECK_REGISTER,
    PAYEE_NAME_1,
    PAYMENT_CD,
    SERV_OFC,
    CPO_CHECK_NBR,
    PAYMENT_FORM,
    DECODE(PAYMENT_CD, 20, PAYMENT_AMT, 21, PAYMENT_AMT,
    22, PAYMENT_AMT, 23, PAYMENT_AMT, 25, PAYMENT_AMT,
    26, PAYMENT_AMT, 27, PAYMENT_AMT, 28, PAYMENT_AMT,
    29, PAYMENT_AMT, 30, PAYMENT_AMT, 31, PAYMENT_AMT,
    32, PAYMENT_AMT, 33, PAYMENT_AMT, 34, PAYMENT_AMT,
    35, PAYMENT_AMT, 36, PAYMENT_AMT, 37, PAYMENT_AMT,
    39, PAYMENT_AMT, 40, PAYMENT_AMT, 41, PAYMENT_AMT,
    42, PAYMENT_AMT, 43, PAYMENT_AMT, 44, PAYMENT_AMT,
    45, PAYMENT_AMT, 46, PAYMENT_AMT, 47, PAYMENT_AMT,
    48, PAYMENT_AMT, 49, PAYMENT_AMT, NULL) INDEMNITY,
    DECODE(PAYMENT_CD, 0, PAYMENT_AMT, 1, PAYMENT_AMT,
    2, PAYMENT_AMT, 3, PAYMENT_AMT, 4, PAYMENT_AMT,
    5, PAYMENT_AMT, 6, PAYMENT_AMT, 7, PAYMENT_AMT,
    8, PAYMENT_AMT, 9, PAYMENT_AMT, 10, PAYMENT_AMT,
    11, PAYMENT_AMT, 12, PAYMENT_AMT, 13, PAYMENT_AMT,
    14, PAYMENT_AMT, 15, PAYMENT_AMT, 18, PAYMENT_AMT,
    17, PAYMENT_AMT, NULL) MEDICAL,
    DECODE(PAYMENT_CD, 70, PAYMENT_AMT, 71, PAYMENT_AMT,
    72, PAYMENT_AMT, 73, PAYMENT_AMT, 74, PAYMENT_AMT,
    75, PAYMENT_AMT, 76, PAYMENT_AMT, 77, PAYMENT_AMT,
    78, PAYMENT_AMT, 79, PAYMENT_AMT, 80, PAYMENT_AMT,
    81, PAYMENT_AMT, 82, PAYMENT_AMT, 83, PAYMENT_AMT,
    84, PAYMENT_AMT, 85, PAYMENT_AMT, 86, PAYMENT_AMT,
    87, PAYMENT_AMT, 88, PAYMENT_AMT, 89, PAYMENT_AMT,
    90, PAYMENT_AMT, NULL) EXPENSES,
    DECODE(PAYMENT_CD, 50, PAYMENT_AMT, 51, PAYMENT_AMT,
    52, PAYMENT_AMT, 53, PAYMENT_AMT, 54, PAYMENT_AMT,
    55, PAYMENT_AMT, 56, PAYMENT_AMT, 57, PAYMENT_AMT,
    58, PAYMENT_AMT, NULL) RECOVERIES,
    DECODE(PAYMENT_FORM, 'N', PAYMENT_AMT, NULL) NONCASH,
    DATE_FROM_SERVICE,
    DATE_THRU_SERVICE
    FROM &INPUT_TABLES
    WHERE &SECURITYCOND
    DATE_OF_PAYMENT BETWEEN :START_DATE AND :END_DATE
    ORDER BY LOCATION_1, CPO_CHECK_NBR
    As you can see, this is both much easier to write and covers the possibility of expansion of paycodes (expansions always fit in these defined ranges).
    My question is, then, is it possible to write something like this in SQL and, if so, could you give me some sample code? (I'm one of those people who learn best from looking at the code as opposed to a set of instructions)

    Here is one way you could do it.
    Create a table that has columns like:
    Payment_code varchar2(2),
    Effective_Date Date,
    Payment_type varchar2(20),
    Expiration_Date Date)
    Payment type for example could be
    I- indemnity
    M- medical
    R- recovery
    E- expenses
    Let the table name for example be PAYMENT_CODE.
    The select query would look like
    SELECT ACCOUNT_NAME,
    LOCATION_1,
    CLMNT_LAST_NAME,
    CLAIM_NBR,
    DATE_OF_INJURY,
    DATE_CHECK_REGISTER,
    PAYEE_NAME_1,
    PAYMENT_CD,
    SERV_OFC,
    CPO_CHECK_NBR,
    PAYMENT_FORM,
    DECODE(p.payment_type,'E',PAYMENT_AMOUNT,0) expenses,
    DECODE(p.payment_type,'I',PAYMENT_AMOUNT,0) indemnity,
    DECODE(p.payment_type,'M',PAYMENT_AMOUNT,0) Medical,
    DECODE(p.payment_type,'R',PAYMENT_AMOUNT,0) recoveries,
    DECODE(PAYMENT_FORM, 'N', PAYMENT_AMT, NULL) NONCASH
    FROM &INPUT_TABLES,
    PAYMENT_CODE P
    WHERE P.PAYMENT_CODE = SOMEINPUT_TABLE.PAYMENT_CODE
    and other conditions
    The idea is to group all the payment codes into a few groups to reduce the clutter. If there is ever a change to the payment code, you could modify the table and it will be reflected in your select query.

  • Table Rows with Multiple Conditions Not Showing Up in RH

    Hi everyone,
    I'm currently evaluating TCS2 (Framemaker 9 and RoboHelp 8 on Windows XP) and have come across the following issue:
    One of our FrameMaker source files contains a table in which one of the rows has multiple conditions applied. When one of the conditions is shown in Framemaker, and the others are hidden, the row is displayed in Framemaker as expected. However, when the file is then imported or linked into Robohelp, the same table row vanishes, even though the Apply FrameMaker Conditional Text Build Expression check box is selected in the Framemaker Conversion Settings > Other Settings screen. This only appears to affect table rows - when paragraph text is tagged with the same conditions, it is imported correctly into RoboHelp.
    For example, when Condition B is shown and Condition A is hidden in the Framemaker file, the content appears like this in Frame:
    Unconditional
    Unconditional
    Condition A and Condition B applied
    Condition A and Condition B applied
    Condition B applied
    Condition B applied
    Paragraph text with Condition A and Condition B applied.
    Paragraph text with Condition B applied.
    When the same file is imported into RoboHelp, the row with both conditions applied is absent from the table:
    Unconditional
    Unconditional
    Condition B applied
    Condition B applied
    Paragraph text with Condition A and Condition B applied.
    Paragraph text with Condition B applied.
    Installing patches 8.0.1 and 8.0.2 did not resolve the issue (and actually caused other, unrelated issues) and I see the same behavior regardless of whether I import or link the FrameMaker document.
    Has anyone else seen this issue? Any help would be much appreciated.
    Thanks
    DaveB

    It just seems that the items I select as align to top in the
    property inspector should force the items to the top of their
    cells, unless I'm missing something.

  • Set_block_property with Like and Between and function

    Hellow All
    I need to find out record where Column Name between
    :Text_item1 and :Text_item2 with Default_where
    For example Manu guide me to find out record with
    SET_BLOCK_PROPERTY('Block53', DEFAULT_WHERE, 'name like ''' || :block70.text || '%''');
    go_block('block53');
    EXECUTE_QUERY;
    Now i need
    To find our Record where name between :block70.Text1 and :Block70.text2 with Like Function
    For example
    I have one Column :NAME
    I want to find out record in name Column with Default Where option where name between Text1 and Text2
    I Hope you guys understand my requirement
    Regards
    Shahzaib ismail

    Hai,
    Try
    SET_BLOCK_PROPERTY('BLOCK53', DEFAULT_WHERE, 'NAME BETWEEN ''' || :BLOCK70.TEXT1 || ''' AND ''' || :BLOCK70.TEXT2 || '''');
    GO_BLOCK('BLOCK53');
    EXECUTE_QUERY;and when you are using BETWEEN for character fields, then LIKE will be there.
    Example, your NAME field have,
    1) Abcde
    2) Asdf
    3) Awer
    And if your condition is NAME BETWEEN 'A' AND 'Z' then you will get all daya.
    And if your condition is NAME BETWEEN 'Ad' AND 'Z' then you will get 2 and 3. like that.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • Problem with Guard Condition (Fields Disabling)

    Hi All
    I have a screen where I am creating a notification... so I enter all my fields and data as below:
    If ALL fields are filled out then the call to my RFC will create the notification and pass back a notification number (EX_QMNUM)
    I then pass back EX_QMNUM to the input of my READ_S1 RFC. Since we have a custom table attached I thought it was best to retrieve the latest data from the database after point of save.
    However if they don't fill in the necessary criteria then I pop up an error (EG. Please fill in customer number). I put a GUARD CONDITION on the call back to the READ_S1 RFC. The guard seems to work as my breakpoint/RFC does not get hit... however it then CLEARS my fields and DISABLES everything. This is what it looks like after the save (with guard condition in place). This means I lose all my data and no save occurs.
    What am I doing wrong here? Is this a bug with the guard condition?
    Guard Condition (which seems to be working apart from the fact it disables my RGA fields)
    I'm not completely sure about IF conditions so let me know if this is wrong?

    Hi Brad,
    Thanks for the input, I have tried this now.
    1. In the case the guard evaluates to "false", I experience the fields being blank, but not grayed out. So the user is able to refill the input and submit. This means something else in your model causes the "grayed out" behavior.
    2. In general, in case you know the conditions to valid input in the client side, you could model this way:
    Valid input => the data services run. example guard to service: =ISNULL(@customer)==false
    Invalid input => the popup shows. example guard to popup: =ISNULL(in1@customer)==true
    3. Is it possible in your case to validate the input before running the first query? This will enable to use the Validation feature as in Input Validation. If possible it's the best way in terms of user experience, in my opinion.
    Thanks,
    Udi

Maybe you are looking for