2013 Sep 21 4:33 PM
Hi, I am a junior ABAP developer and would like help from more experienced abapers in one of my tasks, i am supposed to enhance infotype 0185 by checking the ID number screen field entered by the user to make sure its exactly 14 characters long i have tried enhancement PBAS0001 - EXIT_SAPFP50M_002 which runs after input correctly but i am at a loss as to how to get the values from the screen fields to validate them, i appreciate any help.
2013 Sep 22 6:49 AM
Hi Abdel,
This is the way to go about it.
In the exit you had talked about, (ZXPADU02),
data ls_0185 type p0185.
data: id_len TYPE I,
when '0185'.
* To read values from the screen for validation.
call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
exporting
prelp = innnn
importing
pnnnn = ls_0185.
* Now perform your validation.
id_len = strlen ( ls_0185-icnum )
if id_len ne 14.
message 'Enter ID number in the correct format' type 'E'.
endif.
Hi Abdel,
This is the way to go about it.
In the exit you had talked about, (ZXPADU02),
data ls_0185 type p0185.
data: id_len TYPE I,
when '0185'.
* To read values from the screen for validation.
call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
exporting
prelp = innnn
importing
pnnnn = ls_0185.
* Now perform your validation.
id_len = strlen ( ls_0185-icnum )
if id_len ne 14.
message 'Enter ID number in the correct format' type 'E'.
endif.
2013 Sep 22 6:49 AM
Hi Abdel,
This is the way to go about it.
In the exit you had talked about, (ZXPADU02),
data ls_0185 type p0185.
data: id_len TYPE I,
when '0185'.
* To read values from the screen for validation.
call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
exporting
prelp = innnn
importing
pnnnn = ls_0185.
* Now perform your validation.
id_len = strlen ( ls_0185-icnum )
if id_len ne 14.
message 'Enter ID number in the correct format' type 'E'.
endif.
2013 Sep 22 10:12 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |