‎2009 Oct 25 12:19 PM
Hi Experts,
In my table control, I want to validate a field.
In PAI,
I am using
loop at i_vbap.
module update_changes.
field: zvbap-tdline module check_input.
endloop.
the field zvbap-tdline is always blank in this case.
Where as when I was using just
loop at i_vbap.
module update_changes.
endloop.
I was getting the screen values transferred correctly to my internal table.
But now this particular field value comes blank when I use it with field. I want to throw an error message if the user has kept this field blank.
Thanks,
Abdullah Ismail
‎2009 Oct 25 2:19 PM
With table controls, you must use LOOP ... WITH CONTROL ... statement, see abap documentation, or ABAP examples in SE38 | environment | examples | abap examples
‎2009 Oct 25 2:50 PM
hi Abdullah Ismail ,
along with the above suggestion i would just like to add a point..
use table control WIZARD in the screen painter to create table control.. you will be getting a standardized code to work with ..
‎2009 Oct 26 5:31 AM
Hi Abdullah,
<li> If you are using i_vbap table data to display on table control and zvbap-tdline is the field on table control then, your LOOP-ENDLOOP should be like below.
<li>If i_vbap has header also and using on table control, you need to use like below.
LOOP AT i_vbap INTO zvbap."INTO zvbap has been added
MODULE update_changes.
field: zvbap-tdline module check_input.
ENDLOOP.
Thanks
Venkat.OLOOP AT i_vbap.
MODULE update_changes.
field: i_vbap-tdline module check_input."zvbap-tdline changed to i_vbap-tdline
ENDLOOP.
‎2009 Oct 26 5:48 AM
Hi,
First do the check then use update operation.
The reason you are getting blank value is because of the FIELD statement coming after "module update_changes."
Change the coding as below and try
loop at i_vbap.
field: zvbap-tdline module check_input.
module update_changes.
endloop.Regards