2006 Jul 20 12:53 PM
How to edit table control field values at column level <u>not at row level</u>.
I know we can do row level validation by
LOOP AT i_tab.
CHAIN.
FIELD wa_tab-c2.
MODULE CHECK_VALUE.
ENDCHAIN.
ENDLOOP.
My requirement is I have two columns c1 and c2 in my table control. Column c1 is fixed label and column c2 (value) will be enter by user. After user value entry, all value will be added and the total of column c2 (value) should be 100, if it is not 100 an error message will be displayed and the user can re-enter column c2 (value) values accordingly. I need to display whole c2 column fields editable.
Any one faced similar kind of requirement and any solution?
<b></b>
2006 Jul 20 1:18 PM
Remove the keywords CHAIN and ENDCHAIN.
LOOP AT i_tab.
FIELD wa_tab-c2.
MODULE CHECK_VALUE.
ENDLOOP.
And issue the error message in the Module CHECK_VALUE.
-Kiran
2006 Jul 20 1:28 PM
Hello KD,
remove the CHAIN and ENDCHAIN
LOOP AT i_tab.
FIELD itab-c2 MODULE CHECK_VALUE.
ENDLOOP.
MODULE CHECK_VALUE.
sum.
if itab-c2 GE 100.
error message.
exit.
endif.
ENDMODULE CHECK_VALUE.
Try like this.
If useful reward points.
Vasanth
2006 Jul 20 2:00 PM
Hello Vasanth,
Sorry if my post is not explain in detail. My requirement is not to validate field for 100.
I need to add(sum) all the records in c2 column and compare with 100. If this is not equal to 100, the error message should be thrown and whole table column should be editable.
For example
C1 C2
Aaa 23
Bbb 43
Ccc 12
Sum of C2 => 78 => throw error and allow C2 column fields editable
2006 Jul 20 2:11 PM
Hai,
LOOP AT g_t_final.
MODULE modifydata_to_table.
ENDLOOP.
MODULE modifydata_to_table INPUT.
MODIFY g_t_final INDEX tbctrl-current_line.
ENDLOOP.
After modifying sum the column c2 inside the module modifydata.
Then check if the sum is equal to 100.
if it is not throw the error message.
Reward if helpful.
Regards,
Umasankar
2006 Jul 21 7:04 AM
Hello Uma,
We can throw an error message based on total value. However the table control field can not be editable. any other solution..