Raise exception when the user entered value is not present

Hello Abap experts,
To raise an exception in the function module when the imported variable value is not presnt in the table.
import variable: cust_name.
how to define a exception for this raise it in the code. any examples and suggestions.
Thanks,
BWer

Here is the F1 help on RAISE.
<i>
RAISE
Basic form 1
RAISE except.
Effect
This statement is only effective in function modules and methods.
It triggers the exception except.
If the exception is to be handled by the caller of the function module or method ( CALL FUNCTION or CALL METHOD ), the system passes control straight back to the caller. EXPORT parameters of a function module or method are not filled. The EXPORTING, CHANGING, and RETURNING parameters of a function module or method are only filled with the current values if they were defined to be passed by reference. reference).If they are defined to be passed by value, they are not filled.
If the exception is not handled by the caller, the program terminates with an appropriate error message.
Example
Let there be a function module STRING_SPLIT containing the following code (see also the example in the documentation of the CALL FUNCTION statement):</i>
<b>FUNCTION-POOL CSTR.
FUNCTION STRING_SPLIT.
  IF STRING NA DELIMITER.
    RAISE NOT_FOUND.
  ENDIF.
ENDFUNCTION.</b>
The calling program might then contain the following:
<b>PROGRAM EXAMPLE.
CALL FUNCTION 'STRING_SPLIT'
     EXCEPTIONS
          NOT_FOUND = 7.
IF SY-SUBRC = 7.
  WRITE / 'There is a problem.'.
ELSE.
ENDIF.</b>
<i>
If the NOT_FOUND exception is raised in a RAISE statement in the function module STRING_SPLIT, the system exits the function module and returns control to the calling program. The return code, which you should evaluate directly after the CALL FUNCTION statement, now contains the value 7.
Note
Runtime errors:
RAISE_EXCEPTION: The caller did not handle the exception that was triggered.
Related
MESSAGE ... RAISING
Additional help
Creating Function Modules
</i>
Regards,
Rich Heilman

Similar Messages

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How to find the user entered value is Integer or not?

    hi,
    i want to find, whether the user entered value is Integer or not. If it is Integer, i wanna continue the program. otherwise send an error message. i tried to find for function in API. But i couldn't. can somebody help me with sample code. very urgent.

    Do a Integer.parseInt(<string value>) in a try catch block If a NumberFormatException is thrown, the entered number is not an integer.

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • How to catch an event when the user change values in the project information dialog

    hi,
    i would like to know how to catch an event in my C# code when the user change values in the project information dialog?
    taskChange doesn't catch these changes.
    thanks.
    Thanks, Sharon.

    You need to write save button event handler for project information dialog. Link is having same functionality described. 
    http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx
    http://www.projectserver2010blog.com/2010/01/sharepoint-2010-webpart-client-server.html
    kirtesh

  • Set the user entered values to context node

    Hi Experts,
    I am using a context node for 'BuilHeaderSearch' BOL entity and have provided first name, lastname and email for the user to enter values to search the BP. My requirement here is to capture the values entered on the UI screen and set to context node which supposedly should be taken care by SET_* methods, which is not happening at the moment, consequently are not set to context node meaning that it doesn't go to SET_FIRSTNAME method.
    I know i could access the values using formfields but i don't think that's recommended.
    Please give me some clue.
    Many Thanks for sparing your valuable time,
    Santosh

    Hi Santosh,
    I think i got the problem now..
    Always create instance creates a entity if there is no entity exist in the collection of the context node, for eg lets say you are trying to create one model context node2 which is related to any existing parent context node1.. In this scenario if you check always create instance for the dependent context node2, it will create the blank entity and this you can varify in the  on_new_focus of the dependent context node2.(Create related entity code will be there which will create a blank entity if you have check always create instance).
    If you don't specify always create instance, framework will not create blank entity for your context node(Check the on_new_focus code no create_related_entity code will be there).
    In your requirement if you don't select "always create instance", then as per my understanding you will not be getting blank entity and set_property call should result into exception, which will not be the case when you have entity thru always create instance.
    Hope i am albe to clarify this..
    Cheers,
    Sumit Mittal

  • Need help to get the user entered value from a input field in Table in OA

    I have a table in my OA page.
    Here one column is there which should take in put from user.
    i.e an item quantity field text input is there which should take the updated value when the add to cart link which is next column in the table. On clicking of the link I am trying to get the updated value entered by user. for the respected row for which addto cart link get clicked.
    For that link I have defined some parameter through SPEL,( like this parameter name: item_quantity value : ${oa.MisibeItemSearchVO.ItemQuantity} ) which has fireaction. But when i am clicking the addto cart link I am not getting the current value entered by the user.
    Can any body guide me how to get that related value for which the add to cart link got clicked.
    for this when i am doing pageContext.getParameter("item_quantity"));
    I am not getting the value entered by user.
    please suggest me
    Thanks!
    Smarajeet

    The below is my Vo query for item quanity i am using a dummy query "(select null from dual) as ITEM_QUANTITY"
    in the below query and item type is number. and this is a messageTextINput in OA page and is maped to ItemQuantity vo attribute.
    SELECT idsi.section_item_id
    ,idsi.inventory_item_id
    ,(select concatenated_segments from mtl_system_items_kfv mstk
    where mstk.inventory_item_id = idsi.inventory_item_id
    and mstk.organization_id =idsi.organization_id) ITEM_NAME
    ,(select description from mtl_system_items_tl mtll
    where mtll.inventory_item_id = idsi.inventory_item_id
    and mtll.organization_id =idsi.organization_id
    and language = USERENV('LANG') ) ITEM_Description
    ,(SELECT CASE
    WHEN instr(msib.segment6,'NAMED USER') > 0 THEN 'NAMED_USER'
    WHEN instr(msib.segment6,'PROCESSOR')>0 THEN 'PROCESSOR'
    ELSE msib.segment6
    END
    FROM MTL_SYSTEM_ITEMS_B msib
    WHERE msib.INVENTORY_ITEM_ID = idsi.inventory_item_id
    AND msib.ORGANIZATION_ID = idsi.organization_id) LICENSE_TYPE
    ,(SELECT CASE
    WHEN instr(msib.segment6,'1 YR') > 0 THEN '1YR'
    WHEN instr(msib.segment6,'2 YR') > 0 THEN '2YR'
    WHEN instr(msib.segment6,'3 YR') > 0 THEN '3YR'
    WHEN instr(msib.segment6,'4 YR') > 0 THEN '4YR'
    WHEN instr(msib.segment6,'5 YR') > 0 THEN '5YR'
    WHEN instr(msib.DESCRIPTION,'Perpetual') > 0 THEN 'PERPETUAL'
    END TERM FROM MTL_SYSTEM_ITEMS_B msib
    WHERE msib.INVENTORY_ITEM_ID = idsi.inventory_item_id
    AND msib.ORGANIZATION_ID = idsi.organization_id) TERM
    ,(select qll.operand
    FROM qp_list_lines qll
    ,qp_pricing_attributes qpa
    WHERE qll.list_line_id = qpa.list_line_id
    AND qpa.product_attr_value = to_char(idsi.inventory_item_id)
    AND qll.list_header_id = 439381
    AND sysdate between NVL(qll.start_date_active, sysdate) and NVL(qll.end_date_active, sysdate+1)
    AND qpa.list_header_id = qll.list_header_id
    AND qpa.product_attribute = 'PRICING_ATTRIBUTE1'
    AND qpa.product_attribute_context = 'ITEM'
    AND NVL(qpa.pricing_attribute_context,'MIXED') = 'MIXED') ITEM_PRICE
    ,(select null from dual) as ITEM_QUANTITY
    ,(select currency_code from qp_list_headers_b where list_header_id =439381) currency_code
    ,(select segment1 from mtl_system_items_b msib
    where msib.inventory_item_id = idsi.inventory_item_id
    and msib.organization_id =idsi.organization_id) PART_NUMBER
    FROM ibe_dsp_section_items idsi
    ,ibe_dsp_msite_sct_items idmsi
    ,( select distinct child_section_id
    from IBE_DSP_MSITE_SCT_SECTS b
    connect by PRIOR child_section_id = parent_section_id
    start with parent_section_id =:1
    and mini_site_id =1
    UNION
    select distinct child_section_id
    from IBE_DSP_MSITE_SCT_SECTS b
    where child_section_id =:1
    and mini_site_id =1
    ) csi
    WHERE idsi.organization_id = 101
    AND idmsi.section_item_id = idsi.section_item_id
    AND idsi.section_id = csi.child_section_id
    AND idmsi.mini_site_id = 14409

  • Want only the user entered values on the xml generated by clicking the button

    Hi All,
    Here goes the details of the problem.
    1. I have created two textfields(texttfield3 and textfield4) along with an email button in a fragment and binded to an XSD file.textfield3 and textfield4 are user entered fields.
    2. On the design page I have created two more fields texfield1 and textfield2 and binded to another XSD.These two fields are read only fields.
    3. On preview PDF screen whenever you click on the email button,you get a mail option with an xml file attached to it.
    4. whenever you open the xml file,you will get the values of all the four fields.Its given below
    <form1>
    <TextField1>value1</TextField1>
    <TextField2>value2</TextField2>
    <TextField3>value3</TextField3>
    <TextField4>value4</TextField4>
    </form1>
    5.But I want only user entered fields to be displayed on the xml page i.e
    <form1>
    <TextField3>value3</TextField3>
    <TextField4>value4</TextField4>
    </form1>
    6.How can I remove or avoid the read only fields not to be displayed on the xml page???
    Thanks in advance

    This forum is for our hosted services of LiveCycle.  I'd suggest that you repost this question this on the Designer (best choice) or Forms forum.

  • Delete credit memo work item created in VA01 when the user change value

    Hi,
    In T.code VA01 Credit memo request is creating, this document will automatically create  work item.  Based on Net value in credit memo request, the work item should go for 5 levels of approval. After 1st person is approved, the workflow initiator realized that the net value in created Credit Memo request is wrong; he is going to VA02 and correcting the net value. Again we have to create new work item for this and delete the already created work item. Client has clearly mentioned when ever there is change in 5 critical fields in VA02 then only create fresh work item otherwise no need to create SECOND TIME work item. Net value is one of the critical field in the list.
    How to track already created credit memo request and how to delete the previously created work item. What is the feasibility of this requirement and how to handle this situation?
    Regards
    Vijay

    Hi,
    Just put a Fork and put 1 out of 2 outcomes and in the first alternative, you put your witem that goes to user B. In the 2nd alternative, put a Wait for event "CHANGED". And after this, put a process control step with "Set workitems to Obsolete" or "Cancel workflow" etc., depending on your requirement.
    Pl note that this will only take out old witems, but you need to send a new witem for which you need to trigger another instance of the workflow as well. pl put CHANGED event also as one of the triggering events and use condition editor to restrict the fields that triggers the workflow.
    Also, look into the IMG config of the following path. This might be a fitting solution.
    In SPRO, go to Financial Accounting (New)---> Financial Accounting Global settings(New) -
    >Tools --->Workflow ---> Workflow for Document Parking -->Reset Release Approvals(Customers).
    Here, you can list down the fields, the workflow should restart. But, then you need to give the workflow details etc., in the relevant config settings.
    We have used this in restarting workflows for General Ledger(GL) documents' workflow when some important fields are changed.
    For this config settings, look into the following help link.
    http://help.sap.com/erp2005_ehp_02/helpdata/en/01/a9cdd8455711d182b40000e829fbfe/frameset.htm
    Hope this helps.
    venu

  • How do I make form or table where certain numbers update according to a formula when the user enters one number?

    Hi, I am an amature website designer and have made a website
    using dreamweaver. I am very lost when it comes to doing tougher
    things in dreamweaver. I want to create a small form or a table
    where there will be 7 or so numbers that are generated based on
    simple formulas for each one once you enter one number. Can someone
    please help me with this task whether it is in dreamweaver or even
    making it out of flash or anyway that this would be the easiest to
    make possible. Thanks

    Here's a very simple form you could use to perform a
    calculation, it this case, squares the input value and writes it
    back to another input field... Hopefully you can use this as a
    pattern to apply your own algorithm. You'll need to do validation
    to assure the entered fields are appropriate for the calculation
    (required fields are entered).
    Hope this gets you started.
    ================================================
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=utf-8"
    http-equiv="Content-Type" />
    <script type="text/javascript">
    function squareit() {
    var num = document.getElementById('myinput');
    var res = document.getElementById('myresults');
    res.value = Math.pow(parseFloat(num.value), 2);
    </script>
    </head>
    <body>
    <form id="myform">
    <label for="myinput">Number: </label><input
    id="myinput"><br/>
    <label for="myresults">Result: </label><input
    id="myresults"><br/>
    <input type="button" value="Calculate"
    onclick="squareit()"/>
    </form>
    </body>
    </html>

  • How to keep a calculation field blank until the user enters a number?

    I am building a sales sheet for a school that sells scrip as a fund-raiser. I have the document set so that when the user enters the number of scrip certificates he wants (say, two $25 gift certificates at Lowe's), the program will automatically calculate that this user owes $50 for that scrip category. However, there are more than 100 companies that one can choose from, and if the user doesn't enter a number, the calculated field shows $0. Is there a way that each field can stay blank until the user enters a number bigger than zero? By the way, I'm using this calculation to determine the value (borrowed from a user on this forum): event.value = 50 * this.getField("Lowes").value
    Thanks!

    There are two approaches. You can either add the following Validate script:
    // Custom Validate script for calculated field
    if (+event.value !== 0) event.value = "";
    Or you can change your custom Calculate script and set the Format type of the field to "None":
    // Custom Calculate script
    (function () {
        var v = +getField("Lowes").value;
        event.value = (v !== 0) ? util.printf("$%.2f", v) : "";

  • How to Get User entered value in a text variable

    Hi,
    I have made a text variable to show the user entered value in the column header.
    The user enteres value in a formula variable ABC whose default value is say '30'.
    I am using customer exit to capture this value in the text variable. The code is as follows
    IF i_vnam EQ 'txtvar'.
    if i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range
    WHERE vnam = 'ABC'.
    CLEAR l_s_range.
    l_s_range-low = loc_var_range-low.
    l_s_range-opt = 'EQ'.
    l_s_range-sign = 'I'.
    APPEND l_s_range TO e_t_range.
    EXIT.
    ENDLOOP.
    endif.
    endif.
    Now when I am executing the query I am getting the default value in the column header i,e, 30. But when the user changes this default value to something else while executing the query, I simply get blank in the column. The changed value is not getting captured in the text variable.
    Thanks

    Hi,
    Insted of  going for exit,
    just create a Text variable proceesing typr Default/ Manual Entry and set the default value as u wish,
    use it in the KF header; dont use the same Text Variable for Query Title.
    Now i tried this for you and it is working fine.
    Regards
    ReddY A

  • RRI with passing user enter values

    Hi Friends !
    Brief about my requirement for the RRI.
    I have a Main Query. When I click on Goto option, it shud display the variable screen and pass the user entered values in the Jump Query.
    In RSBBS, I tried with the "Assignment Detail" button, in which we have variable option, etc but via Assignment Details, its not working.
    Please provide some inputs.
    Thanks.
    Rekha

    It sounds like you are trying to make RRI do something that it is not designed to do. For RRI to work correctly, the sender query must contain all of the values to be passed to the receiver query. Therefore, no prompting for additional variable values occurs during the jump from the sender to the receiver.
    To quote the SAP Help on RRI :
    "Queries, transactions, reports and Web addresses can be jump targets. The parameterization of the target action is taken from the context of the cell that you have jumped from. You can set parameters for calling a BEx Query or a BEx Web Application using input variables which are filled from the selection conditions and the element definitions of the cells highlighted in the sender query."
    See <a href="http://help.sap.com/saphelp_nw04/helpdata/en/99/08629bd3e41d418530c6849df303c9/content.htm">SAP Library  -  Report-Report Interface</a> for all the details.
    Hope this helps...
    Bob

  • How to Validate the user entred value

    Hi All
    I am new to APEX... :)
    Can any one send me the URL or material where i can go through and create sample applicaiton having the following functionalities
    1) Create a form for the user to enter the data
    2) Create users and give access
    3) Validate the user entered values (Validation of a e-mail filed or Phone no)
    Thanks & Regards
    Hari

    Hari,
    You should start on our Getting Started page (http://www.oracle.com/technology/products/database/application_express/html/getting_started.html). I would suggest you do the OBE. It will show you how to create an application, add validations (that is what will make a user enter data in your email and phone fields) and create users. It uses APEX Authentication which means that any developer within the workspace can access and run the application and that you can also create end-users from within your workspace that will only be able to run your applications (not access the development environment).
    It will definitely answer your questions -
    -- Sharon

  • Reg: User Entered Value in LOV Window

    Hi All,
    Following is the use case.
    I have an LOV ("PO Number") with its own controller. If user enters a partial value in LOV Field, (say 513),
    LOV Window comes up with results like PO Number starting with 513. Suppose, If user modifies the search value from 513 to 913,
    LOV query needs to get executed with new search value (913).
    Can you please suggest me to capture the new user entered value (913) in the controller.
    I tried the following. But, poNum value obtained through below code is 513(old value - value entered in LOV of base page.)
    Dictionary passiveCriteria = (Dictionary)pageContext.getLovCriteriaItems();
    String poNum = (String)passiveCriteria.get("PosPoNumberInternalLov1");
    Is there any other way, i can find out the new user entered value in LOV Window.
    Thanks,
    Kiran.

    Hi Gyan,
    My requirement is that, I need to make some processing/manipulation on the user entered search value for the LOV.
    If the user enters value in base page, i am able to get the value and process it.
    But, If user clicks on LOV Window, enters a new value in search field, i am not able to capture the new value.
    Please suggest accordingly.
    Thanks,
    Kiran

Maybe you are looking for

  • Why do print margins change when I save or print as a pdf?

    I am printing from a church software program.  I need to save the report as a pdf so that it will print and fold on our new Xerox.  However when I print to pdf, the margins change and the text boxes slightly move and no longer line up with the prepri

  • Error -23 cannot download purchased LP on computer,downloaded song without problem

    I purchased an LP Miranda Lambert Platinum and it has not downloaded to my computer.  In itunes-it says error -23.  It has loaded on my itunes on iphone

  • Trial balance for one given date

    Dear Experts, Please guide me any reprot or t.code for a given particular date trial balnce. regards chandu

  • Alternating row color

    I have a spreadsheet and the alternating row color only works down to a certain row. I can't copy the style, etc. Tried turning it off and then back on and that doesn't work. Also when I copy a cell from a blue row to a white row it retains the blue

  • Unallowed tags - cannot save message

    Hello, On my clients landing page: http://www.saveenergyexpo.ca I'm getting an error on save that says: "You cannot save this page Reason: The content you are trying to save unallowed tags or dynamic code." I don't think I have anything out of the or