Alv object model and cl_salv_hierseq_level
I have used the cl_salv_hierseq_level to enable expand and collapse on an instance of cl_salv_hierseq_table.
The function to show the detail lines works until the grid table is refreshed from the database. I have tried using the set_items_expanded method again after the refresh to no avail.
Can anyone provide information on how to use the class and methods after some grid processing to keep expand and collapse enabled?
There are no replies to this question; but I have noticed the expand/collapse works after process and refresh now.
Similar Messages
-
Editable field in ALV Object Model
Hi Guys,
I'm using method cl_salv_table=>factory to display an ALV (Object Model) in my report.
I want to "open up" one field for user entries, in other words make one column of my table editable.
I assumed to find the respective methods in class cl_salv_table, cl_salv_columns_table or cl_salv_display_settings, so far without getting anywhere.
I know about the field-catalogue and the method set_ready_for_input in class CL_GUI_ALV_GRID - it's not working once you're in the object model.
Any ideas how to do that?
Thank you!
With best regards,
AndreasHi Guys,
I'm using method cl_salv_table=>factory to display an ALV (Object Model) in my report.
I want to "open up" one field for user entries, in other words make one column of my table editable.
I assumed to find the respective methods in class cl_salv_table, cl_salv_columns_table or cl_salv_display_settings, so far without getting anywhere.
I know about the field-catalogue and the method set_ready_for_input in class CL_GUI_ALV_GRID - it's not working once you're in the object model.
Any ideas how to do that?
Thank you!
With best regards,
Andreas -
ALV object model - List download
H Experts,
I have used ALV object model to list display.
Also i have used class CL_ALV_COLUMNS_TABLE and its method set_long_text to set the column heading.
Now if i execute this report, long text is displayed properly in column heading.
But when i download this report output in spreadsheet, short text is displayed in column heading which is taken from the data element in DDIC.
Example:
I have declaed a column of type ABWTG.
I have set leng text as 'TEST'.
When i execute the report, column heading is displayed "TEST', which is as expected.
But when i download this report in spreadsheet, column heading is displayed as 'NUMBER' in spread sheet. While downloading column heading is taken from the data element for field ABWTG. But i want the long text 'TEST' to be displayed when the report output is downloaded.
Please suggest how to do it.
RegardsHi,
As per my understanding , it is displaying in excel based on ur ddic_output_length field.
only becoz of that field it will show the same header.
IF u will change the value at run time for this field then u will not get that issue,
I m also searching on the same issue.
Thanks
Rahul -
ALV Object Model - Merged Cells
Hi all
When utilizing ALV Object Model, how do I display cells as merged when they have the same content?
Can someone help me out?
Thank you very much!Hello Yun
In dialog cells are merged automatically as soon as you sort the column containing repeated values.
Thus, when you call method SET_TABLE_FOR_FIRST_DISPLAY you should additionally provide parameter IT_SORT with the appropriate entries.
For example, you want to sort your ALV list according to COL_A (1st) and COL_B (2nd):
ls_sort-spos = 1.
ls_sort-fieldname = 'COL_A'.
ls_sort-up = 'X'. " sort ascending
append ls_sort to lt_sort.
ls_sort-spos = 2.
ls_sort-fieldname = 'COL_B'.
ls_sort-up = 'X'. " sort ascending
append ls_sort to lt_sort.
Regards
Uwe -
END_OF_PAGE in ALV Object model
Dear all,
I am using ALV Object model, but the END_OF_PAGE is not triggering. I have pasted the sample code below. Let me know how to get END_OF_PAGE in ALV OM.
REPORT ztest_rr.
DATA : it_sflight TYPE TABLE OF sflight.
DATA : gr_sflight TYPE REF TO cl_salv_table,
gr_content TYPE REF TO cl_salv_form_element,
gr_sorts TYPE REF TO cl_salv_sorts,
gr_events TYPE REF TO cl_salv_events,
gr_print TYPE REF TO cl_salv_print.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_top_of_page FOR EVENT
top_of_page OF cl_salv_events
IMPORTING
page
table_index
r_top_of_page,
handle_end_of_page FOR EVENT
end_of_page OF cl_salv_events
IMPORTING
page
r_end_of_page.
ENDCLASS. "lcl_eventhandler DEFINITION
DATA : gr_handler TYPE REF TO lcl_eventhandler.
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_top_of_page.
PERFORM create_alv_form_content_top
USING page
table_index
CHANGING gr_content.
r_top_of_page->set_content( gr_content ).
ENDMETHOD. "handle_top_of_page
METHOD handle_end_of_page.
PERFORM create_alv_form_content_eop
USING page
CHANGING gr_content.
r_end_of_page->set_content( gr_content ).
ENDMETHOD. "handle_end_of_page
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT *
FROM sflight
INTO TABLE it_sflight.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>true
r_container =
container_name =
IMPORTING
r_salv_table = gr_sflight
CHANGING
t_table = it_sflight
CATCH cx_salv_msg .
ENDTRY.
CALL METHOD gr_sflight->get_sorts
RECEIVING
value = gr_sorts.
CALL METHOD gr_sorts->set_group_active
EXPORTING
value = if_salv_c_bool_sap=>true.
TRY.
CALL METHOD gr_sorts->add_sort
EXPORTING
columnname = 'CARRID'
position =
sequence = IF_SALV_C_SORT=>SORT_UP
subtotal = IF_SALV_C_BOOL_SAP=>FALSE
group = if_salv_c_sort=>group_with_newpage
obligatory = IF_SALV_C_BOOL_SAP=>FALSE
receiving
value =
CATCH cx_salv_not_found .
CATCH cx_salv_existing .
CATCH cx_salv_data_error .
ENDTRY.
CALL METHOD gr_sflight->get_event
RECEIVING
value = gr_events.
CALL METHOD gr_sflight->get_print
RECEIVING
value = gr_print.
CALL METHOD gr_print->set_reserve_lines
EXPORTING
value = 5.
CREATE OBJECT gr_handler.
SET HANDLER gr_handler->handle_top_of_page FOR gr_events.
SET HANDLER gr_handler->handle_end_of_page FOR gr_events.
CALL METHOD gr_sflight->display
*& Form CREATE_ALV_FORM_CONTENT_TOP
text
-->P_PAGE text
-->P_TABLE_INDEX text
<--P_GR_CONTENT text
FORM create_alv_form_content_top USING l_page
l_table_index
CHANGING lr_content.
WRITE 'HAI'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_TOP
*& Form CREATE_ALV_FORM_CONTENT_EOP
text
-->P_PAGE text
<--P_GR_CONTENT text
FORM create_alv_form_content_eop USING l_page
CHANGING lr_content.
WRITE 'BYE'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_EOPDear all,
I am using ALV Object model, but the END_OF_PAGE is not triggering. I have pasted the sample code below. Let me know how to get END_OF_PAGE in ALV OM.
REPORT ztest_rr.
DATA : it_sflight TYPE TABLE OF sflight.
DATA : gr_sflight TYPE REF TO cl_salv_table,
gr_content TYPE REF TO cl_salv_form_element,
gr_sorts TYPE REF TO cl_salv_sorts,
gr_events TYPE REF TO cl_salv_events,
gr_print TYPE REF TO cl_salv_print.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_top_of_page FOR EVENT
top_of_page OF cl_salv_events
IMPORTING
page
table_index
r_top_of_page,
handle_end_of_page FOR EVENT
end_of_page OF cl_salv_events
IMPORTING
page
r_end_of_page.
ENDCLASS. "lcl_eventhandler DEFINITION
DATA : gr_handler TYPE REF TO lcl_eventhandler.
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_top_of_page.
PERFORM create_alv_form_content_top
USING page
table_index
CHANGING gr_content.
r_top_of_page->set_content( gr_content ).
ENDMETHOD. "handle_top_of_page
METHOD handle_end_of_page.
PERFORM create_alv_form_content_eop
USING page
CHANGING gr_content.
r_end_of_page->set_content( gr_content ).
ENDMETHOD. "handle_end_of_page
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT *
FROM sflight
INTO TABLE it_sflight.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>true
r_container =
container_name =
IMPORTING
r_salv_table = gr_sflight
CHANGING
t_table = it_sflight
CATCH cx_salv_msg .
ENDTRY.
CALL METHOD gr_sflight->get_sorts
RECEIVING
value = gr_sorts.
CALL METHOD gr_sorts->set_group_active
EXPORTING
value = if_salv_c_bool_sap=>true.
TRY.
CALL METHOD gr_sorts->add_sort
EXPORTING
columnname = 'CARRID'
position =
sequence = IF_SALV_C_SORT=>SORT_UP
subtotal = IF_SALV_C_BOOL_SAP=>FALSE
group = if_salv_c_sort=>group_with_newpage
obligatory = IF_SALV_C_BOOL_SAP=>FALSE
receiving
value =
CATCH cx_salv_not_found .
CATCH cx_salv_existing .
CATCH cx_salv_data_error .
ENDTRY.
CALL METHOD gr_sflight->get_event
RECEIVING
value = gr_events.
CALL METHOD gr_sflight->get_print
RECEIVING
value = gr_print.
CALL METHOD gr_print->set_reserve_lines
EXPORTING
value = 5.
CREATE OBJECT gr_handler.
SET HANDLER gr_handler->handle_top_of_page FOR gr_events.
SET HANDLER gr_handler->handle_end_of_page FOR gr_events.
CALL METHOD gr_sflight->display
*& Form CREATE_ALV_FORM_CONTENT_TOP
text
-->P_PAGE text
-->P_TABLE_INDEX text
<--P_GR_CONTENT text
FORM create_alv_form_content_top USING l_page
l_table_index
CHANGING lr_content.
WRITE 'HAI'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_TOP
*& Form CREATE_ALV_FORM_CONTENT_EOP
text
-->P_PAGE text
<--P_GR_CONTENT text
FORM create_alv_form_content_eop USING l_page
CHANGING lr_content.
WRITE 'BYE'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_EOP -
Hi,
Does anyone know how to create a context menu (right click on line or field) in the new ALV object model (class CL_SALV_TABLE)?
Thanks in advance
Keld Gregersen
PS: In the past we could use event CONTEXT_MENU_REQUEST in class CL_GUI_ALV_GRID, so it must be possibleI don't think there's "any such animal" in the new class. I'm not 100% certain however but the new class is only useful for fairly simple display only type grids.
There's no edit capability either.
I'd stick with cl_gui_alv_grid until there's some decent extra functionality in the cl_salv_table class.
It's fine for quick "bog standard" displays as it doesn't need a field catalog or any screens to be created by the user or developer - but you pay a price for that in limited fnctionality.
Cheers
jimbo -
Questions about ALV object model
Hi,
for a new report i´m planing to use the "new" ALV object model to create the ALV list. Now I´ve got two questions concerning this topic:
- is it possible to switch the ALV into the edit mode like it´s possible if the "old" CL_GUI_ALV_GRID class
is used?
- how I can encolor specific cells?
I couldn´t find any hints or demo programms for these questions
Regards,
Andyit is not possible to Edit the ALV using Object Model.
For coloring...check this code.
DATA: alv TYPE REF TO cl_salv_table.
TYPES: BEGIN OF ty_tab,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
color TYPE lvc_t_scol,
END OF ty_tab.
DATA: wt_color TYPE lvc_t_scol,
wa_color TYPE lvc_s_scol,
w_color TYPE lvc_s_colo.
DATA: wa_flight TYPE ty_tab.
DATA: column_tab TYPE REF TO cl_salv_columns_table,
column TYPE REF TO cl_salv_column_table.
DATA: column_ref TYPE salv_t_column_ref,
wa LIKE LINE OF column_ref.
DATA: it_flight TYPE STANDARD TABLE OF ty_tab.
SELECT carrid connid FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 10 ROWS.
w_color-col = 4.
w_color-int = 0.
w_color-inv = 0.
LOOP AT it_flight INTO wa_flight.
w_color-col = 4.
wa_color-fname = 'CARRID'.
wa_color-color = w_color.
APPEND wa_color TO wt_color.
w_color-col = 6.
wa_color-fname = 'CONNID'.
wa_color-color = w_color.
APPEND wa_color TO wt_color.
wa_flight-color = wt_color.
MODIFY it_flight FROM wa_flight.
ENDLOOP.
cl_salv_table=>factory(
IMPORTING
r_salv_table = alv
CHANGING
t_table = it_flight
"get all the columns
column_tab = alv->get_columns( ).
column_tab->set_color_column( value = 'COLOR' ).
column_ref = column_tab->get( ).
"loop each column
LOOP AT column_ref INTO wa.
"Conditionally set the column type as key or non key
IF wa-columnname = 'CARRID'.
column ?= wa-r_column.
column->set_key( abap_true ).
ENDIF.
ENDLOOP.
alv->display( ). -
Conflict between Client object model and Item Updated Event Receiver in sharepoint 2010
Hello All,
As per my requirement I have a two custom list.
Agent Details
Port Name
Agent Details contains Agent code, Port Name, email, address and phone of Agent. Its possible that one Agent Code is connected with multiple Port Name.
Basically what I am doing is I am getting port name connected with Agent code, using jquery and bind those values with check box(using javascript created dynamically) and bind all with Div tag.
Now when my custom edit form of Agent list open up it shows me different port name binding with checkbox group.
when user select the check box and click confirm button my clicent object model script will run and add this selected value into Port Name list.
After confirm one more button named Save will enable asking user to edit the email, phone or address value and when I click on save my Item updated event fires which update the values of the selected port name(These port name I am getting from port
name list) to Agent Details custom list.
Now when I am trying to update the values my event receiver fires or some times it got stuck(not firing). So could you please help me the possible alternative for this requirements.
Can we user the Ecma Script(Client object model to preserve the value of selectec port) and Item updated event receiver on the same time?
Is anything am doing wrong then please guide me.Hi,
As I understand, when you updated values in the agent details list the Item updated event receiver got stuck sometimes.
The item update event receiver will fire after the item has been saved, and the client object model script or the Ecma Script runs before the item is saved, so there is no conflict between the client object model script and item update event receiver.
You could find out the reason about the item update event receiver gets stuck by debugging the event receiver.
When you want to debug your event receivers, you have to attach to OWSTIMER.EXE and wait till they are executed. You can control this behavior using the Synchronization attribute. Also, if you’re looking for an easy way to debug an event receiver without
having to manually attach a debugger to your code, you can use the System.Diagnostics.Debugger.Launch() method.
The articles below are about how to debug in the event receiver in SharePoint 2010.
http://sharepoint-kings.blogspot.jp/2013/02/debugging-event-receivers-in-sharepoint.html
http://chakkaradeep.com/index.php/event-receivers-in-sharepoint-2010/
http://sharesaint.com/?p=77
Best regards,
Sara Fan
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Dear All
Can anybody tell me, where will i find the examples for ALV report using object model (two-dimensional table).
Thanks
raviHi Ravindra,
Transaction DWDM, Under grid controls...
Also check out all report programs that contain BCALV_GRID*
BCALV_GRID_DEMO being the simple one..
CL_GUI_ALV_GRID is the class, you can find some sample programs by doing a where used list on it as well..
Sri
Message was edited by: Srikanth Pinnamaneni -
Simple Object Modelling and Java IDE for OSX?
I haven't been technical for a while and I want to refresh my Java and object modelling skills. I'm looking for two things. If I can find both in the same environment so much the better.
1) A basic UML modelling tool. All I really care about is describing a medium size object model: classes, sub-classes, attributes, relations, etc.
2) A basic Java IDE. Don't need EJB or anything complex. Just want to compile run and debug simple Java programs.
I down loaded Net Objects but it seems like overkill for what I want. I looked on some open source sites but almost nothing was native to OSX it all ran under Windows or required a Java virtual machine. Actually I guess that's another question, is there already a Java virtual machine as part of OSX or do I need to download one and if so which would be the best.
I'm willing to spend a few $$ but free stuff would be better and no more than $50. So far I found one product native to OSX but the starting cost was $400+ for a five person license.In case anyone has the same question, I just found this very nice tool on the Apple web site called Visual Paradigm for UML:
http://www.apple.com/downloads/macosx/development_tools/visualparadigmforumlente rpriseedition.html
I'm still getting to know it but this is exactly what I was looking for. Fairly easy to use if you already know OO but not as complex as some other tools and works well on the Mac. -
SAP CRM object model and accessibility
Hi All,
I am new to the SAP world.
I am looking into SAP CRM these days to figure out whether we can write a connector in JAVA so that we
could retrieve all the data from the SAP CRM system
could retrieve all the properties associated with the data
permissions associated with the data
But I couldn't find documentation on how the object model looks like and what needs to be done in order to achieve my goals.
For Eg: If that is SharePoint, I know the object model would be like Web Application -> Site Collection -> Site -> List -> List Items etc., and to access that we could either use OOB web services or write custom web services using SharePoint API
Is this possible with SAP CRM?
Can some one help me with this?
Thanks
NagaHi Daniel,
i got the same problem. It is an error concerning the parallel processing. You have to enter the parallel view entries manually (table CRMV_EXTMGR_PAR). Please have a look at note 1271899.
Hope i could help you,
Tobias -
How to connect sharepoint online using client object model and authentictae against window login
Iam developing A console application where in need to connect to sharepoint online and authenticate against window login can u please suggest me the code
Hi,
There is couple of helper method to check and validate the SPO credentials in the same solution.
string userName = GetUserName();
SecureString pwd = GetPassword();
/* End Program if no Credentials */
if (string.IsNullOrEmpty(userName) || (pwd == null))
return;
// Open connection to Office365 tenant
ClientContext cc = new ClientContext(siteUrl);
cc.AuthenticationMode = ClientAuthenticationMode.Default;
cc.Credentials = new SharePointOnlineCredentials(userName, pwd);
if you give incorrect user name or password it will throws an exception in the console.
Murugesa Pandian.,SharePoint 2010 MCPD | MCTS|Configure -
How to show surveys name and responses under curret subsite by Java object model in the CEWP
Hi All,
I need to show the name of surveys, their description and all responses against the survey under my current sub-site.
As I think there is no such out of box web-part available in SharePoint 2010.
1. Can I get it by using java script client object model and place that in CEWP?
2. Could I get code for this need?
NaimishSorry For late reply, I have managed to get needed out put.
Thank you Hemendra.
=====================
<script ='/_layouts/SP.js' type='text/javascript'>
ExecuteOrDelayUntilScriptLoaded(retrieveAllListProperties, "sp.js");
function retrieveAllListProperties() {
var clientContext = new SP.ClientContext.get_current();;
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists();
clientContext.load(collList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
function onQuerySucceeded() {
var listInfo = '';
var str="";
var columns = 3;
var listEnumerator = collList.getEnumerator();
str += '<table style="width:1000px" border="1" cellspacing="1" cellpadding="5">'
str += '<td style="font-size:14.0pt;font-family:"Tahoma","sans-serif"color:red">' + 'Survey Title' + '</td>'
str += '<td style="font-size:14.0pt;font-family:"Tahoma","sans-serif"color:red">' + 'Survey Description' + '</td>'
str += '<td style="font-size:14.0pt;font-family:"Tahoma","sans-serif"color:red">' + 'Total Responses'+ '</td>'
while (listEnumerator.moveNext())
var oList = listEnumerator.get_current();
if(oList.get_baseType() == 4)
{ str += '<tr>'
//listInfo += 'Survey Title: '+oList.get_title() +'------'+' Description: '+oList.get_description() +'------'+ ' Total Responses: ' + oList.get_itemCount();
str += '<td>' + oList.get_title() + '</td>'
str += '<td>' + oList.get_description() + '</td>'
str += '<td>' + oList.get_itemCount() + '</td>'
str += '<tr>'
str += '</tr>'
str += '</table>'
document.getElementById("demo").innerHTML = str;
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
</script>
<span id="demo" style="float:left;">Survey</span> -
Message in Status Bar while using ALV Objects
Hi All,
If we use ALV in objects (Build in class and methods for ALV),is it possible to display a error message using Message statement in Status bar.
Thanks in advance.Hi,
Yes, it is possible. You can do it using the ALV Object Model (ALV OO methods) within an event handler method. For example, the event "added_function of cl_salv_events" can be used and you can add code similar to the following code within the event handler method:
CASE e_salv_function.
WHEN 'XYZ'.
MESSAGE w001(00) WITH 'Message text goes here...'.
ENDCASE.
The warning message will either show up as a popup or in the status bar depending on your user settings. Of course, you can also use other message types (e.g. I, E, S) or other message techniques besides the message statement.
Best Regards,
Jamie -
Client object model - Usage of System account
We are about to start using Client object model (C#) for SharePoint 2010. We have been using Server object model and used Run with elevated privileges for most of the SP operations.
In Client object model, there is an option to use system account credentials as the context credentials.
Is there a security hole with this approach or is it advised to proceed with this approach?
Refer the below link where it is mentioned as a security hole.
http://stackoverflow.com/questions/8496322/sharepoint-2010-change-context-for-runwithelevatedprivileges
Reason for adopting COM - We want to use ASP MVC 4, Web API 2 for writing API for our application which uses SP 2010 as a backend. As SP2010 does not support .net runtime 4.0, we wanted to use COM and host the API separately.I will suggest you to pass credentials of a user with site admin permissions in your code which can act similar to elevated privileges for all SP operations.
I have used in almost similar requirement where I was using ASP.NET MVC and SharePoint 2013, and using SharePoint for document management.
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.
Maybe you are looking for
-
Embedding Flash in HTML using Dreamweaver - stopped working
Hi all, not really sure what's going on, but I've done this many times before and it's worked fine. I've previously embedding Flash videos I've created in Premiere and/or converted using other software. I simply drag and drop the Flash file where I
-
i just got my rma back with new enermax figured id run stock for few weeks to break it in and it wont run ddr 400 all my ram is 400 but on auto it drops it to 266 if i set it to 333 it runs 333 but if i set it to 400 it runs 266. Got a enermax with
-
Mail Service With Internal vs External Domain Question
I have a SLS setup with a private domain ex: server.acmewidgets.private The local dns resolves correctly I have a static IP for this server and I would like it to handle the email for my domain which is ex: acmewidgets.com (Currently acmewidgets.com
-
Needing help installing itunes on my iphone
I have downloaded the latest version of itunes on to my computer but i still dont have the itunes icon on my iphone. Help please?
-
Dataguard showing 8hr lag between logs between primary and physical
I'm showing around 8 hrs between when my primary sends the redo to my physical standby. My protection mode is at maximum performance. I'm wondering if I should change the time that my primary sends the redo to something shorter? Is this ok to have su