cancel
Showing results for 
Search instead for 
Did you mean: 

BADI HRPAD00INFTYBL validation through ESS.

Former Member
0 Kudos

Hi All,

We are implementing the enhancement in standard BADI "HRPAD00INFTYBL" for infotype (IT 0185) validations through ESS Portal.

We are successfull in throwing the error messages. However, even after user is inputting correct values - these error messages are still thrown.

BADI Name : HRPAD00INFTYBL

Method Name : IF_EX_HRPAD00INFTYBL~INSERT_COMPUTATIONS

Pls check the below sample code.


method IF_EX_HRPAD00INFTYBL~INSERT_COMPUTATIONS.
 
data: pan_number(10) type c.
data: first_five_char(5) type c.
data: sixth_to_ninth(4) type c.
data: last_char(1) type c.
data: lw_msg type symsg.
 
CONSTANTS: Lc_error_cause type HRPAD_MESSAGE_CAUSE value 'INVALID_PANCARD'.
 
first_five_char = pan_number+0(5).
 
sixth_to_ninth = pan_number+5(4).
 
last_char = pan_number+9(1).
 
 
IF NOT ( first_five_char CO 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only characters from A-Z in first 5 places and in the last place'(013).
 
  CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
         cause   = Lc_error_cause.
 
 ENDIF.
 
 
IF NOT ( sixth_to_ninth CO '1234567890' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only numeric 0-9 from 6th place to 9th place'.
 
CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
        cause   = Lc_error_cause.
 
ENDIF.
 
 
IF NOT ( last_char CO 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only characters from A-Z in last place'.
 
CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
        cause   = Lc_error_cause.
ENDIF.
endmethod.

Pls suggest the changes to clear the message handlers list.

Regards,

Anil Kumar

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Anil,

I am facing the problem which is of similar one.

I am unable to get the error messages in ESS, where as i am able to get it in R/3. Please suggest me what to do to get the errors in ESS.

Thanks in advance.

Vijay

Former Member
0 Kudos

vijay,

check this thread

Thanks

Bala Duvvuri

former_member182426
Active Contributor
0 Kudos

Hi Anil

In your code

method IF_EX_HRPAD00INFTYBL~INSERT_COMPUTATIONS.
 
data: pan_number(10) type c.
data: first_five_char(5) type c.
data: sixth_to_ninth(4) type c.
data: last_char(1) type c.
data: lw_msg type symsg.
 
CONSTANTS: Lc_error_cause type HRPAD_MESSAGE_CAUSE value 'INVALID_PANCARD'.
 
first_five_char = pan_number+0(5).   
 
sixth_to_ninth = pan_number+5(4).
 
last_char = pan_number+9(1).
 
IF NOT ( first_five_char CO 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only characters from A-Z in first 5 places and in the last place'(013).
 
  CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
         cause   = Lc_error_cause.
 
 ENDIF.
 
 
IF NOT ( sixth_to_ninth CO '1234567890' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only numeric 0-9 from 6th place to 9th place'.
 
CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
        cause   = Lc_error_cause.
 
ENDIF.
 
 
IF NOT ( last_char CO 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' ).
 
    lw_msg-msgid = 'PG'.
    lw_msg-msgty = 'E'.
    lw_msg-msgno = '016'.
    lw_msg-msgv1 = 'Enter only characters from A-Z in last place'.
 
CALL METHOD message_handler->add_message
      EXPORTING
        message = lw_msg
        cause   = Lc_error_cause.
ENDIF.
endmethod.

In above code for the follwoing fields it will be always emty when the cursor comes to this code.

first_five_char = pan_number+0(5).  
 
sixth_to_ninth = pan_number+5(4).
 
last_char = pan_number+9(1).

Here your not passing the value from ESS filed. Your moving the data what you have declared variable. It will be always empty

Try to read from PNNN structure and pass that value to your local data variables and check the condition.

Regards,

Shankar Reddy Ch.

Former Member
0 Kudos

Hello,

I would try to change the following 3 variables to type string.

data: first_five_char type string.

data: sixth_to_ninth type string.

data: last_char type string.

Hope that helps.

Best regards

Karsten

suresh_datti
Active Contributor
0 Kudos

You should be using the INPUT_CONVERSION method of the BAdI HRPAD00INFTYUI for validating User inputs in ESS.

~Suresh

Former Member
0 Kudos

did you try putting breakpoints in this code and identifying statement which throws the error..

cheers~

avadh