Multiple headerline in alv
Hi experts...
I am using REUSE_ALV_GRID_DISPLAY function for alv...
but I want output in below formate:
INVENTORY----
OPENING INV
INCOMING
OUTGOING
00000000999
000000999
0000000999
Can anybody help me...
Hi,
You can use REUSE_ALV_LIST_DISPLAY to achieve this as below,
in TOP_OF_PAGE display |--INVENTORY--
| using WRITE AT statement.
and for other descriptions as
OPENING INV | INCOMING | OUTGOING|
pass it as fieldcatalog values , this should solve the problem.
Regards,
Raghavendra
Similar Messages
-
ALV list: Multiple headerlines?!
Hi
I need multiple headerlines in my ALV list, as shown here:
Books--MagasinDVD--
Paper-electronPaper-Electron--XXXyyy---
====================================================
232 444 21 998 6655 12
Books, Magasin, and DVD is written as headerline1,
paper, electron, paper, electron, xxx, yyy is written as headerline 2.
Then items line is written.
Can/will anybody help me, please?
Best regards.
LYou can do this in the top-of-page event of ALV.sample code is as below :
data :
IT_EVENTS TYPE SLIS_T_EVENT,
IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
G_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*Build the event table
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS.
READ TABLE IT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE G_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO IT_EVENTS.
ENDIF.
REFRESH LT_MATNR[].
LOOP AT SO_MATNR.
LT_MATNR-MATNR = SO_MATNR-LOW.
APPEND LT_MATNR.
ENDLOOP.
CLEAR LV_TEXT.
DATA : LV_INDEX TYPE I,LV_MATNR1 LIKE LIPS-MATNR,LV_MATNR2 LIKE LIPS-MATNR.
LV_TEXT = 'Products:'.
DESCRIBE TABLE LT_MATNR LINES LV_INDEX.
IF NOT LV_INDEX IS INITIAL.
READ TABLE LT_MATNR INTO LV_MATNR1 INDEX 1.
READ TABLE LT_MATNR INTO LV_MATNR2 INDEX LV_INDEX.
IF LV_MATNR2 IS INITIAL.LV_MATNR2 = LV_MATNR1.ENDIF.
CONCATENATE LV_TEXT LV_MATNR1 'To' LV_MATNR2 INTO LV_TEXT
SEPARATED BY SPACE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR LS_LINE.
ENDIF.
REFRESH LT_SHTYP[].
IF NOT SO_SHTYP[] IS INITIAL.
LOOP AT SO_SHTYP.
LT_SHTYP-SHTYP = SO_SHTYP-LOW.
APPEND SO_SHTYP.
ENDLOOP.
CLEAR :LV_TEXT,LV_INDEX..
FORM TOP_OF_PAGE *
FORM TOP_OF_PAGE.
ULINE.
WRITE : SY-TITLE(65) CENTERED, 'Page :' , SY-PAGNO .
ULINE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
ULINE.
ENDFORM. "TOP_OF_PAGE
DATA : LV_SHTYP1 LIKE VTTK-SHTYP ,LV_SHTYP2 LIKE VTTK-SHTYP.
DESCRIBE TABLE LT_SHTYP LINES LV_INDEX.
IF NOT LV_INDEX IS INITIAL.
READ TABLE LT_SHTYP INTO LV_SHTYP1 INDEX 1.
READ TABLE LT_SHTYP INTO LV_SHTYP2 INDEX LV_INDEX.
IF LV_SHTYP2 IS INITIAL.LV_SHTYP2 = LV_SHTYP1.ENDIF.
CONCATENATE LV_TEXT LV_SHTYP1 'To' LV_SHTYP2 INTO LV_TEXT
SEPARATED BY SPACE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR LS_LINE.
ENDIF.
ENDIF.
CLEAR LV_TEXT.
CONCATENATE SO_DATE-LOW6(2) SO_DATE-LOW4(2) SO_DATE-LOW+0(4)
INTO LV_LOW SEPARATED BY '.'.
CONCATENATE SO_DATE-HIGH6(2) SO_DATE-HIGH4(2) SO_DATE-HIGH+0(4)
INTO LV_HIGH SEPARATED BY '.'.
IF LV_HIGH = '00.00.0000'. LV_HIGH = LV_LOW.ENDIF.
CONCATENATE 'Posting Date:' LV_LOW 'to' LV_HIGH
INTO LV_TEXT SEPARATED BY SPACE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR LS_LINE. -
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. -
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 -
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 -
Hi All,
I have the following requirement, need to display multiple headers in ALV display(not multiple lines in alv header).
Header1.
Row1
Row2
Row3
Footer 1.
Header2.
Row1
Row2
Row3
Footer 2.
Header3.
Row1
Row2
Row3
Footer 3.
To display this in hierarchal ALV the above given tables does not have header item relationship. To use Blocked ALV the number of blocks are not constant, Sometimes there can be only 2 blocks sometimes there can be 10 blocks and some times even more, there is no cap on Maximum number of blocks.
I have searched in SDN N google but couldnt found suitable answer. If anyone has solved this type of issue before, can please through some light.
Thanks in Advance.Hi All,
I'm able to solve the above issue somewhat by using split technique. I want to know how to trigger top of page event in split. I want to trigger top of page event in same container where data is being displayed.
I have created container on screen and splitted that container into 3 parts, as I need to display data in each container. Now I want to display top of page for each container.
I have searched over internet and SDN but I'm able to find examples like split the containers into 2 parts and use 1 part for top of page and second part for data display.
My case is little different. I need to display data in each container with separate header for each container. If the header is only single line I could have used Layout-Title, but the header for each container is multiple lines. So I must use top of page.
If any body handled such kind of scenario, please provided some inputs.
Thanks in advance. -
Multiple levels in ALV Hierarchy
Hi All
How to display Multiple levels in ALV Hierarchy.
I have header and Item Tables but Under Header Expansions I have to display one more Expansion.
Means Multiple levels.Hi,
I think you can check standard program BCALV_TEST_HIERSEQ_LIST
Regards,
Himanshu -
How to avoid multiple selection in ALV tree control?
Hi,
Experts,
I want to avoid multiple selections on Alv tree control after pressing control keyboard button(Ctrl). Even by pressing Ctrl keyword button i want to select only one row of a Alv tree control.i have used cl_salv_tree class for it is there any method to achieve this please pass some code/idea on it.
Thanks in advance,
Shabeer ahmed.I haven't tried it before but it should help.
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01] -
How to select multiple lines in ALV report
hi gurus,
I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
Regards,
Satyajithi,
try like this
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
TYPES: BEGIN OF t_ekko,
sel, "stores which row user has selected
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
DATA : BEGIN OF det_tab OCCURS 0,
ebeln LIKE ekpo-ebeln,
END OF det_tab.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
gd_layout-box_fieldname = 'SEL'.
"set field name to store row selection
gd_layout-edit = 'X'. "makes whole ALV table editable
gd_layout-zebra = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_STAT'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'DET'. "button add by me
CLEAR det_tab.
REFRESH det_tab.
LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
MOVE-CORRESPONDING wa_ekko TO det_tab.
APPEND det_tab.
ENDLOOP.
PERFORM build_cat.
PERFORM dis_data.
ENDCASE.
ENDFORM. "user_command
*& Form set_stat
* text
* -->RT_EXTAB text
FORM set_stat USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
ENDFORM. "set_stat
*& Form build_cat
* text
FORM build_cat.
CLEAR fieldcatalog1.
REFRESH fieldcatalog1.
fieldcatalog1-fieldname = 'EBELN'.
fieldcatalog1-tabname = 'DET_TAB'.
fieldcatalog1-seltext_m = 'Order No.'.
fieldcatalog1-outputlen = 10.
APPEND fieldcatalog1 TO fieldcatalog1.
CLEAR fieldcatalog1.
ENDFORM. "build_cat
*& Form dis_data
* text
FORM dis_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_DS'
it_fieldcat = fieldcatalog1[]
i_save = 'X'
TABLES
t_outtab = det_tab.
ENDFORM. "dis_data
here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
here u can select morethan one line using control(ctrl)
reward if usefull... -
Hello Experts,
We are working on a report in which we are supposed to display few fields regarding customer and most of them are time fields. My issue is at the end of every customer i need to display the AVERAGE time as a subtotal. I am having all the data in a internal table which i am passing to REUSE_ALV_GRID_DISPLAY which will be having multiple customer and multiple records for each customer. I tried with the optoin 'do_sum' of field catalog but it is not working. I tested with some other sample program where it worked but in the sample program i am using quantity to be summed up. Is there is any way of getting the average of the time at the end of every customer using ALV Grid..?? Or is there is any best way to display this other than ALV grid...?
My requirement will be much similar to this
Cust1 A1 123 00:04:00
A2 111 00:06:00
Total (2) 00:05:00
Cust2 B1 898 00:01:00
B2 789 00:06:00
B3 454 00:02:00
Total (3) 00:03:00
Thanks & Regards,
Uday S.Hi,
In field catalog for avarage field make do_sum as truc (X) and pass the customer in the sort table. You can take reference of the below code.
Grouping A
wa_fieldcat-fieldname = 'TSL_A'.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_m = wa_fieldcat-seltext_l = text-015.
wa_fieldcat-do_sum = c_true.
wa_fieldcat-outputlen = 20.
l_col_pos = l_col_pos + 1. "SD0K962726
wa_fieldcat-col_pos = l_col_pos. "SD0K962726
*--- Sort order for subtotal
l_wa_sort-fieldname = 'RBUNIT'.
l_wa_sort-spos = '01'.
l_wa_sort-subtot = c_true.
append l_wa_sort to it_sort.
l_wa_sort-fieldname = 'HRTXT1'.
l_wa_sort-spos = '02'.
append l_wa_sort to it_sort.
l_wa_sort-fieldname = 'HRTXT2'.
l_wa_sort-spos = '03'.
append l_wa_sort to it_sort.
*--- call the list for output
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_user_command = 'F_DOUBLE_CLICK' "SD0K963313
is_layout = l_wa_layout
it_fieldcat = it_fieldcat
it_sort = it_sort " You need pass this table for your case it will be customer field
i_save = l_save
is_variant = wa_variant1
it_events = it_events
tables
t_outtab = it_output
exceptions
program_error = 1
others = 2.
Thanks
Subhankar -
Folder for multiple details in ALV GRID DISPLAY
Hi All,
I am developing one ALV GRID DISPLAY report. Here I am displaying the material and production order details in the report. If we have the multiple production order details for one material , then in that case , we have to place one folder at the first material level, in that folder I need to show all the multiple production order details.
I am using FUNCTION MODULE to develope the report, not using any Objects to develope this.
Thanks in advance.
Ramesh.Here is a simple example of such an ALV.
report zrich_0001.
type-pools: slis.
data: begin of head occurs 0,
matnr type afpo-matnr,
maktx type makt-maktx,
EXPAND type c,
end of head.
data: begin of detail occurs 0,
aufnr type afpo-aufnr,
matnr type afpo-matnr,
werks type aufk-werks,
pwerk type afpo-pwerk,
psmng type afpo-psmng,
end of detail.
start-of-selection.
select * into corresponding fields of table detail
from afpo
inner join aufk
on afpo~aufnr = aufk~aufnr
inner join afko
on afpo~aufnr = afko~aufnr
up to 500 rows
where aufk~auart = 'PP01'.
if not detail[] is initial.
sort detail ascending by matnr.
select distinct * into corresponding fields of table head
from makt
for all entries in detail
where matnr = detail-matnr
and spras = sy-langu.
endif.
perform call_alv.
* FORM call_alv *
form call_alv.
data: gt_fieldcat type slis_t_fieldcat_alv,
gs_keyinfo type slis_keyinfo_alv,
gs_layout type slis_layout_alv.
data: ls_fieldcat type slis_fieldcat_alv.
clear gs_keyinfo.
gs_keyinfo-header01 = 'MATNR'.
gs_keyinfo-item01 = 'MATNR'.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-reptext_ddic = 'Material'.
ls_fieldcat-tabname = 'HEAD'.
ls_fieldcat-outputlen = 18.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'MAKTX'.
ls_fieldcat-reptext_ddic = 'Description'.
ls_fieldcat-tabname = 'HEAD'.
ls_fieldcat-outputlen = 40.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'AUFNR'.
ls_fieldcat-reptext_ddic = 'Production Order'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 12.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-reptext_ddic = 'Production Plant'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 4.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'PWERK'.
ls_fieldcat-reptext_ddic = 'Planning Plant'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 4.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'PSMNG'.
ls_fieldcat-reptext_ddic = 'Quantity'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 20.
append ls_fieldcat to gt_fieldcat.
gs_layout-expand_fieldname = 'EXPAND'.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
it_fieldcat = gt_fieldcat[]
is_layout = gs_layout
i_tabname_header = 'HEAD'
i_tabname_item = 'DETAIL'
is_keyinfo = gs_keyinfo
tables
t_outtab_header = head
t_outtab_item = detail.
endform.
Regard,s
RIch Heilman -
Download data from multiple tabs of ALV to tabs of Excel
Hi,
I have a requirement where ALV is being displayed in 6 tabs. Can a download functionality be provided in such a way that data from all the tabs gets downloaded into multiple sheets of Excel document.
In the attached file, expected output with ALV in multiple tabs is displayed. Are there any Function modules which can be used to download data from ALV in each tab into Excel document sheets in one go?
Thanks,
Tejaswini.This is a FAQ, did you use search tool with keywords like worksheet, activate and OLE to find many threads and (some examples)
a sample like XLSX Upload - A Unified Approach
a project like abap2xlsx
Regards,
Raymond -
How to create multiple buttons in ALV Toolbar in Webdynpro ABAP
Hi all,
I am trying to create multiple buttons in Webdynpro ALV toolbar, please go through the code.
What happening is, second button is replacing the first one.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv_table( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv_table( ).
DATA lv_value TYPE REF TO cl_salv_wd_config_table.
lv_value = lo_interfacecontroller->get_model(
DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
DATA button1 TYPE REF TO cl_salv_wd_function.
DATA button2 TYPE REF TO cl_salv_wd_function.
**First button
CREATE OBJECT lr_buttonui1.
lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
button1->set_editor( lr_buttonui1 ).
**Second button
CREATE OBJECT lr_buttonui2.
lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
button2->set_editor( lr_buttonui2 ).
How can I overcome this??
Thanks
EshwarHi Eshwar,
The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
**First button
CREATE OBJECT lr_buttonui1.
lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
button1->set_editor( lr_buttonui1 ).
**Second button
CREATE OBJECT lr_buttonui2.
lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
button2->set_editor( lr_buttonui2 ). -
Hi all,
i want to know is there any way to get multiple checkboxes when i am using FM Reuse_alv_fieldcatalog_merge.. to create ALV...
I know that by giving the style we can get one checkbox.. but i need to display 5 checkboxes...
Help me out frens.
Regards,
SyedYou mean this... This shows a column with a check box for each row.
REPORT ztest_alv_check MESSAGE-ID zz .
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv,
x_events TYPE slis_alv_event,
it_events TYPE slis_t_event.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
chk(1),
END OF itab.
SELECT vbeln
posnr
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
x_fieldcat-fieldname = 'CHK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-checkbox = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-hotspot = 'X'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form USER_COMMAND
* text
* -->R_UCOMM text
* -->RS_SELFIELD text
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: gd_repid LIKE sy-repid, "Exists
ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data .
ENDIF.
LOOP AT itab WHERE chk = 'X'.
itab-chk = 'X'.
MODIFY itab TRANSPORTING chk WHERE vbeln = itab-vbeln .
ENDLOOP.
rs_selfield-refresh = 'X'.
BREAK-POINT.
ENDFORM. "USER_COMMAND
Maybe you are looking for
-
Whenever I open a Private Browsing window, it closes all of my non-private windows until I end the private session. Is there a setting or add-on that will make it so I can have both private and non-private windows open? Both Internet Explorer and Chr
-
Lock screen in gnome 3.2
Before the upgrade the upgrade to gnome 3.2 the following feature was working ok: whenever the laptop lid is closed the system suspends to RAM, whenever the laptop lid is opened up, the system resumes and the screen is locked. The screen lock feature
-
Number of Records in Masterdata
Hallo Experts, Do anbody know why i have two diffenrent number of records. the first one is when i right-click the Infoobject and manage-Masterdata here is 737. the second number is when i make a report of the records in ABAP "select *" 713 records f
-
Hi, I need to develop a 2d game in flash that will use joystick and rubber paddles as input. Is there any tutorial available for how to use these game input devices in flash action script 3.0. Best Regards, Amit
-
My phone was disabled and needed connection to itunes. After following the restore instructions it didnt work? There was no change in internet connection or cable connection with the iPhone, it just came up with the error box after 8 very long hours