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

Highlight row in table control

Former Member
0 Likes
1,193

Hi,

I have a table control in which the user is able to enter States. If the User has entered a duplicate state, eg, NY,NY, an error needs to be issued alerting him of the fact and one of the rows corresponding to the duplicate state needs to be highlighted(selected) so that the user can go ahead and delete that duplicate row.

The problem I'm facing is after the error message is issued, how do I get the row to be selected?

Your answers would be appreciated.

Thanks .

Hi,

I have a table control in which the user is able to enter States. If the User has entered a duplicate state, eg, NY,NY, an error needs to be issued alerting him of the fact and one of the rows corresponding to the duplicate state needs to be highlighted(selected) so that the user can go ahead and delete that duplicate row.

The problem I'm facing is after the error message is issued, how do I get the row to be selected?

Your answers would be appreciated.

Thanks .

3 REPLIES 3
Read only

Former Member
0 Likes
727

Hi Tessy,

Are you using the multiple selections on the screen?

i.e...i am referring is an option where user can select multiple lines/single lines on table control

in the screen painter..there is an option for multiple/single selections..and then you can assign a name to it like W_SEL

Then in the internal table you have displayed on the screen there should be a field of length 1 type character(W_SEL type C.)

if the following is the internal table with 2 fields..to do the select the declaration should be like..

types:begin of ty_screentable,

w_sel type c,

field1 type XXX,

field2 type YYY,

end of ty_screntable.

data: int_screentab type table of ty_screentable.

data: wa_screentab type ty_screentable.

you create a screen painter

the table control screen contains fields...

int_screentab-w_sel ,int_screentab-field1,int_screentab-field2

you are looping at the screen with control in PBO

in PAI....

loop at internal table

endloop.

so in PAI..when you realise that you have multiple entries...set the field = 'X' and update the internal table by modifying the current line.....

write logic to find duplicates..when u find the duplicate record..l

loop at the internal table..

if this is a duplicate record..

wa_screentab-w_sel ='X'..

modify internal table from workarea transporting

w_sel....

endloop..

Please check and revert

Reward if helpful

Regards

Byju

Read only

Former Member
0 Likes
727

Thanks very much for your reply. It was really helpful. One of my mistakes was that I was doing the processing for checking duplicate states outside the loop - endloop in the PAI and not within loop-endloop. Have rewarded the answer with points.

Edited by: Tessy Vadakel on Apr 4, 2008 9:25 PM

Read only

Former Member
0 Likes
727

hi thre..

Hi,

syntax:

CONTROLS .

if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.

u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.

Go through this urls.

www.saptechnical.com

www.sap-img.com

Check the below links.

just refer to the link below

http://www.sapmaterial.com/tablecontrol_sap.html

step by step procedure with screen shots

http://www.planetsap.com/howdo_a.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm

http://sap.niraj.tripod.com/id25.html

Also you can see the below examples...

Go to se38 and give demodynpro and press F4.

YOu will get a list of demo module pool programs.

One more T-Code is ABAPDOCU.

YOu can find more examples there.

See the prgrams:

DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement

DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB

http://www.geocities.com/ZSAPcHAT

http://www.allsaplinks.com/files/using_table_in_screen.pdf

do reward if helpful