Query about the events in ALV List
Hi,
When does the events being triggered in the ALV?
Whta is its behavior? Thanks a lot!
Hi,
Following this report is the sample report ALV. Kindly go through that one.
REPORT YMS_ALVDEMO .
TYPE-POOLS : SLIS.
TABLES : QALS.
DATA : BEGIN OF T_OUT OCCURS 0,
MATNR LIKE QALS-MATNR, "MATERIAL
WERK LIKE QALS-WERK, "PLANT
ART LIKE QALS-ART, "Inspaction Lot Type
OBJNR LIKE QALS-OBJNR, "Object Number
END OF T_OUT.
DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
I_LAYOUT TYPE SLIS_LAYOUT_ALV,
GS_LAYOUT TYPE LVC_S_LAYO,
G_REPID TYPE SY-REPID,
LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
SELECT-OPTIONS:S_PRFLOS FOR QALS-PRUEFLOS.
INITIALIZATION.
G_REPID = SY-REPID.
I_LAYOUT-ZEBRA = 'X'.
I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
START-OF-SELECTION.
PERFORM FETCH_DATA.
END-OF-SELECTION.
PERFORM FILL_FIELDCAT.
PERFORM DISPLAY_ALV.
*& Form FETCH_DATA
* text
* --> p1 text
* <-- p2 text
FORM FETCH_DATA .
SELECT MATNR WERK ART OBJNR
FROM QALS
INTO TABLE T_OUT
WHERE PRUEFLOS IN S_PRFLOS.
ENDFORM. " FETCH_DATA
*& Form FILL_FIELDCAT
* text
FORM FILL_FIELDCAT .
REFRESH I_FIELDCAT[].
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'T_OUT'
I_INCLNAME = G_REPID
CHANGING
CT_FIELDCAT = I_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
ENDFORM. " FILL_FIELDCAT
*& Form display_alv
* text
FORM DISPLAY_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
TABLES
T_OUTTAB = T_OUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " display_alv
Thanks,
Sankar M
Similar Messages
-
How to print the data in ALV list format using an existing layout
Hi all
Iam displaying the output in ALV list format and I saved the layout with some name
now my requirement is i have to provide a field to select the layout name with F4 help and if i execute the program it should show the output with that layout format
I tried this iam getting F4 help for that layout and selecting the layout but iam not getting the output with that layout iam getting the normal basic layout
Can anyone send me a sample program code or what to do to get that
Thank youHi,
refer this code.
DATA : wa_variant TYPE disvariant, "Work area for variant
wa_variant1 TYPE disvariant, "Work area for variant
wa_layout TYPE slis_layout_alv, "Work area for layout
*& Form sub_get_default_variant *
This form will initialize the variant *
FORM sub_get_default_variant .
*--Clear
CLEAR wa_variant.
*--Pass the report name
v_repid = sy-repid. "Report ID
wa_variant-report = v_repid.
*--Call the function module to get the default variant
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
*--Check Subrc
IF sy-subrc = 0.
p_varnt = wa_variant-variant.
ENDIF.
ENDFORM. "sub_get_default_variant
*& Form sub_f4_for_variant *
This form will display the List of Variants *
FORM sub_f4_for_variant .
*--Local Variables
DATA: lv_exit(1) TYPE c. "ALV exit
*--Call the function module to display the list of Variants
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = c_save
IMPORTING
e_exit = lv_exit
es_variant = wa_variant1
EXCEPTIONS
not_found = 1
program_error = 2.
*--Check Subrc
IF sy-subrc <> 2 AND lv_exit IS INITIAL.
p_varnt = wa_variant1-variant.
ENDIF.
ENDFORM. "sub_f4_for_variant
*& Form sub_check_variant *
This form will check the variant *
FORM sub_check_variant .
IF NOT p_varnt IS INITIAL.
CLEAR wa_variant1.
MOVE wa_variant TO wa_variant1.
MOVE p_varnt TO wa_variant1-variant.
*--Call the function module to check the variant exist
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1.
wa_variant = wa_variant1.
ENDIF.
ENDFORM. "sub_check_variant
Regards,
Prashant -
Is there any possibility to see full details about the event?
ipad calendar:I have no chance to read the event location fully on my ipad. It is cut and finishes with "...", thus very important meeting number cannot be seen. Is there any possibility to see full details about the event?
Thanks for quick reply.
Looks like opened the event. Here is a screen shot, I marked the cut numbers with red cirsles. -
Revision: 8271
Author: [email protected]
Date: 2009-06-25 16:25:28 -0700 (Thu, 25 Jun 2009)
Log Message:
Change the event type of List-based component's change, changing and caretChange events to a new event class: spark.events.IndexChangeEvent.
QA: Yes
Doc: Yes
Checkintests: Pass
Mustella: List/DDL/ButtonBar tests pass
Reviewers: Hans & Jason
Modified Paths:
flex/sdk/trunk/frameworks/projects/framework/src/mx/events/IndexChangedEvent.as
flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/ButtonBarE xample.mxml
flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DropDownLi stExample.mxml
flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/ListExampl e.mxml
flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as
flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as
flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
Added Paths:
flex/sdk/trunk/frameworks/projects/spark/src/spark/events/IndexChangeEvent.asAre those components in a SWC? I would expect them to also have a namespace
that looks more like http://.....
Otherwise, make sure the path to the components are correct. -
Hi Support,
I have a query about the DR -Standby:
1) Is FAL_CLIENT and FAL_SERVER parameter mandatory in both Primary and standy node?
2) How many standy by we can create for primary node?
ThanksDear Prashanth,
Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
Since quantity of 3 is rejected and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
Hope this will help you better.
Best Regards,
Shekhar -
Query about the "User Decision
Hi,
I have a query about the u201CUser Decisionu201D, Suppose I have received the 10 quantity and lot get created for 10. At time of UD (QA11) I put 7 quantities in unrestricted and 3 in blocked stock .what we generally use to do with that block stock? Whether we again transfer it to quality stock (Movement 349)? Or move directly to unrestricted (movement: 343).
I tried to move the blocked stock in u201Cquality stocku201D in transaction MB1B with movement 349 but it had given error u201CChange the inspection stock of material 9112223334A in QM onlyu201D. In QM how to transfer the blocked stock in quality stock?
Regards,
PKDear Prashanth,
Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
Since quantity of 3 is rejected and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
Hope this will help you better.
Best Regards,
Shekhar -
About the event on. Sept/ 10 will it be live !
About the event on. Sept/ 10 will it be live !
Since no announcment of a live broadcast has been made, quite unlikley.You should be able to get live coverage (often in teh form of blogs) from a number of sources, however:
http://twit.tv/2013/09/05/apple-iphone-event-coverage-tues-910
http://news.cnet.com/8301-13579_3-57601600-37/apples-sept-10-event-join-us-next- tuesday-live-blog/
http://www.theverge.com/2013/9/8/4708072/live-coverage-apple-iphone-5s-5c-event- cupertino
To name just a few. -
Query on retrieving data back to the program from ALV List
Hi Group,
I have a requirement to send the details of the selected data as an ALV list to the user.
Then, the user selects either 1 or 2 or all or none back to the program from the ALV.
Thing is that,
1) when the user selects ( Icon ) to choose all the fields, they were not getting checked and in turn, I was not been able to read the records as checked in the program ( this is for All selection records ).
2) And also, I am not able to get the records checked ( incase of the user selects all fields ).
In short, I should be able to read the records which were checked and process only that records.
please let me know if you have any queries on the same.
Thank you very much in advance for the help.
Regards,
Vishnu.hi,
try like this
TABLES: ekko.
TYPE-POOLS: slis.
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'.
fieldcatalog-col_pos = 1.
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.
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'. "user presses SAVE
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 created one button(DET) in toolbar along with all the buttons of ALV..
when i click on this i am getting detail list....
reward if usefull.... -
what r the events contain in alv's
plz give in an order
clearly with decsription(Build up events table)
build an event table, which are used for firing both user commands and the system dependent events i.e. top of page, end of page etc.
A list of possible events is populated into an event table (I_EVENTS) when this table is passed from the function module REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events.
The function module contains following import and export parameters.
IMPORTING PARAMETERS: I_LIST_TYPE
This parameter has possible values from 0-4.
The parameter I_LIST_TYPE is of TYPE SLIS_LIST_TYPE and is DEFAULT 0 .
EXPORTING PARAMETERS: I_EVENTS table.
This table is of TYPE SLIS_T_EVENT and returns to the program the name of all the possible events.
The table structure contains the fields:
I_EVENTS-NAME: Name of the Callback event.
I_EVENTS-FORM: Name of the form routine that should be called in the calling program at the event.
Only events with a form routine name are processed.
The 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.
Sample code :
FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE', FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: L_I_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_EVENTS.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_PAGE TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
CLEAR L_I_EVENT.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_USER_COMMAND TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
This will prepare the events table for the report.
The report will contain three forms for the above events:
1. FORM TOP_OF_PAGE: This form will contain the top of page event for the report i.e. header etc
Using the function module REUSE_ALV_COMMENTARY_WRITE, the internal table containing the headings for top of page event can be passed to the list output. Also, any logo specific to the report can be passed to the function module.
2. FORM END_OF_PAGE: This form will contain the end of page event for the report i.e. footer etc
3. FORM USER_COMMAND: This form will contain the desired user command i.e. pick/line selection
hope this helps
Regards
Abdullah -
Whi is the winner? ALV LIst or ALV Grid OO?
Hi Guys,
Hope you are all well.
My company is still mostly using the ALV List Function Modules when creating reports. Yes, they are using the SLIS pools.
I have written a template program for them to start doing things the OO way. That is to say, using ALV Grid Objects.
We are now thinking of COMPLETELY going over into ALV Grid Objects, but some of us are still arguing which one is best?
The biggest argument is :
Is ALV too "expensive" with regards to using system recources?
Please give me your thoughts as Im all for going for OO, but I would understand if it would make things slower.
Points will be awarded for useful arguments.
tks
ChristiaanSLIS is OLD, OBSOLETE DINOSAUR technology.
With the new classes you can create new reports really quickly and easily and add all sorts of functionality to them.
There's a small learning curve -- but what ought to appeal to management is that once you get the hang of it you can produce a report in hours (or even minutes) which done in the old way could take a week or more.
These days Human development time is far far more expensive than machine time so there's NO CONTEST.
The advantages in general of OO are too numerous to list here but if you look at the sample code I've listed here you can see how easy and quicklly you can get an application up and running even if you haven't got my Z_class definition listed in the program (it's a global class now defined with SE24).
With either cl_gui_alv_grid or even easier (if you don't need edit capability) the salv_table type class it only takes a few lines to code your program and display the grid.
All you ever now need to do in an alv program is the following.
1) define your data structures
2) use RTTI to generate dynamic field catalog from your data structures
3) create dynamic table
4) populate it
5) display grid.
You should have all the events etc you need such as cell selection etc etc.
Your whole code could be quite small.
For example I've got a generalized Z_cLass for my alv grid.
Now here's a sample program to display program names in the system. When I double click a program SE38 is entered and on exit unlike the standard sap transaction my list is re-displayed where I can choose another program.
Note how small the code is.
You won't be able to copy and run this program directly as you'll need the Z_class definitions.
In this Z_class there's also functionality for ON data change, multiple cell selection , toolbar additions etc.
These methods are available to EVERY program calling the class.
If you need the extra functionality using SLIS you have to program it in every time for each individual program.
You can therefore concentrate in your application program on just getting the data and displaying it. All the complicated functionality is in the Z_class.
Incidently using ALV classes can also render the whole idea of classical dynpros with Table controls as also obsolete.
program zzjimboprogs.
tables : trdirt.
include my_zdata. "data references to my Z_Class etc.
* Front end to call SE38 Program list
* When you use the search Program facility in SE38
* the system loses the LIST after you choose a program and enter
* transaction SE38
* double click on the Program module you want SE38 to use.
* After exiting SE38 you will return to the list .
types: begin of s_elements,
name type trdirt-name,
text type trdirt-text,
end of s_elements.
data: progname type trdirt-name.
data: wa_elements type s_elements.
selection-screen begin of block one with frame title text-t01.
select-options: s_prog for trdirt-name obligatory.
selection-screen end of block one.
at selection-screen.
initialization.
invoker = sy-repid. "Name of calling program for alv class.
start-of-selection.
create data dref type s_elements.
assign dref->* to <fs>.
i_gridtitle = 'Program List'.
invoker = sy-repid.
i_zebra = ' '.
i_edit = 'X'.
create object z_object
exporting
z_object = z_object
cfname = 'CCONTAINER1'.
assign z_object to <fs1>.
i_object = <fs1>.
call method i_object->build_dynamic_structures
exporting
my_line = <fs>
calling_program = invoker
importing
dy_table = dy_table
changing
it_fldcat = it_fldcat.
perform populate_dynamic_itab
changing dy_table.
perform modify_fldcat.
i_screen = '100'.
i_text = 'Prog List'.
perform display_grid
using
i_screen
i_text
it_fldcat
<dyn_table>.
end-of-selection.
form populate_dynamic_itab changing dy_table.
assign dy_table->* to <dyn_table>.
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
select *
from trdirt
into corresponding fields of table <dyn_table>
where name in s_prog
and sprsl eq sy-langu.
endform.
form display_grid
using i_screen
i_text
field_catalog
dynamic_table.
call method i_object->display_data
exporting
i_gridtitle = i_gridtitle
i_edit = ' '
i_zebra = ' '
i_opt = ' '
title_text = i_text
program = invoker
screen_number = i_screen
z_object = i_object
changing
it_fldcat = field_catalog
gt_outtab = dynamic_table
e_ucomm = e_ucomm.
if e_ucomm = 'BACK'.
leave to screen 0.
else.
leave program.
endif.
endform.
form verwerk.
endform.
form refresh.
call method i_object->refresh_grid.
endform.
form dubbelklik using
e_row type lvc_s_row
e_column type lvc_s_col
es_row_no type lvc_s_roid.
read table <dyn_table> index e_row into wa_elements.
progname = wa_elements-name.
set parameter id 'RID' field progname.
call transaction 'SE38'.
perform refresh.
row_number-row_id = e_row.
call method z_object->set_cell
exporting
e_column = e_column
es_row_no = row_number.
endform.
form modify_fldcat.
col_name it_fldcat 1 'Programe' 25.
col_name it_fldcat 2 'description' 50.
endform. -
Function module to save the data from ALV list to MS Excel file
Hi,
I am displaying an ALV list.
I am assigning a pushbutton in the GUI status to save the list as a MS Excel file.
Can you please let me know the function module to achieve this task.
I tried 'SAP_CONVERT_TO_XLS_FORMAT' FM but it is giving some type confict error.
Thanks & Regards,
Balaji.RALV has this option built in, you may also find FM like [ALV_XXL_CALL|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=alv_xxl_call&adv=false&sortby=cm_rnd_rankvalue].
Can you elaborate a little more on your need, why adding an option that already exits?
Regards -
How to capture the event in ALV grid display?
Hi experts,
How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
regards,
Arul Jothi.Hi Arul,
Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
Select Query after the Event "GET node "
Hi,
My requirements is I am calling get object event in my report and preparing an internal table in the get event, after this i need to write a select query based on this internal table..
i want to avoid select query inside get event, my problem is to end the GET event and write a select query..
How can i do that..
can i write it in the end-of-selection.( i don't think so)
it looks like this.
start-of-selection.
get objec.
" Internal table preparation
????????event name needed??????????
select query.....
please suggest.END-OF-SELECTION.
Effect
This statement defines an event block, whose event is raised by the ABAP-runtime environment during the calling of an executable program , if the logical database, with which the program is linked, has completely finished its work.
Moderator message - Sandeep - if you have to cut and paste from the help, please note it as such.
Edited by: Rob Burbank on Nov 26, 2009 12:42 PM -
What is the Event in ALV to handle a mark/demark?
Hi togehter,
I´m looking for the event to react on a mark or demark in ALV OO.
Thanks in advance,
SebastianHi,
Check with the [Select or Deselect the row of ALV|Row Select in ALV]
Hope it helps you.
Regareds! -
What is the difference between ALV list FM display and OO ALV Display?
What is the difference between ALV Function Modules and Object Oriented ALV Display?
Hi Sathish ,
There is not much diffrence , it is only another way of implementing it.
Regards
Arun
Maybe you are looking for
-
Why no support for GeForce GFX 750 Ti specifically?
Today I received and installed my brand new GeForce GFX 750 Ti, specifically bought for being able to use After Effects properly. My last card was an ATI/AMD FirePro which has no CUDA and thus couldn't use Ae. So I was using it CPU only! Which is tot
-
Where is the Convert feature in DW?
I want to convert web pages to HTML 5 but I couldn't find the "Convert" option on the File menu. Is the "Convert" feature no longer supported in DW?
-
The following problem: I have 2 adobe premiere project. both have the same film and film length but different video codecs. 1. project (low quality video codecs (mpeg4) export works fine 2. project (high quality video codecs (avi) export stops every
-
Applying XSLT to XSLT result in Java
I want to apply a 2nd XSLT to results of ProcessXSL. I started from JDeveloper sample code: TransformedShoppingCart.java. After I have applied one XSL I want to apply another. Code snip: //Up to here have read in an xml file, //parsed it and read an
-
Today I was downloading the The Dark Knight digital copy. It download all the way to the end but never finished. I deleted it and tried to redownload it. Same thing happened. So I closed itunes and restarted the program. Now that I'm on the program i