Proper use of END-OF-SELECTION event in report programme
Hi,
If we will write "WRITE" statements in side START-OF-SELECTION then it will help me to display the output.Then what is the need of END-OF-SELECTION .
Can any body please tell me the <b>proper use of END-OF-SELECTION event in report programme.</b>
This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started.
<b>In report programs using LDB for every value selected the program issues the output, to control this you would use END-OF-SELECTION.</b> Now if you call your output in this event, the output is made only after all the values are selected as per the selection criteria.
suppose while coding, u need a logic like below:
if a condition is satisfied continue with the report
and if not satisfied, then display a message and end the report.
then u can code like below.
start-of-slection.
if a = <condition>.
do the following.......
else.
stop.
end-of-selection.
write: 'THIS IS END'.
stop command triggers end-of-slection from anywhere.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
Similar Messages
-
What is the use of "end of selection" event in report
Hi all
As we can display the outputs in the "start-of-selection "using the write statement.
Then what is the use of "end-of-selection" in reports.
Please tell me with some real tiem examples.
God points will be rewarded.
ThanksHi,
The END-OF-SELECTION event is triggered in type executable programs once the logical database has finished reading all data and before the list processor is started.
It tells the server that all the database reading is completed and no further reading is going to take place..
For more details go through the following link:
http://help.sap.com/saphelp_me21sp2/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/content.htm
END-OF-SELECTION is used mostly when you are using Logical data base in your report. It is triggered when all selection get finished from the data base.
You can use write statments in start of selection and end of selection also.
But the one use of end of selection is... if you want to stop the processing of a certain code and directly display some message you can use this.
start-of-selection.
select data..
process data
if no data .
stop.
endif.
write data
end-of-selection.
write : 'No data to display.
Stop command will take the control to end of selection event.
thanks,
mahesh
Message was edited by:
I Can Solve It -
What is the need of END-OF-SELECTION event in ABAP reporting
Hi,
Can anyone explain the need of the END-OF-SELECTION event in ABAP Reports?
This event is used to terminate the previous event. Is that right? or is there any specific use of it?
and when exactly we use this event while writing a report? I mean what purpose?
Thanks,
Paddu.Hi,
END-OF-SELECTION makes more sense when you are using logical database in your program.
See these links.
http://help.sap.com/saphelp_46c/helpdata/en/34/8e74266df74873e10000009b38f9b8/frameset.htm
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/frameset.htm
After all the data has been selected END-OF-SELECTION event writes the data to the screen
The END-OF-SELECTION event is triggered in executable programs once the logical database has finished reading all data and before the list processor is started.
Try to go thro this link.
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9a1435c111d1829f0000e829fbfe/frameset.htm
Mostly end-of-selection is used in logical data base. It is not mandatory.
Ex:
If you use a logical database in your report then this event is mandatory because when all the data selection from the database is finished this events get triggers.
For example if you are populating a internal table using a logical data base event 'GET' then you need this event because if you don't use this you get display again and again for each selection.
START-OF-SELECTION.
GET PERNR.
itab-pernr = pernr-pernr.
append itab.
*this get triggers after all selection from database.
END-OF-SELECTION.
loop at itab.
write:/ itab-pernr.
endloop.
Regards,
Padmam. -
Infoset Using Join - End of Selection
I have created a Infoset from 2 tables and created a query based on the Infoset. Now I need to write the output from the query to a file in the app server. I think I need to write the code ' END OF SELECTION'.
1) How do I retrieve the values of the output table to write it in the file.
2) I tried writing a small text in a file in End of Selection of the Infoset . When I executed the query.It didnt call that section of the code whereas same code when placed in start of selection, it worked. When is the Code in End of Selction is triggered.hi
good
go through these links, i hope thesell help you to solve your problem
http://help.sap.com/saphelp_erp2004/helpdata/en/11/723c3b35703079e10000000a114084/content.htm
http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb43cc455611d189710000e8322d00/content.htm
thanks
mrutyun^ -
Using plsql tables in select statement of report query
Hi
Anyone have experience to use plsql table to select statement to create a report. In otherwords, How to run report using flat file (xx.txt) information like 10 records in flat files and use this 10 records to the report and run pdf files.
thanks in advance
sureshhi,
u can use the utl_file package to do that using a ref cursor query in the data model and u can have this code to read data from a flat file
declare
ur_file utl_file.file_type;
my_result varchar2(250);
begin
ur_file := UTL_FILE.FOPEN ('&directory', '&filename', 'r') ;
utl_file.get_line(ur_file, my_result);
dbms_output.put_line(my_result);
utl_file.fclose(ur_file);
end;
make sure u have an entry in ur init.ora saying that your
utl_file_dir = '\your directory where ur files reside'
cheers!
[email protected] -
How to use AT END OF logic in ALV reports?
Hi Experts!!
I have a requirement which is given below and the same should be the output of an alv report. I have all the data in one itab which has ields as matnr, sl.no, name and place. And I have the itab values as
MATNR SL.NO NAME PLACE
134 1 ABCD INDIA
134 2 XYZ US
134 3 QWERT GERMANY
256 4 FDGHS CNTRY1
256 5 GVHB CNTRY2
256 6 GHI CNTRY3
256 7 YGJN CNTRY4
256 8 ESEGVU CNTRY5
Now I need the alv output as the below:
Sl.No. Name Place
MATNR: 134
1 ABCD INDIA
2 XYZ US
3 QWERT GERMANY
MATNR: 256
5 FDGHS CNTRY1
6 GVHB CNTRY2
7 GHI CNTRY3
8 YGJN CNTRY4
9 ESEGVU CNTRY5
In normal classic report, I can achieve this by using AT END OF MATNR, and then printing. But how can i achieve the same in ALV report?
Kindly suggest me the normal ALV method, istead of OOPS concepts. I don't ant to consider OOPS, if this is possible by normal ALVs.
Thanks a lot in advance.
Regards,
SeenuHi,
Try this:
data: h_alv_sorttab type slis_t_sortinfo_alv.
h_alv_sorttab-fieldname = 'matnr'.
h_alv_sorttab-tabname = 'it_data'.
h_alv_sorttab-up = 'x'.
h_alv_sorttab-subtot = 'x'.
append h_alv_sorttab.
call function 'reuse_alv_grid_display'
exporting
i_background_id = 'alv_background'
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_sort = h_alv_sorttab
i_save = g_save
is_variant = g_variant
it_events = gt_events[]
i_default = 'x'
tables
t_outtab = it_data.
Hope this information is help to you.
Regards,
José -
About start-of-selection and end-of-selection
Hi all,
what is the functionality of start-of-selection and end-of-selection events in reports.Here we go :
Start-of-selection is the event where you will code ur sql statements, this is the event which will be triggered automatically even for normal programs, not only for reports even if you dont specify this event in the program.
At Selection screen is the event to validate the input values given in the selection screen using initialization event.
First in the sequence AT SELECTION SCREEN event will be triggered and then START-OF-SELECTION.
END-OF-SELECTION, will fire only when you actually write it after the selection of the data is over. Usually between the START and END OF SELECTION you fetch the data and after the END OF SELECTION, you process the data and write that as output as display the same as ALV.
If helpful pl reward.
Cheers. -
Error launching select event in a region
Hi,
We are developing an application using JHeadStart and ADF Faces in JDeveloper 10.1.3.1.
Due to the size of the page code, we have splitted the page in different regions. The page has a master-detail-subdetail structure, where each subdetail has been put in a separated ADF region.
When changing the selected row in the master table, the values displayed in the detail table are refreshed. But when we do the same in the detail, no action takes place (the data in the subdetail doesn't change, and the code for the selection event listener is not executed either).
If I don't use ADF regions, the selection event listener code is executed. What could happen? On the other hand, an action event in the region is executed without problems.
Some pieces of the code:
- The include of the detail region in the main page:
<af:region id="ConcepteEco2" value="#{bindings}" regionType="cat.coec.outis.view.region.ConcepteEco2"/>- The declaration of the detail table in the region:
<af:table id="ConcepteEco2Table" styleClass="scrollable "
value="#{ConcepteEco2CollectionModel}"
inlineStyle="height: 120px; width: 1000px ; "
rangeChangeListener="#{ConcepteEco2CollectionModel.processRangeChange}"
selectionState="#{ConcepteEco2CollectionModel.selectedRow}"
selectionListener="#{ConcepteEco2CollectionModel.makeCurrent}"
disclosureListener="#{ConcepteEco2CollectionModel.hideAllDetails}"
varStatus="status"
var="row" rows="#{bindings.ConcepteEco2Table.rangeSize}"
first="#{bindings.ConcepteEco2Table.rangeStart}"
emptyText="#{bindings.ConcepteEco2Table.viewable ? 'No hi ha dades.' : 'Accés Denegat.'}"
binding="#{ConcepteEco2CollectionModel.table}"
partialTriggers="TipusCctEcoTable" >- The declaration of the table selection facet:
<!-- DEBUG:BEGIN:TABLE_SELECTION : outis/pageComponent/tableSelection.vm, nesting level: 11 -->
<f:facet name="selection">
<af:tableSelectOne disabled="#{ConcepteEco2CollectionModel.newRow}"
autoSubmit="true" id="ConcepteEco2SelectOne"
onclick="javascript:selectCurrentRow('ConcepteEco2:ConcepteEco2',this);">
<!-- DEBUG:BEGIN:DUPLICATE_ROW_BUTTON : outis/button/duplicateRowButton.vm, nesting level: 12 -->
<!-- DEBUG:END:DUPLICATE_ROW_BUTTON : outis/button/duplicateRowButton.vm, nesting level: 12-->
</af:tableSelectOne>
</f:facet><!-- DEBUG:END:TABLE_SELECTION : outis/pageComponent/tableSelection.vm, nesting level: 11--> Any help would be appreciated,
Carles Biosca
BBR Ingeniería de Servicios SL
www.bbr.cathi,
in your datagrid call use the property itemClick.
e.g <mx:DataGrid id="DG" dataProvider="{some provider"}
itemClick"myFunction())">
then in your script you can declare the function myFunction
to get column values of the selected row, use
DataGrid.selectedItem.ColumnDatafield
so for the above datagrid with a column name and
dataField=fullName i can use
DG.selectedItem.fullName
HTH
regards
abhi -
Where does the control moves at first at END-OF PAGE or END-OF-SELECTION
Is END-OF PAGE triggered like TOP-OF-PAGE from the AT-SELECTON-SCREEN automatically with a write statement & where does the control moves at first
at END-OF PAGE or END-OF-SELECTION?Hi,
1. End-of-selection:
This event is triggered after the start-of-selection. to display the contents on the report.
2.Top-of-page: Every time a new page is triggered. Mainly this is used for header of the report.
3. End-of-page : every time the list data reaches the footer region of the page.
This way first data is disaplyed then it reaches the footer..
first End-of-selection then End-of-page
These example may help u in detail...
Leaving Event Blocks Using STOP
If you use the STOP statement within an event block, the system stops processing the block immediately. The ABAP runtime environment triggers the next event according to the following diagram:
Before and during selection screen processing, the next event in the prescribed sequence is always called. From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement. Once the corresponding event block has been processed, the system displays the list.
The following program is connected to the logical database F1S.
REPORT EVENT_TEST.
NODES: SPFLI, SFLIGHT, SBOOK.
START-OF-SELECTION.
WRITE 'Test program for STOP'.
GET SBOOK.
WRITE: 'Bookid', SBOOK-BOOKID.
STOP.
END-OF-SELECTION.
WRITE: / 'End of Selection'.
This produces the following output:
Test Program for STOP
Bookid 00010001
End of Selection
As soon as the first line of SBOOK has been read, the system calls the END-OF-SELECTION event block.
Exiting Event Blocks Using EXIT
If you use the EXIT statement within an event block but not in a loop, the system stops processing the block immediately. The ABAP runtime environment triggers the next event according to the following diagram:
Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list processor directly when the EXITstatement occurs, and displays the list.
If the EXIT statement occurs inside a DO, WHILE, or LOOP loop, it is the loop that terminates, not the processing block.
The following executable program is connected to the logical database F1S.
REPORT demo_program_exit_1.
NODES: spfli, sflight, sbook.
START-OF-SELECTION.
WRITE 'Test Program for EXIT'.
GET sbook.
WRITE: 'Bookid', sbook-bookid.
EXIT.
END-OF-SELECTION.
WRITE: / 'End of selection'.
This produces the following output:
Test Program for EXIT
Bookid 00010001
After the first line of SBOOK has been read, the list is displayed immediately.
The following executable program is connected to the logical database F1S.
REPORT demo_program_exit_2.
NODES: spfli, sflight, sbook.
DATA flag(1) TYPE c.
AT SELECTION-SCREEN.
IF carrid-low IS INITIAL.
flag = 'X'.
EXIT.
ENDIF.
START-OF-SELECTION.
IF flag = 'X'.
WRITE / 'No input for CARRID'.
EXIT.
ENDIF.
GET spfli.
GET sflight.
GET sbook.
END-OF-SELECTION.
WRITE / 'End of Selection'.
If the user does not enter a value for CARRID-LOW, the output appears as follows:
No selection made for CARRID
After the first EXIT statement, the next START-OF-SELECTION event is triggered. After the second EXITstatement, the output list is displayed.
Regards. -
what is the diff btw start of selection and end of selection
HI Raja,
Check out the link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9a0735c111d1829f0000e829fbfe/content.htm
<b>START-OF-SELECTION</b> Point after processing the selection screen
The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables using a logical database. You can use this processing block, for example, to set the values of internal fields or to write informational statements onto the output screen.
At the START-OF-SELECTION event, also all statements are processed that are not attached to an event keyword except those that are written behind a FORM-ENDFORM block
<b>END-OF-SELECTION </b> Point after processing all lines offered
by the logical database.
To define a processing block after the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION.
This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started. You can use the corresponding event block to process and format the data that the program has stored in internal tables or extracts during the various GET events.
The following program is connected to the logical database F1S.
REPORT EVENT_DEMO.
NODES SPFLI.
DATA: SPFLI_TAB TYPE SORTED TABLE OF SPFLI
WITH UNIQUE KEY CITYFROM CITYTO CARRID CONNID,
SPFLI_LINE TYPE SPFLI.
START-OF-SELECTION.
WRITE 'Demo program for END-OF-SELECTION'.
SKIP.
GET SPFLI FIELDS CARRID CONNID CITYFROM CITYTO.
MOVE-CORRESPONDING SPFLI TO SPFLI_LINE.
INSERT SPFLI_LINE INTO TABLE SPFLI_TAB.
END-OF-SELECTION.
LOOP AT SPFLI_TAB INTO SPFLI_LINE.
WRITE: / SPFLI_LINE-CITYFROM,
SPFLI_LINE-CITYTO,
SPFLI_LINE-CARRID,
SPFLI_LINE-CONNID.
ENDLOOP.
This program fills a sorted table with data from the logical database in the GET SPFLI event, and displays them in a list in the END-OF-SELECTIOn event. Depending on what you enter on the selection screen, the beginning of the list display might look like this:
For rest of events check:
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9a1435c111d1829f0000e829fbfe/frameset.htm
Reward points if this Helps.
Manish
Message was edited by:
Manish Kumar
Message was edited by:
Manish Kumar -
Hi ,
have been working on a ALV report using the class SALV cl_salv_hierseq_table
I am facing few issues pertaining to two things:
1. Displaying some subtotal text along with the subtotals.
Example refer the standard demo example: SALV_DEMO_HIERSEQ_FORM_EVENTS
Now instead of A 17 and A26 I would like to show text like Subtotal for the Carrid.for subtotals and grand totals
Like Subtotal for A 17 is : XXXXXXX
GrandTotal is : YYYYYY
2. We have a page break and a new page for every purchasing group as in the standard example SALV_DEMO_HIERSEQ_FORM_EVENTS for CARRID.
I need to display some variable values as number of documents ,total number of records etc at the end of each CARRID group before a new page starts for the next CARRID.Please note i do not want it on every page.it should only be diaplyed at the end of page whose next page would be for next CARRID.[basically at end of every carrid]Example:after displaying all details for AA need to display the number of records for that carrid at the end of the page[as page break is based on CARRID]/
Thanks
Jyotsnaat end of page event, for CL_SALV_EVENTS_HIERSEQ, has some useful parameters allowing to know where you are at the time of event
parameter VALUE is of type CL_SALV_FORM which contains public attribute IF_SALV_FORM~ACCDESCRIPTION; you can slo get contents of it
about text of total/subtotal, this is normally set in the layout -
Using select event for interlayer navigation
Hi All,
I have two tables. The output of first table is input for the second one. When I select a row in the first table,the SELECT event is fired and the second table is populated based on the selection.
Now I have a scenario where the two tables are on separate layers. My requirement is that, the secondlayer should be brought in when the SELECT event is fired. I don't want to use a button to trigger a navigation event. I try naming the navigation event as SELECT but it didn't work.
please helpHi Jarrod,
Yes your view i sright. But i had mistakingly mentioned a table. Its Bar chart actually. When a bar is clicked, second layer should appear with the detail table ouput.
Though the table is filled with the click but the navigation is not happeneing. Do you have any idea abouit it ?
I have used *select also but to no avail -
Using iMovie. I selected "New Movie" from the menu. Now when I click on "Events" all I see is the movie. There are no imported video cups to select from. What did I do?
At the top middle of the screen is a clips filter. Make sure that "All Clips" is selected.
-
End of Page event not triggering in ALV report
Hello,
I am developing an ALV report using REUSE_ALV_LIST_DISPLAY. Whatever I write in top_of_page, it will be displayed in the header portion of the output.
But I want to display some footer text at the end of the page. The problem I am facing is, the WRITE statements within end_of_page are not displayed when the report is run.
I have populated the i_events as follows :
FORM f_events CHANGING p_i_events TYPE slis_t_event.
CONSTANTS : l_c_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
l_c_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
DATA : l_wa_event TYPE slis_alv_event.
Returns table of possible events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_i_events.
To append internal table holding event names with event 'TOP OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE l_c_top_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
To append internal table holding event names with event 'END OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_end_of_page.
IF sy-subrc = 0.
MOVE l_c_end_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
ENDFORM. "f_events
Regds
RajeshHi have a look at the following code, and change ur code for end of page accordingly. this will resolve ur problem.
This is a basic ALV with the followings:-
- Page Heading
- Page No
- Sub-Total
- Grand Total
REPORT ZALV.
TYPE-POOLS: SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: BEGIN OF ITAB,
FIELD1(5) TYPE C,
FIELD2(5) TYPE C,
FIELD3(5) TYPE P DECIMALS 2,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB_FIELDCAT.
Print Parameters
PARAMETERS:
P_PRINT AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
P_RESERV TYPE I. "NO OF FOOTER LINE
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD USING GS_PRINT. "Print PARAMETERS
START-OF-SELECTION.
TEST DATA
MOVE 'TEST1' TO ITAB1-FIELD1.
MOVE 'TEST1' TO ITAB1-FIELD2.
MOVE '10.00' TO ITAB1-FIELD3.
APPEND ITAB1.
MOVE 'TEST2' TO ITAB1-FIELD1.
MOVE 'TEST2' TO ITAB1-FIELD2.
MOVE '20.00' TO ITAB1-FIELD3.
APPEND ITAB1.
DO 50 TIMES.
APPEND ITAB1.
ENDDO.
END-OF-SELECTION.
PERFORM BUILD.
PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
PERFORM COMMENT_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
PERFORM CALL_ALV.
FORM BUILD.
DATA FIELD CATALOG
Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD1'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
*FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
FIELDCAT_LN-KEY = ' '. "SUBTOTAL KEY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD2'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-NO_OUT = 'X'.
FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD3'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
FIELDCAT_LN-REF_TABNAME = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM.
FORM CALL_ALV.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.
HEADER FORM
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM.
FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: GS_LINE TYPE SLIS_LISTHEADER.
CLEAR GS_LINE.
GS_LINE-TYP = 'H'.
GS_LINE-INFO = 'HEADER 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'S'.
GS_LINE-KEY = 'STATUS 1'.
GS_LINE-INFO = 'INFO 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
GS_LINE-KEY = 'STATUS 2'.
GS_LINE-INFO = 'INFO 2'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
ENDFORM.
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
ENDFORM.
FORM END_OF_PAGE.
WRITE at (sy-linsz) sy-pagno CENTERED.
ENDFORM.
PRINT SETTINGS
FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
LS_PRINT-PRINT = P_PRINT. "PRINT IMMEDIATE
LS_PRINT-NO_PRINT_SELINFOS = P_NOSINF. "NO SELECTION INFO
LS_PRINT-NO_COVERPAGE = P_NOCOVE. "NO COVER PAGE
LS_PRINT-NO_NEW_PAGE = P_NONEWP.
LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
LS_PRINT-RESERVE_LINES = P_RESERV.
ENDFORM.
*END OF ZALV PROGRAM
Satish -
Not able to reach start of selection event in the called program
hi,
I have a report 1 in which i am calling report2 using below syntax,
SUBMIT Report2 VIA JOB gv_jobname NUMBER gv_jobcount
WITH s_g_yr IN s_g_yr
WITH s_c_rf IN s_c_rf
AND RETURN.
the problem is when report 2 is called it exists after event "at selection screen output" and does not go in the event "start of selection".
Please advise. how can i reach the "start of selection" event where all the processing logic is specified..
Thanks and Regards,
KritiHi,
In your report you have used the event AT SELECTION-SCREEN OUTPUT. So, first it will trigger this event and then it will go for START-OF-SELECTION event.
Events will trigger in this following way.
LOAD PROGRAM
INITIALIZATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN OUTPUT
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE
In above sequence events will trigger in report.
Regards,
Shankar.
Maybe you are looking for
-
SubmitonEnter is not working in safari
Hi, I have a BSP application which follows MVC pattern and in view I have Htmlb input field code which has submitonEnter="X". If user enters the value and hit Enter button it should go to DO Handle Event. This perfectly works in IE. But in Safari and
-
Create Report Layout (Apex 3.2) - How can I set the substitution variables?
Hi, I created a "Report Query" under "Shared Components". I now want to work on the corresponding "report layout". I created a "Generic Columns (XSL-FO)". I read the following in the documentation: The following are valid substitution strings: #PAGE_
-
DDL for table & all its dependent objects
Hi, I'm trying to perform online_redefinition of a table in Oracle 11g. After this the depedent objects like indexes & Primary Keys & Foreign Keys are missing. Can anyone help with a detailed step by step procedure to perform this online_redefinition
-
Group by in oConditions ?
hi, is it possible to add a group by statement in the conditions of the oDBDataSource? In my following condition i want to 'group by' u_vertreter, u_bp, u_satz oConditions = moSBOApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_C
-
Smart form variable Prob.
I hav a z report connected to smart form for printing. i hav main page and other windows too. on main page, Items are displayed with qty, disc., price. And on other window I m displaying Total qty, at bottom grand total of all above Items. Qty on mai