Multiple Lines Header and Records in ALV List
Dear All,
I am faced with a wierd user requirement to print multiple line header in ALV. Currently we have a classical report where we are displaying a huge text for example 400 characters in a single cell of a column of the report.
Now we will have to convert this to ALV report where I need to show that data in a single cell. I am wondering how is it possible in ALV list/grid. Please let me know if you guys have any clue.
Regards,
Bikramjit
Hi,
Did you find a solution for this?, I am also having a similar requirement.
If you have any work around please share.
Thanks.
Similar Messages
-
Header and Footer in ALV.. URGENT
Hi All,
I want to print Header and Footer in ALV list/grid. Like in header, i want page no.( 1 of 10), UserName, Report Name etc.. and in Footer, I need selection screen criteria. For this I am using a function module (FM_SECECTOIN_CRITERIA_PRINT).
Where exactly should i code this part in my program.
Regards,
Parvez.Check this link -
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
http://www.sap-img.com/fu037.htm
http://www.sap-img.com/abap-function.htm
Regards,
Amit -
Change and Save records on ALV List
Hi,
i made alv list with fieldcatalog-edit to change records on alv list. But i want to save it to my dictionary table after changed. I think i should use dialog program to do that. The problem is how i can use dialog program.(i dont have an idea which user-command perform fields on alv list) I have used dialog programs before but i am new on this so i am not sure how i can do that. I will be pleased if you can help me.
Regards.Hello Masuke,
You have to code that in the AT- USER COMMAND event.
Follow the below sample code.
If the record is changed then track its index no.
and populate it in an internal table for future
action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF. ENDIF.* When save button is pressed
WHEN 'SAVE'.* Sort the index table
SORT i_index.* Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index. LOOP AT i_index.* Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF. ENDLOOP.* Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3. IF sy-subrc = 0.* Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>. REFRESH <dyn_tab_temp>.* Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table. ENDIF.
ENDCASE. rs_selfield-refresh = 'X'.
Hope it helps you.
Best Regards
Santosh -
How do i add multiple lines in a cell (like a list) in Excel for MAC?
I'm trying to add multiple lines (in the form of a list) in a individual cell in Excel for MAC. I used ALT Enter on my PC but that doesn't work on the iMac. Does anyone know how to do this?
Thanks!It's been a while but I think you hold SHIFT while typing a page break (RETURN) to make a new line without shifting to another cell.
However, as Excel isn't an Apple product, I am sure you will get a faster and more current answer by using Microsoft's Office:Mac forums here:
Office for Mac forums
They are very good. -
Creating Header and Footer in ALV
hi,
can anyone please tell how will you create Header and Footer in ALv and Classical Report.Hi,
In classical report use events 'top-of-page' for header and 'end-of-page' for footer.
in ALV
follow this link
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/header-footer-display-in-alv-grid-for-layout-description-344391
Regards and Best wishes. -
I am using CL_SALV_TABLE (List_Display = X) to create a ALV report. I am willing to change it to function module REUSE_ALV_LIST_DISPLAY if it serves my requirement.
The header for the report needs to be multiple lines (8 lines). How can I accomplish this?
I looked into the possibility of using TOP_OF_PAGE event but I will have to hard code the vertical positions of the headers and since it is ALV and you can remove columns at will, I dont think this solution will work. Also if the columns are optimized or output length changed by the user, the positioning of the headers will be ruined.
Currently the header can only be of one line, how can we make the header to display a table of contents.
H1-L1 H2-L1 H3-L1
H1-L2 H2-L2 H3-L2
H1-L3 H2-L3 H3-L3
H1-L4 H2-L4 H3-L4
H1-L5 H2-L5 H3-L5
H1-L6 H2-L6 H3-L6
H1-L7 H2-L7 H3-L7
H1-L8 H2-L8 H3-L8
Thank you.Please guide me hw to put internal table field at report header in ALV.
this is my field catalog.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = 1.
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_m = 'SalesOrderNo'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Also i wnt to total 4 field at header level and other is detail level.
Please guide me hw to do.
thnks
Bhavesh -
Multiple line selection and then capturing the selected values
Dear all
in my alv program ,i need to capture multiple line selections using checkboxes.
I have appended check boxes by adding it in the internal table & filling in field catalog.
but problem is i'm not able to capture multiple selected check boxes dynamically,
i could capture only the last selected check box,
option i found was to use class method get-selected-rows,but i'm unable to use it properly, could anyone explain in detail
i have already gone through the various examples in sdn but i am not able to work out.
like using parameters etc....
CAN ANY ONE HELP ME WITH THE CODE
help reqired immediately,
Thanks in advance.Hi Ankur,
In the PAI, just after the selection of your user event, button or menu,
add this code before getting the selected records.
<b>CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.</b>
where grid1 TYPE REF TO cl_gui_alv_grid,
Now fetch the selected records.
Check this code for reference
C O M P A N Y C O N F I D E N T I A L **
Care should be taken to prevent its unauthorized use. **
REPORT zfipost MESSAGE-ID f4 NO STANDARD PAGE HEADING .
AUTHOR : Susmitha Susan Thomas
DATE : August 18, 2005
*Abridged Version : This report generates a list in Abap List Viewer of
all the selected records in VBKPF/VBSEG. * *
(TRANSACTION ZPPD:Modified from transaction FBV0)
-- Class definition--
CLASS lcl_event_receiver DEFINITION DEFERRED.
--Tables--
TABLES: vbkpf. " Belegkopf
TABLES: tsp1d, pri_params, spopli.
TYPE-POOLS slis.
---- Global Variables -
DATA: anzkr(6) TYPE n,
lsind LIKE sy-lsind,
no_output(1) TYPE c,
records(1) TYPE c,
xpick(1) TYPE c,
xpickc(1) TYPE c,
xbinp(1) TYPE c,
rc LIKE syst-subrc,
ok_code LIKE sy-ucomm,
index TYPE i,
char_x(1) TYPE c VALUE 'X',
post TYPE c,
ans TYPE n,
user(40) TYPE c.
DATA :BEGIN OF i_doctype OCCURS 0,
blart LIKE vbkpf-blart,
END OF i_doctype.
--AlV Initialization--
DATA: gs_layout TYPE lvc_s_layo,
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat TYPE lvc_s_fcat,
gs_index_rows TYPE lvc_t_row,
l_layout TYPE disvariant,
g_repid LIKE sy-repid,
g_max TYPE i VALUE 100,
ws_row_idx TYPE lvc_t_row ,
ws_row_no TYPE lvc_t_roid,
i_excl_func TYPE ui_functions,
ls_prnt TYPE lvc_s_prnt,
refresh TYPE c,
i_fieldcat TYPE lvc_t_fcat,
post(1) TYPE c,
accr_def(1) TYPE c,
rev_cd(3) TYPE c,
ch(1) TYPE c.
DATA: list_index LIKE sy-lsind,
flag TYPE n VALUE 0,
fl TYPE n VALUE 0,
g_container TYPE scrfname VALUE 'GRID_CONTAINER',
grid_container TYPE REF TO cl_gui_docking_container,
grid1 TYPE REF TO cl_gui_alv_grid,
custom_container1 TYPE REF TO cl_gui_custom_container,
event_receiver TYPE REF TO lcl_event_receiver,
gt_vbkpf1 TYPE STANDARD TABLE OF vbkpf WITH HEADER LINE,
i_vbkpf TYPE TABLE OF vbkpf WITH HEADER LINE,
i_ws_row_idx LIKE ws_row_idx WITH HEADER LINE.
---Internal table containing details of selected documents--
DATA : BEGIN OF gt_vbkpf OCCURS 0,
xpick(1) TYPE c,
belnr LIKE vbkpf-belnr,
gjahr LIKE vbkpf-gjahr,
bukrs LIKE vbkpf-bukrs,
blart LIKE vbkpf-blart,
budat LIKE vbkpf-budat,
bldat LIKE vbkpf-bldat,
bktxt LIKE vbkpf-bktxt,
waers LIKE vbkpf-waers,
usnam LIKE vbkpf-usnam,
xblnr LIKE vbkpf-xblnr,
rev_code(3) TYPE c,
rev_rsn(15) TYPE c,
rev_date(10) TYPE c,
linecolor(4) TYPE c,
END OF gt_vbkpf.
--Table to store long text--
DATA : BEGIN OF inline OCCURS 0,
tdformat TYPE tdformat,
tdline TYPE tdline,
END OF inline.
DATA: thead LIKE thead OCCURS 0 WITH HEADER LINE.
-- Records to be posted--
DATA: BEGIN OF tbkpf OCCURS 5.
INCLUDE STRUCTURE vbkpf.
DATA: END OF tbkpf.
---- Constants -
CONSTANTS: awtyp_bkpf TYPE awtyp VALUE 'BKPF '.
CONSTANTS: awtyp_space TYPE awtyp VALUE ' '.
Selection Screen
PARAMETER: funcl LIKE t020-funcl NO-DISPLAY. "P(ost),D(isplay),U(pd)
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
p_bukrs FOR vbkpf-bukrs,
p_belnr FOR vbkpf-belnr,
p_gjahr FOR vbkpf-gjahr,
p_budat FOR vbkpf-budat,
p_bldat FOR vbkpf-bldat,
p_blart FOR vbkpf-blart,
p_xblnr FOR vbkpf-xblnr,
p_bktxt FOR vbkpf-bktxt,
p_usnam FOR vbkpf-usnam.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK blk
WITH FRAME TITLE text-010 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-002.
PARAMETER norm_doc TYPE c
RADIOBUTTON GROUP doc DEFAULT 'X' .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-001.
PARAMETER ad_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-003.
PARAMETER all_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK blk.
CLASS lcl_event_receiver DEFINITION
For capturing events on the ALV *
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
to capture all recently changed data.
handle_data_changed FOR EVENT data_changed OF
cl_gui_alv_grid
IMPORTING er_data_changed,
for hot spot
handle_hotspot FOR EVENT hotspot_click OF
cl_gui_alv_grid
IMPORTING e_column_id e_row_id.
ENDCLASS. " lcl_event_receiver (Definition)
CLASS lcl_event_receiver (Implementation)
For capturing events on the ALV *
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM f2200_handle_data_changed USING er_data_changed.
ENDMETHOD.
METHOD handle_hotspot.
PERFORM f2201_handle_hotspot USING e_column_id e_row_id .
ENDMETHOD.
ENDCLASS. " lcl_event_receiver (Implementation)
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
START-OF-SELECTION
START-OF-SELECTION.
---- Colors -
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
-------------------- Status und Title Bar----------------------------*
SET PF-STATUS funcl.
SET TITLEBAR funcl.
-- Read Records--
SELECT * FROM vbkpf INTO TABLE gt_vbkpf1
WHERE bukrs IN p_bukrs
AND ausbk IN p_bukrs
AND belnr IN p_belnr
AND gjahr IN p_gjahr
AND budat IN p_budat
AND bldat IN p_bldat
AND blart IN p_blart
AND bktxt IN p_bktxt
AND xblnr IN p_xblnr
AND usnam IN p_usnam
AND bstat EQ 'V'
AND ( awtyp IN (awtyp_bkpf, awtyp_space) OR
awtyp IS null )
ORDER BY PRIMARY KEY.
----Call the ALV Screen -
PERFORM alv_display.
END-OF-SELECTION.
FORM BELEG_PICKUP *
Indicate changing of the selected external record *
FORM beleg_pickup.
SET PARAMETER ID 'BUK' FIELD vbkpf-bukrs.
SET PARAMETER ID 'GJR' FIELD vbkpf-gjahr.
SET PARAMETER ID 'BLP' FIELD vbkpf-belnr.
CASE funcl.
WHEN 'P'.
IF anzkr IS INITIAL.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_D'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ELSE.
IF sy-ucomm EQ 'BUCH'.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
synch = char_x
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
ELSE.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
wait up to 3 seconds.
commit work.
ENDIF.
ENDIF.
WHEN OTHERS.
IF sy-tcode = 'ZPPD'.
funcl = 'P'.
ENDIF.
CALL FUNCTION 'ZPRELIMINARY_POSTING_DISPLAY'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ENDCASE.
ENDFORM.
FORM TBKPF_FUELLEN *
Include records for posting in TBKPF *
FORM tbkpf_fuellen.
records = 'X'.
LOOP AT gt_vbkpf.
IF gt_vbkpf-xpick = 'X'.
CLEAR anzkr.
CLEAR records.
IF sy-subrc = 0.
anzkr = anzkr + 1.
MOVE-CORRESPONDING gt_vbkpf TO tbkpf.
APPEND tbkpf.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM MALL *
Select All documents *
FORM mall.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = 'X'.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
FORM EMAL *
Unselect all documents *
FORM emal.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = ' '.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
Form alv_display *
To display the details on an ALV. *
FORM alv_display.
CALL SCREEN 100.
ENDFORM. " alv_display
*& Module PB0_100 OUTPUT
MODULE pb0_100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'POSTDOC'.
--To verify that posting is complete.--
---- Setting the layout -
IF grid1 IS INITIAL.
PERFORM fill_table.
-- Initializing the field catalog--
PERFORM fieldcat_init CHANGING i_fieldcat.
-- Initializing the ALV GRID and CONTAINER--
CLEAR gs_layout.
gs_layout-info_fname = 'linecolor'.
gs_layout-grid_title = 'Parked Documents'(100).
gs_layout-zebra = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_layout-sel_mode = 'A'.
gs_layout-edit = 'X'.
l_layout-report = sy-repid.
------ Create a custom container control for ALV Control----
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT grid_container
EXPORTING
dynnr = '100'
ratio = '100'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-007. " Error in object creation
LEAVE LIST-PROCESSING.
ENDIF.
-- Create an instance of alv control--
CREATE OBJECT grid1
EXPORTING
i_lifetime = 1
i_parent = grid_container.
---- Disable all unwanted button in the ALV grid -
PERFORM disable_functions TABLES i_excl_func.
---- Call the display function of ALV grid -
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
is_print = ls_prnt
it_toolbar_excluding = i_excl_func
CHANGING it_outtab = gt_vbkpf[]
it_fieldcatalog = i_fieldcat.
ENDIF. " IF cl_gui_alv_grid=>offline IS INITIAL
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
---- Create a reciever object to handle events -
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_data_changed FOR grid1.
SET HANDLER event_receiver->handle_hotspot FOR grid1.
CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid1.
ENDIF. " IF grid1 IS INITIAL.
ENDMODULE. " PB0_100 OUTPUT
*& Form fill_table
Fills the data table to be passed to the ALV grid.
FORM fill_table.
LOOP AT gt_vbkpf1.
MOVE-CORRESPONDING gt_vbkpf1 TO gt_vbkpf.
IF ad_doc = 'X' OR all_doc = 'X'.
thead-tdobject = 'BELEG'.
CONCATENATE gt_vbkpf1-bukrs
gt_vbkpf1-belnr
gt_vbkpf1-gjahr INTO thead-tdname.
thead-tdspras = sy-langu.
thead-tdid = '0004'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_code = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0005'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_rsn = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0006'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_date = inline-tdline.
REFRESH inline.
CLEAR inline.
REFRESH inline.
CLEAR inline.
ENDIF.
APPEND gt_vbkpf.
CLEAR gt_vbkpf.
ENDLOOP.
ENDLOOP.
ENDFORM.
*& Form fieldcat_init
Initialize the field catalog
FORM fieldcat_init CHANGING i_fieldcat TYPE lvc_t_fcat.
DATA: i_fldcat TYPE lvc_t_fcat WITH HEADER LINE.
CHECKBOX
CLEAR i_fldcat.
i_fldcat-fieldname = 'XPICK'.
i_fldcat-checkbox = 'X'.
i_fldcat-key = 'X'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-outputlen = '4'.
i_fldcat-scrtext_l = 'ChkB'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BELNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-hotspot = 'X'.
i_fldcat-outputlen = '15'.
i_fldcat-scrtext_l = 'Document Number'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'GJAHR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'FYear'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUKRS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'CCode'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLART'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Type'.
i_fldcat-outputlen = '6'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Doc Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Park Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BKTXT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Document Header Text'.
i_fldcat-outputlen = '25'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'WAERS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Curr'.
i_fldcat-outputlen = '7'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'USNAM'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Parked By'.
i_fldcat-outputlen = '13'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'XBLNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Reference Text'.
i_fldcat-outputlen = '19'.
APPEND i_fldcat TO i_fieldcat.
IF ad_doc = 'X' OR all_doc = 'X'.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_CODE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'RC'.
i_fldcat-outputlen = '2'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_RSN'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Reason'.
i_fldcat-outputlen = '15'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_DATE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Date'.
i_fldcat-outputlen = '10'.
APPEND i_fldcat TO i_fieldcat.
ENDIF.
ENDFORM. " fieldcat_init
*& Module PAI_100 INPUT
MODULE pai_100 INPUT.
CASE ok_code.
WHEN 'BACK'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'EXIT'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN '%EX'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BINP'.
DATA : ws_x TYPE c VALUE 'X'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Documents Via Batch Input'
text_question =
'Are you sure you want to post all the selected documents?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
xbinp = 'X'.
PERFORM tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'MALL'.
PERFORM mall.
WHEN 'EMAL'.
PERFORM emal.
WHEN 'RW'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BUCH'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Document'
text_question =
'Are you sure you want to post all documents selected?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
perform tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'PICK'.
DATA : check TYPE n,
no_rec TYPE c.
check = 0.
no_rec = 'X'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
index = 0.
LOOP AT gt_vbkpf.
funcl = 'D'.
index = index + 1.
IF gt_vbkpf-xpick = 'X'.
check = 1.
CLEAR no_rec.
READ TABLE gt_vbkpf1 INDEX index INTO vbkpf.
PERFORM beleg_pickup.
ENDIF.
ENDLOOP.
IF check = 0.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = ws_row_idx.
IF NOT ws_row_idx IS INITIAL.
CLEAR no_rec.
ENDIF.
LOOP AT ws_row_idx INTO i_ws_row_idx.
READ TABLE gt_vbkpf1 INDEX i_ws_row_idx-index INTO vbkpf.
PERFORM beleg_pickup.
ENDLOOP.
IF no_rec = 'X'.
MESSAGE s999(zv) WITH text-007.
ENDIF.
ENDIF.
WHEN '&RNT_PREV'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&RNT'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%SC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OL0'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OAD'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AVE'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AQW'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&XXL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%PC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&CRTEMPL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN OTHERS.
do nothing.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " PAI_100 INPUT
*& Form exit_program
Exits from the program after freeing the grid and container *
FORM exit_program.
IF NOT grid_container IS INITIAL.
CALL METHOD grid_container->free.
ENDIF.
IF NOT grid1 IS INITIAL.
CALL METHOD grid1->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
ENDIF.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form f2200_handle_data_changed
To handle event of change in data in ALV.
-->P_ER_DATA_CHANGED text
FORM f2200_handle_data_changed USING ir_data_changed
TYPE REF TO
cl_alv_changed_data_protocol.
DATA : ls_mod_cell TYPE lvc_s_modi ,
lv_value TYPE lvc_value,
lflg_check TYPE i.
DATA : wa_vbkpf LIKE LINE OF gt_vbkpf.
SORT ir_data_changed->mt_mod_cells BY row_id .
LOOP AT ir_data_changed->mt_mod_cells
INTO ls_mod_cell
WHERE fieldname = 'I_PICK'.
IF NOT ls_mod_cell-value IS INITIAL .
CALL METHOD ir_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cell-row_id
i_fieldname = ls_mod_cell-fieldname
i_value = ls_mod_cell-value.
READ TABLE gt_vbkpf INTO wa_vbkpf
INDEX ls_mod_cell-row_id.
IF ls_mod_cell-fieldname = 'I_PICK'.
wa_vbkpf-xpick = ls_mod_cell-value.
ENDIF.
MODIFY gt_vbkpf FROM wa_vbkpf
INDEX ls_mod_cell-row_id.
ENDIF .
ENDLOOP .
ENDFORM. " f2200_handle_data_changed
*& Form f2201_handle_hotspot
To handle event of clicking on hyperlink
-->P_E_COLUMN_ID text
FORM f2201_handle_hotspot USING p_e_column_id p_e_row_id.
READ TABLE gt_vbkpf1 INDEX p_e_row_id INTO vbkpf.
funcl = 'D'.
PERFORM beleg_pickup.
PERFORM exit_program.
ENDFORM. " f2201_handle_hotspot
Regards,
Susmitha
Dont forget to reward points for useful answers -
How to define header and footer in ALV
Hi All,
I have created one Report program where i have to display data in both alv grid and alv list display.
Reqt are:
1. The report output must contain standard header & footer.
2. The header must display the count of the materials displayed, the user name & system date.
3. The footer must display the name of the SAP system, Operating System of Application Server, Current GUI Status
& Release Status of SAP System.
I am using Fm REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DSIPLAY.
this top of page n end of page is part of slis_t_events only.
In list display FM, i m not getting any option to define top of page form.
Any pointers on this.
Thanks,
Mamtahii Mamta..
Try this .it will solve TOP-OF-PAGE problem. Pass TOP_OF_PAGE under FM REUSE_ALV_GRID_DISPLAY
eg.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ALV_LAYOUT
I_CALLBACK_PROGRAM = SY_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE' " TOP_OF_PAGE
I_GRID_TITLE = I_TITLE_ITEM
IT_FIELDCAT = I_FIELDCAT[]
I_SAVE = 'A'.
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_ITEM.
Form TOP_OF_PAGE.
* *ALV Header declarations
DATA: T_HEADER1 TYPE SLIS_T_LISTHEADER,
WA_HEADER1 TYPE SLIS_LISTHEADER,
T_LINE LIKE WA_HEADER1-INFO,
LD_LINES TYPE I,
LD_LINESC(10) TYPE C.
* Title
WA_HEADER1-TYP = 'H'.
WA_HEADER1-INFO = 'COMPLETE LC Records displayed'.
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR WA_HEADER1.
* Date
WA_HEADER1-TYP = 'S'.
WA_HEADER1-KEY = 'Date: '.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO WA_HEADER1-INFO. "todays date
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1.
DESCRIBE TABLE IT1 LINES LD_LINES.
LD_LINESC = LD_LINES. " No of Records in internal Table
CONCATENATE 'Total No. of Records in Database : ' LD_LINESC
INTO T_LINE SEPARATED BY SPACE.
WA_HEADER1-TYP = 'A'.
WA_HEADER1-INFO = T_LINE.
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1, T_LINE.
WA_HEADER1-TYP = 'A'.
WA_HEADER1-INFO = sy-uname. "User Name
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1, T_LINE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER1.
endform.
Reards,
Apoorv -
Header and Footer for ALV Layout
Hi All,
I have used the following code to create the Header and Footer Areas for ALV Report.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'build_comment'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
Now the space is available for both Header and Footer...
But i would like to display the Text in Header and Footer areas...
How to insert the Texts....????
Can you help me please.....???
Regards
PavanHi,
Try with following example program:
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT AZEMPNO AZEMPNAME AZDEPTCD BZDEPTNAME AZDESGCD CZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON AZDEPTCD EQ BZDEPTCD
INNER JOIN ZDESG_MST AS C
ON AZDESGCD EQ CZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*& Form LAYOUT
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
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. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*& Form LSORT
*FORM LSORT USING P_FIELD P_TABLE P_UP.
ADD 1 TO L_POS.
IT_SORT-SPOS = L_POS.
IT_SORT-FIELDNAME = P_FIELD.
IT_SORT-TABNAME = P_TABLE.
IT_SORT-UP = P_UP.
APPEND IT_SORT.
*ENDFORM. " LSORT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
ENDFORM.
*& Form F_WRITE_SUMMARY
Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.
Regards,
Bhaskar -
Select multiple lines in a sorted subsumarized ALV
Select multiple lines in a sorted sub summarized ALV
Hi all,
I had to make a Z version of ME28 transaction in order to do a PO mass release.
The customer asked for a similar looking transaction.
The ALV displays PO sorted and summarized by Purchase Document.
I had a selection column to the ALV so the user can select multiple PO.
Te problem is that I don’t know how to see wich PO’s are selected due the selection field of my output data does not get marked when I click on the Purchase Document
As you an see in the ALV I created you can select at "header level" by clicking on the Purchasing Order row.
But this does not affect my output table so I dont have an X on the select field.
It does when I click on a item level.
How can I read this marked lines?
Thanks in advance.I need to release it.
It works fine when I select an item row, cause it updates the i_output-sel = X, So I just loop it and do the mass release,
Problem is when I try to do a seletion like in the image I've upload.
I need to know wich line of my i_output table correspond to which subtotal Purchasing Order selectedrow. -
We keep many logs in a simple list format. One of the columns requires a description using the "multiple lines of text" default column. Sometimes the person making the entry needs to complete about 20-30 lines of text. Users are requesting we reduce
the amount of space advanced between lines to save space and be more concise. Is there a way to reduce the line spacing for the column entries to single spacing without code?
Maree N PercivalWe determined that the site column settings were incorrect for allowing single spacing, we changed the site column setting from "Enhanced rich text (Rich text with pictures, tables, and hyperlinks)" to "Rich text (Bold, italics, text alignment, hyperlinks)"
and it is now keeping the text in single spaced lines.
<label for="onetidRichText">Specify the type of text to allow:</label>
<input id="onetidRichTextPlain" name="RichText" title="Plain text" type="radio" value="PLAIN" />
<label for="onetidRichTextPlain">Plain text </label>
<input id="onetidRichTextCompatible" name="RichText" title="Rich text (Bold, italics, text alignment, hyperlinks)" type="radio" value="COMPATIBLE" />
<label for="onetidRichTextCompatible">Rich text (Bold, italics, text alignment, hyperlinks)</label>
<input id="onetidRichTextFullHtml" name="RichText" title="Enhanced rich text (Rich text with pictures, tables, and hyperlinks)" type="radio" value="FullHtml" />
<label for="onetidRichTextFullHtml">Enhanced rich text (Rich text with pictures, tables, and hyperlinks)</label>
Maree N Percival -
How to create space between Header text of Hierarchical ALV List.
hi,
I am display data using Hierarchical ALV List.
In Perform of field catalog, I am writing this code:
PERFORM fill_catalogue USING :
'CHKBX' 'T_HEADER' 20 'Sess Decision Box'(t19) 'X',
'SESS_NO' 'T_HEADER' 11 'Session'(t20) ' ' ,
'SESS_STAT' 'T_HEADER' 4 'Status'(t39) ' ',
'HOLD_STAT' 'T_HEADER' 4 'HOLD'(t52) ' ',
'ICON' 'T_HEADER' 9 'Tracking'(t21) ' ' ,
'CREATE_DT' 'T_HEADER' 10 'Archiving Date'(t22) ' ' ,
'AGING' 'T_HEADER' 50 'Aging'(t23) ' ',
'OBJECT' 'T_HEADER' 12 'Archive Obj'(t24) ' ',
'HOLD_INFO' 'T_HEADER' 100 'Hold Reason' ' ' ,
'YFY_DATA' 'T_HEADER' 4 'Data Fiscal Year'(t48) ' ' ,
'COMMENTS' 'T_HEADER' 50 'Session Notes'(t26) ' ' ,
'DATATYPE' 'T_HEADER' 50 'Archive Object Description'(t25) ' ',
'APPR_STAT' 'T_ITEM' 16 'Approval Status'(t29) ' ',
'DESTR_DT_REV' 'T_ITEM' 10 'New Date'(t30) ' ',
'REJCT_REASON' 'T_ITEM' 60 'Rejection Reason'(t31) ' ' .
At output of this program , there are two rows in HEADER details.
I want text 'Session notes' of 2nd row under 'Archiving Date' of 1st row.
For this i have to create space between 'Data Fiscal Year' & 'Session notes' text.
How i can do this.
Regards,
MamtaHi,
You can use TOP-OF-PAGE event and pass this event to Hierarchical ALV FM.
Thanks,
Kartavya Kaushik. -
Hi gurus
Apart from normal header with fields..my requirement is to pass the one header section from report which consist of 3-4 lines ..
then header as usual with fields and data ..
detail----
detail--detail--
detail
f1 f2 f3
row1----
row2----
please help..
regardsI don't think it is possible... You can either have it or don't...
Anyway, if you do that then do share with us...
You can disable the default header by setting slis_layout_alv-no_colhead = 'X', then use your own code in TOP-OF-PAGE event to build customize header... that can be multiple line... -
Header and footer in ALV using CL_SALV_TABLE
How to add header and footer for an ALV report using CL_SALV_TABLE. I know how to add header lr_table->set_top_of_list_print( lr_header )
but how do I make it aligned center.
Also how to add a footer
I want it to look like Current page of total pages
What is the system variable for total pages.Hi,
this should be the Method:
SET_END_OF_LIST_PRINT
Best Regards -
Multiple lines for field description in ALV
Hi ,
Is there any way to display the field description in multiple lines in ALV grid .
Regards,
PradiptaHi pradipta,
1. No its not possible.
2. At the most, we can set the WIDTH of the
column, to ACCOMODATE the field description.
3. We cannot do WRAP as u require.
regards,
amit m.
Maybe you are looking for
-
Error while installtion of SAP NetWeaver Sneak Preview
Hi, I get the following error while installing the Sneak Preview version of SAP NetWeaver. This error occurs while checking for the JCE. Request your help. ERROR 2007-05-21 00:34:46 FSL-00001 System call failed. Error 5 (Access is denied. ) in execu
-
I have the education version of photoshop CS5 on my Imac ,,, had to buy a new macbook pro,,, how do I install CS5 on new computer?
-
Cant access my photos and videos on N95
After I installed the latest software update for N95 my cellphone started to act weird. First: everytime I try to access the "gallery" it freeze the cellphone so I cant see my photos and video. Thats VERY annoying and my battery metter can be fully c
-
HT5312 I have forgot my rescue email adress how to reset my rescue email adress
How to reset rescue email adress
-
In using form filler is there a way I can make a universal change to the font and have all fonts at Times Roman 11 pt? Can I use a carriage return to widen the box? Is form filler available on Acrobat 9?