Use of boolean returning functions in a project

Hello all gurus,
in my project, we have a fairly important packaged functions that return boolean values. Working with these ones in pl/sql is very fine. But sometimes we need to reuse these functions in SQL, but no luck because bools are usable under pl/sql only and can't interact in any way in SQL statements. So the workaround should be to use these functions to return us some Y/N or 1/0 to emulate boolean behavior in SQL statements.
Here what i tested with not luck:
-- not work
select r.role, sys.diutil.bool_to_int(dbms_session.is_role_enabled(r.role)) as is_role_enabled
from   dba_roles r;
-- not work
select r.role
from   dba_roles r
where  sys.diutil.bool_to_int(dbms_session.is_role_enabled(r.role)) = 1;
-- not work
select t1.id,
       bool_to_char(my_bool_func(t1.x, t1.y, ...)) as is_something
from   t1;
-- not work
select t1.id,
       sys.diutil.bool_to_int(my_bool_func(t1.x, t1.y, ...)) as is_something
from   t1;The odd wrapping trick as a last resort solution is working....
-- Works! Seems the only way, but a lot of wrapping work...
create or replace function my_bool_func_wrap(p_x number, p_y number, ...) return varchar2 as
begin
   return bool_to_char(my_bool_func(p_x, p_y, ...));
end;
select t1.id,
       my_bool_func_wrap((t1.x, t1.y, ...)) as is_something
from   t1;I read a lot, but no elegant and working way.
Is there a more standard, elegant universal way to call bool functions from SQL?
Is creating a custom type visible and usable from both pl/sql and sql, if possible, a way to go?
Any other pointers?
For new development, is it good to make my boolean type returning functions using SQL compatible type like CHAR (Y/N) or NUMBER (1/0) ? It will make us less wrapping job, but more and less elegant bool handling code on the pl/sql side.
What is the goal to have bool only in pl/sql and not usable in SQL? It's kind of a feature incompatibility in the same product. Strange...
Thanks a lot
Bruno

brlav wrote:
Finally, I'll have to dump the BOOLEAN return type to all our boolean functions and return char instead. With this I will be able to call then from SQL.... From this perspective, BOOLEAN is useless.I would not say that. Let's assume that you implement boolean in SQL as a single byte character string containing either Y or N, enforce that with a constraint and also add a not-null constraint to it.
You simply define two PL functions (not usable from SQL) that deals with the conversion. You use the one function to change boolean to char before hitting the SQL engine, and the other to convert char to boolean when getting data from the SQL engine.
As I/O routines are modularised, it means that you need to deal with these conversions once only when writing and once only when reading (per module).
Simple example:
SQL> create or replace function to_bool( c varchar2 ) return boolean is
  2  begin                                                            
  3          return( c = 'Y' );                                       
  4  end;                                                             
  5  /                                                                
Function created.
SQL>
SQL> create or replace function bool_to_char( b boolean ) return varchar2 is
  2  begin
  3          if b then
  4                  return( 'Y' );
  5          else
  6                  return( 'N' );
  7          end if;
  8  end;
  9  /
Function created.
SQL>
SQL> declare
  2          i       integer;
  3          b       boolean;
  4          flag    all_tables.temporary%type;
  5          tab     all_tables%rowtype;
  6  begin
  7          flag := bool_to_char(true);  
  8          select count(*) into i from all_tables where temporary = flag;
  9
10          select t.* into tab from all_tables t where rownum = 1;
11          b := to_bool( tab.temporary );
12  end;
13  /
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • Calling a BOOLEAN returning function from SQL

    Hello All,
    I have created below function which return BOOLEAN value :
    CREATE OR REPLACE FUNCTION FUNC_1
    P_EMPID IN emp.empno%type
    )RETURN BOOLEAN
    AS
    L_VAR NUMBER;
    BEGIN
    SELECT 1 INTO L_VAR
    FROM EMP
    WHERE EMPNO = P_EMPID;
    IF L_VAR = 1 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END;Now I want to call this function from SELECT but I know that SQL does not support BOOLEAN value so I tried in other way i.e. via CASE
    SELECT CASE FUNC_1(7788)
           WHEN TRUE THEN 'TRUE'
           WHEN FALSE THEN 'FALSE'
           ELSE 'NULL'
           END CASE
    FROM DUALBut it is giving me error "ORA-00904: "FALSE": invalid identifier'
    How can I achieve this ?
    Thanks & Regards,
    Rakesh

    Hi Rakesh,
    Why cant you try something like this, When BOOLEAN type is not supported in SQL.
    Here I have made the return value a number. And, at case comparison, we get the BOOLEAN
    result as TRUE of FALSE.
    CREATE OR REPLACE FUNCTION func_1 (p_empid IN emp.empno%TYPE)
       RETURN NUMBER
    AS
       l_var   NUMBER;
    BEGIN
       SELECT count(*)
         INTO l_var
         FROM emp
        WHERE empno = p_empid;
       IF l_var = 1
       THEN
          RETURN 1;
       ELSE
          RETURN 0;
       END IF;
    END;And,
    SELECT CASE func_1 (55656)
              WHEN 1
                 THEN 'TRUE'
              WHEN 0
                 THEN 'FALSE'
           END
      FROM DUAL;Which return TRUE if the Employee Number Exists and FALSE if doesnot.
    Thanks,
    Shankar.

  • Can I use the value returned from a Text Function in another Formula?

    I'm writing a report in Hyperion System 9 BI + Financial Reporting Studio version 9.2. I have 2 grids in my report.
    Grid1 Column A is set up as a text function using the function type - <<GetCell("Grid2", 1, a, 1)>>. I would like to use the values returned from this text function in Column A (Grid 1) in a formula in Column B (Grid 1).
    Is it possible to use the values returned in Column A of the text function in another formula? My report does not seem to recognize Column A as numerical values, even though the values to be returned are numerical.
    If so, how do I recognize the values in Column A Grid 1 as numerical values and not text?
    Thanks for any help you can offer!

    Hi Edson,
    Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
    You can use a macro similar to the following:
    IF
      CALC_ERROR( )
      = 'X'
          DO SOMETHING HERE
    ENDIF
    Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
    data: g_flg_calc_error type /SAPAPO/FLAG.
    * SAP will pass g_flg_calc_error variable to all macro
    * functions. When SAP calls a macro function, it does
    * something like this.
    call function '/SAPAPO/MACRO_FUNCTION_HERE'
            exporting
              plob_values      = i_s_adv_plob_values
              sdp_book         = g_c_advf_sdp_book
              sdp_view         = g_c_advf_sdp_view
            tables
              cols_index       = i_t_cols
              value_tab        = l_t_value_tab
            changing
              f_calc_error     = g_flg_calc_error
    As you can see, the g_flg_calc_error variable
    is passed in the "changing" part of the call. The macro  function being called can then use the f_calc_error
    variable to change the value of the global
    g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error.  The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
    Hope this helps in clearing things out

  • How can I use the value returned for a function into the macro ??

    I create a function to work in a macro and I would like to use the value of parameter f_calc_error returned by function in a condition like IF, but I don't know how can I do that. I have to use the macro function CALC_ERROR ??
      Thanks.
    Edson Suzuki

    Hi Edson,
    Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
    You can use a macro similar to the following:
    IF
      CALC_ERROR( )
      = 'X'
          DO SOMETHING HERE
    ENDIF
    Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
    data: g_flg_calc_error type /SAPAPO/FLAG.
    * SAP will pass g_flg_calc_error variable to all macro
    * functions. When SAP calls a macro function, it does
    * something like this.
    call function '/SAPAPO/MACRO_FUNCTION_HERE'
            exporting
              plob_values      = i_s_adv_plob_values
              sdp_book         = g_c_advf_sdp_book
              sdp_view         = g_c_advf_sdp_view
            tables
              cols_index       = i_t_cols
              value_tab        = l_t_value_tab
            changing
              f_calc_error     = g_flg_calc_error
    As you can see, the g_flg_calc_error variable
    is passed in the "changing" part of the call. The macro  function being called can then use the f_calc_error
    variable to change the value of the global
    g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error.  The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
    Hope this helps in clearing things out

  • How to use Essbase @RETURN function to displayed messages in 11.1.2.1

    Hi,
    I found Business Rule support Essbase @RETURN function in Hyperion Planning 11.1.2.1 new feature.
    If I create a simple BR for planning app as below:
    "@RETURN("test return message" , WARNING);"
    The validation returns error and BR can not be deployed.
    Does any one how to use @RETURN function in BR?
    Thanks!

    Hi,
    From Essbase Technical Reference Guide: http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?launch.html
    Example+
    The following example stops the calculation and returns a custom warning message if maximum values specified in the IF statement are empty:+
    FIX("Actual")
    . "Profit"(
    IF( ("Marketing" < 0) OR ("Payroll" < 0) OR ("Misc" < 0) )
    @RETURN( @CONCATENATE(
    @CONCATENATE("The violation of data integrity : Market [", @NAME(@CURRMBR("Market"))),
    "] has a negative expenses. Calculations are interrupted")
    , WARNING);
    ELSE
    "Profit" = ("Margin" - "Total Expenses")*0.9;
    ENDIF
    ENDFIX
    Cheers,
    Alp

  • Filter xml data Class and use pushView to populate List (Flex Mobile project)

    I am such noob so I apologize for my ignorance. Trying to learn and work at the same time but i'm stumped been searching and my understanding is not up to snuff just yet.
    I looked at the Mobile Shopping Cart that Adobe has little over my head to grasp and impliment but my project is similar without the cart option basically.
    I'm currently using a single view with 3 states
    <s:states>
    <s:State name="default"/>
    <s:State name="productView"/>
    <s:State name="detailsView"/>
    </s:states>
    Default state has a list that uses a xml file with categoryID number's that correspond with the main products xml file.
    Which when the item is selected it filters and updates the List on the productView and so on to the detailsView.
    Like this:
    Category -> Products-> Details
    I'm using a filterCollection from an .as Class file to complete this here is a small snipet.
    private function productService_resultHandler(event:ResultEvent):void
    var productsArray:Array = new Array();
    var resultData:XMLList = event.result..product;
    for each (var p:XML in resultData) {
    var product:Product = Product.buildProductFromAttributes( p );
         productsArray.push( product );
    products = new ArrayCollection( productsArray );
         products.filterFunction = filterForCategory;
         products.refresh();
    private function filterForCategory(item:Product):Boolean{
    return item.catID == selectedCategory;
    public function filterCollection(id:Number):void{
    selectedCategory = id;
         products.refresh();
    Project works great but incredibly slow on Mobile device iOS. In-between the states I have transition animations and it bogs right down.
    So I was trying to experiment by using pushView and basically do the same but utilize Flex's viewNavigator to see if it speeds things up but I can't get the filter function to push the filtered data to the newView component.
    Or I was thinking of trying to order the events such as seletedItem->transition->filtered Data it seems like it is all happing at once and the app just sits for 3 seconds before the state is updated.
    Any help appreciated or more info needed let me know. THX

    So I will solve this later.
    I was able to stick to the original project layout with states within views instead of view states. Ditched the transition Move effects averaging 1 to 2 seconds on all state changes.
    It is a really basic product view app that all files are local. I'm not super impressed at the first go but it works and into the First Project archieve's and will revisit it on version 2. Which will probably start soon. It's better than hello world!

  • Use of boolean variables in BPEL switch statements

    I have a workflow with a single boolean input parameter:
    <element name="input" type="boolean"/>
    I wish to use a switch statement within the workflow, based on the value of that boolean parameter.
    When I use the following XPath expression:
    bpws:getVariableData("input","payload","/tns:BooleanRequest/tns:input")
    I get the correct functionality, although I get the following BPEL compiler warning:
    " [bpelc] [Warning ORABPEL-10078]: return value of this expression may not be a boolean
    [bpelc] [Description]: in line 35 of "C:\eclipse\workspace\Boolean\Boolean.bpel", xpath expression "bpws:getVariableData("input","payload","/tns:BooleanRequest/tns:input")" used in <switch> may not return boolean type value, the xpath engine would automatically try to convert the return value to boolean..
    [bpelc] [Potential fix]: Please use one of the built-in boolean functions from xpath http://www.w3.org/TR/xpath#section-Boolean-Functions to convert the return value to boolean.."
    However, the boolean functions referenced do not appear to be relevant to a variable which is already of a boolean type. If I attempt to use the boolean() function in my XPath expression, I get rid of the compiler error, but the workflow now does not work as required.
    How can I get rid of the compiler warning and still get the required functionality, and/or am I doing the wrong thing?
    I am currently running on JBoss, with BPEL release 2.1.2 [build #1226].
    Thanks for any help or ideas.

    Hi Marlon,
    Thanks for that - I guess we have to accept the vagaries of XPath and the absence of type-checking for variables.
    I hadn't fully understood until I started investigating that I can assign ANY string to variable of type xsd:boolean, which has been the cause of some of the confusion for me - whether that value is then considered true or false depends on how you write your test condition.
    I tried with your condition, and it didn't seem to work (evaluated to true if the variable data was the string "true()", but otherwise it seemed to always evaluate to false.
    I also tried the following:
    condition="bpws:getVariableData('booleanVariable')=true()"
    but that evaluates to true for any string of length > 0.
    The only one I can get to consistently work is:
    condition="bpws:getVariableData('booleanVariable')=string(true())"
    although that means that variable data of "TRUE" will evaluate to false (may well be the correct behaviour, depending on how you're setting the boolean variable in the first place).

  • How to change the elements number in Number To Boolean Array Function VI

    Hi, I'm working on using the DAQ digital output to control the digital input of a DAC, and I used the Number To Boolean Array Function. VI to convert the number to a Boolean array. The maximum number should be 4096, therefore it should consist of 12 elements.
    For the description of the VI, it says Boolean array returns an array of 8, 16, 32, or 64 elements, depending on the number of bits in the integer. Therefore, I change the number of the channels in task to 16, but it still doesn't work. Any suggesitions are greatly appreciated.
    Thanks!
    Possible reason(s):
    Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.
    When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.
    Number of Channels in Task: 12
    Number of Channels in Data&colon; 32
    Task Name: _unnamedTask<1B>
    Solved!
    Go to Solution.
    Attachments:
    DAC test.vi ‏47 KB

    Once you have the boolean array, you can resize it using array tools. For example you can use "reshape array" with a lenght of 12 to trim the array to 12 booleans elements (you can also use array subset).
    LabVIEW Champion . Do more with less code and in less time .

  • Booleans API Functions into SQL SELECT

    Hello,
    our API is using a huge set of boolean «is_{what we want to check}» functions. These simple atomic functions are used into more sophisticated PL/SQL funcs or procs.
    Sometime, we need to use these bool funcs directly into our SQL queries.
    Here is a simplified example we want:
    SELECT id1, id2, is_valid(id1, id2)
    FROM table
    WHERE ... stuff ...;
    or
    SELECT col1, col2, ...
    FROM table
    WHERE is_valid(id1, id2) IS TRUE ;
    or
    SELECT col1, col2, ...
    FROM table
    WHERE is_valid(id1, id2) = TRUE ;
    to be valid queries....
    I know that booleans aren't supported natively in the SQL, I created a function that translate bool to char:
    FUNCTION bool_to_char (p_bool IN BOOLEAN)
    RETURN VARCHAR2
    IS
    v_retour VARCHAR2 (5);
    BEGIN
    v_retour := CASE p_bool
    WHEN TRUE
    THEN 'TRUE'
    WHEN FALSE
    THEN 'FALSE'
    END;
    RETURN v_retour;
    END;
    So, when I call this func into my sql, it's not working anymore:
    SELECT id1, id2, bool_to_char(is_valid(id1, id2))
    FROM table
    WHERE ... stuff ...;
    or
    SELECT col1, col2, ...
    FROM table
    WHERE bool_to_char(is_valid(id1, id2)) = 'TRUE';
    I'm searching for a solution to make this possible... The only fast solution that came in my mind is to encapsulate every boolean functions to return a corresponding varchar value. Not that good....
    Any ideas or suggestions?

    SQL standards have been developed over the years and whilst some vendors have tweaked SQL functionality to make their database better than others, one thing that is not part of SQL standards is support for BOOLEAN. 3GL and 4GL languages most often support boolean values, which are represented internally as a binary number.
    For those interested, in some languages the BOOLEAN is represented as -1 for TRUE and 0 for FALSE. In binary, -1 is represented as all the bits set to 1 whilst 0 is all the bits set to 0. There was a nice feature in one of the BASIC versions (I think it was BBC Basic if I remember correctly) that allowed you to use booleans within assignments such as...
    x := y + (z AND (y < 100))If the "y<100" condition evaluated to TRUE, this would translate as...
    x := y + (z AND TRUE)which, in binary terms (let's assume all numbers are single bytes for illustrative purposes) would be...
    x := y + (z AND 11111111)The "z AND 11111111" would perform a logical AND between the z value and the binary 11111111 resulting in a value of z... giving...
    x := y + zIf the condition evaluated to false on the other hand it would go as follows...
    x := y + (z AND FALSE)
    x := y + (z AND 00000000)So, "z AND 00000000" would logically AND to give a result of 0 and thus giving...
    x := ySo it was useful to use in conditional arithmetic, avoiding having to put IF statements in the code.
    Getting back to the thread...
    Using PL/SQL functions so extensively in SQL is a bad idea as it will inevitably cause a lot of context switching between the SQL and PL/SQL engines. This will have a noticable effect on performance of queries. Where possible, if the test can be done within SQL, then it should be done there rather than calling PL/SQL.
    ;)

  • If we use DML statement in function then that function can be used inside s

    if we use DML statement in function then that function can be used inside select query or any DML query?

    select f from t2;I think you meant to query t1.
    It works if the function is an autonomous transaction:
    create or replace function f return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
        update t1 set c=2;
        commit;
        return 1;
    end;
    select f from t1But as Billy said why would you want to do DML this way. And this is not the way autonomous procedures should be used either.
    An an answer to an interview question though nothing wrong with it.

  • How do I use a precompiled dylib in my xcode project?

    Hello all you brainiacs out there!
    I want to use mongoDB as my database for my iPhone projects.
    I have compiled their code, with instructions from http://api.mongodb.org/c/current/building.html... successfully.
    I ran all the tests, successfully.
    I have two files, libmongoc.dylib and libbson.dylib generated.
    I have imported them into a brand-new xcode project, (build phases, link binary with libraries, hit '+' sign, add other and browse to these two files)
    I copied the .h files (bson.h and mongo.h) to my project.
    Can I now use the functions in my project as defined to connect, insert, delete.... etc.
    I am a noob at iPhone development (2 months) but I do know what I am doing... (I passed the 2  IOS 5 tests at brainbench.com scoring just under 4/5)
    Can someone walk thru the steps after loading in the dylibs and including the C headers?
    Regards,
    Dan

    Danny Bertrand wrote:
    Is there a list of specific things that you CAN'T do/have to sell on the Apple store?
    The App Store Review guidelines have such a list.
    But rather than focusing on what you can't do, you should focus instead on what you MUST do. One of those "must do" items is comply with any licensing agreements for code or resources you include with your app. It can be quite enlightening to ignore what people say about "open source" and "free software" and actually read those licenses say and research their history. It isn't Apple that is restricting you here . As a wise person once told me - "Follow the money". That will lead you from the Free Software Foundation to academic think tanks and writers right back to .. .some interesting places.
    Welcome to the world of Apple - everybody's bullseye.

  • Use of Procedure and Functions in ADF BC

    Hi,
    In ADF 11g
    1. can I use oracle function and procedures ( having in and OUT parameters) to expose as service interface
    2. if yes , How can this be done. and what are the allowed data types as input to procedure/function and can be returned by procedure/function
    3. How the transaction control will be achieved using ADF BC service interface.
    E.g. one ADF BC creates orders in order details and second creates Order lines in Order lines table. Now if order is created successfully but line creation fails then I want order to be rolled back also.
    Thanks.

    google it out.
    How to get two out param which is used in Procedure
    http://sameh-nassar.blogspot.in/2010/01/create-plsql-function-and-call-it-from.html
    http://adf-tools.blogspot.in/2010/09/adf-function-call-from-el-statement-in.html
    http://adf-tools.blogspot.in/2010/03/adf-plsql-procedure-or-function-call.html
    http://adfhowto.blogspot.in/2010/11/call-db-procedure-or-function-from-adf.html
    Re: use of Procedure and Functions in ADF BC

  • How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCI

    Hi
    we are using Timesten 11 version and as per the documentation, it doesn't support User-Defined Aggregate Functions.
    So we are looking for alternatives to do it. Could you please provide your expert voice on this.
    Thanks a lot.
    As the following:
    create or replace type strcat_type as object (
    cat_string varchar2(32767),
    static function ODCIAggregateInitialize(cs_ctx In Out strcat_type) return number,
    member function ODCIAggregateIterate(self In Out strcat_type,value in varchar2) return number,
    member function ODCIAggregateMerge(self In Out strcat_type,ctx2 In Out strcat_type) return number,
    member function ODCIAggregateTerminate(self In Out strcat_type,returnValue Out varchar2,flags in number) return
    number
    How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCIAggregateInitialize ?

    Dear user6258915,
    You absolutely right, TimesTen doesnt support object types (http://docs.oracle.com/cd/E13085_01/doc/timesten.1121/e13076/plsqldiffs.htm) and User-Defined Aggregate Functions.
    Is it crucial for your application? Could you rewrite this functionality by using standart SQL or PL/SQL?
    Best regards,
    Gennady

  • How to use Exceptions for a function module

    Hi folks,
            I have created  a new function module.Its working fine, but i am not aware of using exceptions for a function module. I hav just declared an exception in the 'exception' tab. Could any body explain me how to use that in my FM source code....Thanks...

    Hi Shyam,
    Have a look at this,
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
        IF sy-subrc NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    Regards,
    Sai

  • Calc manager: @RETURN function with WARNING as message type issue

    Hi Gurus,
    I m working in version 11.1.2.2 in IE 9. I have created a simple calculation script as below to test the @Return essbase function.
    function
    FIX ( .....)
    "502100"(
    IF( ("YearTotal" > 50000))
    @RETURN("True:test message" , WARNING);
    ELSE
    @RETURN("False:test message" , WARNING);
    ENDIF
    This script validates fine , however when executed on Save of Data Form gives a Job console error with no error code but message as below
    Invalid network data. Type is matched but length is zero. An application protocol error might exist between server and client processes..
    The same script executed using error message type as *"ERROR"* executes successfuly on save of data form and gives exepected custom error message.
    I read a thread in forum saying the @Return function works only with ERROR as message type for vesrion 11.1.2.1
    How to use Essbase @RETURN function to displayed messages in 11.1.2.1
    I have tried using WARNING and INFO , both doesnt seem to work even in 11.1.2.2, Only ERROR as message type works.
    Has anyone experienced the same with version 11.1.2.2 as well? Is this still a bug?
    Please let me know your inputs.
    Thanks
    SN

    Hi,
    I am sorry for the late response!
    Thank you for all your suggestions!
    I had used in the followng way and it resolved my issue.
    SELECT GUID_PRGEN  "Primary Key as GUID in "RAW" Format
             GUID_PR     "Primary Key as GUID in "RAW" Format
             ATTR20A     "SUBSTANCE ID
             ATTR05A     "Materail Type
             ATTR10A     "Materail Group
             ATTR05B     "Sub-Family
             FROM /SAPSLL/PRGEN
             INTO TABLE T_PRGEN
             WHERE ATTR20A IN S_AT20A.
      IF T_PRGEN IS INITIAL.
        MESSAGE : I007(ZMSSG) WITH 'Data not available for this entry'.
        STOP.
      ENDIF.
    Regards,
    Kittu

Maybe you are looking for

  • Publish time in Apple App store

    Wondering if anyone has a general time frame for a folio's appearing in the Apple App store. My understanding is that Apple only does approval on the app and the initial publication and after that you can publish whenever you choose. We are publishin

  • Regarding Inbound and outbound interfaces in ABAP HR

    Hi, Iam new to SAP. Can you send the document related to Inbound and Outbound Interfaces in detail. i.e What these interfaces comes under and steps to develop these inerfaces. Thanks&Regards, B.Thulasi.

  • I need to ask YOU, Adobe, for a huge favour.

    Dear Adobe, I would like to ask you; as the title suggests, a huge favour that will save me from loads of stress. So here is the story, I downloaded the Macromedia Flash MX version (yes, the ancient one, that they use for computer programming courses

  • Capturing video from camera to final cut

    I have a camera currently (canon hg20) that captures files that are .mts. I've always used imovie to capture my files and convert them to .mov but imovie only allows you to capture two sizes, one which is too small and the other is too big. I would l

  • Valuated and Non-valuated project stock in same SAP system

    Dear All,   Can we operate with the system where projects are with valuated and non-valuated project stock at the same time. If yes, are there any precautions we need to take before doing this.   Currently we are changing to 'valuated project stock'