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

Table control - Field statement - Value reset

Former Member
0 Likes
650

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

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
0 Likes
576

With table controls, you must use LOOP ... WITH CONTROL ... statement, see abap documentation, or ABAP examples in SE38 | environment | examples | abap examples

Read only

Former Member
0 Likes
576

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 ..

Read only

venkat_o
Active Contributor
0 Likes
576

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.

LOOP AT i_vbap INTO zvbap."INTO zvbap has been added
MODULE update_changes.
  field: zvbap-tdline module check_input.
ENDLOOP.
<li>If i_vbap has header also and using on table control, you need to use like below.
LOOP AT i_vbap.
MODULE update_changes.
  field: i_vbap-tdline module check_input."zvbap-tdline changed to i_vbap-tdline
ENDLOOP.
Thanks Venkat.O

Read only

Former Member
0 Likes
576

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