Field Descriptions without TOP OF PAGE
Hi Experts,
I have one Z report and this was written somebody long back.
This report was normal standard report i.e just writing the table values to screen using WRITE statement.
Eventhogh there is no TOP OF PAGE event in the report, field names were displaying in the screen output with highlighted color.
As soon as WITE statement calling, program is displaying fieldnames automatically? how it possible?
Now, I modified my program by adding another field values to the screen output.
The field which I added it's not showing field name.
How can I display my field description to that output. (without adding TOP OF PAGE)
As I told you report doesn't have TOP OF PAGE event. Please help me.
Thanks
Raghu
Raghu,
I'm guessing that your report is organized in a tabular form and by field description you mean column headings. There are two ways to display column headings 1) by explicitely writing the WRITE statements to output to the column headings, 2) by maintaining the standard list & column headings. (in ABAP editor follow menu path GOTO>Text Elements>List Headings.
You can disable the display of standard headings by using addition in NO STANDARD PAGE HEADING as below.
REPORT YTEST NO STANDARD PAGE HEADING
LINE-SIZE 120
LINE-COUNT 65
MESSAGE ZMSG.
Regards,
Gajendra
Similar Messages
-
How to pass field in Alv Top-of-page
Edited by: Deepak Mathrani on Aug 12, 2008 12:40 PM
<THREAD LOCKED. Please read the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] to discover why>
Edited by: Mike Pokraka on Aug 12, 2008 2:58 PMHi
sample program
*& Report ZNNR_ALVSAMPLE
REPORT znnr_alvsample NO STANDARD PAGE HEADING.
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
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.
*ALV data declarations
DATA: fieldcatalog 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.
*Start-of-selection.
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.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = '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'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
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'.
fieldcatalog-col_pos = 8.
fieldcatalog-EDIT = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
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_top_of_page = 'TOP-OF-PAGE'(001) "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
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 table it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform. -
How To Print Field Value in TOP-OF-PAGE During Line Selection.
How To Print Field Value in TOP-OF-PAGE During Line Selection when double click on field.
(If my memory serves me well (not used for long time ago)
Assign values to system fields sy-tvar0 - sy-tvar9, they will replace the placeholders "&0" through "&9" in the list headers and column headers.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE: / 'Interactive Report &3'.
WRITE record-vbeln TO sy-tvar3.
Regards,
Raymond -
How i can show the selection screen input field in the top of page in alv
hi ,
how i can show the selection screen input field in the top of page in alv grid output.
tell me the processHi,
excample from my program:
FORM topof_page.
DATA: l_it_header TYPE TABLE OF slis_listheader WITH HEADER LINE,
l_info LIKE l_it_header-info.
DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
DATA: l_key LIKE l_it_textpool-key.
READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
DEFINE m_selinfo.
if not &1 is initial.
clear l_it_header.
l_it_header-typ = 'S'.
l_key = '&1'.
translate l_key to upper case.
read table l_it_textpool with key key = l_key.
if sy-subrc = 0.
shift l_it_textpool-entry left deleting leading space.
l_it_header-key = l_it_textpool-entry .
endif.
loop at &1.
case &1-option.
when 'EQ'
or 'BT'
or 'CP'.
write &1-low to l_it_header-info.
when others.
write &1-low to l_it_header-info.
concatenate &1-option
l_it_header-info
into l_it_header-info
separated by space.
endcase.
if not &1-high is initial.
write &1-high to l_info left-justified.
concatenate l_it_header-info
l_info
into l_it_header-info
separated by space.
endif.
if &1-sign = 'E'.
concatenate ']'
l_it_header-info
into l_it_header-info.
endif.
append l_it_header.
clear: l_it_header-key,
l_it_header-info.
endloop.
endif.
END-OF-DEFINITION.
m_selinfo: s_trmdat,
s_trmext,
s_trmint,
s_fkdat,
s_delno,
s_vbeln,
s_deact,
s_kdmat.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = l_it_header[].
ENDFORM.
I hope, this will help you.
Regards
Nicole -
Field descriptions not showing in page layout
I have custom content types with custom fields. The field types vary - text, image, user and so forth. I am building an intranet so this is a publishing site with workflow and I am using custom page layouts with a custom master page.
The issue I have is that the field controls, whilst all having descriptions, rarely show the description in the custom page layout. They are all shown correctly in EditForm.aspx so I know that they are there. However when editing a page using a custom page
layout it seems that only UserField types show the description. Below is an extract from a page layout:
<SharePointWebControls:UserField FieldName="ContentOwner" runat="server"></SharePointWebControls:UserField>
<SharePointWebControls:TextField FieldName="ContentOwnerRemark" runat="server"></SharePointWebControls:TextField>
The first field ContentOwner shows the field description. The second does not. I have tried deleting and re-adding, making fields mandatory and optional, but to no avail. If it's not a UserField it doesn't show the description.Showing names of Site Columns on a Page Layout
Thanks. That allows me to do this:
<SharePointWebControls:FieldProperty FieldName="ContentOwnerRemark" PropertyName="Description" runat="server" />
However the original question is why is it that the OOTB control only displays the description for UserField and not for other types of field in a custom page layout, whereas it shows all descriptions in EditForm.aspx. I could do what you have suggested but
it's a lot of work as I have many fields and custom page layouts, and it seems to me that having the OOTB field control on the page should display the description for all field types not just user field types. -
Field symbol with top of page in reuse_alv_list
When using the top_of_page in REUSE_ALV_LIST_DISPLAY
I had in the old programm reference to values in the outtab for the header in the new programm I use dynamic tables and I wonder how to add those values in a header.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = h_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
* i_structure_name = 'ZDOORBEL_ALV'
* IT_EVENTS = TEVENTS
is_layout = slayout
it_fieldcat = it_fieldcat[]
it_sort = tsort[]
i_save = a_save
is_variant = variant
TABLES
t_outtab = <ta_output>
in my top_of_page I try to read the current row of <ta_output> but I have no clue on how to do it. I gives the error that there is no workarea assigned to <ta_output>
anybody knows how to read the current line of <ta_output> in top_of_page ?
kind regards
arthur de smidtI have
* fieldsymbols voor dynamische ALV tabel
FIELD-SYMBOLS: <ta_output> TYPE table ,
<ta_color> TYPE table,
<l_line> TYPE ANY,
<wa_output> type any,
<wa> TYPE ANY,
<l_field> TYPE ANY,
<fs> TYPE ty_pernrs.
FORM top_of_page.
CREATE DATA new_line LIKE LINE OF <ta_output>.
ASSIGN new_line->* TO <wa_output>.
read table <ta_output> assigning <wa_output> index sy-tabix.
if ra_pernr = 'X'.
if <wa_output>-week = space or <wa_output>-pernr = '00000000'.
but still it says that the
The data object "<WA_OUTPUT>" has no structure and therefore no
component called "WEEK" . .
Edited by: A. de Smidt on Jun 26, 2008 11:07 AM -
How to use Top of page system fields like sy-tvar0 to sy-tvar1
thanks in advance
RishiHello ,
in the standard title you can have &0 ... &n. The program must put the values to fields SY-TVAR0 to SY-TVARN.
see this sample:
Pass the variables for the list heading
MOVE SY-Title TO SY-TVAR0.
MOVE SY-Datum TO SY-TVAR1.
MOVE SY-Pagno TO SY-TVAR2.
From output screen: System>List>List Header
Click on first white line and enter the following title to the yellow box: Title: &0 Date: &1 . Page No: &2......
Hope its what you mean.
Vasanth -
How to update session state from form field values without submitting page?
Hi,
I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
(the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
Any help will be greatly appreciated. Thanks in advance.Create a dynamic action on change and run a PL/SQL process there with the following code:
BEGIN
NULL;
END;Page items to submit > your item.
This will set the session state without submitting the form.
Further examples here:
http://apex.oracle.com/pls/apex/f?p=31517:229
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
To hide some headings in top of page during sorting of fields...
dear experts,
I have a report in which i am fetching multiple company codes in report and in o/p they are displayed according to company codes, but during sorting of any field in list i want to hide some of the headings in top of page...for any of the radio buttons the headings which i want to hide are...
1) company code
2) opening balance and
3) closing balance
please help...my code is as follows...
TYPE-POOLS:slis.
TABLES:bkpf,bseg,kna1,bsid.
TYPES:BEGIN OF ty_bsad,
bukrs TYPE bsad-bukrs,
gjahr TYPE bsad-gjahr,
kunnr TYPE bsad-kunnr,
belnr TYPE bsad-belnr,
budat TYPE bsad-budat,
xblnr TYPE bsad-xblnr,
bldat TYPE bsad-bldat,
augdt TYPE bsad-augdt,
dmbtr type bsad-dmbtr,
END OF ty_bsad.
TYPES:BEGIN OF ty_kna1,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
city TYPE kna1-ort01,
END OF ty_kna1.
TYPES:BEGIN OF ty_knb1,
kunnr TYPE knb1-kunnr,
bukrs TYPE knb1-bukrs,
vzskz TYPE knb1-vzskz,
END OF ty_knb1.
TYPES:BEGIN OF ty_bkpf,
bukrs TYPE bkpf-bukrs,
gjahr TYPE bkpf-gjahr,
hwaer TYPE bkpf-hwaer,
kursf TYPE bkpf-kursf,
bktxt TYPE bkpf-bktxt,
belnr TYPE bkpf-belnr,
budat TYPE bkpf-budat,
xblnr TYPE bkpf-xblnr,
bldat TYPE bkpf-bldat,
waers TYPE bkpf-waers,
END OF ty_bkpf.
TYPES:BEGIN OF ty_bsid,
bukrs TYPE bsid-bukrs,
gjahr TYPE bsid-gjahr,
kunnr TYPE bsid-kunnr,
belnr TYPE bsid-belnr,
budat TYPE bsid-budat,
xblnr TYPE bsid-xblnr,
bldat TYPE bsid-bldat,
augdt TYPE bsid-augdt,
dmbtr type bsid-dmbtr,
END OF ty_bsid.
TYPES:BEGIN OF ty_bseg,
bukrs TYPE bseg-bukrs,
gjahr TYPE bseg-gjahr,
belnr TYPE bseg-belnr,
kunnr TYPE bseg-kunnr,
werks TYPE bseg-werks,
umskz TYPE bseg-umskz,
zuonr TYPE bseg-zuonr,
dmbtr TYPE bseg-dmbtr,
zbd1t TYPE bseg-zbd1t,
sgtxt TYPE bseg-sgtxt,
shkzg TYPE bseg-shkzg,
zterm TYPE bseg-zterm,
zfbdt TYPE bseg-zfbdt,
END OF ty_bseg.
TYPES:BEGIN OF ty_open,
bukrs TYPE bsid-bukrs,
shkzg TYPE bsid-shkzg,
dmbtr TYPE bsid-dmbtr,
umskz TYPE bsid-umskz,
END OF ty_open.
**Main internal Table
**For both open & cleared Customer
DATA:BEGIN OF it_main_all OCCURS 0,
bukrs TYPE bsad-bukrs,
gjahr TYPE bsad-gjahr,
kunnr TYPE bsad-kunnr,
belnr TYPE bsad-belnr,
budat TYPE bsad-budat,
xblnr TYPE bsad-xblnr,
bldat TYPE bsad-bldat,
augdt TYPE bsad-augdt,
dmbtr type bsad-dmbtr,
hwaer TYPE bkpf-hwaer,
kursf TYPE bkpf-kursf,
bktxt TYPE bkpf-bktxt,
name TYPE kna1-name1,
city TYPE kna1-ort01,
vzskz TYPE knb1-vzskz,
lights TYPE c,
END OF it_main_all.
**For Opening balance
DATA:BEGIN OF it_main_open1 OCCURS 0,
bukrs TYPE bsid-bukrs,
opening TYPE p DECIMALS 2,
END OF it_main_open1.
**Internal tables
DATA : t_bsad TYPE STANDARD TABLE OF ty_bsad,
w_bsad TYPE ty_bsad,
t_bkpf TYPE STANDARD TABLE OF ty_bkpf,
w_bkpf TYPE ty_bkpf,
t_kna1 TYPE STANDARD TABLE OF ty_kna1,
w_kna1 TYPE ty_kna1,
t_knb1 TYPE STANDARD TABLE OF ty_knb1,
w_knb1 TYPE ty_knb1,
t_bsid TYPE STANDARD TABLE OF ty_bsid,
w_bsid TYPE ty_bsid,
t_bseg TYPE STANDARD TABLE OF ty_bseg,
w_bseg TYPE ty_bseg,
t_open TYPE STANDARD TABLE OF ty_open,
w_open TYPE ty_open.
**ALV display variables
DATA:fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event,
gt_list_top_of_page TYPE slis_t_listheader,
heading TYPE slis_t_listheader,
g_save(1) TYPE c,
g_exit(1) TYPE c,
g_variant TYPE disvariant,
gx_variant TYPE disvariant,
it_sort TYPE slis_t_sortinfo_alv,
x_sort TYPE slis_sortinfo_alv.
**Selection Screens
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:s_bukrs FOR bkpf-bukrs OBLIGATORY,
s_gjahr FOR bkpf-gjahr OBLIGATORY NO-EXTENSION NO INTERVALS,
s_kunnr FOR bseg-kunnr OBLIGATORY NO-EXTENSION NO INTERVALS,
s_name1 FOR kna1-name1 NO-EXTENSION NO INTERVALS,
s_date FOR bkpf-budat OBLIGATORY,
s_umskz FOR bsid-umskz.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS:xnorm AS CHECKBOX DEFAULT 'X',
xshbv AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b3.
DATA:golive TYPE d VALUE '20080401',
date TYPE d,
date1 TYPE d,
closing TYPE p DECIMALS 2 VALUE 0,
opening TYPE p DECIMALS 2 VALUE 0.
**Start Of Selection
START-OF-SELECTION.
PERFORM get_data.
PERFORM events.
PERFORM f_layout.
PERFORM display.
FORM get_data .
**Open Customers master data
SELECT
bukrs gjahr kunnr belnr budat xblnr bldat augdt dmbtr
FROM bsid
INTO TABLE t_bsid
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjahr
AND kunnr IN s_kunnr
AND budat IN s_date
AND umskz IN s_umskz.
**Clear Customers master data
SELECT
bukrs gjahr kunnr belnr budat xblnr bldat augdt dmbtr
FROM bsad
INTO TABLE t_bsad
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjahr
AND kunnr IN s_kunnr
AND budat IN s_date
AND umskz IN s_umskz.
****Open Customers data
IF NOT t_bsid[] IS INITIAL.
SORT t_bsid BY bukrs bldat.
SELECT
bukrs gjahr hwaer kursf bktxt belnr
FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE t_bkpf
FOR ALL ENTRIES IN t_bsid
WHERE bukrs = t_bsid-bukrs
AND gjahr = t_bsid-gjahr
AND belnr = t_bsid-belnr.
SORT t_bkpf.
SELECT
kunnr name1 ort01
FROM kna1
INTO TABLE t_kna1
FOR ALL ENTRIES IN t_bsid
WHERE kunnr = t_bsid-kunnr
AND name1 IN s_name1.
SORT t_kna1.
SELECT
kunnr bukrs vzskz
FROM knb1
INTO TABLE t_knb1
FOR ALL ENTRIES IN t_bsid
WHERE kunnr = t_bsid-kunnr
AND bukrs = t_bsid-bukrs.
SORT t_knb1.
LOOP AT t_bsid INTO w_bsid.
it_main_all-bukrs = w_bsid-bukrs.
it_main_all-kunnr = w_bsid-kunnr.
it_main_all-gjahr = w_bsid-gjahr.
it_main_all-belnr = w_bsid-belnr.
it_main_all-budat = w_bsid-budat.
it_main_all-xblnr = w_bsid-xblnr.
it_main_all-bldat = w_bsid-bldat.
READ TABLE t_bkpf INTO w_bkpf WITH KEY bukrs = w_bsid-bukrs gjahr = w_bsid-gjahr belnr = w_bsid-belnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-hwaer = w_bkpf-hwaer.
it_main_all-kursf = w_bkpf-kursf.
it_main_all-bktxt = w_bkpf-bktxt.
ENDIF.
READ TABLE t_kna1 INTO w_kna1 WITH KEY kunnr = w_bsid-kunnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-name = w_kna1-name1.
it_main_all-city = w_kna1-city.
ENDIF.
READ TABLE t_knb1 INTO w_knb1 WITH KEY kunnr = w_bsid-kunnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-vzskz = w_knb1-vzskz.
ENDIF.
it_main_all-lights = '1'.
APPEND it_main_all.
CLEAR it_main_all.
CLEAR : w_bsid, w_bkpf, w_kna1, w_knb1.
ENDLOOP .
ENDIF.
**Clear customers data
IF NOT t_bsad[] IS INITIAL.
SORT t_bsad BY bukrs bldat.
SELECT
bukrs gjahr hwaer kursf bktxt belnr
FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE t_bkpf
FOR ALL ENTRIES IN t_bsad
WHERE bukrs = t_bsad-bukrs
AND gjahr = t_bsad-gjahr
AND belnr = t_bsad-belnr.
SORT t_bkpf.
SELECT
kunnr name1 ort01
FROM kna1
INTO TABLE t_kna1
FOR ALL ENTRIES IN t_bsad
WHERE kunnr = t_bsad-kunnr
AND name1 IN s_name1.
SORT t_kna1.
SELECT
kunnr bukrs vzskz
FROM knb1
INTO TABLE t_knb1
FOR ALL ENTRIES IN t_bsad
WHERE kunnr = t_bsad-kunnr
AND bukrs = t_bsad-bukrs.
SORT t_knb1.
LOOP AT t_bsad INTO w_bsad.
it_main_all-bukrs = w_bsad-bukrs.
it_main_all-gjahr = w_bsad-gjahr.
it_main_all-kunnr = w_bsad-kunnr.
it_main_all-belnr = w_bsad-belnr.
it_main_all-budat = w_bsad-budat.
it_main_all-xblnr = w_bsad-xblnr.
it_main_all-bldat = w_bsad-bldat.
READ TABLE t_bkpf INTO w_bkpf WITH KEY bukrs = w_bsad-bukrs gjahr = w_bsad-gjahr belnr = w_bsad-belnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-hwaer = w_bkpf-hwaer.
it_main_all-kursf = w_bkpf-kursf.
it_main_all-bktxt = w_bkpf-bktxt.
ENDIF.
READ TABLE t_kna1 INTO w_kna1 WITH KEY kunnr = w_bsad-kunnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-name = w_kna1-name1.
it_main_all-city = w_kna1-city.
ENDIF.
READ TABLE t_knb1 INTO w_knb1 WITH KEY kunnr = w_bsad-kunnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_main_all-vzskz = w_knb1-vzskz.
ENDIF.
it_main_all-lights = '3'.
APPEND it_main_all.
CLEAR : w_bsad, w_bkpf, w_kna1, w_knb1.
ENDLOOP .
ENDIF.
ENDFORM. " get_data
*& Form events
FORM events .
DATA : l_i_event TYPE slis_alv_event.
l_i_event-name = 'TOP_OF_PAGE' .
l_i_event-form = 'TOP2' .
APPEND l_i_event TO gt_events .
CLEAR l_i_event .
ENDFORM. " events
*& Form f_layout
FORM f_layout .
CLEAR gd_layout.
gd_layout-detail_popup = 'X'.
gd_layout-zebra = 'X'.
gd_layout-no_vline = ' '.
gd_layout-lights_fieldname = 'LIGHTS'.
gd_layout-colwidth_optimize = 'X'.
ENDFORM. " f_layout
*& Form display
FORM display .
fieldcatalog-fieldname = 'BUKRS'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Company Code'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'GJAHR'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Fiscal year'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Doc No.'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BLDAT'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Doc Date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BUDAT'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Posting date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'DMBTR'.
fieldcatalog-tabname = 'IT_MAIN_ALL'.
fieldcatalog-seltext_m = 'Amt in local cur.'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-just = 'R'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
**For Subtotal of fields
x_sort-fieldname = 'BUKRS' .
x_sort-group = '*'.
x_sort-subtot = 'X'.
APPEND x_sort TO it_sort.
CLEAR x_sort .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = it_sort
i_default = 'X'
it_events = gt_events[]
TABLES
t_outtab = it_main_all
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.
*& Form top_of_page
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'RUCHI_LOGO'
it_list_commentary = heading[].
ENDFORM.
*& Form opening
FORM opening USING p_bukrs TYPE bsid-bukrs.
DATA : opdate TYPE d.
IF s_date-low < golive.
opening = 0.
ELSE.
opdate = s_date-low - 1.
SELECT
bukrs shkzg dmbtr umskz
FROM bsid
INTO TABLE t_open
WHERE bukrs IN s_bukrs
AND kunnr IN s_kunnr
AND gjahr IN s_gjahr
AND budat <= opdate.
LOOP AT t_open INTO w_open.
IF w_open-shkzg = 'S'.
opening = opening + w_open-dmbtr.
ELSEIF w_open-shkzg = 'H'.
w_open-dmbtr = w_open-dmbtr * ( -1 ).
opening = opening + w_open-dmbtr .
ENDIF.
CLEAR : w_open.
ENDLOOP.
SELECT
bukrs shkzg dmbtr umskz
FROM bsad
INTO TABLE t_open
WHERE bukrs IN s_bukrs
AND kunnr IN s_kunnr
AND gjahr IN s_gjahr
AND budat <= opdate.
LOOP AT t_open INTO w_open.
IF w_open-shkzg = 'S'.
opening = opening + w_open-dmbtr.
ELSEIF w_open-shkzg = 'H'.
w_open-dmbtr = w_open-dmbtr * ( -1 ).
opening = opening + w_open-dmbtr.
ENDIF.
CLEAR w_open.
ENDLOOP.
ENDIF.
ENDFORM.
*& Form top2
FORM top2 .
date = s_date-low.
date1 = s_date-high.
WRITE : / 'CUSTOMER LEDGER FOR ALL ITEMS' COLOR 7.
WRITE : / 'Customer Code:', it_main_all-kunnr.
WRITE : / 'Customer Name:', it_main_all-name.
WRITE : / 'Customer City:', it_main_all-city.
ON CHANGE OF it_main_all-bukrs.
WRITE : / 'Company Code:' COLOR 3 , it_main_all-bukrs COLOR 3.
PERFORM opening USING it_main_all-bukrs.
PERFORM closing USING it_main_all-bukrs.
WRITE : / 'Opening Balance : Rs.' , opening .
WRITE : / 'Closing Balance : Rs.' , closing .
ENDON.
CLEAR : closing, opening.
IF date1 IS INITIAL.
WRITE : / 'Date:', date DD/MM/YYYY.
ELSE.
WRITE : / 'Date:' , date DD/MM/YYYY, ' to ', date1 DD/MM/YYYY.
ENDIF.
ENDFORM.
*&Form closing
FORM closing USING c_bukrs TYPE bsid-bukrs.
LOOP AT it_main_all WHERE bukrs = c_bukrs.
closing = closing + it_main_all-dmbtr.
ENDLOOP .
closing = closing + opening .
ENDFORM.
Edited by: Vishu on Apr 20, 2009 9:32 AMit can be done with the help of a system code 'sy-xcode'. it is initialised the time list is sorted so just keeping a check point, we can solve this problem.
Vishu Khandelwal -
Triggering a Top-of- Page without a WRITE statement
TOP-OF-PAGE event is fired only when it encounters the first Write statement in the report.
Q)Is there any way to trigger this event,without having a write statement in the program??
A)The answer is yes.If you write a SKIP statement in the SELECTION-SCREEN,then your TOP-OF-PAGE event would fire.hi Phani,
Top-of-page gets triggered if we write something on output screen.
Though we write SKIP in selection-screen, 2 lines gets skipped after printing the statement "top of page triggered" in the example below. After 2 lines "start of selection triggered" gets printed.
report ztest no standard page heading.
selection-screen begin of block b1 with frame title text-001.
parameters : p_para type c.
skip 2.
selection-screen end of block b1.
start-of-selection.
write :/ 'in start of selection'.
top-of page.
write :/ 'top of page triggered'. -
how to remove a black border box that continously tabs to each field automatically till end of web page; restarts to top of page, cannot stop this box. Scroll bar cannot be controlled with mouse, scroll bar returns automatically to the top of scroll slide every time I move the bar to the bottom of the scale. Also, there's a rectangular text box (with black background and white text) that is always on the desktop that emulates a typed text, HTML, or cmd function.
cjuan1morb4ulv wrote:
how to remove a black border box that continously tabs to each field automatically till end of web page; restarts to top of page, cannot stop this box. Scroll bar cannot be controlled with mouse, scroll bar returns automatically to the top of scroll slide every time I move the bar to the bottom of the scale. Also, there's a rectangular text box (with black background and white text) that is always on the desktop that emulates a typed text, HTML, or cmd function.
The first two problems (box cycling from element to element on page, scroll bar returning to top) can be caused by a stuck (or defective) Tab key on the keyboard. Such damage can be caused by a liquid spill; just one tiny droplet is enough to short a wafer switch under one key.
The last issue (black box, white text - sounds sorta like a debugger window) I haven't seen, but could be caused by something similar.
To check for that, try using a different keyboard. If you're using a wireless keyboard, turn it off and see if the oddities stop. -
To display the typ, key field,info in the top-of -page event in OO ALV
Hi all,
I need to display the heading and the other select option details in the top-of-page event in ooalv.How can the key ,typ and the info of top of event in alv grid be passed in ooalv grid display.
Regards,
ArpitaCheck the blog.
TOP_OF_PAGE in ALV Using CL_GUI_ALV_GRID
Now you have to use the method ADD_TEXT to populate the Select options details.
I hope you know the Function to get the selection details
RS_REFRESH_FROM_SELECTOPTIONS,. it will give into a table. so use that table and populate the TOP_OF_PAGE uisng the class CL_DD_DOCUMENT. -
Portlet to return 'description' field of all the child pages
How do I create a dynamic portlet that return the description of all the pages that a user has access to?
This is all the subpages that the user has access to given a page.
-
How to display values in top of page in ALV report
Hai,
This is my billing report program, i developed that object by using ALV but i could not able to use Top-of-page. please any one correct my code,
*& Report ZE0232_ALV_BILLING *
report ze0232_alv_billing.
type-pools: slis.
data: repid like sy-repid.
data: fieldcatalog type slis_t_fieldcat_alv,
wa_fieldcatalog type slis_fieldcat_alv.
data : ievent type slis_t_event,
wevent type slis_alv_event.
data: sal_text like tvkot-vtext,
DIS_TEXT LIKE TVTWT-VTEXT,
DIV_TEXT LIKE TSPAT-VTEXT.
tables: vbrk.
data: begin of i_vbrk occurs 0,
vbeln like vbrk-vbeln,
fkdat like vbrk-fkdat,
erdat like vbrk-erdat,
kunrg like vbrk-kunrg,
name1 like kna1-name1,
netwr like vbrk-netwr,
stext like tvkot-vtext,
dtext like tvtwt-vtext,
divtext like tspat-vtext,
end of i_vbrk.
selection-screen begin of block billing with frame.
parameters: salesorg like vbrk-vkorg.
select-options: dischanl for vbrk-vtweg,
division for vbrk-spart,
bildat for vbrk-fkdat.
selection-screen end of block billing.
select vbeln fkdat erdat kunrg netwr from vbrk into corresponding fields of table i_vbrk where vkorg = salesorg
and vtweg in dischanl
and spart in division
and fkdat in bildat.
select vtext from tvkot into sal_text where vkorg = salesorg and spras = 'EN'.
endselect.
select vtext from TVTWT into DIS_text where VTWEG IN dischanl and spras = 'EN'.
endselect.
select vtext from TSPAT into DIV_text where SPART IN DIVISION and spras = 'EN'.
endselect.
loop at i_vbrk.
move: sal_text to i_vbrk-stext,
DIS_TEXT TO I_VBRK-DTEXT,
DIV_TEXT TO I_VBRK-DIVTEXT.
modify i_vbrk.
endloop.
perform get_fieldcatalog.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
I_GRID_TITLE =
i_callback_top_of_page = 'TOPS'
it_fieldcat = fieldcatalog
tables
t_outtab = i_vbrk
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*& Form GET_FIELDCATALOG
text
<b>form tops.
write :/ 'Hai Welcome'.
endform. "tops</b>&----
*& Form get_fieldcatalog
text
form get_fieldcatalog.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-fieldname = 'VBELN'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'SALES DOCUMENT'.
WA_fieldcatalog-rollname = 'VBELN'.
wa_fieldcatalog-hotspot = 'X'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-fieldname = 'FKDAT'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'BILL DATE'.
WA_fieldcatalog-rollname = 'VBELN'.
WA_fieldcatalog-hotspot = 'X'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '3'.
wa_fieldcatalog-fieldname = 'ERDAT'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'CREATED DATE'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '4'.
wa_fieldcatalog-fieldname = 'KUNRG'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'CUSTOMER NO'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '5'.
wa_fieldcatalog-fieldname = 'NAME1'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'CUSTOMER NAME'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '6'.
wa_fieldcatalog-fieldname = 'NETWR'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'NET VALUE'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '7'.
wa_fieldcatalog-fieldname = 'STEXT'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'SALES ORG'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '8'.
wa_fieldcatalog-fieldname = 'DTEXT'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'DIS.CHANNEL'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
wa_fieldcatalog-col_pos = '9'.
wa_fieldcatalog-fieldname = 'DIVTEXT'.
wa_fieldcatalog-tabname = 'I_VBAK'.
wa_fieldcatalog-seltext_m = 'DIVISION'.
append wa_fieldcatalog to fieldcatalog.
clear wa_fieldcatalog.
endform. "GET_FIELDCATALOGHI see this report
you can know how to write TOP-OF_PAGE code
and insert LOGO also
*& Report ZTEST_ALV_LOGO
REPORT ztest_alv_logo.
TYPE-POOLS : slis.
*ALV Formatting tables /structures
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: gt_events TYPE slis_t_event.
DATA: gs_layout TYPE slis_layout_alv.
DATA: gt_page TYPE slis_t_listheader.
DATA: gs_page TYPE slis_listheader.
DATA: v_repid LIKE sy-repid.
*ALV Formatting work area
DATA: w_fieldcat TYPE slis_fieldcat_alv.
DATA: w_events TYPE slis_alv_event.
DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
INITIALIZATION.
PERFORM build_events.
PERFORM build_page_header.
START-OF-SELECTION.
*perform build_comment. "top_of_page - in initialization at present
SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading
*OR
PERFORM build_fieldcat.
gs_layout-zebra = 'X'.
*top of page event does not work without I_callback_program
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_structure_name = 'BSID'
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'This is the grid title'
I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
TABLES
t_outtab = gt_bsid.
Form..............: populate_for_fm
Description.......: Populates fields for function module used in ALV
FORM populate_for_fm USING p_row
p_col
p_fieldname
p_len
p_table
p_desc.
w_fieldcat-row_pos = p_row. "Row Position
w_fieldcat-col_pos = p_col. "Column Position
w_fieldcat-fieldname = p_fieldname. "Field name
w_fieldcat-outputlen = p_len. "Column Lenth
w_fieldcat-tabname = p_table. "Table name
w_fieldcat-reptext_ddic = p_desc. "Field Description
w_fieldcat-input = '1'.
APPEND w_fieldcat TO gt_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " populate_for_fm
*& Form build_events
FORM build_events.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events.
READ TABLE gt_events
WITH KEY name = slis_ev_user_command
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_user_command TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
READ TABLE gt_events
WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_top_of_page TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
ENDFORM. " build_events
*& Form USER_COMMAND
When user command is called it uses 2 parameters. The itab
passed to the ALV is in whatever order it currently is on screen.
Therefore, you can read table itab index rs_selfield-tabindex to get
all data from the table. You can also check r_ucomm and code
accordingly.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
READ TABLE gt_bsid INDEX rs_selfield-tabindex.
error checking etc.
SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDFORM. "user_command
*& Form top_of_page
Your own company logo can go here if it has been saved (OAOR)
If the logo is larger than the size of the headings in gt_page,
the window will not show full logo and will have a scroll bar. Thus,
it is a good idea to have a standard ALV header if you are going to
use logos in your top of page.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_page
i_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page
*& Form build_fieldcat
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
FORM build_fieldcat.
w_fieldcat-fieldname = 'BUDAT'.
w_fieldcat-seltext_m = 'Dte pst'.
w_fieldcat-ddictxt(1) = 'M'.
w_fieldcat-edit = 'x'.
Can change the position of fields if you do not want them in order
of the DDIC or itab
w_fieldcat-row_pos = '1'.
w_fieldcat-col_pos = '10'.
APPEND w_fieldcat TO gt_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " build_fieldcat
*& Form build_page_header
gt_page is used in top of page (ALV subroutine - NOT event)
*H = Header, S = Selection, A = Action
FORM build_page_header.
For Headers, Key is not printed and is irrelevant. Will not cause
a syntax error, but is not used.
gs_page-typ = 'H'.
gs_page-info = 'Header 1'.
APPEND gs_page TO gt_page.
gs_page-typ = 'H'.
gs_page-info = 'Header 2'.
APPEND gs_page TO gt_page.
For Selections, the Key is printed (bold). It can be anything up to 20
bytes. It gets printed in order of code here, not by key value.
gs_page-typ = 'S'.
gs_page-key = 'And the winner is:'.
gs_page-info = 'Selection 1'.
APPEND gs_page TO gt_page.
gs_page-typ = 'S'.
gs_page-key = 'Runner up:'.
gs_page-info = 'Selection 2'.
APPEND gs_page TO gt_page.
For Action, Key is also irrelevant.
gs_page-typ = 'A'.
gs_page-info = 'Action goes here'.
APPEND gs_page TO gt_page.
ENDFORM. " build_page_header
<b>Reward if useful</b> -
Hi All,
In my Report i am printing both interactive and alv grid display in same report.means i have one check box it is then report print as a alv format otherwise classical format.
But here i have small problem i am trying print in alv format its automatically trigger the top of page event thatsway a blank screen is generated so please tell how to skip the Top of page event.
Regards,
VenkateshEND-OF-SELECTION.
SORT tab1 BY ebeln ebelp.
DESCRIBE TABLE tab1 LINES tabln.
IF tabln = 0.
MESSAGE ID 'ME' TYPE 'I' NUMBER '260'.
EXIT.
ENDIF.
SORT tab1 BY sortkey knttp ebeln ebelp.
if P_ALV = 'X'.
LOOP AT tab1.
IF tab1-knttp = '1'.
gs_final-str = text-k01.
gs_final-kont1 = tab1-kont1.
gs_final-kont2 = tab1-kont2.
ELSEIF tab1-knttp = '2'.
gs_final-str = text-k02.
gs_final-kont1 = tab1-kont1.
gs_final-kont2 = tab1-kont2.
ELSEIF tab1-knttp = '3'.
gs_final-str = text-k03.
gs_final-kont1 = tab1-kont1.
gs_final-kont2 = tab1-kont2.
ELSEIF tab1-knttp = '4'.
gs_final-str = text-k04.
gs_final-kont1 = tab1-kont1.
gs_final-kont2 = tab1-kont2.
ELSEIF tab1-knttp = '5'.
gs_final-str = text-k05.
gs_final-kont1 = tab1-kont1.
gs_final-kont2 = tab1-kont2.
ELSEIF tab1-knttp = '6'.
gs_final-str = text-k04.
gs_final-kont1 = tab1-kont1.
ELSEIF tab1-knttp IS INITIAL.
gs_final-str = 'Stock without Account Assignment'.
ENDIF.
gs_final-ebeln = tab1-ebeln.
gs_final-lifnr = tab1-lifnr.
gs_final-name1 = tab1-name1.
gs_final-aedat = tab1-aedat.
gs_final-udate = tab1-udate.
gs_final-inco1 = tab1-inco1.
gs_final-inco2 = tab1-inco2.
gs_final-ebelp = tab1-ebelp.
gs_final-matnr = tab1-matnr.
gs_final-txz01 = tab1-txz01.
gs_final-paedt = tab1-paedt.
gs_final-eindt = tab1-eindt.
gs_final-eindt1 = tab1-eindt1.
gs_final-labnr = tab1-labnr. "NWC-29042005
gs_final-budat = tab1-budat.
gs_final-menge = tab1-menge.
gs_final-wemng = tab1-wemng.
gs_final-meins = tab1-meins.
gs_final-vbeln = tab1-vbeln.
gs_final-tddat = tab1-tddat.
IF NOT tab1-vbeln IS INITIAL.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/3 wa_tab1-vbeln.
READ TABLE lines INDEX 1.
MOVE lines-tdline TO l_text.
CLEAR lines.
READ TABLE lines INDEX 2.
CONCATENATE l_text lines-tdline INTO l_text SEPARATED BY ' '.
FORMAT COLOR 5 INTENSIFIED OFF.
gs_final-l_text = l_text.
SKIP. "NWC-16092003
ENDAT.
APPEND gs_final to gt_final.
ENDLOOP.
PERFORM maintain_fieldcatlog.
PERFORM Display_data.
ELSE.
LOOP AT tab1.
MOVE tab1 TO wa_tab1.
AT NEW kont1.
RESERVE 5 LINES.
FORMAT COLOR 3 INTENSIFIED.
IF tab1-knttp = '1'.
WRITE:/(20) text-k01, 20 ': ', 22(30) tab1-kont1 NO-ZERO,
60(74) tab1-kont2.
ELSEIF tab1-knttp = '2'.
WRITE:/(20) text-k02, 20 ': ', 22(30) tab1-kont1 NO-ZERO,
60(74) tab1-kont2.
ELSEIF tab1-knttp = '3'.
WRITE:/(20) text-k03, 20 ': ', 22(30) tab1-kont1 NO-ZERO,
60(74) tab1-kont2.
ELSEIF tab1-knttp = '4'.
WRITE:/(20) text-k04, 20 ': ', 22(30) tab1-kont1 NO-ZERO,
60(74) tab1-kont2.
ELSEIF tab1-knttp = '5'.
WRITE:/(20) text-k05, 20 ': ', 22(30) tab1-kont1 NO-ZERO,
60(74) tab1-kont2.
ELSEIF tab1-knttp = '6'.
WRITE:/(20) text-k04, 20 ': ', 22(30) wa_tab1-kont1 NO-ZERO,
60 text-k02, 75 ': ', 77(57) wa_tab1-kont2 NO-ZERO.
ELSEIF tab1-knttp IS INITIAL.
WRITE:/ 'Stock without Account Assignment'.
ENDIF.
WRITE 170 ' '.
FORMAT COLOR INTENSIFIED OFF.
ENDAT.
AT NEW ebeln.
RESERVE 4 LINES.
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE:/ wa_tab1-ebeln,
11 ' ',
13 wa_tab1-lifnr,
23 wa_tab1-name1,
60 wa_tab1-aedat NO-ZERO,
73 wa_tab1-udate NO-ZERO,
86 wa_tab1-inco1,
91(37) wa_tab1-inco2,
170 ' '.
ENDAT.
AT NEW ebelp.
RESERVE 3 LINES.
FORMAT COLOR 2 INTENSIFIED OFF.
WRITE:/2 wa_tab1-ebelp,
9 wa_tab1-matnr,
30(40) wa_tab1-txz01,
73(10) wa_tab1-paedt,
84(10) wa_tab1-eindt,
95(10) wa_tab1-eindt1 NO-ZERO,
106(15) wa_tab1-labnr, "NWC-29042005
122(10) wa_tab1-budat NO-ZERO,
133(16) wa_tab1-menge NO-ZERO,
150(16) wa_tab1-wemng NO-ZERO,
167(3) wa_tab1-meins,
170 ' '.
ENDAT.
HIDE: tab1-ebeln, tab1-ebelp.
I
READ TABLE lines INDEX 1.
MOVE lines-tdline TO l_text.
CLEAR lines.
READ TABLE lines INDEX 2.
CONCATENATE l_text lines-tdline INTO l_text SEPARATED BY ' '.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE: /3(132) l_text,
170 ' '.
SKIP. "NWC-16092003
ENDAT.
ENDLOOP.
ENDIF.
AT LINE-SELECTION.
CHECK NOT tab1-ebeln IS INITIAL.
SET PARAMETER ID 'BES' FIELD tab1-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
CLEAR tab1.
TOP-OF-PAGE.
if P_ALV ne 'X'.
IF sy-pagno = 1.
DETAIL.
WRITE: /2 text-a01.
RESERVE 1 LINES.
SUMMARY.
IF lifnr IS INITIAL.
WRITE: /4 text-a02, 26 'All'.
ELSE.
LOOP AT lifnr WHERE sign = 'I'.
IF lifnr-option = 'EQ'.
WRITE : /4 text-a02, 26 lifnr-low.
ELSE.
WRITE: /4 text-a02, 26 'From', 32 lifnr-low,
44 'to', 48 lifnr-high.
ENDIF.
ENDLOOP.
ENDIF.
IF matnr IS INITIAL.
WRITE: /4 text-a14, 26 'All'.
ELSE.
LOOP AT matnr WHERE sign = 'I'.
IF matnr-option = 'EQ'.
WRITE : /4 text-a14, 26 matnr-low.
ELSE.
WRITE: /4 text-a14, 26 'From', 32 matnr-low,
44 'to', 48 matnr-high.
ENDIF.
ENDLOOP.
ENDIF.
IF ebeln IS INITIAL.
WRITE: /4 text-a03, 26 'All'.
ELSE.
LOOP AT ebeln WHERE sign = 'I'.
IF ebeln-option = 'EQ'.
WRITE : /4 text-a03, 26 ebeln-low.
ELSE.
WRITE: /4 text-a03, 26 'From', 32 ebeln-low,
44 'to', 48 ebeln-high.
ENDIF.
ENDLOOP.
ENDIF.
IF aedat IS INITIAL.
WRITE: /4 text-a04, 26 'All'.
ELSE.
LOOP AT aedat WHERE sign = 'I'.
IF aedat-option = 'EQ'.
WRITE : /4 text-a04, 26 aedat-low.
ELSE.
WRITE: /4 text-a04, 26 'From', 32 aedat-low,
44 'to', 48 aedat-high.
ENDIF.
ENDLOOP.
ENDIF.
IF eindt IS INITIAL.
WRITE: /4 text-a13, 26 'All'.
ELSE.
LOOP AT eindt WHERE sign = 'I'.
IF eindt-option = 'EQ'.
WRITE : /4 text-a13, 26 eindt-low.
ELSE.
WRITE: /4 text-a13, 26 'From', 32 eindt-low,
44 'to', 48 eindt-high.
ENDIF.
ENDLOOP.
ENDIF.
IF bednr IS INITIAL.
WRITE: /4 text-a15, 26 'All'.
ELSE.
LOOP AT bednr WHERE sign = 'I'.
IF bednr-option = 'EQ'.
WRITE : /4 text-a15, 26 bednr-low.
ELSE.
WRITE: /4 text-a15, 26 'From', 32 bednr-low,
44 'to', 48 bednr-high.
ENDIF.
ENDLOOP.
ENDIF.
linno = sy-linno + 1.
BACK.
IF ekorg IS INITIAL.
WRITE: /70 text-a11, 92 'All'.
ELSE.
LOOP AT ekorg WHERE sign = 'I'.
IF ekorg-option = 'EQ'.
WRITE : /70 text-a11, 92 ekorg-low.
ELSE.
WRITE: /70 text-a11, 92 'From', 98 ekorg-low,
104 'to', 108 ekorg-high.
ENDIF.
ENDLOOP.
ENDIF.
IF ekgrp IS INITIAL.
WRITE: /70 text-a12, 92 'All'.
ELSE.
LOOP AT ekgrp WHERE sign = 'I'.
IF ekgrp-option = 'EQ'.
WRITE : /70 text-a12, 92 ekgrp-low.
ELSE.
WRITE: /70 text-a12, 92 'From', 98 ekgrp-low,
104 'to', 108 ekgrp-high.
ENDIF.
ENDLOOP.
ENDIF.
IF werks IS INITIAL.
WRITE: /70 text-a05, 92 'All'.
ELSE.
LOOP AT werks WHERE sign = 'I'.
IF werks-option = 'EQ'.
WRITE : /70 text-a05, 92 werks-low.
ELSE.
WRITE: /70 text-a05, 92 'From', 98 werks-low,
104 'to', 108 werks-high.
ENDIF.
ENDLOOP.
ENDIF.
IF pspid IS INITIAL.
WRITE: /70 text-a06, 92 'All'.
ELSE.
LOOP AT pspid WHERE sign = 'I'.
WRITE:/70 text-a06, 92 pspid-low.
ENDLOOP.
ENDIF.
IF pspnr1 IS INITIAL.
WRITE: /70 text-a07, 92 'All'.
ELSE.
LOOP AT pspnr1 WHERE sign = 'I'.
WRITE:/70 text-a07, 92 pspnr1-low.
ENDLOOP.
ENDIF.
IF elikz EQ 'X'.
WRITE: /70 text-a08, 92 'Open PO only'.
ELSEIF elikz IS INITIAL.
WRITE: /70 text-a08, 92 'All PO'.
ENDIF.
IF stock EQ 'X'.
WRITE: ', Common Stock Items'.
ELSEIF pspnr IS INITIAL.
WRITE: ', All Stock'.
ENDIF.
IF sy-linno >= linno.
linno = sy-linno + 1.
ENDIF.
SKIP TO LINE linno.
ULINE.
ENDIF.
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE:/ 'PO',
12 'Vendor no.',
25 'Company',
60 'PO Crt dt',
73 'Approved dt',
86 'Incoterm',
170 ' '.
FORMAT COLOR 2 INTENSIFIED OFF.
WRITE:/2 'Item',
9 'Material',
30 'Description',
73 'Chged date',
84 'Delv date',
95 'OA date',
106 'OA Number', "NWC-29042005
122 'GR date',
138 'Order Qty',
158 'GR Qty',
167 'UoM',
170 ' '.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/2 'Ship notf #',
15 'ETD.',
26 'ETA',
44 'Shipped Qty',
57 'UoM',
170 ' '.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE:/2 'Remarks',
170 ' '.
ULINE.
ENDIF.
form MAINTAIN_FIELDCATLOG .
REFRESH gt_fieldcat.
CLEAR gs_fieldcat.
PERFORM fill_fieldcatlog USING:
'01' '01' 'STR' 'GT_FINAL' 'Account Assignment',
'01' '02' 'KONT1' 'GT_FINAL' 'Kont1',
'01' '03' 'KONT2' 'GT_FINAL' 'Kont2',
'01' '04' 'EBELN' 'GT_FINAL' 'PO',
'01' '05' 'LIFNR' 'GT_FINAL' 'Vendor no',
'01' '06' 'NAME1' 'GT_FINAL' 'Company',
'01' '07' 'AEDAT' 'GT_FINAL' 'PO Crt dt',
'01' '08' 'UDATE' 'GT_FINAL' 'Approved dt' ,
'01' '09' 'INCO1' 'GT_FINAL' 'Incoterm Code',
'01' '10' 'INCO2' 'GT_FINAL' 'Incoterm Text',
'01' '11' 'EBELP' 'GT_FINAL' 'Item',
'01' '12' 'MATNR' 'GT_FINAL' 'Material',
'01' '13' 'TXZ01' 'GT_FINAL' 'Description',
'01' '14' 'PAEDT' 'GT_FINAL' 'Chged date',
'01' '15' 'EINDT' 'GT_FINAL' 'Delv date',
'01' '16' 'EINDT1' 'GT_FINAL' 'OA date',
'01' '17' 'LABNR' 'GT_FINAL' 'OA Number',
'01' '18' 'BUDAT' 'GT_FINAL' 'GR date',
'01' '19' 'MENGE' 'GT_FINAL' 'Order Qty',
'01' '20' 'WEMNG' 'GT_FINAL' 'GR Qty',
'01' '21' 'MEINS' 'GT_FINAL' 'UoM',
'01' '22' 'VBELN' 'GT_FINAL' 'Ship notf #',
'01' '23' 'TDDAT' 'GT_FINAL' 'ETD',
'01' '24' 'LFDAT' 'GT_FINAL' 'ETA',
'01' '25' 'LFIMG' 'GT_FINAL' 'Shipped Qty',
'01' '26' 'VRKME' 'GT_FINAL' 'UoM',
'01' '27' 'L_TEXT' 'GT_FINAL' 'Remarks'.
endform. " MAINTAIN_FIELDCATLOG
form FILL_FIELDCATLOG using lv_rowpos TYPE sycurow
lv_colpos TYPE sycucol
lv_fldnam TYPE fieldname
lv_tabnam TYPE tabname
lv_seltext TYPE dd03p-scrtext_l.
gs_fieldcat-row_pos = lv_rowpos.
gs_fieldcat-col_pos = lv_colpos.
gs_fieldcat-fieldname = lv_fldnam.
gs_fieldcat-tabname = lv_tabnam.
gs_fieldcat-seltext_l = lv_seltext.
APPEND gs_fieldcat TO gt_fieldcat.
CLEAR gs_fieldcat.
endform. " FILL_FIELDCATLOG
form DISPLAY_DATA .
DATA : lv_repid TYPE syrepid.
lv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0. "#EC NEEDED
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " DISPLAY_DATA
Maybe you are looking for
-
Why can't I use two 8500 wireless printers on one router? The 8500 A910 looses it's connection after awhile.
-
CONFERENCE CALLS DONT WORK ON OS 7 ALONG WITH RESPOND WITH TEXT WHILE ON A CALL
BEFORE UPDATING MY IPHONE 5 TO OS 7, I COULD MAKE OR ADD ON UNLIMITED CONFERENCE CALLS. IMMEDIATELY AFTER UPDATING NOW I CAN ONLY CALL ONE PARTY AND ADD ONE MORE ON TO THE CALL. SO BASIC THREE WAY CALL. ALSO I HAVE NOTICE AFTER UPGRADING THAT IF I W
-
Ideapad S405 windows 8 startup blue screen failure
When it is turned on, it shows Your PC needs to be repaired A required device isn't connected or can't accessed error code 0xc0000034 You'll need to use recovery tools on your installation media. If you don't have any installation media like aDISC or
-
How to create backup dvd of Mac osx
Hi, i wanna backup my original dvd of mac osx but when i try with toast i see the disc is more then 5 gb. There's another way to backup these dvd ? Thx in advance
-
How to replicati in oracle 10g
hi im e new oracle,im using oracle 10g enterprise edition i need to replicate a single table in a single database and after than in two different database. can any one help me and show me the steps please