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

Screen Field Validation in Module pool

Former Member
0 Likes
3,195

HI Guys,

I need to validate fields in module pool programming.

i have declared the fields like below:

  CHAIN.

     FIELD ZTYPE_INVOICES-CUSTOMINVOICE.

     FIELD ZTYPE_INVOICES-CUSTOMINVOICE1.

     FIELD ZTYPE_INVOICES-CUSTOMINVOICE2.

     FIELD ZTYPE_INVOICES-CUSTOMINVOICE3.

     FIELD ZTYPE_INVOICES-CUSTOMINVOICE4.

     MODULE validate_input ON CHAIN-INPUT.

   ENDCHAIN.

then inside the module i coded like this :

MODULE VALIDATE_INPUT INPUT.

SELECT VBELN

   from VBRK

   into TABLE  it_validate

   where vbeln = ZTYPE_INVOICES-CUSTOMINVOICE.

if sy-subrc <> 0.

   Message 'Enter the valid invoice no.' type 'I'.

   endif.

  ENDMODULE.   

but it's not working.

any advise.

Thanks,

Amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,434

Hi,

your flow logic is after PAI?

Why do you select into a table IT_VALIDATE and not SELECT SINGLE. Is the 1st field of table IT_VALIDATE of type VBELN?

Regards,

Klaus

4 REPLIES 4
Read only

Former Member
0 Likes
1,435

Hi,

your flow logic is after PAI?

Why do you select into a table IT_VALIDATE and not SELECT SINGLE. Is the 1st field of table IT_VALIDATE of type VBELN?

Regards,

Klaus

Read only

0 Likes
1,434

Hi Klaus,

yes, the flow logic is after PAI.

i tried  using select single also but it dosen't work. yes, the 1st field of internal table is of type VBELN.

Thanks,

Amit

Read only

0 Likes
1,434

Hi Amit,

please check that field ZTYPE_INVOICES-CUSTOMINVOICE is also of type VBELN. For conversion exit it mustn't be of another type (data element).

Regards,

Klaus

Read only

0 Likes
1,434

Hi Klaus,

Thanks alot.Yes, the data element was different. i changes it to match the VBELN an it solved my problem.

I have rewarded points to you.

Thanks,

Amit