on 09-01-2010 3:00 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be using the INPUT_CONVERSION method of the BAdI HRPAD00INFTYUI for validating User inputs in ESS.
~Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
did you try putting breakpoints in this code and identifying statement which throws the error..
cheers~
avadh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.