How to catch errors in calling program when using SUBMIT ... AND RETURN ?

Hi ,
I am calling a report using submit and return statement from a function module. The report has select-options field for a date field. If user enters a date in low, which is greater than high, getting error message "Lower limit is greater than upper limit".
How to catch this error without endup stoping on selection screen of the report?
In the documentation, I read :
Programs called with SUBMIT ... AND RETURN or CALL TRANSACTION cannot propagate exceptions to the caller, because exception objects are bound to the internal mode of a program.
Is there any way to overcome this?
Also my aim is to write a validation on the date selection-option to have the date range not more than 20 days.
I am not sure of how to achieve this. 
Is there a way to do validation of select-options data before submiting to the report ?
Is there any standard FM to achieve this task?
Thank you,
Surya.
Edited by: Surya on May 24, 2009 6:08 PM

Hi Surya ,
In your function module's code validate the date .
If the low value of the date less than high and date period is not more than 20 then
call transaction and in else condition raise exception.
In your FM write like that - -
IF   date-low LT date-high AND
                       date_difference LE '20' .
CALL  TRANSACTION   'transaction'.
ELSE.
RAISE  ...........  " Raise the invalid date exception
ENDIF.
Regards
Pinaki

Similar Messages

  • How to execute the first program without using SUBMIT and RETURN

    Hi Experts,
    My requirement is , I need to select thet value from VA02 at runtime and need to pass that value to VF01 transaction and press save then it creates proforma document.The created document we can see in VA02 by clicking on document flow.
    My program is processed through OUTPUT TYPE.
    To get this functionality i written coding like this.
    1) i am selecting the value at runtime from VA02  using FORM ROUTINE.Now iam passing this selected value to VF01 for
    genarate proforma document using BDC.Here the problem is,first time when i am selecting the value form VA02 at runtime it is in open status,now my BDC code need to update the value in VA02 only.so locking problem occurres  the document is not getting updated.
    To overcome this problem i have done changes like this......
    2) i splited my program into two parts, that  is into two programs.
    a) In first program i am only selecting the value form VA02 at runtime using FORM ROUTINE and in this program i have written SUBMIT statement to call another program there my BDC  code will create documet and update in VA02,upto here everything is doing fine,
         But here again the problem is when i process OUTPUT type my program is triggering and giving correct result but the status is not changing form YELLOW to GREEN.Why means when SUBMIT statement trigger, control is going to second program and creating a new document,but not coming to first program so the status is not changing as the first prohram is still processing. .If i write RETURN along with SUBMIT the VA02 is in open STATUS only, till control comes to first program.so it will not uodate document in VA02.
    If i execute all line in my program status will automatically change from YELLOW to GREEN how to acheive this
    please suggest me the solution.

    I would do 2 things:
    1) be sure to do a COMMIT WORK AND WAIT
    2) refresh your display in calling program
    the point 2) can be done by submitting the program again (or the transaction) with the same parameters

  • How to CATCH error from call to standard SAP Function Module

    Please, is it possible to catch the following error with the TRY CATCH ENDTRY construct?
    From a custom program, am calling CS_BOM_EXPL_MAT_V2.
    Several nested calls in, Form STL_DATEN_HOLEN (LCSS4F1I) calls FM CS_ALT_SELECT_MAT. 
    However, that call is missing the CALL_INVALID Exception. 
    CS_ALT_SELECT_MAT is raising CALL_INVALID, but since it was not included in the FM call, the RAISE_EXCEPTION runtime error is issued.
    I added a TRY CATCH ENDTRY construct around the call in the custom program using CATCH cx_root, but the program is still short dumping.
    All the research I have done has been misleading...some articles indicate all errors should be caught, some indicate only catchable runtime errors can be caught, others are not quite clear.
    So, I would like to find out if, in this scenario, it is even possible to catch this error and avoid the short dump.
    I will open a message to see about having the SAP code fixed as soon as I get authorization to do so, (as well as fix the data causing the issue in the first place), but in the meantime, I would like to handle it in my code if possible.
    ECC 6.0
    Thanks for any information!
    Kind Regards,
    Deb
    Edited by: Debra Garner on Jan 26, 2012 5:19 PM

    Hi Debra,
    You cannot catch non class based exceptions using the TRY/ENDTRY.  You might also find no luck with help from SAP since the FM in question 'CS_BOM_EXPL_MAT_V2' is not released for customer use.  The best bet is to examine why the error is occurring and figure out what needs to be done to fix it and/or avoid it in the future.
    Regards,
    Ryan Crosby

  • Error while calling RFC when using BSP Web Interface

    Hi,
    we have a problem with the Authorization when we use an Web Interface for BSP. We have assigned all roles to the user which were mentioned in the SAP standard documentation:
    R_AREA   
    R_METHOD 
    R_PACKAGE
    R_PARAM  
    R_PLEVEL 
    R_PM_NAME
    R_PROFILE
    R_STS_PT 
    R_STS_SUP
    R_WEBITF 
    S_RS_ADMWB
    S_RS_AUTH
    S_RS_COMP
    S_RS_COMP1
    S_RS_DAS 
    S_RS_ICUBE
    but we still get the error message: "Error while calling RFC".
    When using a user with SAP_ALL, it works.
    What can we do?
    Thx for your time.
    Joerg

    Actually that's surprising - because BSP (Business Server Pages) and RFC (Remote Function Call) are not related; they use totally different transport protocols (http vs. RFC). Even if an BSP application is calling a function module remotely (acting as RFC client) no authorizations for S_RFC are required - in the calling system (but in the called system, i.e. the RFC server).
    Since assigning SAP_ALL seems to "cure" the problem, it seems to be an authorization issue, indeed. In that case it makes sense to use the authorization trace (ST01 - notice: that's specific to one single ABAP application server; you might have to activate the trace on multiple instances) to find out which authorizations are checked / demanded.

  • How to catch password expiry/password reset when using weblogic Form authen

    Hi
    I am using a custom login screen (login.jsp) to authenticate against weblogic using FORM

    Thanks Bikash, 755633.1 will not help me as I have multiple password policy and user can belong to any of password policy.
    I now have ldap command to find passwordPolicy assigned to user
    1. ldapsearch -p 3060 -D "cn=orcladmin" -w "welcome1" -b "cn=users,dc=com" -s sub "pwdPolicysubentry=*" dn pwdpolicysubentry pwdChangedTime
    Above command will give me password policy applicable to user and date on which password was last updated.
    I then need to search for pwdMaxAge from value received by attribute pwdpolicysubentry like
    2. ldapsearch -p 3060 -D "cn=orcladmin" -w "welcome1" -b "[value_from_pwdpolicysubentry_in_1]" -s sub "objectclass=*" dn pwdMaxage
    I can then say password will expire for user on
    pwdChangedTime (output from 1) + pwdMaxage (output from 2 in seconds)
    and if pwdMaxage is set to value =< 0 then password never expires.
    What is best way to write program around this , is pl/sql (with DBMS_LDAP) or shell scripts ?
    Any help or suggestion to do it in better way ?
    Regards
    Atul Kumar

  • How to hide text NA in red when using 0TCAKYFNM and it is not allowed

    Hello experts,
    I want to hide a column in BEx Query Designer when it is not authorization to see it.
    I am using 0TCAKYFNM to filer the authorization by key figures. The key figure appers in red with "NA". I want to hide this column in BEx Analyzer and BEx Web.
    Is there any way to do that?
    EXAMPLE                              
              Precio FF      Margen
    España          20.692            NA
    Francia          60.233            NA
    Portugal     20.977            NA
    Resto Mundo     46.465            NA

    Hi, thanks for your answer.
    Also SAP marks this as a limitation.
    Bye!

  • Catching error in call transaction

    Hi,
    Can anyone tell me how to catch errors in call transaction method.
    Please provide step by step guide.
    Thanks,
    Shipra

    Hi Shipra...
    This is the way...
    data : It_MSG type table of BDCMSGCOLL with header line.
    DATA : V_MESSAGE TYPE STRING.
    LOOP AT ITAB.
      PERFORM MAP_BDCDATA.
      CALL Transaction 'MK01'
      USING it_bdcdata
      MODE 'N'
      Messages into IT_MSG.
      if sy-subrc ne 0.  "when the Transaction is unsuccessful
    **Display the Error messages
            LOOP AT IT_MSG WHERE MSGTYP = 'E'.
             CALL FUNCTION 'FORMAT_MESSAGE'
                 EXPORTING
                   msgtyp = it_msg-msgtyp
                   msgno = it_msg-msgnr
                   msgid = it_msg-msgid
                   msgv1 = it_msg-msgv1
                   msgv2 = it_msg-msgv2
                IMPORTING
                   MESSAGE  = V_MESSAGE.
               WRITE:/ V_MESSAGE.
            ENDLOOP.
          REFRESH : IT_BDCDATA, IT_MSG.
    ENDLOOP.
    <b>Reward if Helpful.</b>

  • How to transfer range parameter from vb when using bapi calling

    Hi,everyone.how to transfer range parameter from vb when using BAPI calling?

    Did you get the solution to your problem?  Can you please share it with me. I have a similar problem. I have a VB program that calls RFC function. It works with a single parameter but not with a range of parameters. If you have the solution, could you please share sample codes with me? Thank you so much.

  • How do I resolve "Error processing your request", when using Download link in My Orders (photoshop 5

    How do I resolve "error processing your request" when using the download link in My Orders for photoshop 5

    As Jeff already hinted at, try a different browser. Such issues almost always are local problems on your end. Something is either changing or blocking the HTTP headers used for forwarding (could be your router, a desktop firewall or other security tools) or a JavaScript is not running/ being blocked.
    Mylenium

  • How can i do with labview program,when i have 20 different values,and 1 want to add it with constant value.and how to get the results?

    how can i do with labview program,when i have   20 different values,and 1 want to add it with constant value.and how to get the results?

    Why do the 20 values have to be different? The same code should work even if some are equal.
    What do you mean by "get the result"? The result is available at the output terminal and all you need is a wire to get it where you need it. That could be an indicator, another operation, or even a hardware device.
    What is the data type of the 20 values? An array? A cluster? A bunch of scalars? A waveform? Dynamic data?
    LabVIEW Champion . Do more with less code and in less time .

  • How can I disconnect the call in when the keypad is lock mode. I have  option either to put it silent or answer. Please tell me how to disconnect?

    How can I disconnect the call in when the keypad is lock mode. I have  option either to put it silent or answer. Please tell me how to disconnect?

    Push the Sleep/On/Off button.
    Stedman

  • How do I close a JInternalFrame when using subclasses and a separate cla...

    The heading should be: How do I close a JInternalFrame when using subclasses and a separate class for the actionListener?
    I have just created a JInternalFrame appclication and now I want to structure up my code. I have a Superclass that contains the usual settings for the two JInternalFrame:s, and the two subclasses with frame specific information. Both the JInternalFrames use the same OK button. I want to have the actionListener outside the classes to avoid repetition of code. But the dispose()-function does not work properly, it does not close the opened JInternalFrame. What�s wrong?
    class Superclass extends JFrame
         JButton b= new JButton("ok");    
         Superclass()
    class Subclass1 extends Superclass
         Subclass1 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Subclass2 extends Superclass
         Subclass2 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Listener extends Superclass implements ActionListener
         public void actionPerformed(ActionEvent e)
                   dispose();
    }How do I controll in the Listener class that the button in Subclass1 is beeing pressed?

    First of all I think I misunderstood your question. You said you had two internal frames, so I thought you wanted to close the internal frame.
    It now looks to me like you want to close the entire JFrame, which makes the code even a little easier. Something like:
    JComponent component = (JComponent)event.getSource();
    JFrame frame = (JFrame)SwingUtilities.windowForComponent( component );
    frame.dispose();
    Ok, I will make a try:
    public static Container getAncestorOfClass(Class c, Component comp)
    w.getAncestorOfClass(w, this); Fiirst you need to learn the basics of reading the API.
    "getAncestorOfClass()" is a static method. That means you don't use a variable to invoke the method. You use the class itself.
    "w" is a variable, which is a JFrame, but that is not what the first parameter should be. The first parameter is a "Class".
    "this" will refer to your Listener class, but you need the Component that generated the ActionEvent.
    When I thought you wanted to close an internal frame then the code would have been something like:
    JComponent component = (JComponent)event.getSource();
    Container container = SwingUtilities.getAncesterOfClass( JInternalFrame.class, component );
    JInternalFrame internalFrame = (JInternalFrame)container;
    internalFrame.invokeSomeMethodHere();If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
    http://homepage1.nifty.com/algafield/sscce.html

  • BINDING.JCA-12510 JCA Resource Adapter - Cannot call rollback when using di

    Hi,
    i'm facing a simillar issue with dbadapter while trying to insert a record.
    The issue that I'm facing is: (BINDING.JCA-12563)
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: http://InsertEmployee.TestEmp. Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    I faced the same issues that have been posted in this thread before but this is a new one I'm seeing.
    Following are the configurations that I'm using.
    WEBLOGIC ADMIN CONSOLE
    JDBC datasources
    General tab:
    JNDI Name: jdbc/SOADataSource
    Connection Pool tab:
    URL - jdbc:oracle:thin:@localhost:1522/XE
    Driver Class Name - oracle.jdbc.xa.client.OracleXADataSource
    Properties - user=SATRA_SOAINFRA
    oracle.net.CONNECT_TIMEOUT=10000
    Deployments
    Inside DbAdapter - Configuration
    The general tab shows blank values for 'Native lib dir' and 'JNDI name' fields. Is this normal or I need to populate values into these.
    Inside Outbound Connection Pools the javax.resource.cci.ConnectionFactory created an entry 'eis/DB/10gXE_DBCon'
    following is the settings for dataSourceName property
    dataSourceName java.lang.String jdbc/SOADataSource
    I have kept the value for xADataSourceName as blank as giving the same value of 'jdbc/SOADataSource' throws error.
    The JNDI value that I'm using while creating the database adapter from Jdev is eis/DB/10gXE_DBCon where 10gXE_DBCon is the database connection name.
    Can you please tell me what is the issue and where I'm going wrong.
    Thanks in advance,
    Satrajit

    Hi Sunil,
    I followed your advice and did the changes, that error has gone but a new error is popping up.
    BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertEmployee.TestEmp]. Caused by java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist . ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    The name of the table i'm inserting to is test_emp and it exists in the database.
    the .jca file for dbadsapter is like
    <adapter-config name="FileToDB_DBAdp" adapter="Database Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/DB/10gXE_DBCon" UIConnectionName="10gXE_DBCon" adapterRef=""/>
    <endpoint-interaction portType="FileToDB_DBAdp_ptt" operation="insert">
    <interaction-spec className="oracle.tip.adapter.db.DBWriteInteractionSpec">
    <property name="DescriptorName" value="FileToDB_DBAdp.TestEmp"/>
    <property name="DmlType" value="insert"/>
    <property name="MappingsMetaDataURL" value="FileToDB_DBAdp-or-mappings.xml"/>
    <property name="DetectOmissions" value="true"/>
    <property name="GetActiveUnitOfWork" value="false"/>
    </interaction-spec>
    </endpoint-interaction>
    </adapter-config>
    and the .xsd file for dbadapter is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="TestEmpCollection" type="TestEmpCollection"/>
    <xs:complexType name="TestEmpCollection">
    <xs:sequence>
    <xs:element name="TestEmp" type="TestEmp" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TestEmp">
    <xs:sequence>
    <xs:element name="empid" type="xs:decimal" nillable="true"/>
    <xs:element name="name" type="xs:string" minOccurs="0" nillable="true"/>
    <xs:element name="designation" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="50"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="salary" type="xs:decimal" minOccurs="0" nillable="true"/>
    <xs:element name="deptno" type="xs:decimal" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    If I change element name from 'TestEmp' to 'Test_Emp' in the .xsd file,
    I'm getting the following issue ...
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: Could not create/access the TopLink Session. This session is used to connect to the datastore. Caused by java.lang.NullPointerException. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    I'm confused why does it take the table name as TestEmp and not as Test_Emp.
    Regards,
    Satrajit

  • Dreamweaver CC generates one of 3 error messages when using find and replace on Win 8.1 64 bit.

    Dreamweaver CC generates one of 3 error messages when using find and replace is used more than twice in succession. "While executing onLoad in bc_afterSave.htm, the following JavaScript error(s) occurred: At line 188 of file C:\Program Files (x86)\Adobe|Adobe DreamweaverCC|Configuration|Shared|BC\JS\bc_sites.js": out of memory"
    or
    While executing runCommand in File_Save.htm, a JavaScript erroroccurred.
    or
    While exciting getDynamicContent inAdressURL.htm, a Javascript erroroccirred.
    Any thoughts - I end up closing DWCC and reopening. Will work for two additional Find and Replace before the error messaged\s popup again.

    bkaufman43 wrote:
    Thanks Jon. I tried all of those solutions before posting. Same problem. It seems that the problem is tied to DWCC. Do not have the problem when using DW6 on Win8.1. When running DWCC on a Win7 pc, we get the same error message. When running DW6 on Win 7, f&c works fine. It seems to be a bug in DWCC. DWCC works flawlessly on our Macs.
    The same steps apply to DWCC, you just need to choose the CC folders rather than the DWCS4-6 versions that the page talks about. The layout of CC's folders hasn't changed from the older versions which is why, I think, Adobe hasn't updated the troubleshooting page as of yet.
    As Nancy mentions, a 38,500 page site is sort of ridiculously large for a static website, that could be part of the problem, but your response quoted above leads me to think you may have tried the troubleshooting steps in the wrong version of the program. Could you confirm that?

  • Caller Program name after SUBMIT or Call Tran (SAP-Query drill as ex)

    Hi ,  there is real simple situation
    I have SAP Query and do Drill Down to my Report or  Transaction.
    So I have two questions but as I believe they are equal:
    1) How I can get Caller SAP Query name from my Report ?
    2) How can we get  Caller Program name after SUBMIT or CALL TRANSACTION operator (in new started report for example )?

    Hi,
    there is a system variable sy-cprog ...check if u can use it...
    else from the caller prog move its name to SAP memory and retrive it in called prog..
    in caller prog
    data caller_prog type SYCPROG.
    move sy-repid to caller_prog.
    set parameter id 'ZCPROG' field caller_prog.
    submit <called_prog> and return.
    in called prog
    data caller_prog type SYCPROG.
    get parameter id 'ZCPROG' field caller_prog.
    write caller_prog.
    write / sy-repid.
    Cheers,
    jose.

Maybe you are looking for

  • Error in TCODE- FILE

    Hi, We are using OHTs with destination type file. We have created a logical path.when we are trying to assign this logical path to the file,we are getting a dump. Runti.e Errors ASSI6N_SUBSTRIN6-N0L.ALL0WED Date and T1ne 06/1i812009 22:56-:350 Short

  • Change the Payroll area in mid of the month.

    Hi Experts, Why is it not advisable to change the Payroll area in mid of the month. Regards, Tomesh

  • Dynamic Action with field DIVGV not working

    We have built the dynamic action below to default values from infotypes 0007 and 0008 behind the screnes in infotype 0491 Payroll Outsourcing. The issue that we are having is that the dynamic action will not work for field P0008-DIVGV, but will work

  • FM  "COM_PRCAT_CREATE_API_INT"  gives  dump

    Hi all, I am trying to use the foll FM  "COM_PRCAT_CREATE_API_INT" in a report but getting an exception: Function module "COM_PRCAT_CREATE_API_INT" was called with the parameter "IV_HIEARCHY_EXIST_IN_PME". This parameter is not defined. When i run th

  • Awesome cursor theme not applied at root-window and bar.

    I've just started using awesomeWM and it's quite neat. My problem is that my cursor theme doesn't get applied completely. It's all fine in apps, but appears without theme when mouse is over the bar and root window. My setup info here: 1. I set my xcu