Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Validating infotype 0185 screen

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member184569
Active Contributor
0 Kudos

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.



2 REPLIES 2

former_member184569
Active Contributor
0 Kudos

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.



0 Kudos

Thank you very much