Reading selected data in the table control
Hi Friends,
I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
Actually user requirement is he has to update only the selected data from the displayed data in the table control.
Can any one tell me how to read the selected records after displaying in the table control.
Thanx in advance,
Line
Hi
If your table control has a check box, your internal table should have a field for it. Its value will be X if the checkbox is setted else it'll be SPACE.
So in the PAI u should read only the records where that flag is X:
LOOP AT ITAB WHERE MARK = 'X'.
ENDLOOP.
Max
Similar Messages
-
Selecting data in the table control
Hi Friends,
I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
Actually user requirement is he has to update only the selected data from the displayed data in the table control.
Can any one tell me how to read the selected records after displaying in the table control.
Thanx in advance,
LineHello Line,
As gopi has suggested do the following..
for the table control properties u have an option called W/SelColumn.
Give in some name (ROW_SEL)to that and also include a field CHK in the internal which is being passed to the table control.
and in the PAI of the table control module wirte like this...
Then in your code..
PROCESS BEFORE OUTPUT.
PBO FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
MODULE TABCONTROL_CHANGE_TC_ATTR.
MODULE TABCONTROL_CHANGE_COL_ATTR.
LOOP AT lt_final
INTO lw_final
WITH CONTROL tabcontrol
CURSOR tabcontrol-current_line.
MODULE tabcontrol_get_lines.
MODULE TABCONTROL_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE status_0101.
PROCESS AFTER INPUT.
PAI FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
LOOP AT lt_final.
MODULE read_data.
MODULE tabcontrol_user_command.
ENDLOOP.
MODULE TABCONTROL_CHANGE_TC_ATTR.
MODULE TABCONTROL_CHANGE_COL_ATTR.
MODULE user_command_0101.
MODULE tabcontrol_user_command input.
if lt_final-chek = 'X'.
*put your logic here something like
move corresponding lt_final to gt_final.
*now you have selcted rows data in gt_final.
endif.
endmodule.
Regards -
How to delete select data in the table control
this problem makes me headache.
I am new to labview, when a table shows some data. many rows and column. how can delete on row which I selected. the other rows are remain no change.
I really need help.thanks in advance. It is better to attach the program.my labview is 2009
Solved!
Go to Solution.Hi,
You can do it with a table control as well. Check out the attached VI. To delete a row, Run the VI, just right click the row and click "Delete Row". To get back the default values, click reinitialize.
Reards,
NitZ
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved)
Attachments:
Untitled 3.vi 8 KB -
How to modify and save the data in the table control
how to modify and save the data in the table control
hi priya,
kindly go thru the code below.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_cancel AT EXIT-COMMAND.
LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.
MODULE move_data_to_table OUTPUT.
This is to move the data from the internal table to *the table control
*zmpets_mode-modecode, zmpets_range-rangeid, *zmpets_servfacto-factor are field names of the table *control columns.
READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.
ENDMODULE. " move_data_to_table OUTPUT
**********************************************8888
MODULE move_data_from_table INPUT.
*To move the data from the table control to internal *table 'INT_FACTOR'.
int_factor-chk = line.
int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0.
APPEND int_factor.
CLEAR int_factor.
ENDIF.
ENDMODULE. " move_data_from_table INPUT
if this helps , kindly award points.
for any clarification just mail me.
regards,
Anversha.S
[email protected] -
How to validate the dates in the table control ?
How to validate the dates in the table control ?
Can I write like this ?
LOOP AT it_tab .
CHAIN.
FIELD : it_tab-strtdat,it_tab-enddat.
module date_validation.
ENDCHAIN.
ENDLOOP.
Module Date_validation.
ranges : vdat type sy-datum.
vdat-sign = 'I'.
VDAT-LOW = it_tab-STRTDAT.
VDAT-HIGH = it_tab-ENDDAT.
VDAT-OPTION = 'BT'.
APPEND VDAT.
WHAT CODE I have to write here to validate ?
and If I write like this How can we know which is the current row being add ?
It loops total internal table ..?
Bye,
Muttu.Hi,
I think there is no need to put chain endchain.
To do validation you have to write module in PAI which does required validations.
Thanks
DARSHAN PATEL -
How to find out the selected line in the table control
Hi Guys,
i have a requirement like this. i have table control and the internal table for that table control as IT_CASE. this internal table i declared as CHECKBX, MATNR, QUANTITY. but when i am enter the values in the table control i am getting the values in MATNR and QUANTITY in the that internal table IT_CASE. but when iam selecting that that line iam not getting CHECKBOX as 'X' in that internal table IT_CASE. i declared the table control as CAS_CONTROL and in that i have given the "w/selcolum" property as IT_CASE-CHECKBOX. now i want to fill that CHECKBOX as 'X' inthat internal table IT_CASE whatever the lines we are selecting only for those lines i want to fill up as 'X' in that internal table.
Can you please suggest any one reg this.
Thanks in advance
RahulHello body,
You can give a name such as 'SEL' in w/selcol and declare SEL as char1. Then follow the coading.
in TOP.
data: sel type c.
PROCESS AFTER INPUT.
user_command_0011.
loop at <Your internal table>.
module get_data.
endloop.
Inside Module get_data.
if sy-ucomm = <Your Fcode>
if sel = 'X'.
<Your internal table>-<Field for checkbox> = 'X'.
append <Your internal table>.
endif.
endif.
I think your issue is resolved.
Regards.
S Mahanta. -
Copy selected lines in the table control
Hi friends,
I Have a screen 200 in which i have a button COPY and table control.
In my table control i have 6 lines of data.
now my requirement is when i select any lines ie : let us say i ahve selected 1 , 3 , 5 lines of my table control and when i click on the button COPY of that screen. i need those 3 selected lines 1 , 3 , 5 to be copied again in the table control
example :
line 1 selected
line2
line3 selected
line4
line5 selected .
line6
now my table control should be
line1
line2
line3
line4
line5
line6
line1
line3
line5
How can i do that
Regards
Priyanka.I have similar issue...i need help how to accomplish automatic addition on every line. example (see below)
this is how it looks right now
DATE EMPLOYEE DEPT JOB LOT OPER# LX_HRS OP_SETUP LX_TYPE COMPLETE
2/23/2009 M.Paquiao NB 1960 001 10 1.50 14.00 S NO
2/24/2009 1.00 14.00 S NO
2/25/2009 4.50 14.00 S NO
2/27/2009 3.00 14.00 S NO
2/28/2009 1.50 14.00 R YES
3/1/2009 2.00 14.00 R YES
this what I need it to do when I meant automatic addition of each line:
DATE EMPLOYEE DEPT JOB LOT OPER# LX_HRS OP_SETUP LX_TYPE COMPLETE
2/23/2009 M.Paquiao NB 1960 001 10 1.50 14.00 S NO
2/24/2009 2.50 14.00 S NO
2/25/2009 7.00 14.00 S NO
2/27/2009 10.00 14.00 S NO
2/28/2009 11.50 14.00 R YES
3/1/2009 13.50 14.00 R YES
As you can see everything is the same but on column LX_HRS, the first example one is not doing anything addition but on the second example is now doing addition. This additions were done manually, how can I tell crystal to add each line, in the example above, the
first example second example: (addition is involved)
date lx_hrs date lx_hrs
2/23/09 1.50 2/23/09 1.50
2/24/09 1.00 2/24/09 2.50 (sum of : 1.50 + 1.00 was added)
2/25/09 4.50 2/25/09 7.00 (sum of 2.50 (on date 2/24/09 & 4.50 from date 2/25/09 of the first example). -
How to freeze the selection column in the table control of the module pool.
hi ,
in my module pool there is a row selection field <b>w/selcolumn</b> of the table control called as mark.
how to freeze the selection column where there is no record in the table control row.
or in other words where wa is initial.
thanks
ektaHi all,
in the PBO of the screen the following code is written.
say the selection column is MARK and is declared in the data as well.
thanks
ekta
*************************C O D E **************************************************
MODULE disp_tabctrl1 OUTPUT.
IF flag_c = 1.
READ TABLE it_create_data INTO wa_material_data
INDEX tab_ctrl1-current_line.
ELSE.
READ TABLE it_material_data INTO wa_material_data
INDEX tab_ctrl1-current_line.
IF sy-subrc = 0.
IF ok_code_0101 = '&SEL1'.
mark = 'X'.
ELSEIF ok_code_0101 = '&DSEL'.
mark = ' '.
ENDIF.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'MARK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
index_t = tab_ctrl1-top_line.
index_d = tab_ctrl1-top_line + n.
ENDMODULE. " DISP_TABCTRL1 OUTPUT -
Modify data in the table control
hello:
i would like to ask a favor , i am working with a table control (it already has the information i need) all the fields all my table control are present in output form only, but i need when the user press a pushbutton to modify a specific data one of the cell of the table control permit to be change.
my output is:
field1 field2 field3 (only output )
if the user press the button 'CHANGE DATA' it will be present as
field1 field2 fiel3(ready to recibe new data ).
but i don´t know how to do it, if somebody knows how to do it
thanks a lot.this will be your's main program
*& Report ZEMP
REPORT ZEMP.
TABLES: ZEMP." Z TABLE
CONTROLS: TAB_CONTROL TYPE TABLEVIEW USING SCREEN 1000.
DATA: IT LIKE ZEMP OCCURS 0 WITH HEADER LINE.
SELECT * FROM ZEMP INTO CORRESPONDING FIELDS OF TABLE IT.
CALL SCREEN 1000.
*& Module STATUS_1000 OUTPUT
text
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
IF SY-UCOMM = 'BACK'.
LEAVE PROGRAM.
endif.
ENDMODULE. " USER_COMMAND_1000 INPUT
*& Module MODIFY INPUT
text
MODULE MODIFY INPUT.
MODIFY IT INDEX TAB_CONTROL-CURRENT_LINE.
MODIFY ZEMP FROM IT.
ENDMODULE. " MODIFY INPUT
and this should be your flow logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
LOOP AT IT WITH CONTROL TAB_CONTROL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
LOOP AT IT.
MODULE MODIFY.
ENDLOOP.
Regards
Prakash Varun -
Selecting records in the table control
Hi Friends,
I have the requirement to be displayed in the table control, I got the data displayed in the table control. Now I need to select some of the records from the table control and update in the database. When I am trying to do that i am able to select only one records instead of some number of records. When I try to select the second record the first record which i selected is being unselected. Can any one tell me how to select more than one record in the table control.
Regards,
Linehello,
to select more then 1 record
1> you need to put CHECK BOX FEILD
or
1> you have to manually use control and select the feilds.
hope i have replied to your query
thankx
bhanu malik -
hi,
can any one tell me how we code to get the selected line in the display table
thanks.Hi ,
1.Just select a row of table and click on button to read the value of selected row.
2. In the OnAction of button, just read the context node binded to the table using Code wizard(Control + F7).
3. below menttioned code will be automatically genearated and selected value's content will be stored in ls_cn_flight :
DATA lo_nd_cn_flight TYPE REF TO if_wd_context_node.
DATA lo_el_cn_flight TYPE REF TO if_wd_context_element.
DATA ls_cn_flight TYPE wd_this->element_cn_flight.
* navigate from <CONTEXT> to <CN_FLIGHT> via lead selection
lo_nd_cn_flight = wd_context->get_child_node( name = wd_this->wdctx_cn_flight ).
* get element via lead selection
lo_el_cn_flight = lo_nd_cn_flight->get_element( ).
* get all declared attributes
lo_el_cn_flight->get_static_attributes(
IMPORTING
static_attributes = ls_cn_flight ).
CN_FLIGHT is the node binded with table. -
Changing data in the table control during run time of transaction F-28
Dear Experts,
in transaction F-28 of second screen of second column (Field Name: Assignment) currently the data is getting from BSEG table and populating this column of table control, now I have a requirement that the data should be get from the other ZTABLE and populate this column during run time instead of the data from BSEG table, please let me know your suggestions, if you guys feel it will be done using User Exit then please let me know the suitable exit for this.
Best Regards
VenkatHi Venkat,
Use the appropriate sort key in the GL to fill up the assignment field automatically.
U can create ur new sort key through OB16
Regards,
Kiran -
Variant for selection screen with the Table control entries in another Tab
Hi Guys,
The requirement is to create a variant for the two tabs on a selection screen.
First tab contains the select options and the second contains table control for making entries.
So will it be possible to create a variant when the user makes entries in the fields in one tab and the table on other tab?You wrote
Utilizing the "Save as variant" option from the selection screen itself works out perfectly, but this variant cannot be transported.
But, give the variant a name beginning with "CUS&" and this variant will be transported. Variant beginning with "CUS&" or "SAP&" are so-called "system variant" and are transported automatically. You can then copy the transaction code and use this new variant in the new transaction.
Regards,
Raymond -
Hi,
May I know how to achieve the above ? Please enlighten me.
TIA !So you want users to be able to see the name of the table, but not the definition? I am afraid that this is not possible. You can give users access to a table and hide the definition, but the name is considered part of the definition.
Olaf mentioned VIEW DEFINITION. What he did not say is that when you have SELECT permission (or EXECUTE permission on a stored procedure), the permission VIEW DEFINITION is implied by the stronger permission. For this reason you need to explicitly DENY this
permission as shown in the script below.
In the script I create a user without a login and then impersonate a user. This is an excellent way to test permissions.
[sql]
CREATE TABLE tabbe (a int NOT NULL)
go
CREATE USER usse WITHOUT LOGIN
go
GRANT SELECT ON tabbe TO usse
DENY VIEW DEFINITION ON tabbe TO usse
go
EXECUTE AS USER = 'usse'
go
SELECT * FROM tabbe
go
SELECT name FROM sys.objects WHERE type = 'U'
EXEC sp_help tabbe
go
REVERT
go
DROP USER usse
DROP TABLE tabbe
{/sql]
Note: rather than denying VIEW DEFINITION on an individual object you can leave out "ON tabbe" to deny the permission across the database.
Erland Sommarskog, SQL Server MVP, [email protected] -
Issue while vertical scrolling in the table control
Hi,
i have my table control which can show 14 entries at a time. and i have almost 100 entries in table control.
now if i selected 2 entries in the visible part.
now scroll vertically.
again come back to see the selected records now they are unselected.
please respond soon.
Thanks
MalyaHi,
I have redone the scenario and follow the steps it will work....
STEP 1: Create an internal table with field for selection in table.
STEP 2: Assign the selection field in the table control for the line selection.
STEP 3: Now whenever the line is selected, the selection field will have a field 'X'.
STEP 4: In PAI Modify the table fields those are selected with 'X'.
STEP 5: Set a flag in PAI, flag = 'X'.
STEP 6: In PBO set a condition . " We set a flag so that we fetch the data only once.
If flag NE 'X'.
Fetch data.
endif.
Data:
begin of ztable,
ID type char4,
Name type char30,
Sel type c,
end of ztable.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB INTO FS WITH CONTROL EMP CURSOR W_I.
MODULE UPDATE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE APPEND.
ENDLOOP.
MODULE USER_COMMAND_0100.
INCLUDE YMODTOP . " global Data
*& Module UPDATE OUTPUT
* text
MODULE UPDATE OUTPUT.
MOVE FS TO FS.
ENDMODULE. " UPDATE OUTPUT
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
IF FL_FLAG <> 1.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module append INPUT
* text
MODULE APPEND INPUT.
MODIFY ITAB INDEX SY-STEPL FROM FS TRANSPORTING SEL .
FL_FLAG = 1.
ENDMODULE.
Thanks&Regards
Sarves
Maybe you are looking for
-
Change over from Apex to Application Express
When I connect to Oracle 10G XE I use the following URL: http://127.0.0.1:8087/apex/f?p=4550:11:73807998927860::NO::: Now I have downlaoded Oracle Application Express. How do I use it with my existing data on 10G XE? Do I need to have 11g? Thanks Edi
-
Finding corodonates of a color.
hi what i am trying to do is find the coridanates of anywhere there is the color red and save this in 2 variables. one for the corodanets of the color on the x axis and one of the corordonates on the y axis. if anyone knows how please let me know an
-
How Journal Import groups records from GL_INTERFACE into Journal Headers
Hello, Does anyone know how or using what criteria the Journal Import program groups records from the GL_INTERFACE into Journal Entries? The R12 User Guide says that : REFERENCE4 (Journal entry name): Enter a journal entry name for your journal entry
-
XML content parsed incorrectly
Hello, Using HTTPService I read in an XML file containing hexadecimal values. However, it seems like Flex is trying to convert those to numbers. Now it doesn't throw an error, but in case of a value like '660528E7' it is turned into '6605280000000',
-
RECOVERY SOFTWARE...lack of
What is the issue about recovery software.?..I've been coming back weekly for about a month. Why can't a big company like Toshiba include system software disks with their computers? wonderer Solved! Go to Solution.