Validate a field entered in infotype using BADI

I am writing code in PAI method of BADI HRPAD00INFTY for implemetation class CL_PT_P2012_IF to capture the number the hours entered in infotype 2012 and validate that it is not more than 40. I am not able to field any field in the parameters which corresponds to number of hours entered by the user. Can anyone please suggest me a way to get them.
Regards,
Saurabh

In The PAI
FIELD <DATEFIELDNAME> MODULE CHECK_DATE ON INPUT.
In Proram
MODULE CHECK_DATE.
<Your Check here>
ENDMODULE.
The above module will be triggered only on an entry or change in the date field
Cheers

Similar Messages

  • I have to validate the field enter in that table  values is enter in the ra

    i have one table field with data
    1. <=0.5
    2. <=1
    3.textsfsfs
    4. >=2 like that
    i have to validate the field enter in that table  values is enter in the range of the above field.
    can you help me how to validate
    ex:
    if wa-upper =  wa2-sumplus  here i have to check the upper and lowe values
    if the user enter in between and eq based on the i have to give erro message.
    Please help me the same.
    Thanks
    Ramkumar

    Hi Lekha,
    Thank you this problem was solve.
    we did the this validation in back end insted of front end.
    i passed the table data in to ZFM there we are validating and giving the error message.
    thank you for helping me all the time.
    ONE problem:
    LV_TEXT is the context attribut containe type string.
    i amgetting the values in to LV_TEXT attribut.
    LV_TEXT = nkafjkafkafhkafksfkak<b>#</b>bshfsafkasfkasfkas.
    i wanto to split this and will get the before <b>#</b> values in to other other node workarea LS_dis_new.
    this LS_DIS_NEW i have to modify with table LT_DIS_NEW.
    i used the code : Split wa at '#' into table LT_DIS_NEW.
    this is not working.
    please help me the same.
    Thanks
    Ramkumar

  • Field restriction for ME22N using BADI

    Dear All,
    i had a requirement in which i had to restrict ME22N transaction for a particular user for a particular document type
    so i used BADI ME_PROCESS_PO_CUST now the requirement has changed and the user wants the restriction only on three fields rather than entire transaction.
    is there any provision in BADi by which i can prevent changes made to a  particular fields the fields are QUANTITY,RATE PER UNIT & PAYMENT TERMS fields,by throwing error message if changes are done and  for other fields changes should be allowed .
    my code is as below
    method IF_EX_ME_PROCESS_PO_CUST~CHECK.
    IF SY-TCODE = 'ME22N'.
      DATA: IT_MEPOHEADER  TYPE MEPOHEADER.
        IT_MEPOHEADER = IM_HEADER->GET_DATA( ).
         IF IT_MEPOHEADER-BSART = 'ZLNB' OR IT_MEPOHEADER-BSART = 'ZLUB' OR IT_MEPOHEADER-BSART = 'ZLS'
            OR IT_MEPOHEADER-BSART = 'ZLC' OR IT_MEPOHEADER-BSART = 'ZLFO' OR IT_MEPOHEADER-BSART = 'ZLLN'
              OR IT_MEPOHEADER-BSART = 'ZLDB'.
           IF SY-SUBRC = 0.
                IF SY-UNAME = 'ABAP05'  .
                        Message 'You are not authorized to use ME22N for the given  document type' type 'E'.
                 ENDIF.
             ENDIF.
          ENDIF.
         ENDIF.
    endmethod.
    can anyone plz help me
    Thanks in advance,
    Ronak

    Dear All,
    plz let me know if there is any other alternative (other than BADI) to restrict based on filteration for user , document type , and the three fields i have mentioned..
    Regards Ronak

  • Assign field symbols in infotype 0021 BADI implementation (HRPAD00INFTY )

    Hi there,
    In PA30 infotype 0021, i have to change the value of T_VIEW_REPID by implementing BADI HRPAD00INFTY [Program MP002100->screen 2000->MODULE BEFORE_OUTPUT->PERFORM badi_before_output(sapfp50m)]. I'm trying to use field symbols (as below) to change the value of T_VIEW_REPID and getting SY-SUBRC = 4 after the Assign (LV_WA) To <FS_REPID>. Can somebody please help.
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MPPDAT02)VIEW_REPID'.
      Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.
    Thanks.

    Try like this
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MP002100)VIEW_REPID'.
    Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.

  • Make a field of transaction mandatory using badi/exits.

    Hi ,
    I'm asked to make a field of transaction CO11 mandatory.when the user enters a value into scrap/rework field, a message has to be displayed saying that reason for variance is mandatory and should allow the user to enter the value into this without exiting from the transaction.
    Please give me the solution other than creating transaction variant thruogh SHD0.

    hai krupa, go to se24 and type CL_EXITHANDLER in this class go to method GET_INSTANCE and put break poitn at CALL METHOD cl_exithandler=>get_class_name_by_interface  and u enter the transaction and ur debug will stop at this point and see the exti name in exit_name field , this is the badi used in particual screen , and where u want to get the message find the badi definition , and go to transaction se19 and implemetn it and here u cna check the condtion and put the message
    afzal

  • During PO creation vendor material no field should be populated using BADI

    Hi,
    I have created on PR and using PR I am trying to create PO. But one field vendor material no  remains blank when giving vendor at the top vendor field.
    So my requirement is the vendor material no field in item overview should be populated regardless filling vendor field at the top.
    So this functionality can be achieved by BADI or User exit.
    So any one give the proper suggestion to get the value in the vendor material no field while creating PO.
    Waiting for quick response.
    Best Regards,
    Bansi

    Hi,
    use the badi ME_PROCESS_PO_CUST in that method PROCESS_ITEM....
    use GET_DATA method like im_item->get_data.
    and modify the value anduse set_data ...
    Thanks,
    Shailaja Ainala.

  • How to set screen properties for Customer fields in PO(Enhanced using BADI)

    Hi All,
    I have added one custom tab with seven fields in the PO item level using the BADI 'ME_GUI_PO_CUST  and ME_PROCESS_PO_CUST'.
    Now i want to change the screen property dynamically. According to some calculation i need to change the customer fields in display mode and change mode. when ever it is in change mode i need to set the fields as mandatory.
    How can i implement this logic using this BADI. Please help in solving this issue.
    Best regards,
    Kannan. B

    Hi,
    Try adding the code in the PBO part of your custom program used for the custom screen which you have created and added inside the BADI.
    Regards,
    Harish

  • Hiding fields in a screen using BADI

    Hi Experts
    I want to invisible certain fields  in the screen for certain users and it should be made  visible for certain users,the requirement is to do with badi.Can anyone help me regarding this issue.
    Thanks & Regards
    Pravitha

    Use (or Create) authorization [field|http://help.sap.com/saphelp_nw04/helpdata/en/52/67168c439b11d1896f0000e8322d00/frameset.htm] and [object|http://help.sap.com/saphelp_nw04/helpdata/en/52/6716a6439b11d1896f0000e8322d00/frameset.htm], in the BAdI [check this authorization|http://help.sap.com/abapdocu_70/en/ABAPAUTHORITY-CHECK.htm] and change the INVISIBLE field and not the ACTIVE field in SCREEN structure.
    - [Programming Authorization Checks|http://help.sap.com/saphelp_nw04/helpdata/en/52/6712ac439b11d1896f0000e8322d00/frameset.htm]
    Inform system admin to manage those new object and field in the user roles. ([SAP Authorization Concept Modules|http://help.sap.com/saphelp_banking463/helpdata/en/5c/deaa74d3d411d3970a0000e82de14a/frameset.htm])
    Regards,
    Raymond
    NB: The "d" of BAdI should always been in lowercase, except in statement GET BADI...

  • Adding Fields to Custom Infotype Using Custom Infoset in SAP QUERY

    Hi All,
    We have a requirement to add fileds to a custom infotype for querying Custom Infoset in SAP Query.
    We are facing problem as the added field is not getting displayed in the Query set so that we can select and display it in the Basic List along with the other filds.
    Kindly suggest a solution.
    Full points will be rewarded.
    Thanks in Advance
    Kumar

    Hi Salman,
    Thank you for your valuable information. I haven't Configured Dynamic Actions yet. Is it simple to write the Logic for Dynamic Actions. Is this the only way to solve this Issue?
    I tried by adding the standard fields, but they are not populating the values; but just appearing as Input Fields with Input help option.
    Please let me know if you have any suggestion in this direction?
    Regards,
    Hems.

  • Added custom screen in PO using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

    Hi All,
    I have added custom screen with two z fields at item level using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST i can see my screen in tcodes ME21N , ME22N , ME23N but I am not able to save data.
    and also screen is coming in change mode even in ME23N .
    thanks.

    Hi,
    I have added two xfields at item level.
    This is the code i have added in zimplementation ZME_GUI_PO_CUST .
    IN Zimplementation ME_PROCESS_PO_CUST I have added code only in method FIELDSELECTION_ITEM . after doing this I can see only screens in ME21N, ME22N, ME23N but when enter data in zfields and trying to save it is giving me message no data has changed.
    method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
    we want to add a customer subscreen on the item detail tab
      CHECK im_application = 'PO'.
      CHECK im_element     = 'ITEM'.
    each line in re_subscribers generates a subscreen. We add one subscreen in this example
      CLEAR re_subscribers[].
    the name is a unique identifier for the subscreen and defined in this class definition
      ls_subscriber-name = subscreen1.
    the dynpro number to use
      ls_subscriber-dynpro = '0001'.
    the program where the dynpro can be found
      ls_subscriber-program = 'SAPLYMEPOBADIEX'.
    each subscreen needs his own DDIC-Structure
      ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
    a label can be defined
      ls_subscriber-label = text-001.
    the position within the tabstrib can be defined
      ls_subscriber-position = 4.
    the height of the screen can be defined here. Currently we suport two screen sizes:
    value <= 7 a sevel line subscreen
    value > 7  a 16 line subscreen
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
      ENDIF.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL.
      DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    system asks to transport data from the business logic into the view
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
    transport standard fields
          ls_mepoitem = l_item->get_data( ).
    transport customer fields
          CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
            EXPORTING
              im_ebeln = ls_mepoitem-ebeln
              im_ebelp = ls_mepoitem-ebelp
            IMPORTING
              ex_data  = ls_customer.
    store info for later use
          MOVE-CORRESPONDING ls_mepoitem TO dynp_data_pbo.
          MOVE ls_customer-badi_bsgru TO dynp_data_pbo-badi_bsgru.
          MOVE ls_customer-badi_afnam TO dynp_data_pbo-badi_afnam.
        WHEN OTHERS.
      ENDCASE.
    endif.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_PUSH'
            EXPORTING
              im_dynp_data = dynp_data_pbo.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_POP'
            IMPORTING
              ex_dynp_data = dynp_data_pai.
          IF dynp_data_pai NE dynp_data_pbo.
    something has changed therefor we have to notify the framework
    to transport data to the model
            re_changed = mmpur_yes.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL.
    DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    data have to be transported to business logic
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
          ls_mepoitem = l_item->get_data( ).
    standard fields changed?
         IF dynp_data_pbo-matkl NE dynp_data_pai-matkl OR
            dynp_data_pbo-plifz NE dynp_data_pai-plifz OR
            dynp_data_pbo-webaz NE dynp_data_pai-webaz.
    update standard fields
           ls_mepoitem-matkl = dynp_data_pai-matkl.
           ls_mepoitem-plifz = dynp_data_pai-plifz.
           ls_mepoitem-webaz = dynp_data_pai-webaz.
            CALL METHOD l_item->set_data( ls_mepoitem ).
         ENDIF.
            CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
              EXPORTING
                im_ebeln = ls_mepoitem-ebeln
                im_ebelp = ls_mepoitem-ebelp
              IMPORTING
                ex_data  = ls_customer.
            ls_customer-badi_bsgru = dynp_data_pai-badi_bsgru.
            ls_customer-badi_afnam = dynp_data_pai-badi_afnam.
            CALL FUNCTION 'YMEPOBADIEX_SET_DATA'
              EXPORTING
                im_data = ls_customer.
         ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM.
    DATA: l_persistent TYPE mmpur_bool.
    CONSTANTS:
    FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
    l_persistent = im_item->is_persistent( ).
    *IF l_persistent EQ mmpur_yes.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_NUM."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_DES."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    *ENDIF.
    ENDIF.
    endmethod.

  • USING BADI TO ADD A TAB IN PURCHASE ORDER

    FRIENDS,
    CAN ANYONE SEND ME THE DOCUMENT OR WHOLE PROCEDURE FOR ADD EXTRA TAB AND FIELD IN PURCHASE ORDER  USING BADI.I AM DOING THIS FIRST TIME, SO IF SOME ONE HAVE WHOLE DOCUMENT FOR THIS , PLEASE SEND ME OR ELSE SUGGEST ME THE SOLUTION.

    Hi ,
    Please find these two BADi's which will be useful to you.
    ME_GUI_PO_CUST and MEGUI_LAYOUT
    <b>Reward points</b>
    Regards

  • To validate the fields within JSP

    Hi,
    I want to make sure that there's a way to validate the fields against the DB using Javascript.
    I remember that using JSP we can run SQL scripts; am I correct or not?
    Thks & Rgds,
    Huamin

    not sure what u r asking for....
    u can validate the data in the database using javascript very easily....
    u can always write SQL queries in JSP but it is not advisable....
    Pls elaborate ur requirement...
    Thanks

  • How to list all the fields under an Infotype!

    Hi
    I need a list of fields under an Infotype, used the following link to list them but unsuccesful, is there any other way I can list the infotype feilds.
    Re: Infotype 0002 all fields
    Thanks

    Hi Tara,
    The FM 'DDIF_FIELDINFO_GET' gives you all the fields of the table in the Exporting IT 'DFIES_TAB' that you mention under the parameter 'TABNAME'. I am not sure why it doesnt work for you. Alternatively you can also try this FM 'DDIF_NAMETAB_GET' (This FM is actually used in the FM 'DDIF_FIELDINFO_GET' ) .
    If you are still unsuccesful in meeting your requirement then please paste your piece of code.
    Regards
    Nanda

  • How to validate the input field data in VC using RFC FM

    HI,
    Could any body please give me the solution for the following issue?
    When ever I enter a value in the input field of an iView, this value has to be validated from the backend BW system.  Is this validation is possible using RFC function module?
    If yes, please explain me.

    Hi Deepak,
    U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
    http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
    There are two ways to achieve ur task.
    1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
    http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
    http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
    2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
    http://aspzone.com/blogs/john/articles/173.aspx
    Regards,
    Naren

  • Adding a new field in MIRO using BADI

    Hai Experts,
    I am new to BADI. Today one requirement was there to add a field in MIRO screen for costcenter.
    As i searched in SDN i got information to use BADI MRM_ITEM_CUSTFIELDS.
    Is it right or anyother option is there to create a field.
    If it is right please give me detailed steps to create.
    Thanks in advance.

    Its my mistake in the first reply as i thought it was for MIGO transaction.
    Anyways you can use MRM_ITEM_CUSTFIELDS badi for MIRO.
    Check the documentation of this badi in SE18.
    You can get more information in Screen Exit MIRO.

Maybe you are looking for

  • Does the Dreamweaver team work at Adobe?

    Here's why I ask.  We're in CS6 now, which is what, the 12th version of dreamweaver?  I keep thinking, maybe there's going to be bridge integration someday.  Mini-bridge would be awesome.  But it's like the dreamweaver team has never seen another Ado

  • TM with 2 external drives.

    I have a client I am installing 10.5 for, and I was wondering if its possible to backup to 2 different external drives alternately. What they want is to back up to Drive 1 one day and Drive 2 the next, and keep alternating like that. Both the drives

  • Swapping .FLV files with Spry

    I'm trying to make an HTML page using Spry to play videos with the Spry element of the page pulling in a Title, Description and filename {clip} from an XML file. So when you click on the Title/Description it replaces the current .flv file with the ne

  • Make whole Text clickable (or change Hyperlink color)

    Dear madams and sirs, the issue is the following: I have some text that needs to respond to MouseClicked. This text NEEDS to be orange - that's why i use a Text control. Problem: it only catches a click on the strokes and not inbetween. Possible solu

  • Problems with https connection

    Hi there. I use java1.4 and tomcat 4.0.I have trusted certificate. And my code is: try{ URL url = new URL("https://localhost:443/index.html"); URLConnection con = url.openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(