Multiple Lists in ALV
Hi
I have a requirement like this
EMPCODE SALARY PF STATUS TOTALEARN DEDUCTION NETPAY
100 5000 300 ACTIVE 5000 300 4700
101 6000 400 ACTIVE 6000 400 5400
102 7000 500 INACTIVE 7000 500 6500
TOTAL 18000 16600
I want to display
NoofActiveemployyes Netpay foractiveemployy
2 10100
Noofinactivemplo
1 6500
Plz tell me how to do this..
i use reuse_block_list_append..but dont know exactly where to populate the fields...
any example ..
Thanks
Hi RK,
Find a sample code for your reference.
DATA: lv_repid LIKE sy-repid.
lv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = lv_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PF_STATUS'.
*-- Vendor Schedule List
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
it_fieldcat = i_field_cat1
is_layout = w_lay_out1
i_tabname = '<I_TABLE>'
it_events = i_events1
TABLES
t_outtab = <i_table>.
*-- Error Lsit display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
it_fieldcat = i_field_cat2
is_layout = w_lay_out2
i_tabname = 'I_ERROR'
it_events = i_events2
TABLES
t_outtab = i_error[].
w_print-reserve_lines = 2.
w_print-no_print_listinfos = c_x.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = w_print.
ENDFORM. " f0504_create_list
*-- Top of Page
FORM top_of_page.
WRITE: sy-title.
ENDFORM.
Reward point if it helps.
Manish
Similar Messages
-
Move data from multiple Tables to a Single Table & Convert the list to ALV.
Hi,
My aim is to get the list of Materials with their descriptions, with MRP Controller, with Unrestriced Qty. & the Reorder Qty. So, I have to fetch the data from different tables. But finally I am not able to copy or move the fetched data from multiple tables into the single final table.
Also tell me how to convert this list into ALV.
Below is the program code.
*& Report Y_REORDER_REPORT
REPORT Y_REORDER_REPORT.
tables : marc,makt, mard.
DATA: Begin of i_final occurs 0,
matnr type marc-matnr,
maktx type makt-maktx,
DISPO type marc-DISPO,
MINBE type marc-MINBE,
LABST type mard-LABST,
end of i_final.
DATA: Begin of i_marc occurs 0,
matnr type marc-matnr,
DISPO type marc-DISPO,
MINBE type marc-MINBE,
end of i_marc.
DATA: Begin of i_makt occurs 0,
matnr type makt-matnr,
maktx type makt-maktx,
end of i_makt.
DATA: Begin of i_mard occurs 0,
matnr type mard-matnr,
LABST type mard-LABST,
LGORT TYPE MARD-LGORT,
end of i_mard.
SELECT matnr
dispo
minbe from marc
into corresponding fields of table i_marc
where dispo EQ 'STR'.
SORT I_MARC by MATNR.
WRITE: /10 'Material',
75 'MRP',
80 'Reorder Qty.'.
LOOP at i_marc.
Write: /10 i_marc-matnr,
75 i_marc-dispo,
80 i_marc-minbe.
ENDLOOP.
write: /.
SELECT matnr
MAKTX from makt
into corresponding fields of table i_makt
for all entries in i_marc
where matnr = i_marc-matnr.
LOOP at i_makt.
Write: /10 i_makt-matnr,
30 i_makt-maktx.
ENDLOOP.
SELECT matnr
LGORT
LABST from mard
into corresponding fields of table i_mard
for all entries in i_marc
where matnr = i_marc-matnr.
LOOP at i_mard.
Write: /10 i_mard-matnr,
30 I_MARD-LGORT,
40 i_mard-labst.
ENDLOOP.
move i_mard-matnr to i_final-matnr.
move i_marc-dispo to i_final-dispo.
move i_marc-minbe to i_final-minbe.
move i_makt-maktx to i_final-maktx.
move i_mard-labst to i_final-labst.
WRITE: /10 'Material',
30 'Material Desc.',
75 'MRP',
80 'Reorder Qty.',
105 'Current Stock'.
LOOP at i_final.
Write: /10 i_final-matnr,
30 i_final-maktx,
75 i_final-dispo,
80 i_final-minbe,
105 i_final-labst.
ENDLOOP.
*LOOP at i_mard.
*Write: /10 i_mard-matnr,
30 i_makt-maktx,
75 i_marc-dispo,
80 i_marc-minbe,
105 i_mard-labst.
*ENDLOOP.
Regards,
VishalChange like this,
SELECT matnr
lgort
labst FROM mard
INTO CORRESPONDING FIELDS OF TABLE i_mard
FOR ALL ENTRIES IN i_marc
WHERE matnr = i_marc-matnr.
LOOP AT i_mard.
WRITE: /10 i_mard-matnr,
30 i_mard-lgort,
40 i_mard-labst.
ENDLOOP.
LOOP AT i_marc.
READ TABLE i_mard WITH KEY matnr = i_marc-matnr.
READ TABLE i_makt WITH KEY matnr = i_marc-matnr.
MOVE i_mard-matnr TO i_final-matnr.
MOVE i_marc-dispo TO i_final-dispo.
MOVE i_marc-minbe TO i_final-minbe.
MOVE i_makt-maktx TO i_final-maktx.
MOVE i_mard-labst TO i_final-labst.
APPEND i_final.
ENDLOOP.
WRITE: /10 'Material',
30 'Material Desc.',
75 'MRP',
80 'Reorder Qty.',
105 'Current Stock'. -
How do I change multiple list items at once in a SharePoint list with ribbon button
Hi
I have a sharepoint list and a ribbon button that open a dialog box with buttons to set color on a row
The problem is that i can only selecet one item at once to set the color.
How can i do so it could set all or a couple items att once to the color i want
I want to do this with javascript
here is the code i use to get the item id and the color code is in a seperate js file
'use strict';
var clientContext, hostweburl, parentContext, parentWeb, selectedItem, itemId, listId;
clientContext = new SP.ClientContext.get_current();
hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
listId = decodeURIComponent(getQueryStringParameter("SPListId"));
itemId = decodeURIComponent(getQueryStringParameter("SPListItemId"));
parentContext = new SP.AppContextSite(clientContext, hostweburl);
parentWeb = parentContext.get_web();
selectedItem = parentWeb.get_lists().getById(listId).getItemById(itemId);
$(document).ready(function () {
clientContext.load(selectedItem);
clientContext.executeQueryAsync(OnSuccess, OnFail);
function OnSuccess() {
$("#Blue").click(function () {
selectedItem.set_item('Color', 'Blue');
selectedItem.update();
clientContext.load(selectedItem);
clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
$("#Green").click(function () {
selectedItem.set_item('Color', 'Green');
selectedItem.update();
clientContext.load(selectedItem);
clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
$("#Red").click(function () {
selectedItem.set_item('Color', 'Red');
selectedItem.update();
clientContext.load(selectedItem);
clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
$("#Transparent").click(function () {
selectedItem.set_item('Color', 'No Color');
selectedItem.update();
clientContext.load(selectedItem);
clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });Check if below can help you
http://sp2010batchedit.codeplex.com/
http://sharepoint.stackexchange.com/questions/35935/use-view-ribbon-custom-action-on-multiple-list-items
http://webcache.googleusercontent.com/search?q=cache:XqMO-PRLHQIJ:dannyjessee.com/blog/index.php/2014/06/enabling-custom-ribbon-buttons-dynamically-based-on-multiple-selected-item-values-using-refreshcommandui-and-jsom/+&cd=1&hl=en&ct=clnk&gl=in
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="DannyJessee.TestCustomAction"
Location="CommandUI.Ribbon"
RegistrationId="100"
RegistrationType="List">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.ListItem.Actions.Controls._children">
<Button Id="DannyJessee.MarkItemsFinishedButton"
Command="cmdMarkItemsFinished"
Image16by16="/_layouts/images/kpinormallarge-0.gif"
Image32by32="/_layouts/images/kpinormallarge-0.gif"
LabelText="Mark as Finished"
TemplateAlias="o2" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="cmdMarkItemsFinished"
CommandAction="javascript:MarkItemsFinished();"
EnabledScript="javascript:EnableFinishedButton();">
</CommandUIHandler>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="DannyJessee.TestScript"
Location="ScriptLink"
ScriptSrc="/_layouts/15/CustomRibbonButton/CustomAction.js" />
</Elements>
If this helped you resolve your issue, please mark it Answered -
How to select multiple row in ALV report
Hi friends,
1. How to select multiple row in ALV report
( How to set tab in ALV report and want to select multiple line.)
Thanking you.
SubashHi Sahoo,
If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
in layout structure you will find field SEL_MODE
pass :
LS_LAYOUT-SEL_MODE = 'A'.
In PAI.
CALL METHOD GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = T_ROWS
ET_ROW_NO = T_ROWID.
Hope these will solve your problem.
Regards,
Kumar M. -
Combining multiple lists into a single list
Hi,
I have created 5 different lists within the same sharepoint site. These lists have some common fields among them for example each list has same fields such as "Country", "Unit", "Review Name" etc. I now want to create a single
list that will have show only the common fields present in each list. Could you please advise if this can be done and if so how?
Thanks, AartiTo have a full fledged synchronization between 5 lists will be very complicated.
If the 6th list is a read-only / view only, I would recommend you to create Lists 1, 2,3,4 and 5 as a custom content type.
Then you can put a Content Query Web Part that filters out your custom content type and combines the content from the three lists.
or create a workflow to update the data when new item is added in other lists
Check the similar post
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2480cdbe-acb4-434f-9866-cf716cad0994/combining-multiple-lists-into-a-single-list?forum=sharepointadminlegacy
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5a853466-7480-438a-b32d-3ad6d34347ef/combine-lists?forum=sharepointdevelopment -
Is it possible to view the content of multiple lists, that are located in different webs as well, in just one ListViewWebpart? Could I maybe change the query programmatically so that it get's the content this way?
I know that I could use the Content Query Webpart instead - actually I have been using that so far, but the problem is, that it brings no standard Sharepoint functionality for lists with it... I had to write the xsl style sheet, there are no dynamic filters
that the user could set, there are no default list operations the user could use.
The ListViewWepart has all of these, but it only shows the content of one list...
And my second problem:
One column can contain multiple values (like a column that contains multiple users or user groups that are related to one entry). I can filter every other column with the standard filters, but not the column with multiple values in it. Is it possible to
activate that or maybe add this feature programmatically?You can fetch data from multiple lists in ListViewWebpart, this can be possible through Content Query web part or Custom Web Part using visual studio but in that case you can not get the standard SharePoint funcationality for list (which is available in
ListViewWebparts).
No OOB filter available for multi-choice column, you also have to go with custom solution to achieve this.
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer. -
Dear Expert,
I am new to OOPS ,
I want to display drop down list for a particular field in my output, so I am using OOPS but in my below code
I am facing problem in displaying the output as I am getting the error message
Field catalog not found...
Also advice me how to display drop down list in a particular field.
Please advice
MODULE pbo OUTPUT.
SET PF-STATUS 'ZTEST'.
IF g_custom_container IS INITIAL.
DATA: lt_exclude TYPE ui_functions,
lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
CREATE OBJECT g_custom_container
EXPORTING
container_name = g_container.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
PERFORM field_catalog TABLES it_lvc_t_fcat
USING: 'S_FINAL' 'MATNR' ' ' 'Part Number' ' ' ' ',
'S_FINAL' 'MAKTX' ' ' 'Part Description' ' ' ' ',
'S_FINAL' 'MBLNR' ' ' 'Document No' ' ' ' ',
'S_FINAL' 'BLDAT' ' ' 'Document date' ' ' ' ',
'S_FINAL' 'LIFNR' ' ' 'Vendor Number' ' ' ' ',
'S_FINAL' 'STATUS' ' ' 'Acknowledgement' ' ' 'X',
'S_FINAL' 'REMARKS' ' ' 'Remarks' ' ' 'X'.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
* I_STRUCTURE_NAME =
is_layout = it_lvc_s_layo
CHANGING
it_outtab = i_final
it_fieldcatalog = it_lvc_t_fcat
ENDIF.
ENDMODULE. " PBO OUTPUT
FORM field_catalog TABLES t_field_catalog STRUCTURE wt_lvc_s_fcat
USING fp_tabname TYPE any
fp_fieldname TYPE any
fp_key TYPE any
fp_text TYPE any
fp_do_sum TYPE any
fp_edit TYPE any.
t_field_catalog-tabname = fp_tabname.
t_field_catalog-fieldname = fp_fieldname.
t_field_catalog-key = fp_key.
t_field_catalog-seltext = fp_text.
t_field_catalog-do_sum = fp_do_sum .
t_field_catalog-edit = fp_edit .
ENDFORM. "field_catalog
Edited by: Karthik R on Mar 15, 2010 6:11 PMHi Karthik,
Below mentioned is a Simple code for creating dropdown lists for columns in ALV grid output
REPORT z_alv_dropdown.
*Type pools declarations for ALV
TYPE-POOLS : slis.
*data declarations for ALV container, ALV grid, Field catalogues & layout
DATA: g_grid TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container,
gt_fieldcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo.
*INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
wa_outtab TYPE t517a.
*initialisation event
INITIALIZATION.
*Start of selection event
START-OF-SELECTION.
*Call to ALV
CALL SCREEN 600.
*On this statement double click it takes you to the screen painter SE51.
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen , Here we can give a title and customized menus
Here we also call the subroutine for ALV output.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
set pf-status 'xxx'.
set titlebar 'MAIN100'.
Subroutine to display the output in alv
PERFORM alv_output.
ENDMODULE. "pbo OUTPUT
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes and
based on the user command we can do the coding.
MODULE PAI INPUT *
MODULE pai INPUT.
ENDMODULE. "pai INPUT
*& Form BUILD_FIELDCAT
FORM build_fieldcat.
DATA ls_fcat TYPE lvc_s_fcat.
*Build the field catalogue
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'T517A'
CHANGING
ct_fieldcat = gt_fieldcat.
To assign dropdown in the fieldcataogue
LOOP AT gt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'SLART'.
*drdn-hndl = '1' is the first list box
ls_fcat-drdn_hndl = '1'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
*drdn-hndl = '2' is the second list box
WHEN 'ABART'.
ls_fcat-drdn_hndl = '2'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM. "build_fieldcat
*& Form ALV_OUTPUT
FORM alv_output .
*Create object for container
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CCONT'.
*create object for grid
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
Build fieldcat and set column
*Assign a handle for the dropdown listbox.
PERFORM build_fieldcat.
*Build layout
PERFORM build_layout.
Define a drop down table.
PERFORM dropdown_table.
*fetch values from the T517A table
SELECT * FROM t517a INTO TABLE gt_outtab.
*Display ALV output
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = gt_outtab.
ENDFORM. "ALV_OUTPUT
*& Form dropdown_table
text
--> p1 text
<-- p2 text
FORM dropdown_table.
*Declarations for drop down lists in ALV.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
First SLART listbox (handle '1').
ls_dropdown-handle = '1'.
ls_dropdown-value = '01 Pink'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '02 Yellow'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '03 Green'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '04 Black'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '05 White'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '06 Blue'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '09 Other Colors'.
APPEND ls_dropdown TO lt_dropdown.
*method to display the dropdown in ALV
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.
ENDFORM. " dropdown_table
*& Form build_layout
text
*layout for ALV output
FORM build_layout .
gs_layout-cwidth_opt = 'X'.
gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
gs_layout-no_toolbar = 'X'.
ENDFORM. " build_layout
Hope it is helpful,
Regards,
Soundarya. -
Hi,
in sapgui java 7.10 (on mac osx 10.5.1) I cannot select multiple columns in ALV reports.
I can do it only in some transactions (like SE16). But on all our custom reports (REUSE_ALV_GRID_DISPLAY) in does not work.
Any hint?
Many thanks,
LorenzoHi Lorenzo,
did you double check if selecting multiple columns works with SAP GUI for Windows in the same report?
If yes, I suggest to file a bug report so we can do a remote logon to run your custom report.
If not it might be because of REUSE_ALV_GRID_DISPLAY itself or your parameters calling REUSE_ALV_GRID_DISPLAY.
Best regards
Rolf-Martin -
Hello ,
I have a requirement to display Multiple heading in ALV Grid, I am using the Class 'cl_gui_alv_grid'. please let me know if you have Any suggestions.
Ex:
| Divison |
Sub D:1
Sub D: 2
Sub D: 3
Like wise i have few more divisions to display and Under we need to display the Sub Division also .
Thanks in Advance.. Waiting for your suggestions.
With Best Regards
NagsHi,
I had attempted to do it in the object oriented way, but found no ready solution, so I settled for the below solution.
Please use the function REUSE_ALV_COMMENTARY_WRITE.
This allows you to print multiple lines in the header.
I had a requirement of showing 5 lines in the header.
So i went on like:
DATA: it_list_commentary TYPE slis_t_listheader,
wa_list_commentary TYPE slis_listheader.
wa_list_commentary-typ = 'H'.
wa_list_commentary-info = <text>.
APPEND wa_list_commentary TO it_list_commentary.
wa_list_commentary-typ = 'S'.
wa_list_commentary-info = <text>.
APPEND wa_list_commentary TO it_list_commentary.
I fed he internal table with all 5 lines like above.
Finally I called the function.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_list_commentary.
Regards,
Prosenjit.
Edited by: prosenjit chaudhuri on Jan 28, 2009 6:14 AM -
Customising a SharePoint list content type form - "Manage multiple list items with this form"
I have designed a form for a content type on an existing SharePoint list. When I ran the initial wizard, I selected
Manage multiple list items with this form which is great, exactly what I want.
But, there are some columns in this content type that I do not want repeating and have them moved them outside of the Repeating Section but I am getting the below error. I can't seem to find a way to create a new non-repeating group though. Any
advice on how to do this?*Bump*
-
How to handle interactive list in alv reports
hi experts.
how to handle interactive list in alv reports.
regards.
subhasisHI Subhasis,
below is the sample code for handling an interactive ALV report, hope this helps you ..
REPORT ZTEST_ALV123.
TYPE-POOLS:SLIS.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF ITAB1.
DATA: IT_LIPS LIKE ITAB1 OCCURS 0 WITH HEADER LINE.
SELECT VBELN
POSNR
FROM VBAP
INTO TABLE ITAB.
IF SY-SUBRC = 0.
SORT ITAB BY VBELN .
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE ITAB1
FROM LIPS
FOR ALL ENTRIES IN ITAB
WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
ENDIF.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
*& Form POPUP
text
-->P_EXTAB text
FORM POPUP USING P_EXTAB TYPE SLIS_T_EXTAB.
"here double click on PFSTATUS and create the status, "activate, before that set PICK for choose(F2).
*- Pf status
SET PF-STATUS 'PFSTATUS'.
ENDFORM. " POPUP
*& Form HANDLE_USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
LOOP AT ITAB1 WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
MOVE-CORRESPONDING ITAB1 TO IT_LIPS.
APPEND IT_LIPS.
ENDLOOP.
PERFORM INTERACTIVE_REPORT.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
*& Form interactive_report
text
FORM INTERACTIVE_REPORT .
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGBEL'.
X_FIELDCAT-SELTEXT_M = 'SO #'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGPOS'.
X_FIELDCAT-SELTEXT_M = 'SO ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 4.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT1
TABLES
T_OUTTAB = IT_LIPS
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " interactive_report
Regards,
Ranjita
null -
How to use intractive list in Alv REPORT
how to use intractive list in Alv REPORT with example.
thangs
venki.......Hi
using the USER_COMMAND we can move to the Secondary(interactive) list in the ALV
see the sample code
report yh645_secndry_alv.
type-pools: slis.
data: fieldcat type slis_t_fieldcat_alv,
fieldcat_ln like line of fieldcat,
fs_layout type slis_layout_alv,
t_layoout like standard table
of fs_layout.
data: begin of fs_spfli,
carrid type spfli-carrid,
connid type spfli-connid,
countryfr type spfli-countryfr,
cityfrom type spfli-cityfrom,
airpfrom type spfli-airpfrom,
countryto type spfli-countryto,
cityto type spfli-cityto,
airpto type spfli-airpto,
fltime type spfli-fltime,
deptime type spfli-deptime,
arrtime type spfli-arrtime,
distance type spfli-distance,
distid type spfli-distid,
fltype type spfli-fltype,
period type spfli-period,
checkbox,
color(3),
end of fs_spfli.
data:
begin of fs_table,
carrid type spfli-carrid,
connid type spfli-connid,
end of fs_table.
data: begin of fs_sflight,
check,
color(3).
include type sflight.
data:end of fs_sflight.
data:
begin of fs_table1,
carrid type sflight-carrid,
connid type sflight-connid,
fldate type sflight-fldate,
end of fs_table1.
data:
t_spfli like standard table
of fs_spfli.
data:
t_table like standard table
of fs_table.
data:
t_table1 like standard table
of fs_table1.
data:
t_sflight like standard table
of fs_sflight.
data:
t_sbook like standard table
of sbook.
data t_layout type slis_layout_alv.
select *
into corresponding fields of table t_spfli
from spfli.
perform start_list_viewer.
perform get_spfli_details.
*& Form SUB1
text
-->RT_EXTAB text
form sub1 using rt_extab type slis_t_extab.
data: flight type slis_extab.
flight-fcode = 'SFLIGHT'.
append flight to rt_extab.
set pf-status 'SFLIGHT'. " EXCLUDING RT_EXTAB.
endform. "SUB1
*& Form START_LIST_VIEWER
text
--> p1 text
<-- p2 text
form start_list_viewer .
data: pgm like sy-repid.
pgm = sy-repid.
fs_layout-box_fieldname = 'CHECKBOX'.
fs_layout-info_fieldname = 'COLOR'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_callback_pf_status_set = 'SUB1'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SPFLI'
is_layout = fs_layout
tables
t_outtab = t_spfli
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " START_LIST_VIEWER
*******Process Call Back Events (Begin)**************************
form user_command using ucomm like sy-ucomm
selfield type slis_selfield.
case ucomm.
when 'SFLIGHT'.
selfield-refresh = 'X'.
perform get_spfli_details.
select *
from sflight
into corresponding fields of table t_sflight
for all entries in t_table
where carrid eq t_table-carrid
and connid eq t_table-connid.
perform display_sflight.
when 'SBOOK'.
selfield-refresh = 'X'.
perform get_sflight_details.
select *
from sbook
into corresponding fields of table t_sbook
for all entries in t_table1
where carrid eq t_table1-carrid
and connid eq t_table1-connid
and fldate eq t_table1-fldate.
perform display_sbook.
endcase.
endform. "USER_COMMAND
*& Form SUB2
text
-->RT_EXTAB text
form sub2 using rt_extab type slis_t_extab.
data: flight type slis_extab.
flight-fcode = 'SBOOK'.
append flight to rt_extab.
set pf-status 'SBOOK'. " EXCLUDING RT_EXTAB.
endform. "SUB2
*& Form DISPLAY_SFLIGHT
text
--> p1 text
<-- p2 text
form display_sflight .
data: pgm like sy-repid.
pgm = sy-repid.
clear t_layout.
fs_layout-box_fieldname = 'CHECK'.
fs_layout-info_fieldname = 'COLOR'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_callback_pf_status_set = 'SUB2'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SFLIGHT'
is_layout = fs_layout
tables
t_outtab = t_sflight
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_SFLIGHT
*& Form GET_SPFLI_DETAILS
text
--> p1 text
<-- p2 text
form get_spfli_details .
loop at t_spfli into fs_spfli.
if fs_spfli-checkbox = 'X'.
fs_spfli-color = 'C51'.
fs_spfli-checkbox = '1'.
fs_table-carrid = fs_spfli-carrid.
fs_table-connid = fs_spfli-connid.
append fs_table to t_table.
modify t_spfli from fs_spfli.
endif.
endloop.
endform. " GET_SFLIGHT_DETAILS
*& Form GET_SFLIGHT_DETAILS
text
--> p1 text
<-- p2 text
form get_sflight_details .
loop at t_sflight into fs_sflight.
if fs_sflight-check = 'X'.
fs_sflight-color = 'C71'.
fs_sflight-check = '1'.
fs_table1-carrid = fs_sflight-carrid.
fs_table1-connid = fs_sflight-connid.
fs_table1-fldate = fs_sflight-fldate.
append fs_table1 to t_table1.
modify t_sflight from fs_sflight.
endif.
endloop.
endform. " GET_SFLIGHT_DETAILS
*& Form DISPLAY_SBOOK
text
--> p1 text
<-- p2 text
form display_sbook .
data: pgm like sy-repid.
pgm = sy-repid.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_structure_name = 'SBOOK'
tables
t_outtab = t_sbook
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_SBOOK
Reward points for useful Answers
Regards
Anji -
How to select multiple records in ALV with out pressing ctrl
Hi Experts,
Is there a way to select multiple records in ALV with out pressing ctrl button on the key board?
Selection and deselection should allow multiple records.
any clue is highly appreciated.
regards,
AjayThe keyboard always plays a role, although with the Shift key you can select blocks of records.
○ CTRLclick, CTRLspacebar
Toggles a selection.
○ SHIFTclick, CTRLshift
Selects the area from the lead selection to the row selected. If no lead selection is set, the selection starts from the first row. In the multiNoLead mode, the selection starts from the row last selected -
Classical List to ALV format in sap abap report
Hi All,
I have a requirement to change the existing abap report in which teh output is dispalyed in classical list format.
I want to convert this list report output into ALV format.
COuld anyone please help me how to convert this from Classical list to ALV format?
Thanks,
Komal.
Moderator message: sorry, this not the place to teach the basics, please search for available information. If you understand the classical list and how to use ALV, then you can also do the transfer yourself.
Edited by: Thomas Zloch on Aug 12, 2011 4:44 PMThis will be very difficult for you.....
Since you are getting a time out error....it looks like, you are runnning this report in foreground....................
Try running it in background it will work...
ELSE....you have to fetch in small chunks....but the question is how will you do it. Since the USR02 only has BNAME as primary key...
Either put the BNAME as part of selection screen and fetch the data.....it will solve your problem....
Only fetch for those BNAME which is entered in the selection screen...
Hope it helps! -
Send one mail for multiple list item update
i have 3 lists storing customer details which are displayed in a page. i need to send mail whenever there is customer details update(any or all 3 lists). should send only one mail per customer details update(not per list item update).Please advise how to
achieve this using SharePoint workflow.Hi,
According to your post, my understanding is that you want to send an email when this are list items update.
A workaround is that we can use one big list to store the customer details from these three lists, then let users update their information in the big list and send email.
Or we can create a form to update these 3 lists, then send a mail when the form saved.
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/39f2d0bf-6cfd-4b61-b0b7-ff89113406d5/update-multiple-list-from-a-single-form-using-infopath-in-sharepoint-2010?forum=sharepointcustomizationprevious
Best Regards
Dennis Guo
TechNet Community Support
Maybe you are looking for
-
SSRS 2008 R2 report prints empty spaces for html content till end of page
Hi I need to display records containing long html content say each record of different size ranging from 5 lines to 3-5 pages. Issue observed is: When a record complete is printing say half the page and subsequent record is bigger then half a page, t
-
PI 7.1 memory settings ?
Hi Guys, I have installled PI 7.1 and i am looking for ABAP and Java memory settings. I am facing lot of short dump errors on the ABAP side when installing the support packs. I have restored the image back and now i want to set the memory parameters
-
How do I create a booklet in pages?
Hi I want to do an order of servie for a wedding - which is on Saturdsy - and I need to get it printed as a booklet. I can't see how to do this in Pages. Thanks in advance for your help. Elaine
-
Controlling spry accordion from flash doesn't work in IE 8
Hi all, I created a spry accordion in an html page and a little spry controller in flash, on the same page. The flash controller contains buttons that should trigger the accordion in the same page. here is the code I inserted in a flash button: on (r
-
Hi All, why we are using LDB'S in HR ABAP PRG.. and use of END-OF-SELECTION. reply soon plz......... regards, vijay.