Exception Handling in webdynpro abap

Hi
I have a function call which raises an exception. How do i handle it?

hi,
In WD4A, Exception handling in FM is same as We do in R/3. You can check sy-subrc after calling the function module.
Also you can raise error message by using web dynpro code wizard(control + F7 ) button:
Select Generate message radio button. You will find number of methods in F4. You can use them as per your requirement
Example :
Suppose you call a FM like this in WD ABAP :
CALL FUNCTION 'F4UT_RESULTS_MAP'
    TABLES
      shlp_tab          = t_shlp_tab
      record_tab        = t_record
      source_tab        = t_HCP
    CHANGING
      shlp              = p_shlp_descr
      callcontrol       = icallcontrol
    EXCEPTIONS
      illegal_structure = 1
      OTHERS            = 2.
Now after this FM, check the sy-subrc value Like this:
if sy-subrc = 1.
<Report message for exception 1>.
elseif sy-subrc = 2.
<Report message for exception 2>
endif.
Edited by: Saurav Mago on Oct 16, 2009 10:22 AM

Similar Messages

  • Exception handling in outbound ABAP proxy

    Hi All,
    i need to catch exception in outbound abap proxy in two cases:
    1. if RFC dest in R3 which is pinging to XI goes down.
    2. IF xi server is down.
    in both the cases i need to catch the exceptions.
    now i written the code in this way:
    DATA: v_exceptions TYPE REF TO cx_ai_system_fault.
    TRY.
    CALL METHOD zirco_o_msg_if_as_req_details=>execute_asynchronous
    EXPORTING
    output = s_reference.
    COMMIT WORK.
    CATCH cx_ai_system_fault INTO v_exceptions.
    WRITE: 'Exception CX_AI_SYSTEM_FAULT caught'.
    WRITE: / v_exceptions->errortext.
    WRITE: / v_exceptions->code.
    but this code is not working.
    can anybody tell me how can i acheive this?

    Hi All,
    I need to log the error when receiver syatem is down.
    Its like this:
    Outbound proxy >>>XI>>>File adapter..
    Now if xi goes down....means message is succussefully sent from ISD and get stuck in XI then i need to catch this exception in ISD.
    Is it possible?? if yes then how??
    Kunaal

  • Regarding exception handling in webdynpro

    Dear frds..
    I am using webservice for webdynpro application.,,,
    when i call a particular method of webservice in webdynpro i get o/ps but when i give wrong outputs the webservice exception is shown in webdynpro at the bottom
    I dont wanna to display the exception mesage doen the bottom,
    Instead of dispalying the exception message, i want to dispaly some other things like confirmation box or dialog box..
    How to catch exceptions in webdynpro?
    if  use try catch finally block in webdynpro,
    and in catch block i kept messaeg of popup confiramtion box, it is not been displayed....
    Thanks in advance
    Shravan

    For displaying error in confirmation box, try following code:
    Create a eventhandler named as "Exception"
    try
            //Some statements
    catch(Exception e)
    IWDControllerInfo controllerInfo =wdControllerAPI.getViewInfo().getViewController();
    String dialogText = "TYPE UR ERROR MESSAGE";
    IWDConfirmationDialog dialog =           wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,
    controllerInfo.findInEventHandlers("Exception"),"OK");
    dialog.open();
    OR
    To display error message at some place other than bottom( which is default), add a UI element named as MessageArea and placed it at the required location in View and trying executing the application.

  • ABAP Exception Handling Document Link

    Anyone have a link for the document:
    "A Programmers Guide to the New Exception Handling Concept in ABAP"
    Thanks!

    Hello Kenneth
    Perhaps the following article may also be useful to you.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1be1003-0701-0010-3795-f87160de6483">NetWeaver Developers Guide 2004s: Using ABAP</a>
    Regards
      Uwe

  • Null Pointer Exception in CO of type Webdynpro ABAP

    Hi Friends,
    I am getting an Error in creating a callable object of type Webdynpro ABAP,
    The ABAP webdynpro application is working fine individually, but while creating a callable object of the same type, I get the following error,
    (This happens when I click on <b>'Search'</b> button after putting the wd app name)
    <i><b>The initial exception that caused the request to fail, was:
       com.sap.mw.jco.JCO$Exception: (127) JCO_ERROR_FIELD_NOT_FOUND: Field LANGU not a member of INPUT
        at com.sap.mw.jco.JCO$MetaData.indexOf(JCO.java:9372)
        at com.sap.mw.jco.JCO$Record.setValue(JCO.java:14778)
        at com.sap.caf.eu.gp.model.connect.rfc.abapwd.impl.ABAPWDAppManager.getAppInfo(ABAPWDAppManager.java:54)
        at com.sap.caf.eu.gp.ui.co.config.abapwd.VSelect.getApplicationData(VSelect.java:493)
        at com.sap.caf.eu.gp.ui.co.config.abapwd.VSelect.onActionSearch(VSelect.java:438)</b></i>
    Do somebody has any idea about the problem?
    Thanks in advance,
    Deepak.

    Please send us the CreateEmployees.java. It seem the problem is in the way you using the generated java classes.

  • How to handle events in webdynpro abap

    Hi,
    can any body explain how to handle the events in webdynpro abap.
    i want to know some concepts in general.
    Thanks,

    Hi Mahesh,
    you can create event handlers under the actions tab in you view. evry event handler has an importing parameter wdevent of type ref to cl_wd_custom_event.
    you can also create events in your component controller and they can be handled within your views
    check cl_wd_custom_event class for details about what all information you get when an event occurs.
    for further details you can check out the following links
    http://help.sap.com/saphelp_nw04s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/c751415e3b6532e10000000a1550b0/frameset.htm
    also you can try the tutorial at the following link for further clarity
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2eb11b59-0a01-0010-dfa3-8292abdf9c4f
    Regards,
    Shweta
    Message was edited by:
            Shweta R Shanbhag

  • OnSelect event for a Drop down UI Element in Webdynpro ABAP Select Options

    Hi Experts
    We have built our UI based on the webdynpro ABAP Select Options. We have a requirement that, when we change the value of a drop down box in the UI, I need to hide some fields. Can anybody help me out in handling of OnSelect event of a drop down box built using webdynpro ABAP Select Options. We are on SAP Netweaver 7.0 EHP1.
    Rrgards,
    Srikanth.
    Edited by: Srikanth Kancherla on Apr 29, 2010 10:43 PM

    Hi Srikanth,
    as you seem to be already aware, the component is dynamically built.
    so you would have to enhance the code that builds the element and insert a reference to a new action (enhancement) that could handle the onSelect event.
    What is it about this that you particularly want help with?
    Cheers,
    Chris

  • DMS Document not getting created thru Webdynpro ABAP Strange Problem

    Dear all,
    My requirement is that I have a Webdynpro ABAP application sitting on SAP Server1 and I am having a FileUploadUI Element in there for uploading files and we have SAP Server2 with the DMS configured. So, what we have done is we have an RFC in SAP Server2 and we are calling it from our webdynpro ABAP application sitting on SAP Server1. And we are calling BAPI_Create2 with all the necessary parameters in this RFC to create the DMS document with the file from webdynpro ABAP application. But its not working. I am passing the Presentation Server File Path of the File to the BAPI_create2.Even if I write the file to the application server of SAP Server2 and then pass this file path to the BAPI_Create2 then also it doesn't work but when I execute this RFC locally in the SAP Server2 with the presentation server file path It executes successfully.
    I don't know what I am missing.
    Please help.
    Thanks and regards,
    --Sonal

    Dear Thomas,
    Suppose I have got the file copied to the application server in SAP Server2 using datasets from WDA in SAP server1.
    Now I have an RFC say ZFILE_UPLOAD in SAP Server2 for which we have made an SAP ABAP RFC Connection from SAP Server1. In this RFC I am calling BAPI_create2 using the application server filepath(of SAP Server2) in docfile parameter along with ur suggested destination then also it doesn't work. Gives an error that "error in storing and checking file" i.e. Error 253.
    One more query how to handle the file upload of different file types say I am uploading a pdf file from my webdynpro abap application in SAP server1. Then I get the xstring and pass it to ZFILE_UPLOAD and convert it into binary and write it there in SAP Server2 using datasets. Is it possible to upload any kind of file and then creating the DMS document out of it?
    and how to call this RFC?
    Thanksn and regards,
    --Sonal

  • Exception handling in client proxy

    Hi
    Can someone please help me with exception handling in ABAP client proxy.

    HI
      Welcome to SDN
    Check this link you wil get information regarding ABAP Proxy  http://help.sap.com/saphelp_nw04/helpdata/en/c9/74246d8ad2447799063d39013e9a11/content.htm

  • Filling dynamic drop down in adobe interactive form( webdynpro ABAP)

    HI all,
    Im new in Webdynpro ABAP, my requirement is to fill drop down list in adobe interactive form. i created adobe form and its working fine.
    I Created context like ROOT(cardinality 1:1)->DATANODE cardinality 0:n. This context is for drop down and in wddoinit i did  like this.
      IN WDDOINIT ,
    DATA lo_nd_root TYPE REF TO if_wd_context_node.
      DATA lo_nd_datanode TYPE REF TO if_wd_context_node.
      DATA lo_el_datanode TYPE REF TO if_wd_context_element.
      DATA ls_datanode TYPE wd_this->elements_datanode.
    navigate from <CONTEXT> to <ROOT> via lead selection
      lo_nd_root = wd_context->get_child_node( name = wd_this->wdctx_root ).
    navigate from <ROOT> to <DATANODE> via lead selection
      lo_nd_datanode = lo_nd_root->get_child_node( name = wd_this->wdctx_datanode ).
    get element via lead selection
      lo_el_datanode = lo_nd_datanode->get_element(  ).
    ls_datanode[] = lt_dna_value[].
    CALL METHOD lo_nd_datanode->bind_table
      EXPORTING
        new_items            =  ls_datanode
        set_initial_elements = ABAP_TRUE.
       index                =
    while executing  i'm getting this error ": WebDynpro Exception: ADS: com.adobe.ProcessingException: No output was generated while rendering: Stream for: PDFOut.(200,101). " . can u please tell me how to bind value for drop down.
    I created sample table in same form and i binded same value to table, that time its executing fine.
    can u please tell me solution for this Scenario.
    Thanks
    Hemachandran.
    Edited by: hemachandran R on Sep 12, 2008 2:27 PM

    hi,
    My requirement, is to use dynamic drop down in dynamic table. I am using webdynpro abap.
    i populated the value in drop down.
    Its working fine but the problem is how to fill the default value in drop down. because i want to bind the default value which im getting specify value from the table.because each row
    im getting different values, like first row
    CAR
    , that CAR want to fill as a default value in drop down  and second row  as
    BIKE
    that BIKE  want to fill as default value in drop down  ( example drop down contain   car , bike , cycle).
    In adobe form i binded like this
      $record.DATANODE.DATA[*].DNA_RATING
    i dont know whether this one is correct or wrong  .
    im getting default value as empty.
    please give me some solution how to do this.its very urgent
    thanks
    hemachandran.

  • How to call the RFC from R/3 to SRM, when we use webdynpro abap? (Urgent)

    Hello
    We use SRM Server 5.5 with classic scenario.
    We want to call RFC in R/3 from webdynpro ABAP.
    How can we do that?
    We are developing the web report using webdynpro abap.
    So we need some of R/3 data such like PR(EBAN)and PO(EKKO,EKPO).
    When user choose the search parameter, report diplay the Shopping cart, PR and PO data on webdynpro.  So we call the R/3 RFC to display the PR, PO data.
    But I tired to call the RFC in R/3, We could not call it.
    How to call the RFC from R/3 to SRM, when we use webdynpro abap?
    Thank you,
    Best Regards,
    SH.

    Hi
    <b>Please look at the following threads as well -></b>
    WebDynpro in SRM
    BAPI's /RFC's in SRM
    BAPI to Change Shopping Cart by RFC
    SRM60 and webdynpro
    Webdynpro Services Exception
    WebDynpro using BAPI has an error
    SRM60 and webdynpro...
    <b>SAP uses META Function modules in SRM to get data from R/3 back-end.</b>
    <u>For getting Purchase requistion data, use the function modules -></u>
    META_REQUISITION_CHANGE        Change purchase requisition              
    META_REQUISITION_CREATE        Create Requisition                       
    META_REQUISITION_DELETE        Delete/close purchase requisition        
    META_REQUISITION_GETDETAIL     Display requisition details              
    META_REQUISITION_GETITEMS      Display requisition items                
    META_REQUISITION_GETRELINFO    Get Releasease Info for requisitions
    <u>For getting Purchase order data, use the function modules -></u>
    META_PO_CREATE                 Create purchase order                    
    META_PO_DELETE                 Delete reservation                       
    META_PO_GETDETAIL              Display purchase order details           
    META_PO_GETITEMS               Display purchase order items             
    META_PO_GETRELINFO             Display purchase order release information
    Hope this will definitely help. Do let me know.
    Regards
    - Atul

  • Anonymous user Unbale to access an WebDynpro ABAP iView

    Hi,
    I have developed an application using webdynpro ABAP and integrated that into portal.
    For this webdynpro application i have to create an iview, assigned it to a page, assigned this page to a custom role. I also set Authentication to anonymous for the page and iView. Assinged the custom role created to anonymous Group.
    But while running it i am getting an error "An exception occurred while processing your request. Send the exception ID to your portal administrator. Exception ID 04:55_25/10/11_0047_14739050"
    When I checked the log, it shows the error as "Deprecated scope of type SERVERSESSION_AT_LEAST_ONE_APP_SCOPE is used! Please replace the usage of scopes with new
    mechanism based on "Cross application session communication API".
    I also checked the note 1031159 and changed the configurations accordingly but getting the same above error.
    I am on EP7.3 version.
    Please guide me to move further successfully in showing the webdynbpro abap applicaiton to anonymous user.
    Thank you.

    Hi,
    I'm also working on EP7.3 and R3 WD4A integration. But I just can't find any WD for ABAP from whithin EP7.3 wizard.
    I tried to create the WD4A iview by right-clicking a PCD folder and then "New"->"iView"->"iView from remote source" to get a search screen. I choose a system alias (point to bk web as), use "*" as application id, and pick "WebDynpro for ABAP" as the application type.
    However, I always got "Nothing found. Change your search criteria."
    I did do some activation work on backend R3 SICF setting. I'm able to directly access  web dynpro via http://mywebas.domain:8000/sap/bc/webdynpro/mywd.... 
    If you're using the same scenario, please let me know anything I missed or any other special setting.
    Thanks

  • Error Handling in Inbound ABAP Proxy with EOIO

    Hi,
    The scenario
    I have a File to ABAP Proxy scenario and since the requirement is that the messages have to be processed in a single queue in the SAP system (i.e. EOIO), the sender file channel was configured to be EOIO. This ensures that all messages that enters the SAP system are put in a single queue and then processed one after the other.
    The Issue
    Now if one of the messages that enter SAP system fails during the processing in the ABAP program, the queue gets stuck and all messages after that go into a scheduled state. And one has to manually clear the errored message in order to continue processing the other waiting messages.
    The Question
    I know this is a default behavior in an EOIO scenario, however is there any way in which if a message fails in the ABAP program then one can automatically push it out of the queue and keep processing the other messages after it ?
    Thanks
    Bharath

    As a general rule I only use EOIO when there is a possibility of dependancy between messages (message 1 must be first and finsihed before message 2 starts). Assuming your just moving the errored message asside, I would assume that EOIO should be just EO.
    Alternatively, change the ABAP proxy to handle the error and return a clean status. Exception handling (try/catch) should be used were ever dangerous code is being used.
    If alerting in the proxy end point is to much trouble - change your proxy to a sync scenario return the error to PI and fire alerts from there <- I think this should be avoided but it will work.
    The main point is the exception handling so that the proxy fails "gracefully".

  • How to use webdynpro abap? need separate software? or please help me.. :-)

    How to use webdynpro abap? need any separate software? if no, please help me with Transaction Codes..
    Thanks in Advance
    -Parthi
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Oct 19, 2011 8:18 PM

    I don't think you quite understand how hibernation mode works.
    "The state of a computer is stored into its main memory, which is also called RAM. When a
    computer is powered off, the contents of this memory are irremediably wiped out. Hiberna-
    tion works in the following way: before being powered off, the computer saves all the con-
    tents of the memory to a file on the hard disk drive. On wake up, data stored in this file is
    read out and restored to the memory. Therefore, the RAM contents are the same before
    and after the hibernation process, and the state of the computer is also the same. The
    saved file is named sleepimage, and is located in the /private/var/vm directory. Hi-
    bernation is sometimes also called “software suspend” or “suspend to disk”.
    The default suspension feature of Mac OS X, called sleep works in a different way. When
    entering sleep, every subsystem of the computer is shut down, except the main memory
    which is still powered. This process preserves the contents of the memory, and allows the
    computer to wake up quickly. However, a sleeping computer still consumes a small
    amount of power. Sleep is sometimes also called “hardware suspend” or “suspend to
    RAM”.
    Apple introduced the safe sleep feature in Mac OS X 10.4.3 for the Powerbook HD line of
    laptops. This feature is a variation of the default suspension behavior. The main memory is
    still powered during the sleep, but the contents of the memory are also saved to the disk at
    the beginning of the operation. The saved file will only be used if the laptop runs out of bat-
    tery power while sleeping, in order to restore the original state of the computer.
    This safe sleep feature is what makes hibernation possible in Mac OS X 10.4.3 and above."
    Quoted from *Deep Sleep v. 0.7 documentation*
    Matthieu Beaumel, 10/03/2006

  • Class based exception handling

    Hi everyone....
    I am new to object oriented abap.
    I would like to know more about exception handling using classes.
    please provide some good material or links on the topic?
    Points will be rewarded.......

    hi,
    Download the PDF from here.
    http://www.esnips.com/doc/6d16a298-9227-4d32-acf1-e91164c89daf/3-ABAP-Objects(P283)
    Follow this link too for tutorials.
    http://www.****************/Tutorials/OOPS/MainPage.htm
    Hope this helps, Do reward.
    Edited by: Runal Singh on Mar 14, 2008 3:28 PM

Maybe you are looking for

  • Using bulk collect with select

    i am working on oracle 10g release 2 . My requirement is like this   1  declare   2     type id_type is table of fnd_menus.menu_id%type;   3     id_t id_type;   4     cursor cur_menu is select menu_name from menu;   5     type name_type is table of m

  • Tax reversal

    Dear friends, When we cancel the material document , Part 1 enteries will reverse automaticaly, How to reveres the VAT and other taxes captured

  • How do I download a few songs that are missing off my downloaded albums?

    How do I reload a few songs that are missing off my downloaded albums?

  • Mac Pro wakes up from sleep by itself

    My MacPro keeps waking up all by itself every day. I turn it off in the morning and when I come back it's always up. I don't wake wake-on-lan enabled, or automatic poweroff/poweron in System Preferences. Does anybody else have this problem?

  • Older MacBook Pro- should I upgrade to Yosemite?

    I have a 15-inch MacBook Pro released in mid 2010. I'm trying to decide whether to upgrade to Yosemite or not. I know there have been issues. Have there been updates that have eliminated the problems? Thanks for your help.