How to make field mandatory

Hi all,
i want to make price ,tax code and ware house code in purchase order rows mandatory.
i have designed following Stored procedure..
IF @transaction_type IN (N'A', N'U') AND
(@Object_type = N'22')
BEGIN
if exists (SELECT T0.docnum FROM [dbo].[OPOR] T0 INNER
JOIN [dbo].[POR1] T1 ON T1.DOCENTRY =
T0.docENTRY
WHERE   T1.[Price] = 0
and T1.DOCENTRY = @list_of_cols_val_tab_del)
select @Error = 1, @error_message =
'Enter Price'
else
if exists (SELECT T0.docnum FROM [dbo].[OPOR] T0 INNER
JOIN [dbo].[POR1] T1 ON T1.DOCENTRY =
T0.docENTRY
WHERE    T1.[TaxCode] is  null
and T1.DOCENTRY = @list_of_cols_val_tab_del)
begin
select @Error = 2, @error_message =
'Enter Tax Code'
end
else if exists (SELECT T0.docnum FROM [dbo].[OPOR] T0 INNER
JOIN [dbo].[POR1] T1 ON T1.DOCENTRY =
T0.docENTRY
WHERE    T1.[WhsCode] is  null
and T1.DOCENTRY = @list_of_cols_val_tab_del)
begin
select @Error = 3, @error_message =
'Enter Warehouse Code'
end
END
but system checks only for price and not for other two validation .
kindly suggest me way where system will check for all the validation defind in the Stored Procedure.

Hi Chetan
Try this, This should definitely work
if @object_type = '22' and @transaction_type in ('A','U')
begin
select @Total = (select T1.Price from OPOR T0 join POR1 T1 on T0.docentry = T1.docentry
where T0.docentry=cast(@list_of_cols_val_tab_del as int))
Select @comm = (select T1.TaxCode from OPOR T0 join POR1 T1 on T0.docentry = T1.docentry
where T0.docentry=cast(@list_of_cols_val_tab_del as int))
Select @venref = (select T1.TaxCode from OPOR T0 join POR1 T1 on T0.docentry = T1.docentry
where T0.docentry=cast(@list_of_cols_val_tab_del as int))
if @Total = 0
begin
set @Error =11
set @Error_Message = 'Cannot have Zero Price'
end
else
if @comm is null
begin
set @Error =12
set @Error_Message = 'Select Tax'
end
else
if @venref is null
begin
set @Error =13
set @Error_Message = 'Select Warehouse'
end
end
Regards
Reno

Similar Messages

  • How to make fields mandatory in cost center

    Hi Sap Experts,
    How to make fields mandatory in cost center.
    Please give me advise.
    Regards,
    Raj

    If you want to make "Profit Center" field as mandatory, then OBA5 transaction code
    Application Area - KS
    Number 096
    make this as error for online and batch input. Then profit center will become mandatory.

  • LEAD MANAGEMENT- how to make fields mandatory

    Is there a provision in lead management to make the fields mandatory so that lead number is not generated without filling the mandatory fields/ as it is in business partnerm using field groupings in customizing (eg. without submitting address proof BP number is not generated)

    Hi
    I dont know Kai's solution but it could be good.
    If you want to deal with badi you can use its method CHECK_BEFORE_SAVE, and in it
    if some fields are not filled you can write: RAISE do_not_save.
    Document won't be saved then.
    I checked in my system, and guid is generated (perhaps it is just generated by special FM, but you can not find it
    in any of tables like crmd_orderadm_h or crmd_order_index).
    So in my opinion just guid is generated but not saved in database, until this BADI allows to save.
    Regards
    Radek

  • How to make Fields mandatory in service entry sheet

    Dear Experts,
    I need to make  "Quality of Service" and "Service Timeliness" fields mandatory for user entry  in VENDOR EVALN tab during Service Entry Sheet.
    Kindly help..

    Check the note attached to the configuration node.
    + for required (mandatory) field
    . for optional field
    - for hide
    for display
    Double click on the line showing ...+++...
    It will open up a list of fields grouped logically and you now have a radiobutton style way of changing status.

  • How to make field mandatory in Sales Order Item level?

    Hi SDN's,
    I need to make Shipping type field(Item level) mandatory in Sales order.
    Can any one tell me what is the user-exit to achieve this?
    Thanks in advance..
    Regards,
    Rahul

    Rahul,
    U can check the BADI     'BADI_SD_SALES_ITEM'
    othewise u can check
    Exit Program MV45AFZZ.
    Check the program SAPMV45A
    V45W0001
    V46H0001

  • How to make fields mandatory in Message Address for Custom Notification.

    Hi Experts,
    We have created a new custom Notification Type and we were in the process of configuring it. I want to know, if I want to make a few fields obligatory in Message Address, can that be achieved through configurations. I am basically an ABAPer so please pardon my ignorance if the question looks basic.
    In our implementation, I have seen different Work Orders with different mandatory fields in Message Addresses. I hope the same is achievable for notification as well.
    Thanks for your help.
    Regards,
    Subhrangsu

    There are 2 ways to make any Notification filed mandatory.
    1. Configuration route:
    Here Under Plant Maintenance->Maintenance and Service Processing>Maintenance & Service Notifications>Notification Creation>Notification types> Set Field selection for Notifications:
    You select influencing button and your notification type then select the Radio button under Required column (against the 
    field you want to make mandatory)
    2. User Exit Route: Through SMOD -->User Exit QQMA0014 -->Cutsomer Exit EXIT_SAPMIWO0_020 -->Include ZXQQMU20.
    Then put your code in this include.
    Code Sample:
    IF I_VIQMEL-QMART= 'AC'.
    IF T_VIQMSM-MNGRP IS INITIAL.
    MESSAGE ID 'IW' TYPE 'I' NUMBER 464 WITH 'Tasks'.
    RAISE EXIT_FROM_SAVE.
    ENDIF.
    ENDIF.
    (The above Code makes the 'Tasks' filling mandatory in the Notification type 'AC')
    Hope this answers your query.
    Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on Oct 8, 2010 9:21 AM

  • How to make field ( F110V-LIST1 ) mandatatory in free selection tab of F110

    hi
    How to make field ( F110V-LIST1 ) mandatatory in free selection tab of F110
    regards,
    Billa

    Hi,
    Standard transaction variant is not possible ,i dont want to use as zf110.
    Regards,
    Billa
    Edited by: Billa Mahe on Sep 3, 2010 3:14 PM

  • How to make attachment mandatory in E-Separation ?

    How to make attachment mandatory in E-Separation in ESS screen while submitting the resignation?

    Hello,
    Apologies for delayed response. Please find the below steps :
    1) Extend ReviewCO (pkg - oracle.apps.per.selfservice.review.webui.ReviewCO)
    2) In PFR – check button event is Submit then call function ( that check whether doc is attached or not )
    3) Funtion returns True and False. If false display message.
    Pls. let me know if you need any more information.
    Thanks,
    Sudhakar

  • How to make fields required in an updateble multi line form?

    How to make fields required in an updateble multi line form?

    You need to create a validation item that is triggered when the user clicks the submit button.
    Set the validation type to "Function Returning Error Text".
    Then add your validation into the "Validation Expression 1" field. Something like:
    BEGIN
    FOR I IN 1.. HTMLDB_APPLICATION.G_F02.COUNT LOOP
    IF HTMLDB_APPLICATION.G_F02(I) IS NULL THEN
    RETURN 'Please enter in a value for xxxxx on line ' || TO_CHAR(I,'0');
    END IF;
    END LOOP;
    RETURN NULL;
    END;
    As long as the function returns a string, an error is generated - as there is no single field where this error can be displayed, it will need to be displayed "On Error Page".
    If the return value is NULL, then the fields are valid and the submit process can continue.
    Andy

  • Help Desk - make fields mandatory and sub catagories

    Is there a way to make fields mandatory (not in the portal) but on the ticket?
    Also, when creating custom attributes, is there a way to make a 'sub attribute' show up based on another attribute?
    thanks!
    This topic first appeared in the Spiceworks Community

    Hello Alex,
    To add a message, you can modify the EH_ONSAVE method of the controller class.
    For a sample code, please see below.
    I hope this helps.
    Kind regards,
    Kristoff.
    data: lv_entity         TYPE REF TO cl_crm_bol_entity,
            lv_coll             TYPE REF TO if_bol_entity_col,
            lv_current        TYPE REF TO if_bol_bo_property_access,
            lv_country          TYPE string,
    Address Data
    *navigate down to Address
        try.
          lv_coll = lv_entity->get_related_entities(
                   iv_relation_name = 'BuilStandardAddressRel' ).
          lv_current = lv_coll->get_current( ).
          catch CX_CRM_GENIL_MODEL_ERROR.
        endtry.
        if lv_current is not bound.
          return.
        endif.
        lv_entity ?= lv_current.
        lv_country = lv_entity->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_STRING( 'COUNTRY' ).
        IF lv_country IS INITIAL.
              lv_msgsrv->add_message( iv_msg_type = 'E' iv_msg_id = 'Z_CRM_IC' iv_msg_number = '001' ).
              lv_input_nok = 'X'.
        ENDIF.

  • How to make field is editable in ALV  CL_SALV_TABLE only)

    Hi,
    How to make field is editable in ALV  CL_SALV_TABLE only)
    Any one has tried to make field si editable by using CL_SALV_TABLE class.
    *I know how to do it in REUSEALV function module and CL_GUI_ALV class.*_
    Please reply only if you riedin CL_SALV_TABLE class method.
    Regards
    Rajesh V
    Moderator message: not supported, please read class documentation and search for previous discussions.
    Edited by: Thomas Zloch on Mar 17, 2011 2:07 PM

    Hi Chad,
    Please refer the link,
    Edit field in alv
    Regards,
    Hema.
    Reward points if it is useful.

  • How to make plant mandatory field in Sales order thru standard SAP process

    Hello,
    There is requirement in business that User wants to make plant field Mandatory in Sales order line item once material number is entered. Can you please guide me how I can make Plant field mandatory thru Standard SAP process.
    I had checked it thru Incompletion process & Order type incompletion messages but still Plant field is not becoming mandatory in Sales order. It only gives incompletion log while saving the SO. Please suggest how to do it thru Standard SAP process.
    Thanks & Regards,
    Saurabh

    HI
    Plant will determine based on Customer-material Info Record, Customer Master data & material Master
    If plant is not mandatory in customer Master and Customer material no problem
    but at the time of creating the material master  Plant Mandatory as per my knowledge, so system will pick plant from Material master  that is the case why you required plant Mandatory in Sale order level
    and you need to do Shipping Point Determination for that plant
    Did you check by using User Exit ? if not try once what i have suggested
    Try with User Exit
    MV45AFZZ , FORM USEREXIT_SAVE_DOCUMENT
    VBAP - WERKS = " "
    if VBAP - MATNR , POSNR = not initial
    Error Messgae "E"
    Check and Revert
    Regards,
    Prasanna
    Edited by: prasanna_sap on Feb 14, 2012 11:41 AM

  • How to Make Field/InfoObject Required Entry/Mandatory in DataSel of IPackag

    Hi All,
    How to make InfoObject or field as required/Mandatory Entry in the Data Selection TAB of InfoPackage.(Flat File Extraction)
    Actually I have already Checked Selection Option of my required fields  in DataSource/Transfer Structure  TAB  but unable to make mandatory
    Rgds,
    C.V.

    Hi,
      you can do that using an ABAP program in teh infopackage. You should write code to trigger an exception and throw a message if the selection is not given.
    If it is possible to give selection by calulating a date like thing you can automate with ABAP code once again and can use it in teh process chain.

  • How to make field 'profit center' as non-mandatory in Transaction F-28?

    Transaction F-28 shows Profit Center field as mandatory. How to make it optional; i have already checked it in field status groups-its suppressed over there?
    Field status groups are suppressed. I have also checked posting keys and posting keys assigned to the relevant Bank G/L Account.
    Document splitting is inactive on my company code.
    Payments can be processed through transaction code: F-26 (Incoming Payment: fast entry) without Profit Center requirement.
    But at F-28 (Incoming payment), profit center is mandatory.
    Any Help in this regard will be appreciated.
    Thanks.
    Arslan Qureshi.

    Thank You Karan
    I have Un-checked profit center accounting at transaction OKKP, but no effect.
    why can i post incoming payment through F-26 but not F-28.
    Also Document type is DZ in both Transactions. its only in F-28 that it askes for Profit Center
    Thanks
    Arslan

  • How to make DFF mandatory in forms personalization based on another field

    how to make DFF field mandatory in forms personalization based on another field ,and also user can put values in the DFF field.
    Edited by: SinghP on Mar 14, 2012 12:16 AM

    Hi,
    4 DFFs are enabled.
    CASE1: when payment is voided DFF4 should be mandatory feild
    CASE2: when user queries the voided payment , above DFF4 should be readonly or not editable
    Unable to acheive both the cases with Forms Personalization.
    When trying case2 error pops up saying null canvas.
    Can you please provide some examples if you have any.
    I can find any customizations on this form
    Thanks
    Edited by: user11344029 on Mar 15, 2012 11:28 AM

Maybe you are looking for