Table Controls: - Find selected line index
HI,
I have a table control . In tis 4 lines are visible at a time..1 field in this table comntrol is a button.
when the user clicks on a button, the details of the corresponding line should be used to trigger a new screen. If the no of lines in the table control is less than 4( o of visible lines) , i can use get cursor line, to get the index of the line selected. . but if i scrolled down and selected the button in the 15 th line, then get cursor line cannot be used as it will retrieve the no 3. CAn u please give me a solution.
thnx.
declare two variables to get line count and line index
data: wrk_linecnt(10),
wrk_lineindx(10).
get cursor line wrk_linecnt.
wrk_lineindx = <table control name>-top_line + wrk_linecnt - 1.
read table <internal table used in table control> index wrk_lineindx.
Similar Messages
-
Module pool ---Problem in finding the line index for the table control
Hi Friends,
I am working in Module pool programming.
My requirement is when i select any record on the lead selection I need to find out the index of the line on which row i have selected.
Could any one please suggest me the proper solution how to get the line index for the table control in module pool programming.
Thanks
Satish RajuHi Raju,
Follow the steps
<li>U should take one variable in your internal table or in structure which is used for table control fields.
DATA :BEGIN OF itab OCCURS 0 ,
mark TYPE c ,
matnr LIKE mara-matnr ,
matkl LIKE mara-matkl,
maktx LIKE makt-maktx,
END OF itab .
controls: tabc types tableview using screen 100.
<li>This mark variable should be given in Table control properties. follow the path
double click on the table control-->attributes .->select w/SelColumn and in that give itab-mark.
<li>Flow logic of the screen
process before output.
MODULE status_0100.
LOOP AT itab with control tabc
endloop.
process after input.
module cancel at exit-command.
LOOP AT itab.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0100.
<li>read_table_control module code
MODULE read_table_control INPUT.
MODIFY itab INDEX tabc-current_line."this will update the itab table
"mark field with 'X ' whatever we
"have selected on table control
ENDMODULE.
<li>If you want to Delete some of the records from Table control follow this code u2026Create one pushbutton and give Fucnction code to that and write below code
CASE okcode.
WHEN 'DELETE'.
LOOP AT itab WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDCASE.
I hope that it helps you.
Thanks
Venkat.O -
How do I execute some code when a line of a table control is selected?
Hi,
I would like to execute some code when a line of a table control is selected. At the moment I have to select one or multiple rows and then press enter, this forces a screen refresh and my code is executed but I would like the code to be executed as soon as any line is selected.
I've done something like this using ALV grids and object orientated code but is there a way of doing this in a normal non-OO table control?
Thanks in advance.
GillHi,
U need to declare a char1 field for marking (mark field). This will reflect with value 'X' in your tcontrol internal table for all the selected rows.
Now u need to handle the okcode for enter in your PAI.
There u need to loop through the table for all marked fields.
There after u can do what ever u want.
Venkat. -
Need Table Control in Selection Screen
I have a selection screen with some fields. Now, below these fields, I need a table control in which i will have input parameter along with some check boxes so that i can enter data and use the same while executing the report.
paste the code for the requirement how to add a table control on the selection screen.hi ramesh,
i have a very same requirement as u did. pleae send me the code which u used.
Till now, i have been able to display table control on selection screen. but, how to write or display the output or how to call the output screen. i have to display alv output.
Please help on above issue.
Thanks,
Rajesh -
Checkbox Within Table Control At Selection Screen
Hello, there.
In my selection screen (dialog) I'm using a table control which is based on an internal table.
In that internal table I have a simple Yes/No field (declared as type XNULL for example).
The problem is that I want it to be displayed as checkbox on the selection screen's table control and not as a simple string with size = 1 like it is..
I hope it's clear and understood ...
Thanks in advance,
RebekaRebeka,
Its very simple,
In that field of table control just drag & drop the checkbox.
In Screen modules ,
loop at itab.
If Field = 'YES'.
Checkbox = 'X'.
else .
clear checkbox.
endif.
endloop.
Regards,
TAlwinder -
Table control in Selection Screen
Hi,
Is it possible to keep table control and tabstrip control in selection screen without using dialog programming? I mean , using coding from program itself, have to get table in the selection screen,like how we are keeping checkbox and radio button from program itself .
by
Mohan Ram
Moderator Message: Search before posting.
Edited by: kishan P on Sep 16, 2010 11:04 AMHi, Mohan
Please Always do a little Search Before Posting => [Search Results|http://forums.sdn.sap.com/search.jspa?threadID=&q=TablecontrolinSelectionScreen&objID=&dateRange=all&numResults=30&rankBy=10001]
Hope you will get the answer from the First Few Threads From Search Result.
Thanks and Regards,
Faisal -
Can Table Control alternate on line color?
Is it possible to change line color on Table Control? I would like the lines on the Table Control to alternate in color as to make it easier to read the data. I tried using screen-intensifed but that changes the color on a column, I need to make every other row stand out.
Thanks
Edited by: Gary Morman on Mar 11, 2010 9:17 PMALV Grid is editable if using the CL_GUI_ALV_GRID class. See programs which start with BCALV_EDIT*
Regards,
Rich Heilman -
Control Slave Select line with blackfin
Hi
I am trying to communicate with an SD memory card using the BF-537 ez-kit board. I have the SPI interface set up, but i need to send a 6-byte command at once without the slave select line changing. It appears the only word size options availabe are 8- and 16-bits... is there a way to do this??
Thanks in advance!
-Eman2334Hi Eman,
What VIs are you using to send data? Is the 6 byte command for the flash memory? Is it mentioned in the memory manual? Can you verify that its 6 bytes and not bits.
Thank You,
Jaidev
National Instruments
LabVIEW Embedded Product Support Engineer -
Problem with table control adding new line
Dear friends,
i am working with the VA01 upload program.
when i am uploading the multiple line items i am getting the error.
i resoved the error and successfully upload the data for 3 line items.
when i am upload the data for 10line items it was showing the error as the screen field doesn't exists.
here i am attaching the logic
DATA: V_MABNR(20) TYPE C,
V_KWMENG(20) TYPE C,
V_KBETR(20) TYPE C,
VAL(03) TYPE N VALUE 01.
include bdcrecx1.
start-of-selection.
perform open_group.
LOOP AT IT_FINAL INTO WA_FINAL.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR' 'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'VBAK-AUART' WA_FINAL-AUART."'OR'.
perform bdc_field using 'VBAK-VKORG' WA_FINAL-VKORG."'1000'.
perform bdc_field using 'VBAK-VTWEG' WA_FINAL-VTWEG."'12'.
perform bdc_field using 'VBAK-SPART' WA_FINAL-SPART."'00'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'BDC_CURSOR' 'VBKD-BSTDK'.
perform bdc_field using 'VBKD-BSTKD' WA_FINAL-BSTKD."'PO TEST'.
perform bdc_field using 'VBKD-BSTDK' WA_FINAL-BSTDK."'03.02.2012'.
perform bdc_field using 'KUAGV-KUNNR' WA_FINAL-KUNAG." '1033'.
perform bdc_field using 'KUWEV-KUNNR' WA_FINAL-KUNWE." '1033'.
LOOP AT IT_FINAL1 INTO WA_FINAL1.
CONCATENATE 'RV45A-MABNR(' '0' VAL ')' INTO V_MABNR.
CONCATENATE 'RV45A-KWMENG(' '0' VAL ')' INTO V_KWMENG.
CONCATENATE 'KOMV-KBETR(' '0' VAL ')' INTO V_KBETR.
perform bdc_field using 'BDC_CURSOR' V_KBETR."v_kwmeng.
perform bdc_field using v_mabnr WA_FINAL1-MATNR."wa_item-matnr.
perform bdc_field using v_kwmeng WA_FINAL1-KWMENG."wa_item-kwmeng.
perform bdc_field using v_kbetr WA_FINAL1-KBETR."wa_item-kwmeng.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '/00'.
VAL = VAL + 1.
endloop.
*VAL = 01.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '=SICH'.
ENDLOOP.
perform bdc_transaction using 'VA01'.
perform close_group.
i searched in SDN i found a lot of links but i can't find the proper document.
can any one explain me clearly about adding the N line items and screen resolution logic.
Thanks,
karunakarHi,
For screen resolution logic, you can pass the value 'X' into the variable CTU_PARAMS-DEFSIZE in the OPTIONS parameter of CALL TRANSACTION using BDC DATA.
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
OPTIONS FROM OPT
MESSAGES INTO MESSTAB.
DEFSIZE - Selects whether the screens of the called transaction are displayed in the standard screen size. Values: "X" (standard size), " " (current size). -
Table control line selection issue
HI im facing a problem in table control.
I have a table control with selection column ( single ).
First time when i select a row its is marked X in the internal table,
Now again when i select another row .. The old row still holds the value X and the new row is gettign marked as X.
The problem here is the old selection is not getting cleared in the internal table.
This is the statement used in PAI
MODIFY gt_header INDEX tbl_header-current_line FROM wa_header .
Here the previous value is not getting cleared.KSD,
During PAI Loop, the screen flow logic loops only through the visible table control lines. In your case, the user has scrolled down and seeing line 30 to 40 (say for example) after selecting a line in first page view. This is very common with any table control.
Now user is viewing 1 to 10 lines of the TC and have selected 3rd line. User then scrolls down by pressing page-down - now PAI is triggered and the internal table's 3rd line is modified with MARK='X'. User then views lines 30 to 40 and selects 33rd line. Now table control will automatically clear the MARK in 3rd line in the Table Control only. But it is the responsibility of the developer written code to clear the same in the Internal Table.
So within PAI Table Loop, you have to check the MARK which is coming from Screen to ABAP program every-time and if it is 'X', you have to clear any other line's MARK. Remeber you should not do this for multi-select. There is an attribute of the table control LINE_SEL_MODE. The above logic of clearing other lines' MARK should be implemented only after checking this attribute.
So incidentally your solution was the appropriate one.
Cheers,
Suresh -
Hi,
I have a table control. How to get the index of the row selected in the table control?
Please help. Very urgent
ThanksHi Kushaal Choudri,
Procedure for Table control line selection and modifying master table using
those values.
1).
U should take one variable in your internal table or in structure which
is used for table control fields
ex :
data :begin of itab occurs 0 ,
mark type c ,
matnr like mara-matnr ,
matkl like mara-matkl,
maktx like makt-maktx,
end of itab .
Controls: TABC types TABLEVIEW using screen 100.
2).
This mark variable should be given in Table control properties.
follow the path
double click on the table control-->attributes .->select
w/SelColumn and in that itab-mark. Check in the figure.
[http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
3).
After that. Take this example.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB WITH CONTROL tabc
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
LOOP AT ITAB.
Module read_table_control.
ENDLOOP.
module user_command_0100.
==============================
In this Module read_table_control, You should write the following code
MODULE read_table_control INPUT.
MODIFY itab INDEX tabc-current_line."( This will update the ITAB table MARK field with 'X ' whatever we have selected on table control.)
ENDMODULE.
4)
If you want to Delete some of the records from Table control
follow this code u2026Create one pushbutton and give Fucnction code to that
and write below code
WHEN 'DELETE'.
LOOP AT itab WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDCASE.
I hope that it helps u .
Regards,
Venkat.O -
Possible to code a Find/Find Next feature for use inside a Table Control
Hello,
I have a Table Control that displays many lines. Is it possible to code a Find/Find Next feature that would allow the user to enter a 'keyword' then search each line of the Table Control for existing matches?
I have provided the user with various Selection Criteria that will filter the table control results, but there are still too many lines to visually scan for the desired result.
I am guessing that I would place an input box and a 'Find' button onto my layout screen. Then in user command, I have to scroll through each line of the table control and check every value to see if the string contains 'keyword' When found, stop and display table control assigning current line as Top line?
Am I on the right track or is there a better solution already?
Kind Regards,
MPerssonI've done that. It works pretty well. You might want to allow the user to search only in selected column(s) as well.
Rob -
How to transfer the contents of a line of a table control to second screen?
Hi,
I have a table control and I have entered some contents in one line of a table control .
When i click on this line and then click on the detail button on the screen , it should take me to another screen and whatever I have entered in the table control should be transferred to the second screen .
Please could anyone help me out with this .
Regards,
Sushanth H.S.Hi
U need to get the index of the line of table control by command GET CURSOR:
PROCESS PAI.
LOOP AT ITAB.
MODULE GET_CURSOR.
MODULE MODIFY_ITAB.
ENDLOOP.
MODULE USER_COMMAND.
Module to pick up the selected line:
MODULE GET_CURSOR.
GET CURSOR LINE VN_LINE.
ENDMODULE.
Module to transfer the data from table control to internal table:
MODULE MODIFY_ITAB.
ITAB-FIELD1 = <FIELD OF TABLE CONTROL>.
MODIFY ITAB INDEX <TABLE CONTROL>-CURRENT_LINE.
ENDMODULE.
U should considere the variable line has the value of the index of the line of table control, so u need to calculate the number of the corresponding line of internal table:
MODULE USER_COMMAND.
CASE OK_CODE.
WHEN 'DETAIL'.
* Calculate the line of internal table:
VN_LINE = <TABLE CONTROL>-TOP_LINE + VN_LINE - 1.
* Read the data
READ TABLE ITAB INDEX VN_LINE.
* Transfer the data to the output structure of the new screen
<STRUCTURE>-FIELD1 = ITAB-FIELD1.
* Call the new screen
SET SCREEN <NEW SCREEN>.
LEAVE SCREEN.
Max -
Table control and a selection screen
Hi,
I have a requirement where I am supposed to be designing a screen that has a table control with fields
w/selection column label 1(non-editable) i/o field(from) i/o field(to)
w/selection column label 2(non-editable) i/o field(from) i/o field(to)
On searching the forum threads, I found related threads as to how to implement a selection screen (as the I/O fields are similar to select-options) in module pool programming. But mine requires the use of table control and a kind of selection screen embedded into it. Please guide me through this requirement.Hi
If you need to implement a table control on selection screen u need to use a tabstrip as graphic element supports the table control.
So
1 - Step: define a tabstrip with 1 tab only:
SELECTION-SCREEN BEGIN OF BLOCK 3.
SELECTION-SCREEN BEGIN OF TABBED BLOCK MAX FOR 22 LINES.
SELECTION-SCREEN TAB (25) TABS1 USER-COMMAND UCOMM1
DEFAULT SCREEN 100.
SELECTION-SCREEN END OF BLOCK MAX.
SELECTION-SCREEN END OF BLOCK 3.
2 - Step design the subscreen (in my sample the dynrpo 100) and insert the table control there:
PROCESS BEFORE OUTPUT.
MODULE INIT_CTRL.
LOOP WITH CONTROL T_CTRL.
MODULE DISPLAY_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL T_CTRL.
MODULE UPDATE_DATA.
ENDLOOP.
In the module DISPLAY_DATA and UPDATE_DATA u need to implement the code to transfer the data from internal table to table control and from table control to internal table, in order to display and update the data.
Max -
Selecting rows in table control
Hi experts,
I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
regards,
sriram.By,
Using the Get cursor syntax you can achive the Selected row in Table control.
DATA : selrow TYPE i,
selindex TYPE i .
* getting the cursor line in Table Control for selected row
GET CURSOR FIELD selfield LINE selrow.
selindex = <tablecontrol>-top_line + selrow - 1.
Prabhu
Maybe you are looking for
-
I noticed after my two updates, that my iPod gets weird after every single one. For example, it was perfectly fine when I bought it and then, I updated iTunes. Then, my iPod starts acting like a TV screen and has lines show up every so often to make
-
Getting "Express Document Update was terminated" while creating BP..
HI All I am creating Business Partner using HR Pernr using following BAPI's. 1. BUPA_CREATE_FROM_DATA - To create BP. 2. BUPA_ADDRESS_ADD - To create address.. 3. BUPA_ROLE_ADD_2 - To create role. 4. BUPR_RELATIONSHIP_CREATE - To create relations
-
From Word DOC to Acrobat PDF... borders and lines get screwed up.
I've been looking this up for days now and have yet to find a solution. I have a MS Word document that has a bunch of tables with borders and sometimes just text with borders for stylistic reasons. In Word, it all looks perfect. But, when I convert i
-
Table to check status(active or inactive) of objects?
Hi All, what is the table name, which contains the status of objects. I want to check all the objects(pgms, tables, classes, FM etc) of server, if they are active or not? Thanks santosh.
-
Building animation previews for Presets
There's a helpful preview animated GIF that shows up in Bridge when I select a preset that shipped with AE. How can I build my own preview animation for 3rd party and custom made presets?