Application Development and Automation 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: 
Read only

Infotype Entry Validation

Former Member
0 Likes
491

Hi Experts,

When i create an entry for an infotype via Pa30, The data i givein for a particular field if invalid should immediately prompt me for an error message when i start moving to the next field. I dont want my error message to come when i give "SAVE" rather i want it instantly when i move on to the nest field. How can i go about this i.e. where should i place my validation code?

TIA

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
455

Hi ,

Thier must be some exit for this under which you can write your code for validation checking.

You can try this exit PBAS0001 in SMOD.Under it you will get 2 component write the code under 2nd component.

I am sample code for error message display for an infotype

DATA:
  i0000         LIKE p0000,
  w_persk4(25)  TYPE c VALUE '(SAPFP50M)PSPAR-plans'.

ASSIGN (w_persk4) TO <fs>.

CASE:innnn-infty.

  WHEN:'0000'.

    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      EXPORTING
        prelp = innnn
      IMPORTING
        pnnnn = i0000.

    IF i0000-massn = '01' OR i0000-massn = '12'.
      IF <fs> = '99999999'.

        MESSAGE text-000 TYPE 'E'.

        CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
          EXPORTING
            pnnnn = i0000
          IMPORTING
            prelp = innnn.

      ENDIF.
    ENDIF.

ENDCASE.

With Regards,

Anomitro Guha

2 REPLIES 2
Read only

Former Member
0 Likes
455

Hi,

There is no such event like lost focus or something.

You can do one thing, place your validation in 'WHEN OTHERS' condition of case endcase along with 'WHEN SAVE' inside PAI module.

This called when u press enter or any event is occured.

Read only

Former Member
0 Likes
456

Hi ,

Thier must be some exit for this under which you can write your code for validation checking.

You can try this exit PBAS0001 in SMOD.Under it you will get 2 component write the code under 2nd component.

I am sample code for error message display for an infotype

DATA:
  i0000         LIKE p0000,
  w_persk4(25)  TYPE c VALUE '(SAPFP50M)PSPAR-plans'.

ASSIGN (w_persk4) TO <fs>.

CASE:innnn-infty.

  WHEN:'0000'.

    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      EXPORTING
        prelp = innnn
      IMPORTING
        pnnnn = i0000.

    IF i0000-massn = '01' OR i0000-massn = '12'.
      IF <fs> = '99999999'.

        MESSAGE text-000 TYPE 'E'.

        CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
          EXPORTING
            pnnnn = i0000
          IMPORTING
            prelp = innnn.

      ENDIF.
    ENDIF.

ENDCASE.

With Regards,

Anomitro Guha