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 Data Validation

Former Member
0 Likes
737

I have a table control (through internal table). The user can punch in his data in this table field. I want to validate the data as soon as user has moved from one of the columns (in the row). User can move from the column either by using the tab key or using his mouse.

Another vaidation approach that is not suitable to us is to let user fill in his details, collect eveything in the internal table and do the validation in one go. I am however interested in run time validation.

Appreciate any help.

4 REPLIES 4
Read only

Former Member
0 Likes
527

Hi Vaibhav,

Put condition in PAI event..

Or you can use Chain EndChain.

http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm

&***********Reward Point if helpful*************&

Read only

former_member195383
Active Contributor
0 Likes
527

hi for data validation in table controll the second approach is generally followed..

The user will insert the value and then will hit Enter key...

In a module in PAI..u can validate then as

if sy-ucomm eq 'ENTE'.

<give error message>

endif.

so after hitting enter key validation will be done...

Hope the above helps..reward points if ans is useful...

Read only

Former Member
0 Likes
527

Please see the sample code.

----


code in flow logic*****

PROCESS AFTER INPUT.

LOOP AT IT_PARTS.

CHAIN.

FIELD IT_PARTS-PARTNO.

FIELD IT_PARTS-PART_DESC.

FIELD IT_PARTS-ITEMNO.

FIELD IT_PARTS-QUANTITY.

FIELD IT_PARTS-UNIT.

FIELD IT_PARTS-PLANT." MODULE plant_help.

FIELD IT_PARTS-SLOC.

FIELD IT_PARTS-BATCH.

FIELD IT_PARTS-USAGE.

FIELD IT_PARTS-ISSUEQTY.

FIELD IT_PARTS-ISSUED_QTY.

FIELD IT_PARTS-REVERSE_QTY.

ENDCHAIN.

*This is where you canvalidate your field***

FIELD IT_PARTS-PARTNO MODULE validate_parts ON INPUT.

MODULE INIT_TC.

ENDLOOP.

*----


Code in Program *

MODULE validate_parts.

GET CURSOR LINE w_index.

<your logic for validation>

SET CURSOR FIELD <your intrnal table> LINE w_index.

end module.

Rewards points if finds helpful

Regards,

swarup

Read only

0 Likes
527

Hi Swarup,

can you tell me where you actually defined " w_index " . and how ??