Application Development 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: 

Table Control in Module Pool

Former Member
0 Kudos

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

9 REPLIES 9

daixiong_jiang3
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

hi all,

ne suggestion.... plz help

rgds,

Avijit

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.