01-08-2008 3:26 PM
Hi,
I'm using 2 ALV Grid in a dynpro.
On the top I have a frame with some text fields that I use as header.
When I click on the ALV grid I can update the other one but I can't update the header or better ... the sceen does'n refresh.
I'm tryng using Call Screen and it works but I know that it's not the best solution...
How can I resfresh the dynpro...
Thanks
Salvatore
01-08-2008 7:52 PM
Hello Salvatore
Have a look at my sample report ZUS_SDN_TWO_ALV_GRIDS in thread [ALV|;.
In the event handler method for DOUBLE_CLICK I call the following method:
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ). " not 4.6c compatibe, use instead
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
okcode = 'DETAIL'
* IMPORTING
* rc =
.
This method call triggers that the PAI of the screen is passed and, thereby, PBO of the same screen, too. In the PBO module(s) you can refresh your header.
Please note that normal ALV grid events do NOT trigger PAI of the screen (similar behaviour like F4 search help).
Regards,
Uwe
01-08-2008 7:52 PM
Hello Salvatore
Have a look at my sample report ZUS_SDN_TWO_ALV_GRIDS in thread [ALV|;.
In the event handler method for DOUBLE_CLICK I call the following method:
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ). " not 4.6c compatibe, use instead
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
okcode = 'DETAIL'
* IMPORTING
* rc =
.
This method call triggers that the PAI of the screen is passed and, thereby, PBO of the same screen, too. In the PBO module(s) you can refresh your header.
Please note that normal ALV grid events do NOT trigger PAI of the screen (similar behaviour like F4 search help).
Regards,
Uwe
01-10-2008 8:22 AM
Hi Salvatore,
Update of Table
Implementation in Component Controller for Update
IPublicTableTransactionComp.ITableNodeElement element;
Zstable table = new Zstable();
update.setPo_Type("M");
int size = 0;
int sizeMax = wdContext.nodeTableNode().size();
for(;size<sizeMax;size++)
{
element = wdContext.nodeTableNode().
getTableNodeElementAt(size);
table.setCust_No(element.getCustNo());
table.setFirst_Name(element.getFirstName());
table.setLast_Name(element.getLastName());
table.setPhone_No(element.getPhoneNo());
table.setOrg_Code(
wdContext.nodeZs_Dislay_Table_Input().
currentZs_Dislay_Table_InputElement().
getPo_Org_Code());
update.addLi_List_Of_Users(table);
}
try
{
wdContext.nodeZs_Update_Table_Input().
currentZs_Update_Table_InputElement().
modelObject().execute();
wdContext.nodeOutput_Update().invalidate();
if(!wdContext.nodeOutput_Update().
currentOutput_UpdateElement().
getPo_Success().equals("1"))
wdComponentAPI.getMessageManager().
reportWarning("UNSUCCESSFUL UPDATE");
else
wdComponentAPI.getMessageManager().
reportSuccess("SUCCESSFUL UPDATE");
}
catch(Exception ex)
{
wdComponentAPI.getMessageManager().
reportException(ex.toString(),false);
}
Implementation in View for Update
1. In the Action tab of StartView define an action Update and associate it with OnAction property of Button Update
2. In the eventhandler for the button in Implementation namely OnActionUpdate write the following code:
//Executing the Bapi on Click of Update Button
wdThis.wdGetBokApplCompController().executeZs_Update();
Declaration of Method executeChange
This method is defined to execute actions of updating the table with latest changes. We create method with Type as parameter in it.
9. Diagram describing Method executeChange and its Type being parameter
public void executeChange( java.lang.String Type )
{
//@@begin executeChange()
IPublicTableTransactionComp.ITableNodeElement element;
Zstable table = new Zstable();
update.setPo_Type(Type);
int size = 0;
int sizeMax = wdContext.nodeTableNode().size();
for(;size<sizeMax;size++)
{
element =
wdContext.nodeTableNode().
getTableNodeElementAt(size);
table.setCust_No(element.getCustNo());
table.setFirst_Name(element.getFirstName());
table.setLast_Name(element.getLastName());
table.setPhone_No(element.getPhoneNo());
table.setOrg_Code(element.getOrgCode());
update.addLi_List_Of_Users(table);
}
try
{
wdContext.nodeZs_Update_Table_Input().
currentZs_Update_Table_InputElement().
modelObject().execute();
wdContext.nodeOutput_Update().invalidate();
if(!wdContext.nodeOutput_Update().
currentOutput_UpdateElement().
getPo_Success().equals("1"))
wdComponentAPI.getMessageManager().
reportWarning("UNSUCCESSFUL ");
else
wdComponentAPI.getMessageManager().
reportSuccess("SUCCESSFUL ");
}
catch(Exception ex)
{
wdComponentAPI.getMessageManager().
reportException(ex.toString(),false);
}
//@@end
}
Regards,
Sravanthi.