‎2008 Jun 11 12:38 PM
hi all,
i have one table cotrol having 2 flds ID and VALUE. ID is input fld but VALUE is in display mode.
also there is another screen fld TOTAL in display mode. it will show total of VALUE of all rows of table control.
when ID is entered if it is valid, VALUE will be populated and also TOTAL will be updated.
if ID is changed and new ID is not valid, ERROR msg should be shown and ID will be in editable mode and TOTAL will be updated subtracting the VALUE of old value of ID.
plz help how to solve this issue.
rgds,
Avijit
‎2008 Jun 11 12:47 PM
Use Chain statement in PAI.
Process after input.
Chain.
Field:wa_ctrl-id.
Module update_table on chain-request.
Endchain.
Module update_table.
If wa_ctrl-id is <valid> "Condition for checking valid ID.
" Logic to populate Value field and calculate Total.
Else.
If wa_ctrl-value is not initial.
w_total = w_total - wa_ctrl-value. "Subtract value.
Clear wa_ctrl-value.
Modify it_ctrl from wa_ctrl.
Endif.
"Error message
"The field will be automatically in Editable mode since it is inside CHAIN statement
Endif.
Endmodule.
This logic will work.
Regards,
Lakshmi.
Edited by: Santhanalakshmi V on Jun 11, 2008 5:17 PM
‎2008 Jun 11 1:10 PM
hi lakshmi,
thnks 4 ur reply.
i think CHAIN-ENDCHAIN should be within LOOP AT <Internal Table for Table Control>. rectify me if i am not correct.
i have coded as u suggested but total in screen is not getting updated when ERROR msg is showing as PBO is not fired then.
plz help
rgds,
Avijit