Adding header to alv(factory) in container
Hi frends!
How can I add a header to alv in container using factory method?
You can use splitter. For example :
REPORT ZCE_TEST2.
DATA: IT_FLIGHT TYPE TABLE OF SFLIGHT.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
DATA: G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL',
O_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
O_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
O_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,
O_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER,
O_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER.
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE
OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD TOP_OF_PAGE.
PERFORM EVENT_TOP_OF_PAGE USING O_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
START-OF-SELECTION.
SELECT *
FROM SFLIGHT
UP TO 20 ROWS
INTO TABLE IT_FLIGHT.
END-OF-SELECTION.
IF NOT IT_FLIGHT[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE 'NO DATA FOR THE SELECTION' TYPE 'I'.
ENDIF.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
IF G_CUSTOM_CONTAINER IS INITIAL.
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
FORM CREATE_AND_INIT_ALV .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER.
Create TOP-Document
CREATE OBJECT O_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
Create Splitter for custom_container
CREATE OBJECT O_SPLITTER
EXPORTING PARENT = G_CUSTOM_CONTAINER
ROWS = 2
COLUMNS = 1.
CALL METHOD O_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = O_PARENT_TOP.
CALL METHOD O_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = O_PARENT_GRID.
Set height for g_parent_html
CALL METHOD O_SPLITTER->SET_ROW_HEIGHT
EXPORTING
ID = 1
HEIGHT = 5.
CREATE OBJECT G_GRID
EXPORTING I_PARENT = O_PARENT_GRID.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
*Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
CHANGING
IT_OUTTAB = IT_FLIGHT[].
CALL METHOD O_DYNDOC_ID->INITIALIZE_DOCUMENT
EXPORTING
BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.
Processing events
CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = O_DYNDOC_ID.
ENDFORM. "CREATE_AND_INIT_ALV
FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
DATA : DL_TEXT(255) TYPE C. "Text
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Flight Details'
SAP_STYLE = CL_DD_AREA=>HEADING
SAP_FONTSIZE = CL_DD_AREA=>LARGE
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CALL METHOD DG_DYNDOC_ID->ADD_GAP
EXPORTING
WIDTH = 200.
CALL METHOD O_DYNDOC_ID->ADD_PICTURE
EXPORTING
PICTURE_ID = 'ENJOYSAP_LOGO'.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
program ID
DL_TEXT = 'Program Name :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
DL_TEXT = SY-REPID.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
CLEAR : DL_TEXT.
program ID
DL_TEXT = 'User Name :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
DL_TEXT = SY-UNAME.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
Run Date
DL_TEXT = 'Run Date :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
Move date
WRITE SY-DATUM TO DL_TEXT.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
*Time
DL_TEXT = 'Time :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
Move time
WRITE SY-UZEIT TO DL_TEXT.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
PERFORM DISPLAY.
ENDFORM. " EVENT_TOP_OF_PAGE
FORM DISPLAY.
Creating html control
IF O_HTML_CNTRL IS INITIAL.
CREATE OBJECT O_HTML_CNTRL
EXPORTING
PARENT = O_PARENT_TOP.
ENDIF.
CALL METHOD O_DYNDOC_ID->MERGE_DOCUMENT.
O_DYNDOC_ID->HTML_CONTROL = O_HTML_CNTRL.
Display document
CALL METHOD O_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = O_PARENT_TOP
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
IF SY-SUBRC NE 0.
MESSAGE 'Error in displaying top-of-page' TYPE 'I'.
ENDIF.
ENDFORM. " display
Similar Messages
-
Displaying Selection option values in header using alv-factory
Hi all,
I am using alv factory class 'CL_SALV_TABLE'.
I want to display selection-option values on my header.
I have creted grid using class 'CL_SALV_FORM_LAYOUT_GRID' and am displaying other values.
But am facing problem in displaying selection option values.
Any pointer on this will be GR8.
Thanks & Regards.
Yats.Hi,
Use this sample code.
form top_of_the_list_main changing lv_grids type ref to cl_salv_table.
*Creating instances of the clases
data : lv_grid type ref to cl_salv_table,
lv_header type ref to cl_salv_form_element,
lv_layout type ref to cl_salv_form_layout_grid.
move lv_grids to lv_grid.
*Creating the layout object
create object lv_layout.
*Setting the Header Text
lv_layout->create_label(
row = 1
column = 1
text = text-008 ).
lv_header = lv_layout.
lv_grid->set_top_of_list( lv_header ).
endform. " TOP_OF_THE_LIST_MAIN
Loop it and keep changing the row and colom..Pass the selection option to the text field.
Regards
Ansair -
Hi Friends
I need to add header to ALV grid, pls tell me how to do it.
Thanx in advance,
Regards,
Venu.*& Report Y_TOP_PAGE *
REPORT y_top_page .
TABLES : mara.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
END OF it_mara.
*layout
DATA: wa_layout TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
I_INTERNAL_TABNAME = 'IT_MARA'
* i_structure_name = 'IT_MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = w_repid
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat_wrt_off[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat_wrt_off
TABLES
t_outtab = it_mara
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.
* Form TOP-OF-PAGE *
* ALV Report Header *
FORM top-of-page.
*ALV Header declarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.
* Title
wa_header-typ = 'H'.
wa_header-info = 'CHANDU REPORT'.
APPEND wa_header TO t_header.
CLEAR wa_header.
* Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
APPEND wa_header TO t_header.
CLEAR: wa_header.
* Total No. of Records Selected
* describe table it_ekko lines ld_lines.
* ld_linesc = ld_lines.
* concatenate 'Total No. of Records Selected: ' ld_linesc
* into t_line separated by space.
* wa_header-typ = 'A'.
* wa_header-info = t_line.
* append wa_header to t_header.
* clear: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
* i_logo = 'Z_LOGO'.
ENDFORM. "top-of-page -
Adding header in split alv using SALV
Hello Champs,
I have a requirement to display 6 diff reports in a screen. I have achieved it by using SALV(Split Container). Now I need to add header to each ALV report. The normal way of adding header in SALV doesnt work in the split ALV.
Can someone help me with this.
Thanks,
GregHi, im experiencing the same situation right now, have you solved the problem? any inputs would be appreciated. thanks!
-
hi,
can any one explain me how to pass header from my alv report when i wish to download it to excel.
but the problem here is the header of my alv report comes form a table in to which more fields can be added in future.now the table contains 10 fields in future fields may grow up to n.
pls help with good solution i am using gui download to pass data to excel but only body of the report is downloaded.
thnks
vamsihey all,
Thanks everyone for the reply.
I am using the foloowing field cat:
l_col_pos = l_col_pos + 1.
wa_fieldcat-col_pos = l_col_pos.
wa_fieldcat-outputlen = 32.
wa_fieldcat-fieldname = 'SOLLWERT'.
wa_fieldcat-inttype = 'P'.
* wa_fieldcat-tabname = 'i_final'.
wa_fieldcat-seltext_l = text-t11. "Target Value
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
I have use this also in the field cat but stil i get space in the excel header.
wa_fieldcat-REF_FIELDNAME = 'SOLLWERT'.
* wa_fieldcat-REF_TABNAME = 'QAMV'.
Also the space comes with the descrip[tion in the cell of excel.
its like [space Target Value] and i dont need this Space.
I have also used wa_layout-colwidth_optimize = 'X'. but it doesnt wrk.
Please suggest -
hi,
can any one explain me how to pass header from my alv report when i wish to download it to excel.
but the problem here is the header of my alv report comes form a table in to which more fields can be added in future.now the table contains 10 fields in future fields may grow up to n.
pls help with good solution i am using gui download to pass data to excel but only body of the report is downloaded.
thnks
vamsiSample Code -
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
i_tabname = 'T_GRID' " Name of the Internal table
it_fieldcat = t_fcatk[] " Field catalog
TABLES
it_outtab = t_grid " Interbnal table with data
EXCEPTIONS
fatal_error = 1
no_display_possible = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e806(bk).
ENDIF.
It opens the excel and passes the data directly. All you need to do is to pass your ALV's field catalog here. Just transfer your field catalog in the form of KKBLO_T_FIELDCAT. Thats it. -
How to get f4 help in alv grid in container-urgent
hi,
how to get f4 help in alv grid in container using abap objects
ganeshHi Ganesh,
Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
Here is part of the header documentation:
*& Report BCALV_GRID_F4_HELP *
Purpose:
~~~~~~~~
This report illustrates the use of f4-Help in an alv grid control.
Background:
~~~~~~~~~~~
There a two possibilities to implement an f4-Help in the alv grid
control: one can either use standard f4-help or write one by Hand.
For the former there is nothing to do at all. This report shows how
to implement user-defined f4-help.
I am sure you will find within this report the solution you are looking for.
Reward points if this Helps.
Manish -
List header for alv grid using abap objects
Hai all,
I have displayed alv grid in container control using abap objects i.e. using method set_table_for_first_display.
now i need to display list header for this alv grid.
please help me how to create with a sample coding.
Thanks and regards,
Prabu S.Create a splitter using CL_GUI_EASY_SPLITTER_CONTAINER with a top and bottom half. Put the alv grid in the bottom half. Use cl_dd_document (documented in help.sap.com ) to build the header in the top half. Use events on CL_GUI_ALV_GRID to handle the top-of-list printing.
Or, if available, use CL_SALV_TABLE, and read the documentation on that. When I needed a header for my report, that's what I did. There's plenty of good documentation about if you'll search for it.
matt -
ALV with splitter container in background
Hi all,
I have an ALV grid in which I am using a splitter container to display top of page and the alv grid.
I am unaware how to use a docking container in conjunction with a splitter container, so that the ALV list is displayed in the background.
Request assistance from you all...
Regards,
Vidya.Hi,
In background , you can't dispaly the ALV with splitter container , dispaly ALV in foreground with splitter and in background use top-of-page to display header text with docking container.
Code :
DATA: o_grid TYPE REF TO cl_gui_alv_grid,
o_container TYPE REF TO cl_gui_custom_container,
o_dockingcontainer TYPE REF TO cl_gui_docking_container .
IF NOT sy-batch = 'X'.
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT o_grid
EXPORTING
i_parent = o_container.
ELSE.
CREATE OBJECT o_grid
EXPORTING
i_parent = o_dockingcontainer.
IF sy-subrc NE 0.
ENDIF.
ENDIF
METHOD handle_print_top_of_page.
prev_linno = sy-linno.
sy-linno = 64.
SKIP.
WRITE:/40 'Page:', sy-pagno .
SKIP.
sy-linno = prev_linno.
ENDMETHOD. "handle_print_top_of_page
METHOD handle_top_of_page.
WRITE:/40 'Page:', sy-pagno .
ENDMETHOD. "handle_top_of_page
Regards
Appana -
I need to display Table header in ALV using Oops.
I need to data from 8 fields which I get in the run time of the program.
I am new to Oops ALV, I have done a similar thing in normal ALV but not in oops.
Detailed info required, Custom container settings as well.
Thanks in Advancesee this weblog TOP_OF_PAGE in ALV Using CL_GUI_ALV_GRID
-
Editing a pdf form that I created. Adding header, currently the header only appears on page 1 of a 3 page pdf form. I want it to appear on each page. I am receiving the error msg "do not have sufficient permissions to perform this task"
In Adobe Acrobat use a Action for this.
-
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 -
Hi All,
I want to print a report in the following manner:
DATE:
CLASS GROUP :
MATNR CLASS ADSIZE
123 c col1
124 c col2
156 c col2
DATE:
CLASS GROUP :
MATNR CLASS ADSIZE
125 a col3
128 a col4
150 a col5
How do i do it...I am planning to do it with REUSE_ALV_LIST _DISPLAY...but i dont know how to print the header..plz help<b>Note : In the below i am passing my purchase order Ebeln with internal table to the Form header so that all purchase order are passed to Header by this way you can also pass it .</b>
<b>Add Title(heading) to ALV Grid</b>
In order to insert a report heading in to the ALV grid you need to perform the following steps:
1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM
2. Create 'top-of-page' FORM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
* Title
wa_header-typ = 'H'.
wa_header-info = EKKO-ebeln.
append wa_header to t_header.
clear wa_header.
endform.
reward points if it is usefull .....
Girish -
Header in alv grid using class
Hello All,
I developed alv grid using class method.
First I created CREATE OBJECT GR_CCONTAINER
then CREATE OBJECT GR_ALVGRID
then PERFORM FIELD_CATALOG TABLES GT_FIELDCAT----
for field catalog
PERFORM LAYOUT CHANGING GS_LAYOUT.----
for header
p_gs_layout-grid_title = 'class method'.
p_gs_layout-sel_mode = 'D'.
APPEND P_GS_LAYOUT TO IT_LAYOUT.
and finally CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
the report is cooming fine but in header it comes only "class method".
but i need also
1. reporting date
2. reporting time.
can any body tell me how i can i put 2 more heading line
Thanks,
RakeshHi Dude,
Please refer the below link how to handle the header in alv using abap oo
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/abapObjects-ALVModel-UsingHeaderand+Footer
Hope it clears,..............
Thanks & Regards
Ramakrishna Pathi -
Hello,
i need to dislay header as well as item details in an alv pop up. I am using FM REUSE_ALV_POPUP_TO_SELECT. but I am not able to get the header information. I am able to get the item details for a particular Purchase order number. I need to display purchase order number in the header of alv POPUP.
how can i achieve this using the same FM?hi
hope this wil help to u
...tables vbak.
data it_vbak like vbak occurs 0 with header line.
selection-screen begin of block b1 with frame.
parameters: alv1 radiobutton group alv, "REUSE_ALV_LIST_DISPLAY
alv2 radiobutton group alv, "REUSE_ALV_POPUP_TO_SELECT
alv3 radiobutton group alv, "REUSE_ALV_GRID_DISPLAY
alv4 radiobutton group alv. " NORMAL DISPLAY
selection-screen end of block b1.
select * from vbak
into corresponding fields of table it_vbak
up to 10 rows.
if alv1 = 'X'. perform alv_func1.
elseif alv2 = 'X'. perform alv_func2.
elseif alv3 = 'X'. perform alv_func3.
elseif alv4 = 'X'. perform norm.
endif.
**& Form ALV_FUNC1
*form alv_func1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_structure_name = 'VBAK'
tables
t_outtab = it_vbak
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. " ALV_FUNC1
**& Form ALV_FUNC2
*form alv_func2 .
call function 'REUSE_ALV_POPUP_TO_SELECT'
exporting
i_title = 'SALES ORDER INFO'
i_zebra = 'X'
i_tabname = 1
i_structure_name = 'vbak'
tables
t_outtab = it_vbak
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. " ALV_FUNC2
**& Form ALV_FUNC3
*form alv_func3 .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_structure_name = 'vbak'
i_grid_title = 'SALES ORDER INFO'
tables
t_outtab = it_vbak
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. " ALV_FUNC3
**& Form NORM
*form norm .
format intensified.
skip 1.
write: /'SALES DOC.',
' Created on ',
' Time',
' Created by',
' Valid from ',
' Sold-to party'.
format intensified off. skip 2.
loop at it_vbak.
write: / it_vbak-vbeln,
it_vbak-erdat,
it_vbak-erzet,
it_vbak-ernam,
it_vbak-angdt,
it_vbak-kunnr.
endloop.
endform. " NORM
Edited by: Nawanandana Edirisinghe on Sep 3, 2009 12:52 PM
Maybe you are looking for
-
File upload uix controller (how to access/save file name in DB returned by
sorry i am new in uix xml. my question is how to save/access file name in DB returned by FileUploadManager. I have used example Using a Controller in ADF UIX. Its uploading the file fine but i am not able to save this filename in DB so that i can acc
-
Multiple JScrollPanes in one window
Hi. I've been trying to figure out how to make multiple scrollable text areas in one window. I'm trying to use JEditorPanes for the text areas so that they can display html. Does anyone know how I can make multiple scrollable JEditorPanes appear side
-
Hello I am trying to load flat file from my workstation to BI. I have a transaction data, in which 4 chars IO filed and 3 KFs field. I am little confusion about loading in BI7 since Infosource , TR, UR not required. I am creating flat file source sys
-
Hi everybody, I have a MacBook Air late 2011 with OS 10.10.1 (Yosemite). Safari is crashing unexpectedly, and here is the crash report from the latest crash. I read on this community that it may be related to Flash Player, but I have already tried t
-
Com.sap.km.cm.docs file corruption error
Problem Description Within the Portal there are several html files served up to a user through the KM repository. These html files contain links that open up 'pdf' files stored within the KM repository. These links are served to the user via the 'com