How to validated screen field(Age) at PA30 transaction

Hi SAP Technical Guru,
i'm working with PA30 transaction, i have to validate the sceen field i.e. Birth Date.it should not consider less than 18 years,
eg:the person who has <18 yrs it should raise a message like min age invalid for employement
so ple

Hi SAP Techinical Guru,
please see code below, which i written to raise a message for filed date of birth,when the entere date if lessthan the 18 yrs it should raise message,
data: dyears   like P0347-SCRYY,
      ddays  TYPE i,
      fromdate TYPE d,
      todate   TYPE d,
      temp TYPE string.
CASE innnn-infty.
WHEN '0002'.
    IF sy-tcode = 'PA30'.
      todate = sy-datum.
      temp = innnn-data3.
      CONDENSE temp NO-GAPS.
      fromdate = temp.
      CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
        EXPORTING
         date1                   = todate
         date2                   = fromdate
         output_format           = '01'
        IMPORTING
          years                   = dyears
        EXCEPTIONS
          invalid_dates_specified = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
       IF dyears < 18.
           MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                   WITH 'EMPLOYEE AGE IS LESS THAN 18 YEARS'.
           RAISE error_occured.
       ENDIF.
please give where iam getting wrong.
regards,

Similar Messages

  • How ti disable screen fields in Module pool

    hi
    How to change screen fields to DISPLAY MODE aftr clicking on a particular pushbutton in Module pool  prg .
    regards
    chetan
    Edited by: chetan teli on Jul 29, 2008 1:04 PM

    hiiii
    use following code for disabling field
    IF p_rad2 IS INITIAL .
        LOOP AT SCREEN.
          IF screen-name CS 'p_docno'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN.
      ELSE.
        LOOP AT SCREEN .
          IF screen-name CS 'p_docno'.
            screen-active = 1.
            screen-input = 1.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN .
      ENDIF.                               " IF p_rad2 IS INITIAL .
    regards
    twinkal

  • How to make screen field enable when table control gives an error

    Hi,
        I had a scneario like when table control data wrong then one parameter of the screen should be enabled for the input, i knew that screen-name will not work since it will have always table control fields only when table control gives an error.
    How to make the other parameter enable when table control throws an error.
    Regards,
    Jaya

    Hi Gobi,
         Thanks for your response, but issue is - how to make other screen fields enable when there was an error in the table control data.
    For table control - lets say we will use the code as i mentioned above.i am sure that we cant write the code for field enable in between loop & endloop.
    as you said if we right outside the loop-endloop, the module wont be triggered when table control throws an error, because that statement was not there in the loop-endloop.
    please let me know if you need any more information on the issue. I hope there is alternative for this in SAP.
    Thanks
    Jaya

  • How to change screen field value.

    Hi Experts,
             I like to change the screen field MSAUS(check box) of program SAPLIQS0 in one of the exit.But if I use
    (SAPLIQS0)VIQMEL-MSAUS = 'X'. its showing compile error.Please tell me how can i change this field in this exit.
    Regards,
    Ajish.

    try something like this:
    create field symbol
      FIELD-SYMBOLS: <fs>.
    Assign value of variable from calling prog to field symbol
      ASSIGN ('(SAPLIQS0)VIQMEL-MSAUS' ) TO <fs>.
    <fs> = 'X'.
    Regards,
    ravi

  • How to access screen field value in a module pool programming?

    Hi Experts,
       I have create a module pool program SAPMYDLG. It contains two screens 100 and 200.
       The first screen contains Employee_ID field. This field is not a dictionary field.
       In the second screen 200, I want to access the value of Employee_ID field from first screen.
       For this I created a global variable v_empid in TOP include.
       Then in the PAI of the screen 100 I have assigned the screen field value to global variable.
       v_empid = Employee_ID.
       But this gives an error saying " Field  Employee_ID not defined".
       What am I doing wrong? How can I access the screen field value?
    Thanks
    Gopal

    Hi,
    Employee_ID field also must u define in the top include when u define that 100 screen and 200 screen will access.
    regards,
    muralii

  • Validating Screen Fields in FD32 - BTE 1520

    Hello everyone,
    I have a requirement to make various checks before saving in FD32. For example I want to make sure that KNKK-DBEKR will be less than or equal to KNKK-KLIMK.
    I have searched SCN and I have implemented BTE 1520 (you can see an example thread here).
    My problem is that while in BTE 1520 I don't have the screen fields available (or at least I don't know how to make them available to my function module).
    Has anyone done something similar?
    Thank you in advance.

    Thanks Neal, but I already tried that. The function module (a copy of SAMPLE_INTERFACE_00001520) uses only two variables I_KUNNR and I_KKBER.
    As you can see in the screenshot below (from the debugger), I have been trying to find whether I have anything else available at that point.

  • How to fetch screen field in HR abap

    hi friend,
      I need to fetch a screen field q0128-tdline. And the field should be included in payslip. Is there any user exit to proceed with this.Please reply ASAP.
    Thanks and Regards
    K.karthikeyan.

    hi,
    Use the user exit PBAS0001.
    you need to write the code in include ZXPADU02 to get that field.

  • How to update screen fields dynamically

    Hi,
    Can any one help me in updating screen field dynamically using so_expr, so_where,so_flds

    Hi,
      Use this type of logic. Though this code is for selection-screen, but you can use this type of logic for screens by using screen table and implement this logic in PAI.
    REPORT z_sdn.
    PARAMETERS:
      p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
      p_char RADIOBUTTON GROUP rad1.
    PARAMETERS:
      p_num1 TYPE i MODIF ID num,
      p_num2 TYPE i MODIF ID num,
      p_char1 TYPE c MODIF ID chr,
      p_char2 TYPE c MODIF ID chr.
    AT SELECTION-SCREEN OUTPUT.
      IF p_num EQ 'X'.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'CHR'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'NUM'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Regards
    Abhijeet

  • How to disable a field in a standard transaction

    Good day,
    Can any one tell me , with an example of , how to disable (the field should not allow any input ) a parameter  or a select option in a standard transaction.

    Probably the only way to achieve this is by creating transaction variants:
    In the SAP Reference IMG, you can create transaction variants. Choose Basis Components ® Application Personalization ® Tailoring of Application Transactions ® Configure Transaction-Related Display Values for Fields (Transaction SHD0). Transaction variants allow you to preset values for fields in a transaction, set field attributes, or hide entire screens.
    To execute a transaction variant, you define a variant transaction using the Transaction Maintenance transaction (SE93).
    Once you have entered a transaction code and short description, choose transaction type Transaction with variant (Variant transaction).
    To define a variant, enter the name of the transaction and the name of the variant. You can then use the new transaction code to start the special variant of the transaction.
    Steps :-
    Transaction SHD0 - Create a variant for the required transaction bychanging the layout through hiding fields and screens.
    Transaction SE93 - Create a variant transaction (e.g. for VA02 you canname it as ZA02). Next allocate the transaction variant to this varianttransaction.

  • How to display verfication fields in ITS mobile transactions

    Experts,
    We are working with ITS mobile for the first time.We are not sure how to display the verification feilds in ITS mobile transaction.I see these are displayed in backend. Since these verification fields are dynamic, how do we get them on ITS mobile transactions.Can anyone tell me how to do this.
    [How to display Verification fields in ITS mobile trnasactions.|How to display Verification fields in ITS mobile trnasactions.]
    Thanks in advance
    Edited by: RKsap193 on Apr 5, 2010 8:13 AM
    Edited by: RKsap193 on Apr 5, 2010 8:14 AM

    Hi Vinod,
    It does not show up unless with some coding. there must be some Java script or HTML code to write in the ITS transaction to enable these dynamic fields to dsiplay.We have issue with regard to how to display these fields when required.
    Thanks in advance
    Any suggestions from experts on how to control these verification fileds on ITS transactions.Also I can not control ITS RF screens upon scanning as to trigger SAVE + NEXT , or COPLETE like we do in the backend transactions.
    Edited by: RKsap193 on Apr 5, 2010 10:32 AM

  • Hide or Show the Dialog Screen Field in a SAP Transaction

    Hi All,
    I am working on a SAP Upgrade Project (4.6C to ECC 5.0). In VA03 Transaction, There is a Filed Name VBAK-KTEXT with Field Text as “Description” appears in 4.6C. But it does not appear in ECC 5.0. I checked the screen Layout in 4.6C as well as ECC 5.0 and noticed that VBAK-KTEXT is available in the Layout of ECC 5.0 but does not appear in the Transaction VA03.
    I was told that there is a way in Customization to Hide or Show a Screen Field for any Transaction. Can any one please guide me through this? I need this help as soon as possible.
    Thanks,
    Kannan.SA

    Hi,
    I am not sure if there's a tcode using which you can configure all the screens the only tool I know that can do this is GUIXT. Regarding the configuration some of the fields are configurable based on document types you should check with SD functional person regarding this. Unfortunately I don't have R/3 access right now, but you can look under SPRO in SD and look for document type.
    thanks

  • How to make screen fields editable

    Hi all,
    iam writing a validation for FD32 transaction in exit, if the validation fails showing error message.
    Porblem is when ever error message comes and after that if i press enter fields are going to mode of non editable ( Display mode), how to make them editable which were already editable ( before error message comes).
    Iam not using module pool program for this, iam writing code in include exit and throwing the message.
    Thanks,

    Hi,
    You can use pop up window to display error message as below:
    -Quote-
    AT SELECTION-SCREEN ON ABCD.
      IF <condition fails>.
        CALL FUNCTION 'FC_POPUP_ERR_WARN_MESSAGE'
          EXPORTING
            popup_title        = 'Error'
          IS_ERROR           = 'X'
            message_text       = 'Error message description'
            start_column       = 25
            start_row          = 6
        STOP.
      ENDIF.
    -Unquote-
    You may also use:
    -Quote-
      IF <condition fails>.
        MESSAGE 'abcd' TYPE 'E'.
      ENDIF.
    -Unquote-
    Kindly let me know whether this is of any help or not.
    Regards,
    Shayeree.

  • How to activate screen fields of VA01 after an error displayed

    Hi
    I have an issue working with USEREXIT_CHECK_VBAK, which affects transactions VA01, VA02 and VA03.
    I have written the logic to validate the combination of Sold-To and Ship-To, against the Partner Table KNVP, under USEREXIT_CHECK_VBAK. And, if a user enters wrong combination of Sold-To and Ship-To, say in transaction VA01, USEREXIT_CHECK_VBAK will be triggered and the validation error message will be displayed. So, once the error is displayed, all the fields available on the screen are getting inactive. The requirement I have is that, after the error message is displayed, both the Sold-To and Ship-To fields should be ready for input again by the user, and the error should be displayed each time user enters wrong combination, but the fields should always be ready for input.
    I have tried working with USEREXIT_FIELD_MODIFICATION, to no avail.
    Could anyone help on this, or give me an idea on how this requirement could be achieved.
    It's urgent.

    You can try it with warning message instead of error message.
    Or else have a lok at below link which gives the details of VA01 exits so that u can find out the corresponding exit where you can make the changes.
    http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • How to set screen field in ME_PROCESS_PO_CUST?

    Dear all,
    I need to set this field 'MEPO1317-MWSKZ' to display only by some criteria. I want to know HOW to do it in ME_PROCESS_PO_CUST
    Thanks for your kindly helpful.

    Hi Esaki,
    1) Define new field selection in configuration "Define screen layout at Document level"
    2) write code in fieldselection_item_refkeys as follow
    get item data
    if your condition
      ch_key0 = new field selection
    endif
    Hope it can help u.
    Grace

  • How to access screen field in pai event

    Hi All,
    I have created a custom screen it has the field say matnr selected from the dictionay.NOw  how will I should access this field in PAI event module?
    Thanks in advance
    Mahesh

    just declare the same variable in your abap editor as per your layout field name.
    suppose in your layout input field name is matnr just declare
    data : matnr like mara-matnr.
    in pai module if you are using matnr it will give you the screen data.
    like
    module pai input.
    if matnr ne '1000'.
    message 'Error matnr is not 1000' type 'E'.
    endif.
    endmodule.
    reagards
    shiba dutta

Maybe you are looking for

  • WHAT IS USE OF CHANGE DOCUMENT FIELD?

    HI experts, go like this,   mara->matnr->dataelement of matnr->further charecteristics ->change document in this if we select change document field what will be occured , if we deselect   thatfield what will be the changes and where will be reflected

  • Running Java Program in WinCE

    Hi all, I am writing a mobile software using Java that going to run in WinCE. Since Java is a platform independent, is advisable to be program and run in Win CE? TQ. -Eugene-

  • Impact of enabling Manufacturer Part Number feature

    Hi, Please note that I would like to activate Manufacturer Part Number (MPN) of SAP. I want to record MPN no of own material, Manufaturer detail in material master. This is for recording those details in MMR. The point is that when I activate MPN ind

  • Captivate 4 link between 2 .exe files

    I work with adobe captivate 4 and i developped a lot of presentations that i want to link i published each of them in the .exe format but the thing is that when i passes from one .exe file to another one, there is a delay and we can see the first .ex

  • System State backup of CA Server 2012 R2

    Hallo, I have read an article about 'System state backup does not include CA private keys in Windows Server 2008 or in Windows Server 2008 R2'  http://support.microsoft.com/kb/2603469 Is this also valid for Server 2012 and Server 2012 R2? If yes, is