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: 

TableControls, icons and fuction codes

Former Member
0 Kudos

Hi everybody and thanks in advance.

I have a problem with my table control.

I have a table control with five fields, one of them is colled note, and is a char of 4 characters.

I assigned to this field an icon with this code:


    move '@0J@' to tab_s9035-nota.

My problem is I want to assign a function code as 'NOTE' for instance, because I want to get in the PAI the code when the user do click on the icon.

But instead of that, I obtain a message like this: 'choose a valid function'.

Can anybody help me?

Thank you for your time.

7 REPLIES 7

dani_mn
Active Contributor
0 Kudos

Hi you can get the selected line by opening the properties of table control and check on the property 'W/SelColumn' and mention a internal table field as flag in which system will set 'X' if user select some row.

Regards,

Wasim Ahmed

former_member181962
Active Contributor
0 Kudos

Refer this LInk:

Regards,

Ravi

0 Kudos

I think is not the same problem.

I have just assigned the icon inside my table control, but when the user click the field, no event is fire, cause my icon has not a function code.

I want to know how to assign this function code. I have tried with the screen design but it is not possible.

Thank you for your answer anyway.

Former Member
0 Kudos

Hai David

Go through the following Documents

1) Screen tables

A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.

These are of two types.

Table Controls and Step loops

These tables are treated as Loops.

2)Features of Table Controls

Data is displayed in the form of table.

Table control gives user the feeling of an actual table.

You can scroll through the table vertically as well as horizontally.

You can select rows and columns.

You can resize the with of columns.

You can have separator lines between rows and columns.

Automatic resizing of the table when the user resizes the window.

You can update information in the table control and it can be updated in the database table by writing code for it.

3)Steps for creating table control

Declaration of table control in module pool program.

Designing of table controls on the screen.

Passing data to table control in flow logic.

4)Declaration of TC in MPP

syntax:

controls <name of table control> type tableview using screen <‘screen no.’>.

5)Designing Table control on screen

Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.

Name the table control.(same name as given in data declaration).

From dictionary object OR from program fields select the fields and place them in the table control

6)Passing data to table control

Usually transfer of data from program to screen is automatic.

In case of TC, you need to explicitly transfer the data to table control.

ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.

7)Passing of data contd.

PBO.

Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.

module…….

Endloop.

PAI.

Loop at < name of internal table>.Endloop.

8)Scroll variables

Top_line : the row of table where the screen display starts.

Current_line : the row currently being processed inside a loop.

9)Transfer of data from prg to TC.

With ‘Loop at …’ statement, the first row is placed in the header of internal table.

If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.

The row in internal table is transferred to the TC as stated in the ‘Loop at…..’ statement.

The system encounters the ‘Endloop’ statement and control is passed back to the next line of internal table.

In the same way all the records of the internal table are passed to the TC.

Thanks & regards

Sreenivasulu P

0 Kudos

Thank you for your answer, Sreenivasulu.

But I have just created my table control and I have a manual about this control.

Maybe I am not saying what I want to ask.

My problem is when the user do click on the icon, no event is fired because the icon has not a function code assigned. I can not assign this function code in design mode, with the screen painter. I would like to find out wich is the trick I have to use to assign the function code to the icon in order to fired the even PAI when the user do click on the button.

Thank you for your time.

> Hai David

>

> Go through the following Documents

>

> 1) Screen tables

> A table can be created in transaction. These tables,

> when designed on the screen are called as SCREEN

> TABLES.

>

> These are of two types.

> Table Controls and Step loops

>

> These tables are treated as Loops.

>

>

> 2)Features of Table Controls

>

> Data is displayed in the form of table.

> Table control gives user the feeling of an actual

> table.

> You can scroll through the table vertically as well

> as horizontally.

> You can select rows and columns.

> You can resize the with of columns.

> You can have separator lines between rows and

> columns.

> Automatic resizing of the table when the user resizes

> the window.

> You can update information in the table control and

> it can be updated in the database table by writing

> code for it.

>

> 3)Steps for creating table control

>

> Declaration of table control in module pool program.

>

> Designing of table controls on the screen.

> Passing data to table control in flow logic.

>

> 4)Declaration of TC in MPP

>

> syntax:

>

> controls <name of table control> type tableview using

> screen <‘screen no.’>.

>

> 5)Designing Table control on screen

>

> Click on Table in Control bar and place it on the

> screen. You can adjust the length and width of the

> Table Control.

> Name the table control.(same name as given in data

> declaration).

> From dictionary object OR from program fields select

> the fields and place them in the table control

>

> 6)Passing data to table control

>

> Usually transfer of data from program to screen is

> automatic.

> In case of TC, you need to explicitly transfer the

> data to table control.

> ABAP/4 provides Loop statement, which is associated

> with flow logic to transfer the data.

>

> 7)Passing of data contd.

> PBO.

> Loop at <name of internal table> with control <name

> of table control> cursor <scroll variable>.

> module…….

> Endloop.

> PAI.

> Loop at < name of internal table>.Endloop.

>

> 8)Scroll variables

>

> Top_line : the row of table where the screen display

> starts.

>

> Current_line : the row currently being processed

> inside a loop.

>

> 9)Transfer of data from prg to TC.

> With ‘Loop at …’ statement, the first row is placed

> in the header of internal table.

>

> If any module is specified between Loop and End loop,

> it will be executed. In this module, generally we

> will be assigning this internal table fields to table

> control screen fields.

>

> The row in internal table is transferred to the TC as

> stated in the ‘Loop at…..’ statement.

>

> The system encounters the ‘Endloop’ statement and

> control is passed back to the next line of internal

> table.

>

> In the same way all the records of the internal table

> are passed to the TC.

>

>

> Thanks & regards

> Sreenivasulu P

Former Member
0 Kudos

I am closing this question because nobody answered and it was a long time ago.

sorry

0 Kudos

Hi

Sorry but I see your problem only now, anyway, for the next time, u need only to insert a pushbutton in your table control and assign a function code to it.

If you insert the sign % in the function code (like <CODE>%), the system'll replace % with the index of the selected row.

Max