2008 Jun 09 1:35 PM
hi all,
i have a table control having 1 field VALUE.
below table control there is one field TOTAL VALUE.
requirement is when user presses ENTER after entering VALUE in row of table control then SUM of VALUE should be shown in TOTAL VALUE. If user deletes VALUE from any row of table control then TOTAL VALUE will be SUM of remaining rows' VALUE and error message will come with cursor at the blank VALUE.
plz help.
rgds,
Avijit
2008 Jun 09 1:41 PM
IN PAI :
case ok_code.
when "ENTER". "any sy-ucomm stands for 'ENTER'
sum the total_value.
give the message.
you needn't do any code in PBO and the new total_value will be displayed.
2008 Jun 09 1:41 PM
Hello,
Please see this: [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5932] [original link is broken] [original link is broken] [original link is broken];.
Regards.
2008 Jun 09 1:47 PM
Hi,
For enter use SPACE as sy-ucomm if no usercommand is assigned and write the logic to handle your requirement.
ex:
PAI:
case sy-ucomm.
when SPACE.
----
----
endcase.
Reward the points if it is helpful.
2008 Jun 09 2:13 PM
hi all,
thnks 4 ur comments.
but my requirement is to check the VALUE field. if it is blank throw error msg with updated TOTAL VALUE to b displayed.
plz help.
rgds,
Avijit
2008 Jun 09 3:53 PM
2008 Jun 10 10:49 AM
hi all,
till now d problem isn't resolved.
my requirement is :
modify one separate field (TOTAL) in PAI at the time when validation fails 4 the field of table control (VALUE) and cursor will b at d erroneous VALUE field and one ERROR msg will b shown below.
plz help.
rgds,
Avijit
2008 Jun 10 11:04 AM
Hello sikdar,
In PAI,
loop
case sy-ucomm.
when 'ENTER'
do logic for summing up the values
when 'DEL'.
do logic for subtracting the values.
if value is initial
tc1-cursor = fieldname.
message e001.
endif.
endloop.
control : tc1 type tableview using screen <screen no.>
In CXTAB type-pools
scxtab_tabcontrol
u can find some fields in that u can find CURSOR field that is used to set the cursor position in the table control.
2008 Jun 10 11:11 AM
hi subash,
thnks 4 ur comment. but d probelm is dat i want to track when user manually deletes d table control field value and presses enter.
plz help.
rgds,
Avijit
2008 Jun 10 11:45 AM
Hi,
Get the value of field using GET CURSOR FIELD <F> VALUE <VAL>.
Whenever the ok_code is ENTER check the value is initial.
If it is initial raise error message.