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.

Similar Messages

  • 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

  • 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?

  • Strange problem while checking Mandatory fields

    Hi ,
    I am checking mandatory fields with the method following method.
    CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( VIEW_CONTROLLER = my_controller ).
    It was working fine for mandatory fields and also showing one extra input field which is not mandatory with red border .
    Please tell me how to avoid this and What could be the problem.
    Thanks and Best Regards,
    Vijay

    Hi Vijay,
                the extra vield thats showing in re d will be a field that doesnt support blank entry. try commenting the method thats calling CL_WD_DYNAMIC_TOOL.
                CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW will check only mandatory fields.. thats for sure.
       the error message thats showing on the optional fild is coming from some standard check
    Regards
    Sarath

  • User exit to check the consistency of filled fields before saving

    Hi,
    I am looking for a User Exit which can be executed when a user click on "Save" button.
    In this User Exit, I would like to implement some controls to check the consistency of filled fields.
    I have an example to better understand : I work on transaction code ME11 and ME12 (create and modify Info Record). When all mandatory fields are filled, the user can save its. When the user click on "Save" button, I want that a checking (with a user exit, or anything else) verify the consistency of some fields (for example, the consistency between the Tax code of the country and the country of the supplier).
    If it's not clear, I could precise...
    Thanks in advance for you help...

    Hi,
    I am looking for a User Exit which can be executed when a user click on "Save" button.
    In this User Exit, I would like to implement some controls to check the consistency of filled fields.
    I have an example to better understand : I work on transaction code ME11 and ME12 (create and modify Info Record). When all mandatory fields are filled, the user can save its. When the user click on "Save" button, I want that a checking (with a user exit, or anything else) verify the consistency of some fields (for example, the consistency between the Tax code of the country and the country of the supplier).
    If it's not clear, I could precise...
    Thanks in advance for you help...

  • Digital Signature - enforce mandatory fields before signing

    (Using version 8.05)
    I have a form with digital signature that locks certain fields in a collection upon signing it, then they click button to send full PDF via email to another person. That person then signs, locking down their portion of the form, and email to another person for action.
    The digital signing works fine but it allows mandatory fields to be locked down even though they are blank, the submit button enforces the mandatory fields but will not enforce the digital signing. The button can allow user to sign submission, but it does not show on the form which I need it to do.
    How can I make this work in 8, my javascript knowledge is very limited.
    I am considering upgrading to 9, I believe it allows more control for non-java types like myself with the action builder...
    Thanks,
    Blake

    Hello
    You could add some JavaScript to the "PreSign" event of the signature field that could check to see if the mandatory fields were filled.  If not then you could abort the signing process.
    I'm not 100% sure if the "PreSign" event existed in version 8.x of Designer however.  It is definately part of version 9.x.
    Regards
    Steve

  • Check mandatory fields of view in ViewContainer

    Hi Experts!
    I created a view (main view) which containes a ViewContainer UI element. After a click on the main view  I want to check the mandatory fields (with method check_mandatory_fields onview). But therefore I need the reference to the view controller which is embedded in the ViewContainer element. How can I solve this???
    Thanks!

    Hi
    This is how I achieved it:
    In DoINIT of the view which is embedded inside view container UI element I got the reference of view controller and stored it as a component controller public attribute
      wd_comp_controller->mo_api_controller = wd_this->wd_get_api( ).
    Here mo_api_conroller is a comp controller public attr of type ref to if_wd_view_controller.
    Now you can call your method like this in the main view
    cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
        EXPORTING view_controller  = wd_comp_controller->MO_API_CONTROLLER
                  display_messages = abap_true
        IMPORTING messages = lt_messages
    Hope this helps.
    Regards
    Manas Dua

  • 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 Mandatory Fields (Dynamic Programming)

    Hi All,
    I am currently generating UI elements dynamically. I have few elements in these dynamically generated elements which are mandatory. Does anyone has information about how to programmatically check whether the entries have been made before the user is allowed to proceed to the next step?  I have maintained the state property of the InputField and the webdynpro application doesnot automatically checks for the entries.
    Any help will be greatly appreciated.
    Thanks and regards,
    Hemanth

    Hi Hemanth,
    there are at least two ways to do this:
    1. Define some simple types in the local dictionary with minLength > 0 and use this simple types as the property types of the context attributes. If you bind the UI elements to this context attributes, the WD runtime will do the checks automatically.
    2. Check the contents of the UI elements with required input manually (by checking the contents of the bound context attributes). Use the report(Invalid)ContextAttribute... methods of the <a href="https://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/webdynpro/com/sap/tc/webdynpro/progmodel/api/IWDMessageManager.html">Message Manager API</a> to report missing data.
    Hope that helps.
    Regards
    Stefan
    PS: The state property is just a visual indicator for required/not required fields and doesn't trigger any automatic validation.

  • 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

  • FPM - Check Mandatory Fields

    Hi,
    Could you please let me know, how can I do the required fields check in FPM?
    I can do this requirement in a simple webdynpro application as below:
    lo_view_controller = wd_this->wd_get_api( ).
    cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
    EXPORTING view_controller = lo_view_controller
    IMPORTING messages = lt_messages ).
    CHECK lt_messages[] IS INITIAL.
    Please let me know how can I do the same in FPM?
    Thanks,
    Vijay.

    There is really no guideline about that. You have decided to go for Dynamic UI elements and you have to find a way to validate them that is the price you would pay for doing things in Dynamic programming. You might have to rely on the looping of your UI elements and see if it is state is mandatory and go for validation in a dynamic way. Requires lots of programming and understanding of UI hierarchy.

  • Check Mandatory Fields when state is bound with context attribute

    Hello All,
    Currently i am facing  problem in my SAP SRM 7.0 standard component.
    Actually, i have to remove  mandatory(State = Required) for one of my inputfileds for this I have written below code, but it has been  remove only Red mark * infront of Inputfield, after that, i am trying to save other data, still it is asking me enter the required value.
         here my input field  bound with Context attribute, it is standard attribute.
    data:lo_input1 type ref to cl_wd_input_field.
       lo_input1 ?= VIEW->get_element( 'NAME_FIRST' ).
       lo_input1->set_state( '00' ).
    I am trying to delete state = required property from below component and view
    Component Name : /SAPSRM/WDC_MOFC_PERSON
           View  :  V_PERSON
    Can you help me on this?
    Thanks
    Sandeep.

    Hi Baskaran ,
    Thanks for ur reply ..
    Eveen in that component they have not used cl_wd_dynamic_tool class for mandatory attributes
    I want to share another thing with u that is
    I am trying it in another way
    with the following code which i have done in post exit  is
    let me explain u what i did
    __first of all i got the child node of rootuielementcontaine
    later
    i get the childnode of container_left and assigned it to another class of ref cl_wd_uielemnent
    now where i have struked is
    *CALL METHOD LR_CHILD2->GET_CHILD
    EXPORTING
       ID        = 'FORM_OF_ADDRESS_DROPDOWN'
       INDEX     =
    RECEIVING
       THE_CHILD = LR_C1.
    what the error i am getting is
    OBJECTS_OBJREF_NOT_ASSIGNED
    Please correct me if there is any wrong inn the code ...
    FORM_OF_ADDRESS_DROPDOWN--->ui element dropdown
    r__ DATA lr_container TYPE REF TO cl_wd_uielement_container.
    DATA lt_children  TYPE        cl_wd_uielement=>tt_uielement.
    DATA lr_view      TYPE REF TO if_wd_view.
    DATA lr_child     TYPE REF TO cl_wd_uielement.
       DATA lr_child1     TYPE REF TO cl_wd_uielement.
       DATA lr_child2     TYPE REF TO cl_wd_uielement.
    data : LR_CON1 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    data : LR_CON2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    SANDEEP
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lt_children = lr_container->get_children( ).
    CALL METHOD lr_container->get_child
       EXPORTING
         id        = 'DATACONTAINER'
         index     = 1
       RECEIVING
         the_child = lr_CHILD.
    LR_CON1 ?= LR_CHILD.
    CALL METHOD LR_CON1->GET_CHILD
      EXPORTING
        ID        = 'CONTAINER_LEFT'
        INDEX     = 1
      RECEIVING
        THE_CHILD = LR_CHILD1 .
    DATA : LR_CHILD2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    LR_CHILD2 ?= LR_CHILD1 .
    *DATA : LR_C1 TYPE REF TO CL_WD_UIELEMENT.
    *CALL METHOD LR_CHILD2->GET_CHILD
    EXPORTING
       ID        = 'FORM_OF_ADDRESS_DROPDOWN'
       INDEX     =
    RECEIVING
       THE_CHILD = LR_C1.
    *DATA : LR_DD TYPE REF TO CL_WD_DROPDOWN_BY_KEY .
    *LR_DD ?= LR_C1 .
    *CALL METHOD LR_DD->SET_STATE
    EXPORTING
       VALUE  = '00'
    sandeep

  • How to get the previous value of a field before saving the record

    Hi All,
    I have a requirement like, listing out the modified field values with their previous value and new value using integration events or any method.
    For Ex: If i modify the customer name from "Jack" to "Amith" in the record.
    Then i have a requirement to display the message like : CustomerName has changed from "Jack" to "Amith"
    Please post your help notes on this.It's Urgent.
    Thanks & Regards
    Amith

    Hello Amith,
    How does a user perform the modification? Do you already have access to the existing value when the user makes the update? How are you identifying the record to be updated within CRMOD and what method are you using to perform the update?
    Thanks,
    Sean

  • PO-MANDATORY FIELDS

    i want to make storage location to be mandatory field  in purchase order. i went through the path---define screen layout at document level -
    >storage location activated as a required entry.
    still system is not performing this field as a mandatory field before saving of purchase order.

    ear,
    Check below path.
    SPRO - > Material Management - > Materials Management - >Purchasing - >Purchase Order - > Define Screen Layout at Document Level.
    Select your document type for exa : ZDOM, ZIMP, Then click on execute button.
    And Change as per your requirement.
    Make Storare location field as required - it is availabel at Basic Data, Item.
    Also check you have change in ME21N transaction level, Select your document type for exa: ZDOM, Zimp.
    Then tyr to create po
    Regards,
    Mahesh Wagh.

Maybe you are looking for

  • Display a message in a For Loop  with field value

    Hello All, pls,i wanna display a message in a For Loop with field value the code is: FOR Q1 IN GET_SUM_EXP_QUANTITY LOOP               . INSERT INTO PLN_PLAN_DISTRIBUTION_WAY (FIN_YEAR_CODE , MONTH_CODE , MATERIAL_CODE , DISTRIBUTION_WAY , EXPECTED_Q

  • Change the attribute "src" to "href" before importing an XML

    I need to change the attribute "src" to "href" (<img scr="....">) before importing an XML document. I think you could do with XSLT, so you can add a script to import XML documents. But I do not know much about XSLT ... Does anyone could give me an id

  • Oracle 8i rel2 / Designer 6.x

    Hey Guys, I am Installing designer6.x on Oracle 8i rel2, it ask to install designer of Oracle 8i default home, How to install Designer on different Home.

  • Mac mini works extremely slow

    Hi I have Mac mini that works extremely slow, it starts to load the OS but turns really slow once the login is done, it takes about 30-40 min to load. i did few tests like permissions verify and fix, then verify and repair disk which said that Macint

  • A problem about incorrect return value

    Hi,expert:    we have a scenario ECC(Proxy)->PI->P6(soap),  request and response message use the xslt mapping.    The response message contains chinese characters,but when the message come to PI,the chinese charater is garble.    The xml encoding is