Skip to Content

infotype enhacement using BADI

Hi all,

this is naresh.

i have done an infotype enhancement using BADI for infotype 2001,

displaying a warning message.

for that i have written code in PAI.

now the issue is after giving the inputs and pressing enter it will display the warning message.

second time pressing enter gives save your entries.

how should avoid those message 'save your entries'.

can any1 answer?

thanks,

Naresh.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 28, 2014 at 11:11 AM

    Hi Naresh,

    Make code as simple....

    DATA : WA_OLD_P2001 TYPE P2001, " store the value of infotype before change

    WA_NEW_P2001 TYPE P2001. " store the value of infotype after change

    data : wa_0019 type pa0019.

    CASE NEW_INNNN-INFTY.

    WHEN '0002'.


    if ipsyst-ioper eq 'INS' " Debug here for the operations 'INS' or COP or MOD or DEL


    CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

    EXPORTING

    PRELP = NEW_INNNN

    IMPORTING

    PNNNN = WA_NEW_P2001.

    if wa_new_p2001 is not initial.

    select single * from pa0019 into wa_0019

    where pernr eq wa_new_p2001-pernr

    and TMART eq 'Z1' . " Here give your task type for probation period

    if wa_0019-tmart between WA_NEW_P2001-begda and WA_NEW_P2001-endda.


    message 'Leave cannot availed during probation period' Type 'E'.


    endif.

    endif.

    endif.

    ENDCASE.

    ENDMETHOD.



    Thanks,

    Vijay SR

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Vijay,

      thanks for info and sorry, actually displaying warning message when pressing ENTER is OK.

      before saving also the message is displaying.

      i didn't understood the issue. so i struggled.

      now i got it and for that i have written code within a condition if SY_UCOMM is initial..... endif.

      it worked, since when saving sy-ucomm becomes UPD.

      thanks all.

      regards,

      Naresh.

  • Posted on Jan 28, 2014 at 07:46 AM

    Hi NAresh,

    U given the message type as WARNING,

    Warning message will allow further process after pressing ENTER Key,

    So u change the Message Type as 'ERROR', it will not allow further until Your condition satisfies..

    So if you need Error message ,

    Message 'Please enter valid date' type 'E'.

    Warning message will allow you for the next process, because it just a warning given to users and after the enter key it proceed further...

    Any queries , feel free to ask me..

    Thanks,

    Vijay SR

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.