Tableview pai
Hi. I have 2 tableviews on screen. The pai pbo logic is implemented according to the down-right-up order.
When I change data in any of tableviews, the PAI doesnt trigger. How to make the PAI logic run?
Best regards.
Lukasz
Message was edited by: Lukasz Sawicki
Hi,
The PAI cannot be triggerred unless the user performs some action like hitting a button, or at least the enter key. Merely changing the values on the screen is something that happens on your local GUI. You will have to hit a button , i.e., trigger a function code to respond to the Application Server , where the processing logic resides.
Regards,
Anand Mandalika.
Similar Messages
-
How to modify changes of table control data in PAI
I have a table control where the columns are brought by dict fields.I am able to bring data into table control through an itab.
Now what i want is whenever user edits data in table control and clicks on save button the corresponding changes should be made in database.
For this according to my understanding we need to (in PAI) modify the changes in itab from the table control and then in SY-UCOMM of SAVE button we need to update in database table using itab.
For this , I am not able to write code for modifying the changes in itab from table control. Here is my code below.Please tell me how to do this.
PROCESS BEFORE OUTPUT.
MODULE FILL_DATA.
LOOP AT ITAB INTO ZEMPLOYEE_MASTER WITH CONTROL EMPTABLE CURSOR
EMPTABLE-CURRENT_LINE.
ENDLOOP.
MODULE STATUS_0001.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE MODIFY_ITAB.
ENDLOOP.
MODULE USER_COMMAND_0001.
REPORT ZDATA_FORM1.
TABLES: ZEMPLOYEE_MASTER.
CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.
data: begin of itab occurs 0,
emp_no like zemployee_master-emp_no,
name like zemployee_master-name,
city like zemployee_master-city,
end of itab,
rowno TYPE I VALUE 1.
*& Module STATUS_0001 OUTPUT
* text
MODULE STATUS_0001 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
* text
MODULE USER_COMMAND_0001 INPUT.
MESSAGE 'Inside INPUT' TYPE 'I'.
CASE SY-UCOMM.
WHEN 'SAVE'.
UPDATE zemployee_master.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
*& Module fill_data OUTPUT
* text
MODULE fill_data OUTPUT.
select emp_no name city from zemployee_master into TABLE itab ORDER BY emp_no.
Describe table itab lines EMPTABLE-LINES.
ENDMODULE. " fill_data OUTPUT
*& Module modify_itab INPUT
* text
MODULE modify_itab INPUT.
* MODIFY itab from zemployee_master index
* MESSAGE 'Inside modify_itab' TYPE 'I'.
ENDMODULE. " modify_itab INPUTHi
In the following module of your code
MODULE modify_itab INPUT.
MODIFY itab from zemployee_master index tc-current_line " Where TC is the name of the Table control on the Screen
ENDMODULE.
Table control data gets refreshed on *enter*
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
Cheerz
Ramchander Rao.K -
PAI not getting triggered.
HI, I have a code as below.
The PAI module is not getting triggered.
I guess something small is missing but I am not getting it.
YOur help wud be appretiated and rewarded.
Thanks
=================
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP WITH CONTROL TC.
MODULE FILL_TABLE_CONTROL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
MODULE CANCEL AT EXIT-COMMAND.
LOOP WITH CONTROL TC.
module read_table_control.
ENDLOOP.
module user_command_0100.
======================
Program Code :
*& Report ZSCD_TEST5
REPORT ZSCD_TEST5.
DATA: BEGIN OF ITAB OCCURS 0,
PERNR TYPE PA0002-PERNR,
NACHN TYPE PA0002-NACHN,
VORNA TYPE PA0002-VORNA,
END OF ITAB.
CONTROLS TC TYPE TABLEVIEW USING SCREEN 100.
DATA: BEGIN OF WA_ITAB ,
PERNR TYPE PA0002-PERNR,
NACHN TYPE PA0002-NACHN,
VORNA TYPE PA0002-VORNA,
END OF wa_ITAB.
data : fill TYPE i.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: lines TYPE i,
limit TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_LNAME LIKE PA0002-NACHN.
SELECTION-SCREEN END OF BLOCK B1.
start-of-selection.
select pernr nachn vorna from pa0002 into table itab where nachn = p_lname.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'PF1'.
DESCRIBE TABLE itab LINES fill.
TC-lines = fill.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module CANCEL INPUT
text
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE. " CANCEL INPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'NEXT_LINE'.
TC-top_line = TC-top_line + 1.
limit = fill - lines + 1.
IF TC-top_line > limit.
TC-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
TC-top_line = TC-top_line - 1.
IF TC-top_line < 0.
TC-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
TC-top_line = TC-top_line + lines.
limit = fill - lines + 1.
IF TC-top_line > limit.
TC-top_line = limit.
ENDIF.
WHEN 'PREV_PAGE'.
TC-top_line = TC-top_line - lines.
IF TC-top_line < 0.
TC-top_line = 0.
ENDIF.
WHEN 'LAST_PAGE'.
TC-top_line = fill - lines + 1.
WHEN 'FIRST_PAGE'.
TC-top_line = 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module READ_TABLE_CONTROL INPUT
text
MODULE READ_TABLE_CONTROL INPUT.
lines = sy-loopc.
MODIFY itab from wa_itab INDEX TC-current_line.
ENDMODULE. " READ_TABLE_CONTROL INPUT
*& Module FILL_TABLE_CONTROL OUTPUT
text
MODULE FILL_TABLE_CONTROL OUTPUT.
READ TABLE itab into wa_itab INDEX TC-current_line.
ENDMODULE. " FILL_TABLE_CONTROL OUTPUTGive MODULE USER_COMMAND_0100 lik this
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
LOOP at itab WITH CONTROL TC.
module read_table_control.
ENDLOOP.
MODULE USER_COMMAND_0100.
siva -
The PAI Event Code to search for a record in Table Control
Logic
1. I have a position button and entry text field (search content) for a table control in my screen. Position button has the function code 'PBUT'.
2. Content of table control will be in an internal table. The entry text field is to be used for positioning.
3. I enter the search (key) field in text field & Click the position button.
4. The PAI event of button click (Module user_command) of that screen is as under.
Case sy_ucomm.
When 'PBUT'.
What will be the code to bring the row as selected in table control, that I have to write here, for this case-value.
Endcase.
Regards,Hi Alok,
Excuse me, couldn`t catch u yesterday. Ok i`ve the code which will set the cursor on the selected entry.
Reward points if convinced.
*& Report Y131_TC_TEST *
REPORT y131_tc_test NO STANDARD PAGE HEADING.
TABLES: vbak.
DATA : BEGIN OF str_tc,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
END OF str_tc,
it_tc LIKE TABLE OF str_tc WITH HEADER LINE,
loopc LIKE sy-loopc,
flag,
lin TYPE i.
CONTROLS : my_tc TYPE TABLEVIEW USING SCREEN 9000.
CALL SCREEN 9000.
*& Module STATUS_9000 OUTPUT
* text
MODULE status_9000 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
IF it_tc[] IS INITIAL.
SELECT vbeln erdat INTO TABLE it_tc UP TO 10
ROWS FROM vbak.
DESCRIBE TABLE it_tc LINES lin.
my_tc-top_line = loopc.
ENDIF.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE user_command_9000 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE PROGRAM.
<b> WHEN 'PBUT'.</b>
**** Now this event is triggerred when the user uses the ****Position Push button to locate the field value.
CALL SCREEN 9001 STARTING AT 10 15.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module USER_COMMAND_9001 INPUT
* text
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'OKAY' OR ' ' or 'EXIT'.
<b>**** When the user selects values from the search help on **** position button, the itab is read and index is *****assigned</b>
READ TABLE it_tc WITH KEY vbeln = vbak-vbeln.
IF sy-subrc = 0.
loopc = sy-tabix.
flag = 'X'.
**** the cursor is set here
<b> my_tc-top_line = loopc.</b>
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
* text
MODULE status_9001 OUTPUT.
SET PF-STATUS 'MODAL'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9001 OUTPUT
Regards -
Adding/removing rows in TABLEVIEW
Hi. I've got a TABLEVIEW in one of my subscreens. But when load itab into that tableview with 'LOOP AT...' tableview appears but I can't add rows to it. I can't delete existing rows too. What should I add to my programm to have possibility of adding/removing rows from my tablewiev? Greetings. P.
Hi Friend,
To add/delete rows in your table view.
You have to add/delete rows from internal table fro where you are displaying values.
You have to write code in PAI..
In LOOP ... ENDLOOP check the OK_CODE if it is ADD (for eg.) you have to add a blank row to internal table by just passing a blank work area.
And if it is DELETE (for eg.) delete the row of that index (TABLEVIEW-CURRENT_LINE)...
for these two excersies you have to readjust lines of tableview...after taking number of lines from internal table (DESCRIBE TABLE INT_EX LINES WS_LINES
TABLEVIEW-LINES = WS_LINES) write this piece of code in Intialization.
Hope it will solve the problem.
Regards
Krishnendu -
Hello!
How I can copy selected lines in TableView?Hi Andrej S,
Are you asking about getting the records selected in a TABLE
CONTROL?
There should be a field for ROW SSELECTION in the internal table wich is displayed in the table control.
If you have maintain it, then in PAI, just loop the internal table with the condition that this field is set and get the required rows.
i.e. as follows,
LOOP AT IT_TC_DATA INTO WA_TC_DATA WHERE SEL = 'X'.
APPEND WA_TC_DATA TO IT_RESULT.
ENDLOOP.
Here SEL is the field dedicated for ROW SELECTION.
If no fields like this, add an integer field in the internal table.
Specify the screen field name of this field to 'ROW SELECTION' property i.e. 'w / SelColumn' property and try.
Regards,
R.Nagarajan.
We can - -
How to display an alert message on click of link in tableview
Hi,
Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.
CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates
EXPORTING im_application = application
im_tform = trainingform.
<htmlb:tableView id = "dates"
table = "<%= dates %>"
iterator = "<%= lr_dateiterator %>"
width = "100%"
rowCount = "<%= lp_len %>"
footerVisible = "FALSE"
sort = "SERVER" >
<htmlb:tableViewColumn columnName = "evbeg"
type = "user"
title = "<%= otr(LSO_FRONTEND/schedule) %>"
tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"
sort = "TRUE" >
</htmlb:tableViewColum>
Thanks and Regards,
Archana.you have to code in the iterator for this.
in the render_cellstart method of the iterator you need to code.
this is for a column.
when 'MATNR'.
data: text type string.
text = 'disp_alert()'. "this java script i placed in the page
data: lo_link type ref to cl_htmlb_link.
create object lo_link.
lo_link->id = p_cell_id.
lo_link->onclientclick = text.
lo_link->text = <fs>-matnr.
p_replacement_bee = lo_link.
below is the java script i added in my page..
< sc ri pt type="text/javasc ript" >
f u n ction disp_alert()
a l e rt("helloworld");
< /s c ript > -
SIGABRT error when choosing a row of a tableview
Hello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
Here is my first view (table view) .h file:
#import <UIKit/UIKit.h>
@interface videoTableViewController : UITableViewController
NSArray *videos;
@property (strong, nonatomic) NSArray *videos;
@end
Here is my first view (table view) .m file:
#import "videoTableViewController.h"
#import "videoURLController.h"
@interface videoTableViewController ()
@end
@implementation videoTableViewController
@synthesize videos;
- (id)initWithStyle:(UITableViewStyle)style
self = [super initWithStyle:style];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
// Return the number of sections.
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
// Return the number of rows in the section.
return [self.videos count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"videoCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
NSUInteger row = [indexPath row];
cell.textLabel.text = [videos objectAtIndex:row];
if (row == 0)
cell.detailTextLabel.text = @"Welcome";
if (row == 1)
cell.detailTextLabel.text = @"What we value";
if (row == 2)
cell.detailTextLabel.text = @"What does Honor mean?";
return cell;
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the specified item to be editable.
return YES;
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the item to be re-orderable.
return YES;
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
if (indexPath.row == 0){
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
@end
Here is my videoURLController (second view/web view) .h file?
#import <UIKit/UIKit.h>
@interface videoURLController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
Here is my videoURLController (second view/web view) .m file?
#import "videoURLController.h"
@interface videoURLController ()
@end
@implementation videoURLController
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
@endHello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
Here is my first view (table view) .h file:
#import <UIKit/UIKit.h>
@interface videoTableViewController : UITableViewController
NSArray *videos;
@property (strong, nonatomic) NSArray *videos;
@end
Here is my first view (table view) .m file:
#import "videoTableViewController.h"
#import "videoURLController.h"
@interface videoTableViewController ()
@end
@implementation videoTableViewController
@synthesize videos;
- (id)initWithStyle:(UITableViewStyle)style
self = [super initWithStyle:style];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
// Return the number of sections.
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
// Return the number of rows in the section.
return [self.videos count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"videoCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
NSUInteger row = [indexPath row];
cell.textLabel.text = [videos objectAtIndex:row];
if (row == 0)
cell.detailTextLabel.text = @"Welcome";
if (row == 1)
cell.detailTextLabel.text = @"What we value";
if (row == 2)
cell.detailTextLabel.text = @"What does Honor mean?";
return cell;
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the specified item to be editable.
return YES;
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the item to be re-orderable.
return YES;
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
if (indexPath.row == 0){
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
@end
Here is my videoURLController (second view/web view) .h file?
#import <UIKit/UIKit.h>
@interface videoURLController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
Here is my videoURLController (second view/web view) .m file?
#import "videoURLController.h"
@interface videoURLController ()
@end
@implementation videoURLController
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
@end -
Tableview getting refreshed when changing data in the rows
Hi Gurus,
Iu2019m doing a BSP with MVC. The requirement is as below.
In the main page there is a button u2018Create Orderu2019, to create a sales order, once I click this button, another screen (pop up) comes up and within that I have a Tableview display with the below fields with the data of 20 records.
Material no
Quantity
Delivery Date
Here user is allowed to choose the quantity and delivery date by selecting each row.(with MULTISELECT option in BSP)
The issue is after I select first row and change the quantity and date, and if I click on second row, the Tableview gets refreshed to enable the second row to be editable and the changes what I did on the first row are also refreshed.
So i want the Tableview not to be refreshed when selecting the multiple rows. So that I can keep the changes I make to the quantity and date fields Can you please suggest any method.
Cheers,
Srini.Hi Srinivas,
You need to capture the value entered by user in Quantity and date field and update the internal table with these values for the current selected row.
For ex.
The tableView code is like:
<htmlb:tableView id = "material"
headerText = "<%= otr(Z_SUS/HEADER_TEXT_MATERIALS) %>"
headerVisible = "true"
design = "alternating"
onRowSelection = "MyEventRowSelection"
selectionMode = "MULTILINEEDIT"
width = "880"
filter = "SERVER"
emptyTableText = "<%= otr(Z_SUS/EMPTYTABLE_MATERIALS) %>"
iterator = "<%= iterator %>"
table = "<%= gt_materials %>" />
In eventhandler OnInputProcessing :
DATA: lt_fields type tihttpnvp ,
ls_fields like line of lt_fields.
call method request->get_form_fields
changing
fields = lt_fields
Now the internal table lt_fields contains all the editable cell values , just update the internal table of your tableview with these values.
You can try these threads
[Thread-I.|Re: Retrieve changes made in tableView]
[Thread-II|https://forums.sdn.sap.com/click.jspa?searchID=24460585&messageID=5516977]
Search the forum for more information on this.
Regards,
Anubhav -
Issue with tableview data storing
Hi,
We are using MVC model, it has view-model-main controller and sub controller. I am displaying
4 columns on the tableview where 2 columns are editable. when i click update button on the screen
i have called do_handle_event method on sub controller, when i debug the code i am getting
table as initial always. I am not sure what am i missing here..can any one help me ?
Here is code
method DO_HANDLE_EVENT
data: o_event type ref to cl_htmlb_event,
visible_row type int4,
visible_last_row type int4,
visrow_count type int4 value 10,
it_osha like line of it_mfgprf_osha,
wa_osha type zpp1_mfgprf_osha,
o_app type ref to zcl_mfg_perf.
o_event = cl_htmlb_manager=>get_event( request ).
if o_event is not initial.
if o_event->id = 'osha_update'.
data: tv type ref to cl_htmlb_tableview.
tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'it_osha_history' ).
if tv is not initial.
data: tv_data type ref to cl_htmlb_event_tableview.
tv_data = tv->data.
if it_mfgprf_osha is not initial.
visible_row = tv_data->visiblefirstrowindex.
visible_last_row = visrow_count + visible_row - 1.
loop at it_mfgprf_osha into it_osha
from visible_row to visible_last_row.
it_osha-zosha_ytd = tv_data->get_cell_value(
row_index = sy-tabix column_index = 3 ).
endloop.
endif.
endif.
endif.
endif.
view
<htmlb:tableView id = "it_osha_history"
table = "<%=o_app->it_mfgprf_osha%>"
iterator = "<%=o_cont->osha_iterator%>"
headerText = "OSHA History"
headerVisible = "True"
sort = "SERVER"
onHeaderClick = "sort"
visibleRowCount = "10"
width = "100%"
design = "ALTERNATING"
allRowsEditable = "<%=o_app->ALLOW_RECORD_EDIT%>" />
Thanks!
LakshmikandhHi Guys,
Thanks for valuable suggestion. Let me give you over view of application. We have sub-controller
for all views, one controller and one model for those sub controllers and views.
Hi Sebastian,
Are you suggesting to use new model for all table view iterator ?
If i use iterator on that one model i can't use
that for other table view iterator..right ?
Hi raju,
If i get all the values on 'do_handle_data' method in the controller class, can i use that
for other table view iterator if i create a new table view iterator? can i have some
outline(example coding) of passing those values to sub controller ?
Thanks in advance.
Lakshmikandh -
Updation of internal table from tableview
Hi,
I am using a tableview in which coloumn-3(last_days) is editable.After editing it when user pressess on the button SAVE I should capture the changes and update it in database.
But here I am facing a problem.Always the field last_days is being filled with '000' irrespective of the value entered.
The below is the piece of code which I had written:
DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW,
wa like line of R_GT_VIEW.
tv ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'tableView'
id = 'tvx' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
tv_data = tv->data.
loop at R_GT_VIEW into wa .
wa-last_days = tv_data->get_cell_value( row_index = sy-tabix
column_index = '3' ).
modify R_GT_VIEW from wa index sy-tabix.
endloop.
ENDIF.
Helpful answers will be rewarded.
ThanksHi,
Sorry....coz I replied in a haste...
Just to let you know....The method get_cell_value will not work if you are rendering a column as InputField.
Use the below mentioned code and this it should work....
DATA: tv TYPE REF TO cl_htmlb_tableview.
wa like line of R_GT_VIEW.
tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'tvx' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
tv_data = tv->data.
LOOP AT itab INTO wa .
data : if_value type ref to cl_htmlb_inputfield.
data : p_cell_id type string,
row_ix type string.
clear p_cell_id.
clear row_ix.
row_ix = sy-tabix.
condense row_ix.
concatenate p_cell_id 'TV_' row_ix '_3' into p_cell_id. "generating cell ID...Make Sure to use ur TableView Id instead of TV
if_value ?= cl_htmlb_manager=>get_data( request = request
name = 'inputField'
id = p_cell_id
if if_value->value is not initial.
wa-last_days = if_value->value.
endif.
MODIFY itab FROM wa INDEX sy-tabix.
ENDLOOP.
<i>Do reward each useful answer..!</i>
Thanks,
Tatvagna. -
How to read vales from dropdownlistbox placed in tableView Cells
Hi,
Thanks for reply.. I got problem of reading values from Dropdownlist box placed in tableView Cells. Please correct me or give some sample to read vales from dropdownlistbox placed in tableView Cells.
TableView column defined as
<htmlb:tableViewColumn columnName = "OT_REASON_CODE"
title = "OT Reason"
type = "User"
width = "6"
edit = "true" >
<htmlb:dropdownListBox id = "rcode"
table = "<%= I_YH008 %>"
nameOfKeyColumn = "OT_REASON_CODE"
nameOfValueColumn = "OT_REASON_DESC" />
</htmlb:tableViewColumn>
OnInput processing I am trying to read dorpdown list values selected.
W_YH022-ENDUZ = TABLE_EVENT->GET_CELL_VALUE(
ROW_INDEX = SY-TABIX
COLUMN_INDEX = 3 ). " Get time
DATA: data TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
DATA: value type string.
value = TABLE_EVENT->GET_CELL_ID( row_index = SY-TABIX
column_index = '7'). " get Cell ID
data ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'dropdownlistbox'
id = value
IF data IS NOT INITIAL.
W_YH022-OT_REASON_CODE = data->selection. " +Cell Values...I am not getting cell values here+
endif.Hi:
Do like this
Layout
<htmlb:dropdownListBox id="mydropdownlist" >
<htmlb:listBoxItem key = "bpno"
value = "Business Partner Details" />
<htmlb:listBoxItem key = "bpaddress"
value = "Business Partner Address" />
</htmlb:dropdownListBox>
OnInpurProcessing event - >
DATA: lcl_dropdown TYPE REF TO cl_htmlb_dropdownlistbox.
data : selection2 type string.
lcl_dropdown ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'dropdownListBox'
id = 'mydropdownlist' ).
IF NOT lcl_dropdown->selection IS INITIAL.
selection2 = lcl_dropdown->selection.
ENDIF.
Regards
Shshi -
Hi folks,
We generally know that we write " SELECT Statements " in PBO.
But if i write SELECT STATEMENT IN PAI. then wht will be the outcome and if there is any example plz suggest.
thnking u.
regards,
satya.In PAI of the screen 9100 write as belwo
module USER_COMMAND_9001 input.
CASE sy-ucomm.
WHEN 'EXIT' or 'CANC'.
* free the container
* leave program.
LEAVE PROGRAM.
when 'BACK'.
* free ALV grid
set screen '0'.
leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen
When 'ME32K'.
CALL TRANSACTION 'ME32K' .
Similarly u can write ur query or anything depending
upon ur fcode created in the screen painter. This part of teh code will work only when u press the button after the display.
when others.
ENDCASE.
endmodule. " USER_COMMAND_9001 INPUT
module STATUS_9001 output.
*enable the back and cancel buttons
SET PF-STATUS 'Z_TEMPLATE_STATUS'.
SET TITLEBAR 'ZTITLE'.
* This form create the Docking container and the ALV grid.
perform f9000_objects_create.
Hope this solves ur query.
In PBO u will be setting the PF-STATUS and u have to specify the FCODE for
BACK, Cancel and Exit. -
"Select All" in tableview does not trigger event?
Hi,
I have a MULTISELECT table, and whenever I use the "Select all" or "Deselect all" feature, I don't seem to be able to capture the resulting event... Whenever I select one line, there's always a "tableView" event being triggered, allowing me to run the following code to recover the selected entries:
me->check_groups = table_event->GET_ROWS_SELECTED(
includeCurrentSelectedRow = 'X' ).
However, when I select all entries, there's not even an event being generated:
event = CL_HTMLB_MANAGER=>get_event( request ).
if event is not initial...
endif.
The above code fails; no event seem to be generated!!
Have I missed out on something; or is this a bug...? I would assume the built-in "select all" would trigger some kind of event... or do we have to check/program this manually?
Trondhi trond,
what i know is that for catching <b>request</b> u have to use <b>runtime</b> object.
so u may try this:
event = CL_HTMLB_MANAGER=>get_event( <b>runtime->server-></b>request ).
might be possible it will solve your problem.
Regards,
kamaljeet -
How to get editable value from thtmlb:tableView
Hi,
I create a tableview using tag thtmlb:tableView and set column editable. Now the value in the tableview can be changed, but I don't know how to get the changed value from tableview. Pls help me.
thanks in advance!Hi,
You can get the collection of the context node and any line of the table is an entity in the context node.
If it is not helpfull try to find a table called 'table' or 'tableview', maye it's an attribute in your context node.
Best regards,
Caíque Escaler
Maybe you are looking for
-
How do I get email and text message notifications when my phone is locked?
How do I get email and text message banner notifications on my iphone when the phone is locked? When I had iOS 6 I could get notifications with sound and banner. Now that I have iOS7 I can't see notificaitons when the phone is locked.
-
Attempting to copy to the disk "My shortname's iPod" failed.
Attempting to copy to the disk "My shortname's iPod" failed. The disk could not be read from or written to. ^^^^^^ I get this error since i want to upgrade my music in my ipod 5th gen. I have done the 5 R's. I cannot believe my iPod gor ruined when i
-
Update count is not refreshing in obiee11.1.1.7 after upgrade
Hi Team, we have upgraded the obiee from 10g to 11.1.1.7 every this works fine except. when we are doing updated count for segment,Segment tree or priview List outputb File the query ends at back end but in the screen from where i clicked the update
-
I would like to play an audio cd on my macbook pro. on either the mac or MS parallel window as I have that installed but can't
-
Dear Abode Support Staff; Is it possible for me to create my own brand and have no mention of Abobe at all? Or can I accomplish this by embedding my form on a website and then using the redirect function to cycle back to the website? I love the prod