Checking for errors before saving in CRMD_ORDER

Hi,
I have a requirement where I need to check if any errors exist before being able to save a document in t-code CRMD_ORDER. If any error exists, then user should not be able to save the document.
Currently, if even if errors exist, the user is able to save the document. But this should not be allowed.
I searched for BADI for this and found method CHECK_BEFORE_SAVE in BADI ORDER_SAVE. But not sure of how to check if errors exist. Can someone please guide me on how to do this?
Thanks in advance.

Hi Manvi,
I have two different options for you to gte the info you need !
Well first i would like to confirm you that the Badi you re trying to use is the right one. You can raise an error and cancel saving in case you want. And then, well you can either check dirrectly in a table or using a call function see if ticket is flagged on error
1 - Using table: In table CRM_JCDS or in table CRM_JEST if for guid of your ticket you have an entry with stat = I1030 and flagged to INACT = ' '; then the ticket contains at least one error
2 - Using call function:
call function 'CRM_STATUS_CHECK'
  exporting
    objnr             = lv_guid
    status            = 'I1030'  " = gc_status-error (CRM_STATUS_CON)
  exceptions
    object_not_found  = 1
    status_not_active = 2
    others            = 3.
PS: in Order to get the guid of your ticket you can use table crmd_orderadm_h. Using ID of ticket you ll be able to retrieve guid corresponding to it
Hope this helps
Regards,
Khalil

Similar Messages

  • Checking for errors in application item computation (at page level)

    I have a conditional computation used to set the value of an application-level item.
    In the condition, I need to check to see if the action (button-press to initiate DML processing) generated an error (eg cannot delete row because of child records). I don't need to catch/handle any specific errors, I just need to know if an error occurred.
    What do I check for? I've seen references on the forum to hidden page items Pxx_msg and Pxx_err, but I've played around with them, and apparently don't know how they're set.
    Another thought I had is to create a before-computation process that checks to see if there is some sort of error/exception, but I'm not having luck w/ this either.
    Ideas?
    Thanks,
    C

    Max -- I appreciate you helping me to clarify this issue. I need to track which database tables have had data changes committed to them in the course of the app running. My thought is to track this in an application item (a list of changed tables), and check/set the item as needed when delete/create/apply changes buttons are pressed. But if a DML statement fails, I don't want to add the table to the list of modified tables.
    When I was setting the app item in a computation, it appeared that (like you said) I was trying to check for errors before the process had executed. (I'm also not sure I was checking for errors in the correct manner.) Regardless, the result was that the table got added to the list even when the delete operation failed because of child records.
    What I'm doing now appears to work (and sorry, I can't actually access the app this morning, the server is down, so I may not be able to communicate this as clearly as I'd like). If I recall, yes, I'm setting the item in a post comp/validation process. I'm still not doing any error checking, but it appears that if there is an error, the process isn't executing: the item is definitely not getting set.
    Can you clarify what you mean when you say that "all of this will execute before the processes". Do you mean that comps and page processes will execute before DML is executed on the database?
    Thanks,
    Carol

  • User Exit for CO01/CO02 : How to check production order before saving ?

    Hi all,
    I try to check production order before saving.
    if  AFPO-LGORT or RESB-LGORT  or some other field is initial, throw an error msg and stop saving process.
    I try using badi WORKORDER_UPDATE and user exit PPCO0001  EXIT_SAPLCOBT_001, find out that i can check the data but can't stop the saving process.
    Anyone knows some other user exits can do this?
    Thanks a lot.

    Solved.
    A wired solution from
    http://abaplog.wordpress.com/2007/03/01/reading-other-programs-data-using-field-symbols-in-abap/

  • InCopy workflow in InDesign: Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?

    The situation:
    We are working with the InCopy feature (checking in and checking out ICML files).
    The problem:
    I might have saved a document with an ICML file still checked out.
    The question:
    Is there a way to find out which document was saved with the ICML file still checked out?
    or in other words:
    Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?
    Thanks for any help!

    Hello Sumit Singh,
    thank you for your answer and your reasonable recommendation. Unfortunately, this only works when the ICML content is used in one INDD file. In our case, we use ICML content in multiple docs (various manuals with the same safety instructions, warranties, adresses etc.).
    So, is there a way to trace back where an ICML has been used?
    Is it possible to find out in which document the ICML is still checked out?

  • FlexBuilder not checking for errors in AS files

    FlexBuilder 2 isn't finding any errors in AS files that
    aren't explicitly referenced in an MXML file for anyone in my
    office. This seems like a pretty basic function everyone needs, so
    I can't imagine it's not a huge bug....
    To be more specific, I have a flex project set up with two
    files in the root named SimpleTest.as and test.mxml. If test.mxml
    is empty, I can write absolutely anything into the .as file and
    flex builder won't locate any errors in real time. As soon as I
    instantiate an instance of SimpleTest in my mxml file, however,
    flex builder suddenly reports all of the problems in the problems
    view, and we're good to go.
    This is a huge pain from a development standpoint - I don't
    want to have to keep an instantiation of a class just to find if
    there are any errors in it. And if I'm not able to find errors in
    real/development time, FlexBuilder becomes a glorified text editor
    with the only real useful AS feature being code hints.
    If the project is an ActionScript project instead of a Flex
    project, flex builder will detect errors on AS files if they're in
    the root package, but files nested in folders aren't checked for
    errors unless an instance of the class exists in another
    root-package object.
    Is there anything we can do to fix this? Is anyone else
    seeing this error?
    Thanks.

    Sorry guys, but the way Flex ignores unreferenced .as files
    is just plain wrong, and it's also inconsistent. There... thats the
    synopsis of this post, now the explanation.
    In our app, we want to have a list of menu items that are
    read in from the database. Each item consists of the man-readable
    text and the name of a class that is normally derived from
    TextWindow. The user clicks on a menuitem and the window appears.
    Flex provides the function flash.utils.getDefinitionByName()
    which will return the class definition for the given class name
    supplied as a string. But it will only work if the class is loaded
    i.e it has been referenced somewhere. To get around this, I have
    had to create my own map of class names to class definitions. In
    other words, I've had to rewrite getDefinitionByName.
    quote:
    Well, it makes sense to me that the IDE should ignore a file
    if you're not actually using it.
    Yes, but what the IDE doesn't know is that you may want to
    create an instance of the class
    without referencing it directly. getDefintionByName is the
    proof that there was/is some intention to be able to do that. IMO
    this is a reasonable thing to want to do, e.g if functionality is
    enabled/disabled according to user security, then one would expect
    to be able to dynamically create classes at runtime.
    getDefinitionByName() should allow me to do that. After all, the
    function exists to begin with, so it should work. But it only
    partially works because the IDE doesn't load up unreferenced .as
    code.
    If the .as file appears in the project, it should be
    compiled. Period. The fact that it is not referenced should not
    determine whether or not it is compiled. getDefinitionByName would
    then work as I reasonably expected it to work and allow dynamic
    creation of classes.
    The
    Inconsistency I mentioned earlier is therefore that Flex
    offers the getDefinitionByName but renders it pretty useless as you
    have to reference the class anyway.
    Finally all the other development languages I have used will
    compile all source in the project regardless of whether or not it
    is referenced. This includes C++, C#.NET and Visual Basic. So Flex
    is definitely the odd one out here.

  • Any way to check for errors in an external table besides the log?

    For example if you have an external table where a column is defined with a CHAR(1) but when you run a SELECT on it, the mapping comes up with trying to put a CHAR(2) into that single space. The only way I'm aware to see if something is wrong is to check the .log file. Is there any other way to check for an error message or count?
    I'm mounting external tables and copying data over to a 'holding' table to be able to work on the data before it's moved into the actual production table with PL/SQ code. If the stored proc can determine what rows are bad or missing or even that there just are some rows with problems then hand back to the app, it would greatly improve things.
    Thanks.

    No other way than to check for the existance of a .bad file, then have a look see at the .log then?

  • Create Credit Memo (VA01) - Problem of checking a field before saving

    Hello!
    In tcode VA01, why a field (ex. Customer Group) is checked to be filled before saving in case of a Standard order (type OR, or for us is ZOR), but not in case of a Credit Memo (type CR, or for us is ZCR) ? Is this Config problem? If yes, do you know how to config? If not, do you know any User-Exits I should use? I've tried some but didn't work.
    Please help if you can. Thanks!!

    Hi Timmy,
    Please go to include MV45AFZZ and try the user exits
    USEREXIT_SAVR_DOCUMENT
    in here VBAK values are present in XVBAK and VBAP values in table XVBAP....
    Write the required code here and see if it solves our problem
    Every time user clicks the 'SAVE' button it has to go through this exit
    Regards
    Byju

  • Check mandatory fields before saving

    Hello,
    In my Z-program, how can I check all mandatory fields in a dynpro before saving?
    Is there any function to do that?
    Thanks!!!

    Hi alberto,
    1. If the fields are mandatory (as set in the field attributes while designing the screen),
    2. then we don't have to write any additional logic for the same.
       The system will AUTOMATICALLY check for it, and issue appropriate message.
    regards,
    amit m.

  • Check Batch characteristics before saving

    Hi community,
    i'm searching for a way to check whether characteristics of a batch were changed.
    I found an Badi which is called just before saving the batch.
    My target is to create (as usual) a batch Idoc if a specific characteristic is set to a specific value.
    Thanks & best regards
    Michael

    I forgot one thing.
    If I create the Idoc within the BADI Implementation,
    the batch isn't saved yet.
    how can I trigger the idoc creation <i>after</i> the batch is saved ?
    any ideas ?????

  • Check for null before rendering on jsp

    I have the following code which should only display the address if it is not null.
    I have the following code.
    <tr:outputText value="#{myBean.addressLine}"
                         rendered="#{!empty myBean.addressLine}"/>But the rendered attribute doesnt make a difference.
    Can any one tell me where I am going wrong ?

    A null check might not be you best option.  If your requirement is you must have both the date and time component supplied in order to populate EventDate, then I would use a Script Functoid that takes data and time as parameters.
    In the C# method, first check if either is an empty string, if so return an empty string.
    If not, TryParse the data, if successful, return a valid data string for EventDate.  If not, error or return empty string, whichever satsifies the requirement.

  • IDOC -- File:(R/3-- XI) : Idocs not reaching XI. Where to check for error

    Hi,
    I have completed the config for IDOC to XI (R/3-->XI) scenario based on various weblogs available on Sdn.
    For testing, I am using we19 to trigger the outbound idoc from R/3. But when I look in IDX5 in XI or message monitor, I do not see any message or IDOC there. Even SXMB_MONI in XI does not have any message.
    What could be the potential issue for this behaviour. Is there a way where I could debug or any steps that could tell me where to look for the error.
    So far only odd behaviour I have observed is:
    When in WE19 I trigger the IDOC for outbound processing, XI login screen pops up, where I need to enter password. Once I click enter the screen disappears and the message, IDOC sucessfully sent to external system/Port appears.
    Appreciate your help.
    Thanks
    Shirin

    Hi,
    I checked SM58 and teher indeed are errors saying
    "Name or Password is incorrect (repeat logon) "
    So which connection is having incorrect password in SM59?
    I checked and I have a working RFC connection  (TYpe 3) in SM59 for XI.
    Just to add TCP/IP connection(Type T) has 2 connections not working. They are LCRSAPRFC and SAPSLDAPI.
    So what should be my next step in correcting this error as I am not sure which RFC connection user-id is responsible for SM58 errors.
    Any feedback is welcome.
    Thanks
    Shirin

  • How to check for errors in starting workflow from plsql?

    Hi All,
    I am using the below code to start a custom workflow.
    DECLARE
    l_itemtype VARCHAR2(30) := 'XXPWA';
    l_itemkey  VARCHAR2(30) := '1116410C';
    error_code VARCHAR2(2000);
    error_msg  VARCHAR2(2000);
    BEGIN
        wf_engine.createprocess(l_itemtype, l_itemkey, 'XX_WEBADI_APPROVAL');
        wf_engine.setitemuserkey(itemtype => l_itemtype
                                ,itemkey  => l_itemkey
                                ,userkey  => 'USERKEY: ' || '1116410C');
        wf_engine.setitemowner(itemtype => l_itemtype
                              ,itemkey  => l_itemkey
                              ,owner    => 'SYSADMIN');
        wf_engine.setitemattrnumber(itemtype => l_itemtype
                                   ,itemkey  => l_itemkey
                                   ,aname    => 'BATCH_ID'
                                   ,avalue   => 1116410);
        wf_engine.startprocess(l_itemtype, l_itemkey);
    EXCEPTION
    WHEN OTHERS THEN
    error_code := SQLCODE;
    error_msg  := SQLERRM(SQLCODE);
    dbms_output.put_line(error_code||error_msg);
    END ;
    The script completes successfully without errors.
    I am sending a notification from this workflow. I can see the records getting created in tables like WF_NOTIFICATIONS and WF_ITEM_ATTRIBUTE_VALUES. But i cannot see any thing if i query from Status Monitor. Also I am not getting the said notifications. How can i find what is the issue?

    Hi Manu,
    Thanks for sharing the information, If you think of speeding up finding were exactly your notification is struck, You can use the below query (Input parameter would be your notification id), Hope this information is good, I liked this very much, the way it was narrated.
    SELECT n.begin_date,
           n.status,
           n.mail_status,
           n.recipient_role,
           de.def_enq_time,
           de.def_deq_time,
           de.def_state,
           ou.out_enq_time,
           ou.out_deq_time,
           ou.out_state
      FROM applsys.wf_notifications n,
           (SELECT d.enq_time def_enq_time,
                   d.deq_time def_deq_time,
                   TO_NUMBER((SELECT VALUE
                               FROM TABLE(d.user_data.parameter_list)
                              WHERE NAME = 'NOTIFICATION_ID')) d_notification_id,
                   msg_state def_state
              FROM applsys.aq$wf_deferred d
             WHERE d.corr_id = 'APPS:oracle.apps.wf.notification.send') de,
           (SELECT o.deq_time out_deq_time,
                   o.enq_time out_enq_time,
                   TO_NUMBER((SELECT str_value
                               FROM TABLE(o.user_data.header.properties)
                              WHERE NAME = 'NOTIFICATION_ID')) o_notification_id,
                   msg_state out_state
              FROM applsys.aq$wf_notification_out o) ou
    WHERE n.notification_id = &NOTIFICATION_ID
       AND n.notification_id = de.d_notification_id(+)
       AND n.notification_id = ou.o_notification_id(+)
    This single query links all together and shows you the current state of the message.
    Column 5 & 6 shows the enqueue & dequeue time of WF_DEFFERRED queue.
    Column 7 shows the message status in WF_DEFFERRED
    Column 8 &  9 shows the enqueue & dequeue time of WF_NOTIFICATIONS_OUT queue.
    Column 10 shows the message status in WF_NOTIFICATION_OUT.
    Below is the sequence of activities going on between the PL/SQL trigger of the business event and the e-mail received from notification mailer in the tail -end
    1. EBS user sends email – To send an email EBS modules use standard API. Email API is implemented in PL/SQL package WF_NOTIFICATION (I will cover it in the next article).
    1.1. Provides application data – First of all user’s session inserts business data (recipient, message type, message text etc.) into WF_NOTIFICATIONS table (do not mix up with PL/SQL package mentioned above);
    1.2. Defers processing Generates event – a user or process leaves EBS to run further email processing steps. It is done using a Business Events System (BES). Session raises an event k“oracle.apps.wf.notification.send” via the WF_EVENT PL/SQL package (BES processing to be covered in the next articles). Each deferred event is put in one of the two Advanced Queues WF_DEFERRED or WF_JAVA_DEFERRED for further processing. All email sending events go through the WF_DEFERRED queue.
    2. Deferred Agent Listener – is a process responsible for ALL BES events processing. It executes all deferred events calling subscriptions’ functions defined for each business event. There are several more things to explain about Agent Listeners and subscription processing (e.g. there are several differed agents, subscriptions groups etc.) This is one more subject for further articles.
    2.1. Reads event and starts subscriptions processing – Strictly speaking there is no any enabled subscription for the “oracle.apps.wf.notification.send” event (submitted during the first step). This event is a part of “oracle.apps.wf.notification.send.group” event group. The Deferred Agent executes subscriptions for that group rather than for the stand alone event. At this stage the Agent knows that it should process the notification with given notification id (it is a part of the event data passed via the event).
    2.2. Reads application data – in order to generate the email/notification the Agent reads business data from the WF_NOTIFICATIONS table and a few related tables and during the next step builds up the email’s text in XML format.
    2.3. Generates data for outbound interface – This is the last step executed by the Deferred Agent Listener. It generates XML representation of email to be sent and together with other important bits of information posts it to the Notification Mailer outbound queue WF_NOTIFICATION_OUT.
    3. Notification Mailer – As you see it was a long journey even before we started to talk about the Notification Mailer. There are a lot of things which may go wrong and this is why it is important to know the whole flow of the events to troubleshoot the mail sending functionality in EBS. We’ve come to the last processing step before the message leaves EBS boundaries.
    3.1. Reads message – the Notification Mailer dequeues messages fromWF_NOTIFICATION_OUT queue on regular basis. In fact this is the only place where it looks for the new messages to be sent. This means if a notification doesn’t has a corresponding event ready for dequeuing in the WF_NOTIFICATION_OUT queue it will never be send. As soon as a new message arrives Notification Mailer dequeues it and gets prepared for sending;
    3.2. Sends email via SMTP – This is the step when the message leaves EBS. The Notification Mailer sends the email using text retrieved from the advanced queue during previous step;
    3.3. Updates status – as the last step in the notification sending process the Notification Mailer updates a MAIL_STATUS column in WF_NOTIFICATION table.

  • Check for filesize before uploading the file

    Hi everyone,
    I�m currently thinking about a solution to the following question and would need some help:
    I wanna write a small jsf-application where it�s possible to upload files from the client to a server. But I have the problem, that I want to check the filesize of the user-selected file before he starts to upload the complete file, so that I can decide dynamically if it is allowed to upload a file of that filesize . If I simply use the mulipart/form-data-request I always get the complete request and can only decide afterwards if it was too big or not. That�s not the way a wanna go.
    Does anyone know of a good solution to this problem? I guess I won�t be the first one who has to handle with that kind of problem.
    Many thanks
    Thomas

    This can only be done with a client side script. Javascript with ActiveX can do, but in the latest browsers this is disabled by security reasons.
    Locally you might try:<html>
        <head>
            <script>
                function getFileSize(filePath) {
                    var fileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
                    var file = fileSystemObject.getFile(filePath);
                    var size = file.size;
                    alert(size + " bytes\n" + (size / 1024) + " KB\n" + (size / 1024 / 1024) + " MB");
            </script>
        </head>
        <body>
            <form name="myForm">
                <input type="file" name="myFile">
                <input type="button" value="check size" onclick="getFileSize(document.myForm.myFile.value);">
            </form>
        </body>
    </html>This works in IE only and doesn't work in FF 2.0 here.
    I don't know any other solutions as such scripts are forbidden for security reasons.

  • Compile Forms on a Unix Machine (check for errors in any of the files)

    Hello there,
    Our organization is wrapping up the development phase and beginning our testing phase. I am responsible for the Configuration Management of our forms, menus, libraries, and reports.
    We develop our code in a Windows environment (including compilation check), then we FTP the source files to a unix environment, then we compile the forms on a unix environment. We have this process down pretty well (for a couple of files at a time).
    Now we would like to automate our "build" procedure. This process involves the following tasks.
    1.) Extract all the source files from our vault software (PVCS)
    2.) FTP all the source files to the UNIX environment
    3.) Compile all the source files on the UNIX environment
    4.) Test the Software on the UNIX application server
    We have all of the above working (if no compilation errors occur). I am not sure how to check if any of the files errored during compilation. How can I check to see if any errors occurred during the UNIX source code compilation? I know how to do this manually (look at the output and see if the module compiled), but we are compiling approximately 200 files during our release build process. Maybe some sort of send the compilation results to an output file then search for any files that contain "not generated" (I assume if an error is generated, the text will be displayed to the user).
    Is there an easy way to check if any of the forms, menus, libraries, or reports errored during the "automatic" compilation process?
    Thanks,
    Mike

    I use this script to generate .fmx files from a zipped .fmb file. This approach allows for much faster FTP because our developers are not co-located with our servers.
    In addition, the tail command echoes the final line of the .err as either...
    Created form file <filename.fmx>
    for success or
    Compilation errors have occurred.
    for failure.
    # SCRIPT: zipgen
    # REV: 1.0.d - Used for developement
    # DATE: 070515
    # PLATFORM: Not Platform Dependent
    # PURPOSE: This script takes a single filename variable (w/o extension)
    # and it unzips the file then deletes any existing compiled
    # form of that name and finally attempts to generate a new fmx
    # of the variable name.
    # Assign Variables
    v_log=$1.err
    v_zip=$1.zip
    v_fmx=$1.fmx
    v_fmb=$1.fmb
    # Unzip File: Overwriting any existing file(s)
    unzip -q -o $1.zip
    # Cleanup ZIP files
    rm $1.zip
    # Delete existing FMX
    rm $1.fmx
    # Generate FMB
    gen $1
    # Display results
    tail -1 $1.err
    # End of script

  • Authorization Check for Reuse_ALV_Grid_display Variant Saving

    Hi,
    I am facing an issue with Reuse_ALV_Grid_Display where i provided the layout saving parameter as 'A' ie. for activation of the user-specific and global saving of the layout. But this is taken undue advantage of by the clients as they save their specific layout as the global layout.
    Hence can anybody help me in highlighting any authorization object which can prevent the users from saving their layouts as global layouts.
    URGENT...
    Thanks
    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 6:14 PM

    For clarification, refer the code used:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = l_layout
          it_fieldcat        = t_fieldcat[]
          i_default          = 'X'
          i_save             = 'A'
        TABLES
          t_outtab           = t_vbrkvbfa1.
    Here bcoz. of       i_save             = 'A',
    the users can save their variants as user-specific or global. So, i need the auth. object for restricting the users from saving the variant as global.
    So, plz help...SOS

Maybe you are looking for

  • "Not enough space" - on DB.open

    Hello, My application is using BDB 3.3.1. I'm running with the following Parameters: m_dbEnv.set_cachesize(0, 536870912, 0); m_dbEnv.set_verbose(Db.DB_VERB_CHKPOINT, true); m_dbEnv.set_verbose(Db.DB_VERB_RECOVERY, true); m_dbEnv.set_verbose(Db.DB_VER

  • Image processor: "No source files could be opened by Photoshop."

    I am also getting a "There were no source files that could be opened by Photoshop" warning when trying to save jpegs of open images (opened from a PDF) using the image processor. Here is what I'm doing: 1. Open multiple pages of a PDF into Photoshop

  • Jsp:declaration and request

    Can we use request in jsp:declaration? In my program request cannot be recognised unless it is inside of <jsp:scriptlet> So what do we set inside of jsp:declaration?

  • ADS error. Test FP_PDF_TEST_00 unsucessful

    Dear colleagues, I need to add SRM development(ABAP) to ADS service, which allocates on the Solution Manager system(ABAP+JAVA) and i faced with error when i try to make test FP_PDF_TEST_00 (Connection to ADS using RFC). Following messages: SYSTEM ERR

  • Problems with Mail...

    Initially, the problem started when why wife said that her e-mails disappeared.  I looked at her screen and saw that there was a warning triangle next to the Mailboxes' Inbox in the upper left corner of the Mail app.  I thought it odd that there was