Data disappear in table control when hiting Enter
Dear Expert, Please help Me.
I have Made one Table Control, For this First of all i Defined data in top page like this:
data: begin of iloc occurs 10,
lnsl,
lgort like mseg-lgort,
end of iloc.
data:wloc like iloc.
controls: stoloc type TABLEVIEW USING SCREEN 1001.
and I have Also made table control in screen 1001,
But now my Problem is Whenever i entered data and hitting Enter it disappears data which i entered at screen during Execution.
While Debugging I have seen it is not modifying internal table from Work area, Please have a look.
PROCESS BEFORE OUTPUT.
loop AT iloc WITH CONTROL stoloc CURSOR stoloc-top_line.
MODULE display_loc.
endloop.
PROCESS AFTER INPUT.
loop at iloc.
chain.
field wloc-lnsl.
field wloc-lgort.
module disp_loc on CHAIN-REQUEST.
endchain.
endloop.
MODULE DISP_LOC INPUT.
select single * from T001L where LGORT = wloc-lgort.
if sy-subrc = 0 .
modify iloc from wloc index stoloc-current_line. "this modify is not working, Please Tell me the Reason.
stoloc-top_line = 1.
else.
MESSAGE w000(zexi) with wloc-lgort 'not maintained in Master data'.
endif.
ENDMODULE.
Hi SM,
try to use loop....
Thnx
RK
Edited by: Rahul Keshav on Oct 22, 2009 3:05 PM
Similar Messages
-
I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
What is the best way to do it without increasing overheads?This view works:
SELECT
i.IDNO,i.[Date],i.[Level]
FROM
mytable i
INNER
JOIN mytable
d
ON
d.IDNO
= i.IDNO-1
WHERE
i.[Level]
<> d.[Level]
on this mytable below. A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable). mytable below
should give 3 lines. The IDNO is an identity column.
IDNO
Item
Date
Level
1
X24
12/23/13 10:41
22996
2
X24
12/23/13 10:41
22996
3
X24
12/23/13 9:21
23256
4
X24
12/23/13 9:21
23256
5
X24
12/23/13 9:22
23256
6
X24
12/23/13 9:22
23256
7
X24
12/23/13 9:22
22916 -
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 -
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,
LineHi
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 -
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 -
Is it possible to assign user-defined data elements to table control?
Hi SDN,
Is it possible to assign a user defined data element other than basic data types in table control column.Hi Suresh,
In Screen layout,In element list tab,i am not able to give the user-defined data types other than basic data types?please tell me how to give other data types -
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 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 can I highlight the default data in a numeric control when a VI loads.
I have a VI that features a string constant that asks for a numeric response via a numeric control, a "next" button that enters the data (controlled by the enter key), and two leds, one that lights if the data entered is correct, and one that lights if the data entered is incorrect. Is there anyway that I can make sure that when this VI loads, the zero in the numeric control is highlighted?
Currently the opeator must use the mouse to highlight the zero in the numeric control, type the number and press enter ("next") to advance in the program. I want the operator to be able to simply type the number after the VI loads and press enter. This would require the zero to be highlighted when the VI loads.
Is there anyway that I can format the numeric control to do this?If you set the key focus of the control to true (Right click on
control->Create->Property Node, then on the property node, select
"Key Focus") before anything else, it should be highlighted when you
run the program. -
Module pool transfer of data from one table control to another
Hi all,
I have been assigned to module pool object wherein i have to display table control on screen and that table control contains only 10 rows on screen for display. Now my internal table it_out has 15 rows
Describe table it_out
line v_l. " v_l = 15.
There is a pushbutton below table control and when i select multiple rows and click on that pushbutton it will navigate me to the next screen containing another table control on which i need to display those selected records.
Now the problem is that when i select first record and move cursor down to select last record then i am seeing only last record on next screen table control. why is it happening? please provide me with solution. For rest of cases it is working fine for example if i select first record and second record then i am seeing both these selected records on next screen table control . Only the problem arises when i tried to select first and lets say last record when scrolling down on table control.
I think the problem is with scrolling but when i loop on next screen with moved records i am seeing that 2 records are their but it is transferring only one record to next screen not the last one.
Your response is highly appreciated.
Thanks
ParagHi Parag,
Screen 8002 (with table control) --> select records --> press a button --> move to screen 8003 --> display selected records in screen 8002.
First problem that if you select first record in table control and scroll to end to select the last record, the first record in deselected.
Next problem, that if you select say 3 records in table control you want the to be displayed in another table control, the use this code.
Also take another internal table and work area same as the initial internal table and work area used in screen 8002.
On screen 8002, take a button with function code 'PROCESS', on which user clicks the screen 8003 should display selected records.
Now, use this code, its working:-
Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
You must have passed a code in PBO of the screen for reading internal table into the table control.
So it reads the internal table into the table control whenever you perform any action on use command.
All you need to do is to write a code to modify the internal table form the table control while performing any user action.
Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
At Screen Logic:-
PROCESS BEFORE OUTPUT.
MODULE status_8002. "for pf-status
LOOP WITH CONTROL po_tab. "po_tab is name of table control
MODULE pass_data. "to pass data into table control from internal table
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_8002. "to handle other user commands (back and exit)
LOOP WITH CONTROL po_tab. "po_tab is name of table control
MODULE modify_data. "to modify data from table control into internal table
MODULE process_data. "to display selected records on another screen
ENDLOOP.
In PBO,
*& Module STATUS_8002 OUTPUT
MODULE status_8002 OUTPUT.
SET pf-status 'ZAB_PFSTA'. " pf-status
DATA : line_count TYPE i.
DESCIRBE TABLE it_ekpo
LINES line_count.
po_tab-lines = line_count + 10.
" to make table control scrollable
ENDMODULE. " STATUS_8002 OUTPUT
*& Module PASS_DATA OUTPUT
MODULE pass_data OUTPUT.
READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE. " PASS_DATA OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
"modify records from table control into the internal table
ENDMODULE. " MODIFY_DATA INPUT
*& Module PROCESS_DATA INPUT
MODULE PROCESS_DATA INPUT.
CASE sy-ucomm.
WHEN 'PROCESS'.
IF wa_ekpo-flag = 'X'.
wa_ekpo1 = wa_ekpo.
APPEND wa_ekpo1 TO it_ekpo1. "if record selected move to another internal table
ENDIF.
ENDCASE.
"modify records from table control into the internal table
ENDMODULE. " PROCESS_DATA INPUT
Now if you select some records in this table control the values will retain in internal table.
Screen 8003 with selected records to be displayed in another table control.
At Screen Logic:-
PROCESS BEFORE OUTPUT.
MODULE status_8003. "for pf-status
LOOP WITH CONTROL po_tb. "po_tb is name of table control
MODULE pass_data1. "to pass data into table control from internal table
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_8003. "to handle other user commands (back and exit)
LOOP WITH CONTROL po_tb. "po_tb is name of table control
MODULE modify_data1. "to modify data from table control into internal table
ENDLOOP.
In PBO,
*& Module STATUS_8003 OUTPUT
MODULE status_8003 OUTPUT.
SET pf-status 'ZAB_PFSTA'. " pf-status
DATA : line_count1 TYPE i.
DESCIRBE TABLE it_ekpo1
LINES line_count1.
po_tb-lines = line_count1 + 10.
" to make table control scrollable
ENDMODULE. " STATUS_8003 OUTPUT
*& Module PASS_DATA1 OUTPUT
MODULE pass_data1 OUTPUT.
READ TABLE it_ekpo1 into wa_ekpo1 INDEX po_tb-current_line.
ENDMODULE. " PASS_DATA1 OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*& Module MODIFY_DATA1 INPUT
MODULE MODIFY_DATA1 INPUT.
MODIFY IT_EKPO1 INDEX PO_TB-CURRENT_LINE FROM WA_EKPO1.
"modify records from table control into the internal table
ENDMODULE. " MODIFY_DATA1 INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
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 -
Problem with the date field in Table Control
I have created a table control in my module programming. One of the column in the table control is a date field which is I/O field.
Now if I enter a value in date field column and hit enter the date field is reset. I dont want the field to get reset and accept valid date field.
I have set type of the column as DATS and I havent used any dictionary fields. The column is from the internal table in the program.
Please suggestIn your PAI, in the LOOP AT <itab> did you
- check date validity
- update internal table
* Sample
LOOP AT itab.
FIELD itab-field MODULE checkfield.
MODULE updateitab.
ENDLOOP.
Look also at SAP documentation like [Table Controls|http://help.sap.com/abapdocu/en/ABENTABLE_CONTROL1_ABEXA.htm] or [Table Controls in ABAP Programs|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm]
Regards,
Raymond -
Multiple times Data showing in table control
Hi,
In my pop uo i am having a search input field and a table control for diaplaying search data .
But each time i enter the search button,it shows the same data again and it's getting overlapped back to back .
Means the same no of rows (suppose 20)are displayed one after other .It becomes 40,60 so on .
Can anybody tell me how to resolve this issue .
Thanks a lot .Hi
Please make sure that Is there any logic being implemented in WD MODIFY VIEW of view controller.
If yes that may be the cause of your problem because WDModifyView() is being called every time u perform an action.
or
Try to Invalidate current context node which is bound to table UI element and actually containing data at run time. I think this node is not being refreshed. Try to refresh it in Search Button action.
or
Check your loop code snippet, if you implemented it anywhere.
Mandeep Virk -
Add fields to CAT2 data entry area table control
Hi All,
I have a requirement where in I need to add a column after every day ( Moday , Tuesday.. ) in CAT2 to enable the user to enter short text description for the time entry accountabiity. For this I will have to add 7 additional columns to the table control of the data entry area one beside each day. The description entered by the user should be updated in the database.
I am thinking of using screen exit CATS0012. But not very sure how to go about it.
Pls help.
Thanks in Advance.
Regards,
JoshiThanks Ankush. I am going for the CATS0005 option. I have created a customer project TSHEET within an existing PS package on the system. The system prompted me to obtain a transport number which I guess will attach the new project to the package in future.
Could you advise further on how to do this in practise? My instructions say 'on the initial project administration screen select the Enhancement components field and choose Change. In fact there appear to be 2 options - either Components or Enhancements assignement. If I choose Enhancements assignment I am prompted to enter the name of an exit. I entered CATS0005 as I have to bring this into the customer project somehow. Within package MY_CATS_INTERFACE appeared however CATS0005 was not recognised within this package. Likewise CI_CATSDB was not recognised.
Any advise useful
Thanks
Rachel -
Data in the table changes when multiple users try to submit data
I have a dynamic table. The table is created in the wdDoModifyView. The user can load data into the table from an excel file. So I have a "Load" button that loads the data from the selected excel file to the table. I also have a "Submit" button. This "Submit" button converts the data to an xml file and make a call to an oracle stored procedure for validation check. If there's an error it will be returned and displayed to the user. If none, a summary of data for posting will be displayed to the user. If the data is correct and the user hit the ok button, the same data will be return to oracle sp for loading in the table.
The problem we encountered is when multiple users are loading and submitting at the same time, the data displayed in the dynamic tables changes after clicking the ok button. It is as if, the table displays the data being loaded by other user.
This is an error that is difficult to recreate. This doesn't happen all the time. I hope you somebody could enlighten me why this is happening. I'm not sure if it has something to do with multithreading or session.
Edited by: Marlyn Agco on Apr 14, 2009 3:57 PMHi Armin,
Did you mean storing view instances in static references and accessing them outside the wdDoModifyView is not a good idea? In wdDoInit the nodes are dynamically created according to the xml file being returned by the database. This node is stored in a static variable which is also used in wdDoModifyView to create the dynamic table.
What do you suggest? We're still encountering same issue when multiple users are uploading data.
Maybe you are looking for
-
Visual Studio's Emulator for Android is not working or either showing in Hyper-V
I installed the VS 2015 CTP with Cordova tools and Have already installed the Xamarin .... But the Android emulator is not showing in the Hyper-v or dosn't start up. But i just check the Programmes i have installed its there in the list. I have enabl
-
Advanced Pricing:Fetching Price from Price Break List
Hi All, We have a requirement where we have to fetch the price for Items from a Price Break list using Pricing Engine. For this we did following setup. 1) We created a Price List for list of Items and it price list is defined there 2) Then we created
-
Blackberry Protect - Delete data command executed on new Z10 and not lost Z10
My BB Z10 was stolen and somebody took the battery off immediately. I executed command to display message and delete data using blackberry protect. Command will be executed whenever the thief turns phone on. Afterwards, I restored data from blackberr
-
I don't know how to resolve this .
I have taken advice about backing up my mac, but this always happens , where am I going wrong ... It's new and has 999.86 Gb free.
-
Opening ADOBE forms is very slow.
Lately, once I enter my username and password, opening ADOBE forms is very slow.