Classic & ALV
Hi Friends,
I'm doing a comparison between ALV and classic report and I am trying to find differences. So far, I have gathered information regarding their
1) Interactivity (sorting etc. Classic needs more coding in this sense)
2) Capabilities (ability to export to other file format)
Does anyone know of any other major/important differences? It does not have to be too technical. Thanks in advance
Regards,
r3venant
r3venant,
Check
what are ALV reports? how they are different from normal reports?;�
ALV is nothing but "application list viewer.
An ALV displays the output directly in the form of a grid or a list.
ie,in a tabular format with the required field names as headings.
while in a normal report,user has to design and format his output in a list or table fashion,which is a tedious process.
it is to overcome the user designing the output in list,SAP has given ALV,thro which one can deirectly get a tabulated list output.
type-pool:slis is basically declared to call the respective function module for the ALV display.
its mandatory that type-pool:slis is declared.
Imagine you have to write a report that lists out customer addresses. You will write code to get the input from the user via selection screen and then read the data based on the seletion from the database into an internal table(or a set of internal tables). Now once you have the data you will need to output this. In normal list reports, you will have to use 'WRITE' statements to format the output into columns and rows. Now suppose user wants some interactivity in it. Then you will have to provide some buttons and/or menu options through custom pf-status and then write logic for reacting to the user actions. After writing many such reportsm, you will feel like some of this can generalized and reused in every report.
That is exactly what ALV does. It takes out most of repeated sections of the code from out of you and provides you with excellent outputting functionality. It provides many standard functions like 'print', 'sort', 'filter', 'sum' etc by default. Imagine writing code yourself for all these if you were writing normal list program. One more major difference is the editing feature. If you were write a program that gives the user with editing features, then you will have to write a lot of logic. But with ALV, all the features like adding a row, deleting a row, copying a row, editing some fields of a row etc come by default.
Likewise, interactivity has become quite easy to implement. Like double clicking on a customer number, if the user wants to go to display customer transaction, it is very easy using ALV.
As pointed out here by others, go through the documentation of ALV and go through some of those demo programs and you will know the difference. ALV takes out a lot of burden of coding everything away from you and lets you worry about the business functionality that your report provides, rather than formatting the output or providing interactivity to the output.
Check ---ALV
differences between normal list and ALV list
http://www.allsaplinks.com/alv2.html
http://www.allsaplinks.com/alv1.html
Pls. MArk if useful
Similar Messages
-
Regarding Reading contents in classical ALV
Hi Experts,
I have a problem in Classical ALV Grid Display.
I donot know how to read the contents of modified fields after the grid is displayed.ie. i will modify some cells and press a button which is defined by me then the modified contents need to be read and updated in the data base.i am not able to read those modified contents.so please help me.i am using REUSE_ALV_GRID_DISPLAY.that is my requirement.i cannot use ALV Objects.i am posting the code.please verify and help me.
REPORT ZMRMMO_CUSTPOCHANGE.
*******************************TABLES***************************************
TABLES : VBAK, "Sales Document:Header Data.
VBUK, "Sales Document:Header Status And Administrative Data.
VBAP. "Sales Document:Item Data.
********************************TYPES***************************************
INCLUDE ZPOCHANGE_DECLARATIONS. "Include Program for declaration part.
****************************SELECTION SCREEN********************************
INCLUDE ZPOCHANGE_SELSCREEN. "Include Program for selection screen.
****************************INITIALIZATION**********************************
INITIALIZATION.
COM1 = 'Select Reject Open Sale Order Radio Button To Delete An Open Sale Order'.
COM2 = 'Select Remove Rejection Radio Button To Undo The Delete sale Order'.
****************************START OF SELECTION******************************
START-OF-SELECTION.
*CREATE OBJECT obj1.
PERFORM F_CUSTPOSELECTION. "Subroutine for selection of data from the tables.
PERFORM F_BUILDFCAT. "Subroutine To bulid a field catalog.
*I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
*I_LAYOUT-BOX_TABNAME = 'I_FINAL'.
*I_LAYOUT-BOX_FIELDNAME = 'X'.
*APPEND I_LAYOUT.
PERFORM F_EVENTSGET.
IF FLAG = 'X'.
PERFORM F_ALVGRIDDISPLAY. "Subroutine to call the ALV Grid Display Function Module inorder to display the data
ELSE.
EXIT.
ENDIF.
FORM F_POCHANGEPFSTATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'PO_CHANGE'. "EXCLUDING RT_EXTAB.
ENDFORM.
FORM F_POCHNGUSERCOMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
RS_SELFIELD-REFRESH = 'X'.
IF R_UCOMM EQ 'UPD'.
PERFORM F_POCHANGECHECK." USING RS_SELFIELD.
ENDIF.
ENDFORM.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_POPULF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_TESTF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01.
INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01.
*& Include ZPOCHANGE_DECLARATIONS
TYPE-POOLS : SLIS.
TYPES :BEGIN OF TY_VBAK,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
LIFSK LIKE VBAK-LIFSK,
GWLDT LIKE VBAK-GWLDT,
END OF TY_VBAK,
BEGIN OF TY_VBUK,
VBELN LIKE VBUK-VBELN,
LFGSK LIKE VBUK-LFGSK,
END OF TY_VBUK,
BEGIN OF TY_VBAP,
VBELN LIKE VBAP-VBELN,
LPRIO LIKE VBAP-LPRIO,
ABGRU LIKE VBAP-ABGRU,
END OF TY_VBAP,
BEGIN OF TY_FINAL,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
LFGSK LIKE VBUK-LFGSK,
LIFSK LIKE VBAK-LIFSK,
GWLDT LIKE VBAK-GWLDT,
LPRIO LIKE VBAP-LPRIO,
ABGRU LIKE VBAP-ABGRU,
END OF TY_FINAL.
****************************INTERNAL TABLES*********************************
DATA :I_VBAK TYPE STANDARD TABLE OF TY_VBAK,
I_VBUK TYPE STANDARD TABLE OF TY_VBUK,
I_VBAP TYPE STANDARD TABLE OF TY_VBAP,
I_FINAL TYPE STANDARD TABLE OF TY_FINAL,
WA_VBAK TYPE TY_VBAK,
WA_VBUK TYPE TY_VBUK,
WA_VBAP TYPE TY_VBAP,
WA_FINAL TYPE TY_FINAL.
DATA : I_FCAT TYPE SLIS_T_FIELDCAT_ALV,
I_LAYOUT TYPE SLIS_LAYOUT_ALV, "OCCURS 0,
WA_FCAT LIKE LINE OF I_FCAT,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS LIKE LINE OF I_EVENTS,
I_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT1 LIKE LINE OF I_FCAT1.
*DATA : obj1 TYPE REF TO CL_GUI_ALV_GRID_BASE.
*DATA :G_ROWNO TYPE I.
DATA FLAG VALUE 'X'.
*& Include ZPOCHANGE_SELSCREEN
****************************SELECTION SCREEN********************************
SELECTION-SCREEN : BEGIN OF BLOCK SC1 WITH FRAME TITLE TEXT-000.
PARAMETERS : P_KUNNR TYPE VBAK-KUNNR OBLIGATORY,
P_BSTNK TYPE VBAK-BSTNK.
SELECTION-SCREEN : END OF BLOCK SC1.
SELECTION-SCREEN : BEGIN OF BLOCK SC2 WITH FRAME TITLE TEXT-001.
PARAMETERS : R_REMSET RADIOBUTTON GROUP RAD1,
R_CNGGAR RADIOBUTTON GROUP RAD1,
R_CNGDEL RADIOBUTTON GROUP RAD1,
R_REJSO RADIOBUTTON GROUP RAD1,
R_REMREJ RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN : COMMENT /1(79) COM1,
COMMENT /1(79) COM2.
SELECTION-SCREEN : END OF BLOCK SC2.
***INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01 .
*& Form F_CUSTPOSELECTION
text
--> p1 text
<-- p2 text
FORM F_CUSTPOSELECTION .
IF P_BSTNK IS INITIAL.
SELECT VBELN BSTNK KUNNR LIFSK GWLDT
FROM VBAK
INTO TABLE I_VBAK
WHERE KUNNR EQ P_KUNNR.
IF SY-SUBRC <> 0.
MESSAGE I000(YMES).
FLAG = '0'.
ELSE.
SORT I_VBAK BY VBELN.
ENDIF.
ELSE.
SELECT VBELN BSTNK KUNNR LIFSK GWLDT
FROM VBAK
INTO TABLE I_VBAK
WHERE KUNNR EQ P_KUNNR AND
BSTNK EQ P_BSTNK.
IF SY-SUBRC <> 0.
MESSAGE I000(YMES).
FLAG = '0'.
ELSE.
SORT I_VBAK BY VBELN.
ENDIF.
ENDIF.
*IF I_VBAK[] IS NOT INITIAL.
LOOP AT I_VBAK INTO WA_VBAK.
WRITE :/ WA_VBAK-VBELN,
10 WA_VBAK-BSTNK,
20 WA_VBAK-KUNNR,
30 WA_VBAK-LIFSK,
40 WA_VBAK-GWLDT.
ENDLOOP.
*ENDIF.
IF I_VBAK[] IS NOT INITIAL.
SELECT VBELN LFGSK
FROM VBUK
INTO TABLE I_VBUK
FOR ALL ENTRIES IN I_VBAK
WHERE VBELN = I_VBAK-VBELN AND
LFGSK <> 'C'.
ENDIF.
IF SY-SUBRC <> 0.
MESSAGE I000(YMES).
FLAG = '0'.
ELSE.
SORT I_VBUK BY VBELN.
ENDIF.
*IF I_VBUK[] IS NOT INITIAL.
LOOP AT I_VBUK INTO Wa_VBUK.
WRITE :/ WA_VBUK-VBELN,
10 WA_VBUK-LFGSK.
ENDLOOP.
*ENDIF.
IF I_VBUK IS NOT INITIAL.
SELECT VBELN LPRIO ABGRU
FROM VBAP
INTO TABLE I_VBAP
FOR ALL ENTRIES IN I_VBUK
WHERE VBELN = I_VBUK-VBELN.
ENDIF.
IF SY-SUBRC <> 0.
MESSAGE I000(YMES).
FLAG = '0'.
ELSE.
SORT I_VBAP BY VBELN.
ENDIF.
LOOP AT I_VBUK INTO WA_VBUK.
MOVE :WA_VBUK-VBELN TO WA_FINAL-VBELN,
WA_VBUK-LFGSK TO WA_FINAL-LFGSK.
READ TABLE I_VBAK INTO WA_VBAK WITH KEY WA_VBUK-VBELN.
MOVE :WA_VBAK-BSTNK TO WA_FINAL-BSTNK,
WA_VBAK-KUNNR TO WA_FINAL-KUNNR,
WA_VBAK-LIFSK TO WA_FINAL-LIFSK,
WA_VBAK-GWLDT TO WA_FINAL-GWLDT.
READ TABLE I_VBAP INTO WA_VBAP WITH KEY WA_VBUK-VBELN.
MOVE :WA_VBAP-LPRIO TO WA_FINAL-LPRIO,
WA_VBAP-ABGRU TO WA_FINAL-ABGRU.
APPEND WA_FINAL TO I_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
ENDFORM. " F_CUSTPOSELECTION
***INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01 .
*& Form F_BUILDFCAT
text
--> p1 text
<-- p2 text
FORM F_BUILDFCAT .
PERFORM F_POPULATE_FCAT USING '1' 'VBELN' 'I_FINAL' '' '' '10' 'Sales Document' 'VBELN' 'VBAK'.
PERFORM F_POPULATE_FCAT USING '2' 'BSTNK' 'I_FINAL' '' '' '10' 'Customer PO No.' 'BSTNK' 'VBAK'.
PERFORM F_POPULATE_FCAT USING '3' 'KUNNR' 'I_FINAL' '' 'X' '10' 'Sold-to Party' 'KUNNR' 'VBAK'.
PERFORM F_POPULATE_FCAT USING '4' 'LFGSK' 'I_FINAL' '' '' '1' 'Delivery Status' 'LFGSK' 'VBUK'.
CASE 'X'.
WHEN R_REMSET.
PERFORM F_POPULATE_FCAT USING '5' 'LIFSK' 'I_FINAL' '' '' '2' 'Delivery BlocK' 'LIFSK' 'VBAK'.
PERFORM F_POPULATE_FCAT USING '6' 'LIFSK' 'I_FINAL' 'X' '' '2' 'Present Delivery BlocK' 'LIFSK' 'VBAK'.
WHEN R_CNGGAR.
PERFORM F_POPULATE_FCAT USING '5' 'GWLDT' 'I_FINAL' '' '' '8' 'Guarantee Date' 'GWLDT' 'VBAK'.
PERFORM F_POPULATE_FCAT USING '6' 'GWLDT' 'I_FINAL' 'X' '' '8' 'Present Guarantee Date' 'GWLDT' 'VBAK'.
WHEN R_CNGDEL.
PERFORM F_POPULATE_FCAT USING '5' 'LPRIO' 'I_FINAL' '' '' '2' 'Delivery Priority' 'LPRIO' 'VBAP'.
PERFORM F_POPULATE_FCAT USING '6' 'LPRIO' 'I_FINAL' 'X' '' '2' 'Present Delivery Priority' 'LPRIO' 'VBAP'.
WHEN R_REJSO.
PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
WHEN R_REMREJ.
PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
ENDCASE.
ENDFORM. " F_BUILDFCAT
***INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01 .
*& Form F_EVENTSGET
text
--> p1 text
<-- p2 text
FORM F_EVENTSGET .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
SORT I_EVENTS BY NAME.
ENDIF.
*READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'USER_COMMAND'.
*IF SY-SUBRC = 0.
*MOVE 'USER_COMMAND' TO WA_EVENTS-FORM.
*MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX."TRANSPORTING FORM WHERE NAME = 'WA_EVENT-NAME'.
*ENDIF.
READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'LIST_MODIFY'.
IF SY-SUBRC = 0.
MOVE 'LIST_MODIFY' TO WA_EVENTS-FORM.
MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
*READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'PF_STATUS_SET'.
*IF SY-SUBRC = 0.
*MOVE 'PF_STATUS_SET' TO WA_EVENTS-FORM.
*MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
*ENDIF.
ENDFORM. " F_EVENTSGET
***INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01 .
*& Form F_ALVGRIDDISPLAY
text
--> p1 text
<-- p2 text
FORM F_ALVGRIDDISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'F_POCHANGEPFSTATUS'
I_CALLBACK_USER_COMMAND = 'F_POCHNGUSERCOMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'U'
IS_VARIANT =
IT_EVENTS = I_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = I_FINAL
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.
*CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DATA_GET'
EXPORTING
I_HEADER_TABNAME =
I_ITEM_TABNAME =
IMPORTING
ET_FIELDCAT =
ET_SORT =
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. " F_ALVGRIDDISPLAY
***INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01 .
*& Form F_POCHANGECHECK
text
--> p1 text
<-- p2 text
FORM F_POCHANGECHECK.
ENDFORM. " F_POCHANGECHECKHi
I sure that there is a better way,but this one will work also...
In PBO enter rows you will show in report to itab you define (same type)
In PAI (after change) compare this tables (your grid table and itab with values before the change) and you will get rows which have been changed...
REGARDS
Yossi -
How to disable the custom push button in Classic ALV
Hi All,
Iam Using Classic Alv (with out classes).I have a created a push button.now at run time i want to make it dynamic .
iam using REUSE_ALV_GRID_DISPLAY
for ex.
i have some records in my out put.
i have a push button "INSERT"
For first time when i clicked it will be inserted.
Now if i run the report for the same inputs as top,i will get the records.But the "INSERT" push button should be disable.IS that Possible ??
If yes kindly send me the solution.Hi,
Here is the piece of code for your understanding...
FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
REFRESH i_extab.
PERFORM f4210_exclude_fcodes CHANGING i_extab.( This form is mentioned below ).
SET PF-STATUS 'STANDARD' OF PROGRAM '(Program name)' EXCLUDING i_extab.( This line of code will excude the function u don't want)
ENDFORM.
FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
DATA: ws_fcode TYPE slis_extab.
CLEAR ws_fcode.
ws_fcode = '&EB9'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&ABC'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&NFO'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&LFO'.
APPEND ws_fcode TO i_extab.
ENDFORM. " f4210_exclude_fcodes
I hope this clarifies. Revert for any queries.
Cheers,
Venkat -
I need to change my report list from OO ALV to classic grid , but there are some functionalities which I do not apply to the classic ALV . Can you help me..? Functionalities are listed below
CALL METHOD grid_201->set_toolbar_interactive.
CALL METHOD grid_201->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
CALL METHOD grid_201->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter. "event_id = 18
CREATE OBJECT event_receiver_201
TYPE
lcl_event_receiver.
SET HANDLER event_receiver_201->handle_data_changed_finished FOR ALL INSTANCES.Hi,
Please refer to the following link where detailed information is available:
http://help.sap.com/saphelp_nw04/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm -
Hi all,
Please let me know the advantages and disadvantages of ALV control over Classical ALV.
Thanks & regards,
Naresh.ALV LIST Can be coded using only FMs
ALV control Can be coded using FMs and object oriented concepts
ALV LIST Can be displayed hieraicharlly
ALV GRID cannot be displayed hierarichally
Alv grid (using oo concept) requires
designing the screen layout .
Hence, in one screen, we can show more
then one alv grid
(we cannot show more than
one alv list on one screen)
ALV LIST is Display Only.
Whereas
ALV Grid Can Be made EDITABLE for entry purpose. -
Hi,
I want to know the Purpose of using the below Events in Classical ALV (if possible with example).
1. CALLER_EXIT
2. REPREP_SEL_MODIFY
3. top_of_coverpage
4. END_OF_COVERPAGE
5. TOP_OF_FOREIGN_PAGE
6. END_OF_FOREIGN_PAGE
7.SUBTOTAL_TEXT
Thanks in Advance,
SumiThe I_EVENTS table returns with the following possible constants:
1. Slis_ev_item_data_expand TYPE slis_formname VALUE 'ITEM_DATA_EXPAND'.
Only relevant for hierarchical-sequential lists using the layout parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT. Exit for passing item entries (ITEM table) for a header record that was expanded interactively by the user.
2. Slis_ev_reprep_sel_modify TYPE slis_formname VALUE 'REPREP_SEL_MODIFY'.
RS_SELFIELD-TABINDEX contains the header table index for which the item entries are to be put in the global item output table (T_OUTTAB_SLAVE). The Callback is only called if ALV has no items for a header that is to be expanded.
RFLG_ALL is passed with 'X' if the user shows all items. The application must ensure that entries are not repeated in the item table.
RS_SELFIELD is initial in this case.
3. Slis_ev_caller_exit_at_start TYPE slis_formname VALUE 'CALLER_EXIT'.
Is called at the beginning of the function module to make special settings. It is not usually used.
4. Slis_ev_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
As this is a frequently-used Callback event, the form routine can also be passed directly in the interface by passing the user command in the IMPORTING parameter I_CALLBACK_USER_COMMAND.
5. Slis_ev_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
Equivalent to the list processing TOP-OF-PAGE event.
6. Slis_ev_top_of_coverpage TYPE slis_formname VALUE 'TOP_OF_COVERPAGE'.
The selection information and list status are output together (if they exist) on a separate page by default
7. Slis_ev_end_of_coverpage TYPE slis_formname VALUE 'END_OF_COVERPAGE'.
Analogously to TOP_OF_COVERPAGE the user can add other information
to the information output by ALV (selection information, list status) at this event.
8. Slis_ev_foreign_top_of_page TYPE slis_formname VALUE FOREIGN_TOP_OF_PAGE'.
The Top-of-page event is always processed in ALV and is only passed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a user action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV).
In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called.
9. Slis_ev_foreign_end_of_page TYPE slis_formname VALUE 'FOREIGN_END_OF_PAGE'.
The event end-of-page is always processed in ALV and only passed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV).
In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called.
10. Slis_ev_pf_status_set TYPE slis_formname VALUE 'PF_STATUS_SET'.
If a user list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS command (with inactive user function codes as well, if necessary).
The STANDARD status of the function group SALV should be used as a template for a user-specific status. As this is a frequently used Callback event, its form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET.
11. Slis_ev_list_modify TYPE slis_formname VALUE 'LIST_MODIFY'.
LIST_MODIFY USING R_TABNAME TYPE SLIS_TABNAME
R_INDEX LIKE SY-TABIX
R_INDEX_ITEM LIKE SY-TABIX
R_INDEX_SUM LIKE SY-TABIX.
12. Slis_ev_top_of_list TYPE slis_formname VALUE 'TOP_OF_LIST'.
Information output at the start of the list
13. Slis_ev_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
Information output at the end of a page. This is only called for printing.
14. Slis_ev_end_of_list TYPE slis_formname VALUE 'END_OF_LIST'.
Information output at the end of the list
15. Slis_ev_after_line_output TYPE slis_formname VALUE 'AFTER_LINE_OUTPUT'.
Output information after each output line. Should only be used in justified cases because it costs a lot of performance.
16. Slis_ev_before_line_output TYPE slis_formname VALUE 'BEFORE_LINE_OUTPUT'.
Output information before each output line. Should only be used in justified cases because it costs a lot of performance.
17. Slis_ev_subtotal_text TYPE slis_formname VALUE 'SUBTOTAL_TEXT'.
This event table (I_EVENTS) is now checked with the desired constants. If the desired constant is found, then the corresponding field for the FORM NAME is populated with the name of the routine containing the corresponding event. -
How to display ALV GRID in the middle of the screen.I am using classical ALV not OOP's concept.
Thanks in Advance,
SumithraHi,
If you are using reuse_alv_grid_display, have a look at the parameters.
I_SCREEN_START_COLUMN
I_SCREEN_START_LINE
I_SCREEN_END_COLUMN
I_SCREEN_END_LINE
Fill the necessary values and try the output. -
Hi All,
I have a small problem. Can anybody tell me how can i add a search help to a specific column in my classical ALV?
Regards,
Prakash PandeyHi Prakash,
In the Field Catalog there are two fields which are used to get the Search Help of any of the Column in ALV. Those are : REF_FIELDNAME and REF_TABNAME.
For example,
ls_fieldcat-fieldname = 'VBELN'.
ls_fieldcat-fix_column = 'X'.
ls_fieldcat-key = 'X'.
ls_fieldcat-outputlen = '10'.
ls_fieldcat-seltext_m = 'Sales Document'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-ref_fieldname = 'VBELN'.
ls_fieldcat-ref_tabname = 'VBAP'.
append ls_fieldcat to p_fieldcat.
clear ls_fieldcat.
The above code will show the F4 for the column VBELN in the ALV. -
Classical report to classical ALV report
Hi All,
Please help in converting classical report to classical ALV report as in my classical report between the program ,after calculation block i have deleted all the WRITE statement to convert it into classical ALV and after end of the program i have used
PERFORM LAYOUT_INIT USING gs_layout.
PERFORM COMMENT_BUILD USING gt_list_top_of_page[].
PERFORM build_fldcat CHANGING field_cat1.
PERFORM build_layout.
PERFORM set_events CHANGING lt_events.
and FM Reuse_alv_grid_display.
Please suggest the right way where to use these perform statements & the FM Reuse_alv_grid_display.
either in place of the deleted write statements or any where else in the program so that the calculation part output is displayed in Grid form.
Thanks.use in place of the write statements only....
Regards,
SAPient -
How to process check box in classical ALV
Hi,
I have one requirement wherein I am using Reuse_ALV_GRID_DISPLAY..I have a checkbox as a field and I have a push button as UPDATE...
If I select the rows in the ALV list using checkbox and if i click the Update button, I have to continue processing based on the checked rows..how will i capture the rows which are selected in ALV list...
Thanks in Adavance,
Saranya.Hi Saranya
Plz try the following logic.
" Display data on the screen
" Alternative to it u can display the data usign REUSE_ALV_LIST_DISPLAY
" FM as well
Data : len type i .
loop at itab. " contains data to b displayed
write : / a as checkbox,itab-<f1>,itab-<f2>,...........,itab-<fn>.
endloop.
describe table itab lines len.
at line-selection.
do len times.
read line sy-index field value a itab-<f1>, itab-<f2>,...........,itab-<fn>.
if a = 'X'.
write : /5 itab-<f1>, itab-<f2>,...........,itab-<fn>.
endif.
enddo.
Plz try this and revert in case of issues .
Regards
Pankaj -
Download to Excel using on Classical ALV List..
Hi Experts,
I want to Display data in ALV using REUSE_ALV_GRID_DISPLAY.
I already did it.
But on the ALV screen I have to disable all Push Buttons, and enable only one push button to Down Load to Excel Sheet.
Can any give clear solution for this?
Regards,
Kumar
Edited by: ABAP on Jun 1, 2010 1:26 PMHi.
I found class cl_salv_table (there are other ones). They handle ALV display in a much easier way that the REUSE function modules. It is worth trying. After I started using them I do not want to see REUSE* again. Here a code sample. The three last lines are actually the ones doing all the work for you.
*& Report MYALV
REPORT myalv.
PARAMETERS: tab TYPE dd02t-tabname VALUE CHECK.
DATA: gr_itab TYPE REF TO data,
go_alv TYPE REF TO cl_salv_table.
FIELD-SYMBOLS <go_itab> TYPE ANY TABLE.
START-OF-SELECTION.
CREATE DATA gr_itab TYPE TABLE OF (tab).
ASSIGN gr_itab->* TO <go_itab>.
SELECT * UP TO 100 ROWS FROM (tab) INTO TABLE <go_itab>.
cl_salv_table=>factory( IMPORTING r_salv_table = go_alv
CHANGING t_table = <go_itab> ).
go_alv->display( ). -
How to Edit the CheckBox in Classic ALV GRID Display
Hi,
I want to Edit the checkbox in Grid Display.
I have one checkbox field in my internal Table,
Code Of the Program,
Data :
Begin of itab occurs 0,
CHK type C,
MATNR like MARA-MATNR,
end of itab.
Iam building the fieldcatelog using Merge Funcion module.
After that I am chaning the properties of the field
catelog like below,
loop at I_FCAT assigning <FCAT>.
Case <FCAT>-Fieldname
When 'CHK'.
<FCAT>-Checkbox = 'X'.
<FCAT>-INPUT = 'X'.
I dont have edit option in fieldcatelog.
modify I_FCAT from <FCAT>.
endcase.
endloop.
In the Layout,
I_LAYOUT-box_fieldname = 'CHK'.
I_LAYOUT-box_tabname = 'ITAB'.
It is displaying the Checkbox field.but I couldnt edit the checkBox.
I can able to edit in REUSE_ALV_LIST_DISPLAY.
But I have to use REUSE_ALV_GRID_DISPLAY.How to edit the checkbox.
Thanks in Advance,
SumithraHi vasu,
The below procedure explains you to create a checkbox cloumn in the grid and allows you to edit i hope this will helps u.
The ALV Grid Control displays the cells of a column as checkboxes if the column is marked as a checkbox column in the field catalog.
Add another field to the output table in which you want to display checkboxes
OR
Define an existing field as a checkbox.
Procedure
1. Add a field to your output table:
Data: gt_fieldcat type lvc_t_fcat.
Types: begin of gs_outtab.
Types: checkbox type c. "field for checkbox
Include structure <ABAP Dictionary structure> .
Types: end of gs_outtab.
Data: gt_outtab type gs_outtab occurs 0 with header line.
2 * Add an entry for the checkbox to the field catalog
clear ls_fcat.
ls_fcat-fieldname = 'CHECKBOX'.
* Essential: declare field as checkbox and
* mark it as editable field:
ls_fcat-checkbox = 'X'.
ls_fcat-edit = 'X'.
* do not forget to provide texts for this extra field
ls_fcat-coltext = text-f01.
ls_fcat-tooltip = text-f02.
ls_fcat-seltext = text-f03.
append ls_fcat to gt_fieldcat.
regards,
venu. -
F4 Help for Classical ALV Grid ( REUSE_ALV_GRID_DISPLAY_LVC)
Hi All,
We have an ABAP program that displays data using REUSE_ALV_GRID_DISPLAY_LVC. There is an editable column in the report for which we need to display F4 help. The functionality of the F4 help will completely user-defined.
Please let me know how to provide custom F4 help for editable column in ALV.
Thanks,
sathish.Hi satish,
Use ' F4IF_INT_TABLE_VALUE_REQUEST' function module after PROCESS ON VALUE-REQUEST event.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LAND1'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'T_LCDETAILS-DEST_COUNTRY'
callback_program = sy-repid
value_org = 'S'
TABLES
value_tab = t_country
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
Regards,
Venkat. -
Dynamic internal table Created from current classic ALV layout?
Hi,
Currently I have a dynamic ALV column output who's number of columns is dependent on t_output.
ALV Sample:
MANTR WK1 WK2 WK3 ...
10001 10 20 30
10002 5 10 15
I see this option, Get the ALV output, so this includes the header column name and its corresponding entries (which is easier.
Question here: How can I create a dynamic internal table for it_fieldcat of my ALV? Is there any FM or method?
If it will be a method, can you provide more details (I'm not that much yet familiar with method concept in ABAP)
*Note: I am not creating a dynamic table out of SELECT statements
Thanks.
Regards,
JaimePERFORM f_0600-init_alv_layout USING t_alv_layout.
PERFORM f_0700-init_field_catalog USING t_alv_fcat[]. "Populates the ALV Field Catalog
PERFORM f_0800-build_alv_comment USING t_alv_list_top_of_page[]. "title header of the report
PERFORM f_0900-fill_alv_sort_fields.
PERFORM f_1000-build_alv_display.
FORM f_0700-init_field_catalog USING us_vit_alv_fcat1 TYPE slis_t_fieldcat_alv.
DATA: w_vit_alv_fcat TYPE slis_fieldcat_alv.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_matnr TO w_vit_alv_fcat-fieldname,
c_material TO w_vit_alv_fcat-seltext_l,
c_x TO w_vit_alv_fcat-fix_column,
c_x TO w_vit_alv_fcat-key.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_maktx TO w_vit_alv_fcat-fieldname,
c_material_dis TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR: w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_meins TO w_vit_alv_fcat-fieldname,
c_uom TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR: w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_lifnr TO w_vit_alv_fcat-fieldname,
c_vendor TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_name1 TO w_vit_alv_fcat-fieldname,
c_vendorname TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_dispo TO w_vit_alv_fcat-fieldname,
c_mrp_cont TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_stprs TO w_vit_alv_fcat-fieldname,
c_std_price TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_st_pck TO w_vit_alv_fcat-fieldname,
c_st_pck_sz TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
CLEAR w_vit_alv_fcat.
MOVE : c_vit_output TO w_vit_alv_fcat-tabname,
c_kanban TO w_vit_alv_fcat-fieldname,
c_kanbanqty TO w_vit_alv_fcat-seltext_l.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
* To display 26 weeks historical consumptions:
CLEAR w_vit_alv_fcat.
UNASSIGN <fs_hwk_date>.
LOOP AT t_hwk_date ASSIGNING <fs_hwk_date>.
MOVE c_vit_output TO w_vit_alv_fcat-tabname.
CONCATENATE c_hwk <fs_hwk_date>-calender_wk
INTO w_vit_alv_fcat-seltext_l.
CONCATENATE c_hwk <fs_hwk_date>-index
INTO w_vit_alv_fcat-fieldname.
APPEND w_vit_alv_fcat TO us_vit_alv_fcat1.
ENDLOOP.
Edited by: Jaime Cabanban Jr on Apr 24, 2009 3:06 PM -
F4 changes in Classic ALV Grid
Hi
I'm using REUSE_ALV_GRID_DISPLAY , I have a Requirement to display F4 for MRP Group based on the plant in ALV GRID DIsplay.
How Can I capture F4 event and modify Standard F4 by using normal ALV.
Thanks for all your suggestions and time.Check this Code it will be helpful
{TYPE-POOLS: slis.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
DATA: it_data TYPE vbap_t.
SELECT *
FROM VBAP
INTO TABLE it_data
UP TO 20 ROWS.
wa_fcat-fieldname = 'VBELN'.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-ref_fieldname = 'VBELN'.
wa_fcat-ref_tabname = 'VBAK'.
APPEND wa_fcat TO it_fcat.
clear wa_fcat .
wa_fcat-fieldname = 'POSNR'.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-seltext_l = 'Item'.
APPEND wa_fcat TO it_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab = it_data
EXCEPTIONS
program_error = 1.}
Edited by: Pradeep Mohandass on Mar 7, 2012 2:09 PM
Maybe you are looking for
-
I have upgraded to itunes 11.1.3 and now cant see how I sync my devices?
Can anyone tell me how I now sync my devices thru itunes on my Macbook, since upgrading to 11.1.3. The only tab for devices is greyed out?
-
First of all sorry for bringing this old topic about my system up again. I can only use the performance modes Fast and Turbo if DDR voltage is set to 2.65-2.7, DDR frequency on Auto, memory by SPD and fsb to exactly 201..not 200 and not 202. Otherwis
-
Cant use video or slideshow in ellements 12
Since upgradeing to elements 12 I cannot create a slide show or open the video edit side of ellements. Also elements aout analyser quits working on bootup.
-
Frieght Cost In STO for Intracompany
Hi , We want a stock transport order to shift material from one plant to other plant within a company and want to book the freight cost while receiving the same material at receiving plant .The condition tab is deactivated for posting a sto.and how
-
SSL - Default SSL context init failed: null - need help with code
Hi! Once Again I have problems with SSL. I read something about SSL here: http://www.javaalmanac.com/egs/javax.net.ssl/Server.html Now I tried to test this stuff, that resulted in this program (I simply tried to put the SSL stuff from the above code