Dynamic header in oo-alv
Hi
I have a requirement to display Dynamical header in ALV.
I am displaying the SUM of my list in ALV header . This I am able to do , as I can calculate before displaying ALV for the first time.
But when the user filters the list the SUM should change according to the new entries displayed after filtering .
How can i do this .
Line: -
All the helpful answers will be rewarded for sure.
Thanks.
Regards,
Sandeep.
fieldname type slis_fieldname,
tabname type slis_tabname,
seltext(40),
valuf(80),
valut(80),
valuf_int(80),
valut_int(80),
sign0(1),
sign_icon(4),
optio(2),
stype(1),
decimals like dfies-decimals,
intlen like dfies-intlen,
convexit like dfies-convexit,
edit_mask type slis_edit_mask,
lowercase like dfies-lowercase,
inttype like dfies-inttype,
datatype like dfies-datatype,
exception(1) type c,
no_sign(1) type c,
or(1) type c,
order type order,
cqvalue(5) type c,
ref_fieldname like dfies-fieldname,
ref_tabname like dfies-tabname,
ddic_outputlen like dfies-outputlen,
The following are the example code for filter settings.
lv_filter-fieldname = u2018FIELDNAMEu2019.
lv_filter-valuf_int = u2018VALUEu2019.
lv_filter-sign0 = u2018SIGNu2019.
lv_filter-optio = u2018OPTIONu2019.
APPEND lv_filter TO gt_filter_list.
Where gt_filter_list is of type slis_t_filter_alv.
This populated internal table is then passed as the import parameter u2018it_filteru2019 of the display ALV FM.
I hope this help u...!
Similar Messages
-
Dynamic header in oo alv print_top_of_page based on current line
I would expect this to be a common problem with the solution easily to google/find, but somehow...
dynamic header generation during alv print_top_of_page:
- i print an oo alv grid, sorted by kunnr
- for each new kunnr a new page
-> now I want during print-out to: at each top of page, read the first (or any) line of the current page, i.e. the current kunnr, and select data on basis of that kunnr to be written to the header.
My problem is that sy-tabix is not being filled correctly (always 1).
Strange thing is that in another report with a non-dynamic itab to display, sy-tabix is actuall being filled more or less correctly. (with the minor drawback that on the first page the tabix might not be 1 but more likely to be 2; but that's easy to fix and for the next pages sy-tabix is correct)
Kind regards, A
baanbrecherIn the handle_print_top_of_page method, use :
FIELD-SYMBOLS : <lv_line> TYPE ANY.
ASSIGN ('(SAPLKKBL)G_INDEX') TO <lv_line>.
if <lv_line> = 0. "First time, G_INDEX is equal to zero
<lv_line> = 1.
endif.
So in <lv_line> you will always have the good index of your table. -
hi Experts ,
My requirment is to display customer ledger and the address part of each customer to displayed in the TOP-OF_PAge part how to achive this please sugget me ...
Thanks in Advns.
Regards,
Prakashhi
DATA: gt_list_top_of_page TYPE slis_t_listheader.
FORM text-top-of-page1 .
DATA: ls_line TYPE slis_listheader.
DATA : text(60).
DATA:date25(10).
DATA:date75(10).
DATA:date105(25).
DATA:date125(45).
DATA:sl(5).
DATA:sh(5).
DATA:st(9).
DATA:se(25).
CLEAR ls_line .
ls_line-typ = 'H'.
ls_line-info = 'ULTRATECH CEYLINCO (PVT) LTD'.
APPEND ls_line TO gt_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = '81/11/1, New Nuge Road, Peliyagoda, Kelaniya.'.
APPEND ls_line TO gt_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'CIC Commision Report'.
APPEND ls_line TO gt_list_top_of_page.
* CLEAR ls_line.
* ls_line-typ = 'S'.
* ls_line-key = 'SALE ORDER DATE:'.
* ls_line-info = s_indate-low.
* DATA : date1 LIKE sy-datum.
* date1 = s_indate-low.
* CONCATENATE date1+6(2) '.'
* date1+4(2) '.'
* date1(4) INTO date25.
* CLEAR date1.
* date1 = s_indate-high.
* CONCATENATE date1+6(2) '.'
* date1+4(2) '.'
* date1(4) INTO date75.
* CONCATENATE date25 ' To ' INTO date105 SEPARATED BY space.
* CONCATENATE date105 date75 INTO date125 SEPARATED BY space.
* ls_line-info = date125.
* APPEND ls_line TO gt_list_top_of_page.
* CLEAR ls_line.
* ls_line-typ = 'S'.
* ls_line-key = 'ISO NO:'.
* ls_line-info = text-012.
* APPEND ls_line TO gt_list_top_of_page.
* CLEAR ls_line.
ENDFORM. " text-top-of-page
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page
i_logo = 'CEY1'.
*WRITE :/ 'Daily Despatch Summary Sheet Of Traders and Non-Traders.' .
ENDFORM . "top_of_page
you can use this code
Regard,
nawa -
LAYOUT FORMAT
Program Title
Client Name Run Date/Time :
Program : Program Name
User ID : Page : X of Y
Pernr:
Name:
IC Number:
RBAF / Reference Number:
Rank:
Service:
Unit:
Sub Unit:
No.| Position| Leave Taken| From|Leave Taken To| Type of Leave|
Leave Entitlement| No. Of Leave Taken| Present Balance of Leave|
Please help to program dynamic alv header for above format. I have used page break on Pernr but the header is not coming according to pernr. Though I managed
dynamic header when we press Print Preview. But that is not a solution.Hi,
I did something very similar to your requirement.
There is a predefined event for Reuse_alv_list_display called 'BEFORE_LINE_OUTPUT'. In the event table, you have to specify the <event>-name = 'BEFORE_LINE_OUTPUT' and the <event>-form = 'ALV_BEFORE_LINE_OUTPUT'.
Then you need a form like
FORM alv_before_line_output
USING ps_lineinfo TYPE kkblo_lineinfo. "#EC CALLED
FIELD-SYMBOLS:
<prot> TYPE typ_prot.
READ TABLE gt_prot INDEX ps_lineinfo-tabindex
ASSIGNING <prot>.
CHECK g_file_no <> <prot>-file_no.
g_file_no = <prot>-file_no.
NEW-PAGE.
ENDFORM. "alv_before_line_output
In my program the global table displayed in ALV was gt_prot (of line type typ_prot) and the requirement was to start a new page for each file processed. The form stores the file processed in
g_file_no. If a new file is processed, a NEW-PAGE will trigger the TOP_OF_PAGE event of the alv. I will not copy the form here because we also issued some statistical values, system and user informations and so on.
But I hope you get it done.
The only remaining issue may be that the before_line_output event will cost some time because it is triggered for every output line. But my report was still quite fast.
regards,
Clemens -
Reg: Dynamic Field catalog in ALV
Hi ,
Can any one guide me to build a dynamic field catalog in ALV report?
Below is the format which i expect..........
Material | Plant1 | Plant2 | Plant3 | ....................| Plant 20 |
Qty
Val
Qty
Val
Qty
Val
Qty
Val
The plant 1 to 20 has to be brought dynamically as headings from T001W table. (Horizontally populate)
Below each plant i need sub-headings "QTY" and "VAL". (Horizontally populate)
List of Materials should be brought vertically from MARA table. (Vertically populate)
Can anyone suggest how to bring out this format for populating data accordingly into the o/p format?
Ur help will be appreciated.
Thanks,
K.S.Kannanyour part of the code is present in routine
perform dynamic_table.
*& Report ZCS_NAC_MAT_CHARACTERISTICS
2/ Description ...: Business requirement is to get all materials
without any characteristic values maintained in SAP
which are given in the selection screen.
REPORT znac_material_char.
TYPE-POOLS : abap,
slis.
TABLES : kssk,
klah,
mara,
makt,
cabn,
t134,
t023.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv ,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : w_layout TYPE slis_layout_alv.
DATA : st_layout TYPE slis_layout_alv.
DATA : t_header TYPE slis_t_listheader,
w_header TYPE slis_listheader.
TYPES : BEGIN OF ty_cabn,
atinn TYPE cabn-atinn,
atnam TYPE cabn-atnam,
END OF ty_cabn.
DATA : i_cabn TYPE STANDARD TABLE OF ty_cabn WITH HEADER LINE.
DATA : w_cabn LIKE i_cabn.
TYPES : BEGIN OF ty_ausp,
objek TYPE ausp-objek,
atinn TYPE ausp-atinn,
klart TYPE ausp-klart,
END OF ty_ausp.
DATA : i_ausp TYPE STANDARD TABLE OF ty_ausp WITH HEADER LINE.
DATA : w_ausp LIKE i_ausp.
TYPES : BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
prdha TYPE mara-prdha,
mstae TYPE mara-mstae,
mstde TYPE mara-mstde,
END OF ty_mara.
DATA : i_mara TYPE STANDARD TABLE OF ty_mara WITH HEADER LINE.
DATA : w_mara LIKE i_mara.
DATA : i_mara_temp TYPE STANDARD TABLE OF ty_mara WITH HEADER LINE.
DATA : w_mara_temp LIKE i_mara_temp.
TYPES :BEGIN OF ty_data,
atnam TYPE cabn-atnam,
atinn TYPE cabn-atinn,
objek TYPE ausp-objek,
klart TYPE ausp-klart,
matnr TYPE mara-matnr,
maktx TYPE makt-maktx,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
prdha TYPE mara-prdha,
mstae TYPE mara-mstae,
mstde TYPE mara-mstde,
END OF ty_data.
DATA : i_data TYPE STANDARD TABLE OF ty_data WITH HEADER LINE.
DATA : w_data LIKE i_data.
DATA : i_class TYPE STANDARD TABLE OF sclass WITH HEADER LINE.
DATA : w_class LIKE i_class.
DATA : i_class_temp TYPE STANDARD TABLE OF sclass WITH HEADER LINE.
DATA : w_class_temp LIKE i_class_temp.
DATA : i_objdata TYPE STANDARD TABLE OF clobjdat WITH HEADER LINE.
DATA : w_objdata LIKE i_objdata.
TYPES : BEGIN OF ty_objdata_temp.
TYPES: matnr TYPE mara-matnr.
TYPES: maktx TYPE makt-maktx.
INCLUDE STRUCTURE clobjdat.
TYPES : prdha TYPE mara-prdha.
TYPES : mstde TYPE mara-mstde.
TYPES : END OF ty_objdata_temp.
DATA : i_objdata_temp TYPE STANDARD TABLE OF ty_objdata_temp WITH HEADER LINE.
DATA : w_objdata_temp LIKE i_objdata_temp.
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
<fs_dyntable>,
<fs_fldval> TYPE ANY.
DATA: t_newtable TYPE REF TO data,
t_newline TYPE REF TO data,
fs_fldcat TYPE slis_t_fieldcat_alv,
t_fldcat1 TYPE lvc_t_fcat,
wa_it_fldcat TYPE lvc_s_fcat,
wa_colno(2) TYPE n,
wa_flname(30) TYPE c.
DATA: fieldname(20) TYPE c.
DATA: fieldvalue(40) TYPE c.
DATA: index(3) TYPE c,
v_time(60) TYPE c.
DATA: wa_cat LIKE LINE OF fs_fldcat.
CONSTANTS : c_nac TYPE klah-class VALUE 'NAC',
c_klart TYPE ausp-klart VALUE '001',
c_check TYPE c VALUE 'X' .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (28) text-001 .
SELECT-OPTIONS: s_atnam FOR cabn-atnam NO INTERVALS OBLIGATORY. " Characteristic name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1 .
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_matnr FOR mara-matnr. " material Number
SELECT-OPTIONS: s_mtart FOR mara-mtart. " material type
SELECT-OPTIONS: s_matkl FOR mara-matkl. " material type
SELECT-OPTIONS: s_mstae FOR mara-mstae. " X-Plant material status
PARAMETERS : s_date LIKE sy-datum OBLIGATORY DEFAULT sy-datum . " date
SELECTION-SCREEN END OF BLOCK b2 .
AT SELECTION-SCREEN ON s_atnam.
SELECT SINGLE * FROM cabn WHERE atnam IN s_atnam.
IF sy-subrc 0.
MESSAGE text-003 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_matnr.
SELECT SINGLE * FROM mara WHERE matnr IN s_matnr.
IF sy-subrc 0.
MESSAGE text-004 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_mtart.
SELECT SINGLE * FROM t134 WHERE mtart IN s_mtart.
IF sy-subrc 0.
MESSAGE text-005 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_matkl.
SELECT SINGLE * FROM t023 WHERE matkl IN s_matkl.
IF sy-subrc 0.
MESSAGE text-006 TYPE 'E'.
ENDIF.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_data_keydate.
PERFORM material_all_charname.
PERFORM get_classification.
PERFORM dynamic_table.
*& Form dynamic_table
text
--> p1 text
<-- p2 text
FORM dynamic_table.
PERFORM fieldcatalog.
PERFORM dynamic_table_create.
PERFORM final_data.
PERFORM final_fieldcatalog.
PERFORM layout_build.
PERFORM grid_display.
ENDFORM. " fieldcat
*& Form layout_build
text
FORM layout_build .
st_layout-zebra = c_check.
st_layout-no_vline = ''.
st_layout-colwidth_optimize = c_check.
st_layout-detail_popup = c_check.
st_layout-detail_initial_lines = c_check.
st_layout-detail_titlebar = text-021.
ENDFORM. " layout_build
*& Form alv_top_of_page
text
FORM alv_top_of_page.
REFRESH t_header.
CLEAR t_header.
w_header-typ = 'H'. "H=Header, S=Selection, A=Action
w_header-key = ' '.
w_header-info = text-019.
APPEND w_header TO t_header.
CONCATENATE sy-datum4(2) '-' sy-datum6(2) '-' sy-datum0(4) ' / ' sy-uzeit0(2) ':' sy-uzeit2(2) ':' sy-uzeit4(2) INTO v_time.
w_header-typ = 'S'. "H=Header, S=Selection, A=Action
w_header-key = text-020.
w_header-info = v_time.
APPEND w_header TO t_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. "alv_top_of_page
*& Form grid_display
text
--> p1 text
<-- p2 text
FORM grid_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'ALV_TOP_OF_PAGE'
it_fieldcat = fs_fldcat
is_layout = st_layout
i_default = c_check
i_save = 'A'
it_events = v_events[]
TABLES
t_outtab = <t_dyntable>.
ENDFORM. " grid_display
*& Form FINAL_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM final_fieldcatalog .
wa_cat-fieldname = text-009.
wa_cat-seltext_m = text-015.
wa_cat-outputlen = 18.
APPEND wa_cat TO fs_fldcat.
wa_cat-fieldname = text-011.
wa_cat-seltext_m = text-016.
wa_cat-outputlen = 40.
APPEND wa_cat TO fs_fldcat.
LOOP AT s_atnam.
CLEAR wa_cat.
wa_cat-fieldname = s_atnam-low.
wa_cat-seltext_m = s_atnam-low.
wa_cat-outputlen = '15'.
APPEND wa_cat TO fs_fldcat.
ENDLOOP.
wa_cat-fieldname = text-012.
wa_cat-seltext_m = text-017.
wa_cat-outputlen = 18.
APPEND wa_cat TO fs_fldcat.
wa_cat-fieldname = text-013.
wa_cat-seltext_m = text-018.
wa_cat-outputlen = 8.
APPEND wa_cat TO fs_fldcat.
ENDFORM. " FINAL_FIELDCATALOG
*& Form FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM fieldcatalog .
wa_it_fldcat-fieldname = text-009.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 18.
APPEND wa_it_fldcat TO t_fldcat1.
wa_it_fldcat-fieldname = text-011.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 40.
APPEND wa_it_fldcat TO t_fldcat1.
LOOP AT s_atnam.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = s_atnam-low.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 30.
APPEND wa_it_fldcat TO t_fldcat1.
ENDLOOP.
wa_it_fldcat-fieldname = text-012.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 18.
APPEND wa_it_fldcat TO t_fldcat1.
wa_it_fldcat-fieldname = text-013.
wa_it_fldcat-datatype = text-014.
wa_it_fldcat-intlen = 8.
APPEND wa_it_fldcat TO t_fldcat1.
ENDFORM. " FIELDCATALOG
*& Form DYNAMIC_TABLE_CREATE
text
--> p1 text
<-- p2 text
FORM dynamic_table_create .
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat1
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO <t_dyntable>.
Create dynamic work area and assign to FS
CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
ASSIGN t_newline->* TO <fs_dyntable>.
ENDFORM. " DYNAMIC_TABLE_CREATE
*& Form FINAL_DATA
text
--> p1 text
<-- p2 text
FORM final_data .
LOOP AT i_objdata_temp INTO w_objdata_temp.
*assign w_objdata_temp-matnr to <fs_dyntable>.
AT NEW matnr.
wa_flname = text-009.
fieldvalue = w_objdata_temp-matnr.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
ENDAT.
wa_flname = text-011.
fieldvalue = w_objdata_temp-maktx.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = w_objdata_temp-atnam.
fieldvalue = w_objdata_temp-ausp1.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = text-012.
fieldvalue = w_objdata_temp-prdha.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = text-013.
fieldvalue = w_objdata_temp-mstde.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
AT END OF matnr.
APPEND <fs_dyntable> TO <t_dyntable>.
ENDAT.
ENDLOOP.
ENDFORM. " FINAL_DATA
*& Form GET_CLASSIFICATION
text
--> p1 text
<-- p2 text
FORM get_classification .
LOOP AT i_data INTO w_data.
SELECT SINGLE * FROM klah WHERE class = c_nac.
IF sy-subrc = 0.
IF w_data-mstde >= klah-vondt.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
class = c_nac
classtext = c_check
classtype = c_klart
clint = 0
features = c_check
language = sy-langu
object = w_data-objek
TABLES
t_class = i_class
t_objectdata = i_objdata
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
LOOP AT i_class INTO w_class.
MOVE w_class TO w_class_temp.
APPEND w_class_temp TO i_class_temp.
ENDLOOP .
LOOP AT s_atnam.
READ TABLE i_objdata INTO w_objdata WITH KEY atnam = s_atnam-low.
IF sy-subrc = 0.
MOVE w_data-matnr TO w_objdata_temp-matnr.
MOVE w_data-maktx TO w_objdata_temp-maktx.
MOVE-CORRESPONDING w_objdata TO w_objdata_temp.
MOVE w_data-prdha TO w_objdata_temp-prdha.
MOVE w_data-mstde TO w_objdata_temp-mstde.
APPEND w_objdata_temp TO i_objdata_temp.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " GET_CLASSIFICATION -
Dear Vinod,
IMHO i don't think this is a spec dumping. I did try to search and even tried hands on it. Unfortunately i didn't get any luck with that.
Morever i'm not asking for any spoon feeding...It's just about some pointer's or any ideas that would help me.
Hope that clarifies much better.
Thanks in advance,
Arya.
My selection screen has a parameter P_WEEK.
Suppose if user enter's a week no for ex: 5. My ALV header should display as
Week5 Week6 Week7 Week8 Week9 Week10
i.e. Up to next 5 weeks. How to design a ALV that would display a dynamic header?
Any ideas or suggestion would be of great help.
Thanks,
Arya
Moderator message : Search for available information. Moved to basic(points-free) forum.
Edited by: Vinod Kumar on Oct 19, 2011 3:37 PM
Edited by: arya.soumya on Oct 19, 2011 12:22 PM
Edited by: Suhas Saha on Oct 19, 2011 4:08 PMHi,
you just try to write below logic in TOP-OF-PAGE routine in your program.
parameter: p_week(3) type c.
Form top_of_page .
do p_week times.
pass the required data to your internal table and append it.
enddo.
Endform.
Ram. -
Dynamic Header help in PDF Portfolio
Need some help please, to create and load a Dynamic Header when creating a PDF Portfolio in LiveCycle ES2. Have input parameter of a [name] and an [image file] to place in the Header. Process flowing out of Assembler (PDF Generator). Currently other PDFs being inserted within the Portfolio, and Navigation parameter being received ok, and setting up custom navigation. Any help w/ creating Dynamic Header is very much appreciated.
By "Dynamic Header" do you mean the PDF cover page, or the interactive portfolio navigator?
If its the cover page then it should be a fairly easy thing to do. You can create a form (XDP or PDF template) with a field for the name and one for the image. Then you would use something like LC Forms or Form Data Integration to merge the data (image and name) with the template.
The one thing you would have to do is to put the image and data into an XML format before you merge it with the form. That means you will need to convert the image to a base64 encoded format. Fortunately there is a built in function for doing the conversion in a SetValue operation (its under Document Object Functions).
If you are talking about the Navigator (portfolio shell) then it gets a bit more tricky. The navigator is actually a Flex application and not a PDF. You'll have to code a new one using Flash Builder, then import the resulting .nav file into your LiveCycle application. Merging the data with it is not something I've done before, but it should be possible (the LiveCycle Interactive Statement Solution Accelerator does something similar).
If it is new navigator you need, check out some of the following links:
http://joelgeraci.com/adobe/devjunkie/web/portfolios_p1_outer.shtml
http://acrobatusers.com/tutorials/modifying-pdf-portfolio-navigator
http://acrobatusers.com/navigator-contest-faq (for the development software links) -
Issue in displaying header details in ALV report
Hi,
I have used slis_t_listheader and REUSE_ALV_COMMENTARY_WRITE to display the header details in ALV report.I want the details to be displayed as below.
Requester : ---------------------- Page: 1
Program: ----------------------- Date:---------
Title of Report
But when I use the structure slis_t_listheader to display the header details,all the fields are coming one below the other.
How can I get the fields as shown in the above format
Edited by: Abaper12345 on Jun 25, 2009 7:54 AMHi,
Go through following code... its showing the data exactly the way you want....
REPORT TEST3.
TYPE-POOLS:slis.
TABLES:MARA.
*Type Declaration
TYPES:BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
END OF t_mara.
*Internal Table
data:it_mara type standard table of t_mara.
*Work Area
data:wa_mara type t_mara.
DATA:i_repid TYPE sy-repid .
i_repid = sy-repid.
*Declaration for field catalog
DATA : fcat TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv.
*Declaration for Layout
data : WA_LAYOUT type SLIS_LAYOUT_ALV.
*Initializing ColumnWidth_Optimize For Layout
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
START-OF-SELECTION
START-OF-SELECTION.
*Fetching data into internal tables
PERFORM get_data.
*Buil Fieldcatalog
PERFORM build_fcat.
*Display ALV Report
PERFORM alv_display.
*Build Fieldcat
FORM build_fcat .
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'Material Number'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'ERSDA'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'Date'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'ERNAM'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'User'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
endform.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
select matnr ersda ernam from mara into table it_mara.
endform. " GET_DATA
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
form ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = i_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE'
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = fcat
TABLES
t_outtab = it_mara
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " ALV_DISPLAY
*& Form html_top_of_page " I_CALLBACK_HTML_TOP_OF_PAGE "
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
CALL METHOD document->add_text
EXPORTING
text = 'Program'
sap_color = document->list_group
sap_fontstyle = document->standard
sap_emphasis = document->strong.
CALL METHOD document->new_line
EXPORTING
repeat = 1
CALL METHOD document->add_text
EXPORTING
text = 'Requester'
sap_color = document->list_group
sap_fontstyle = document->standard
sap_emphasis = document->strong.
CALL METHOD document->new_line
EXPORTING
repeat = 1
CALL METHOD document->add_gap
EXPORTING
width = 125
CALL METHOD document->add_text
EXPORTING
text = 'This Is Test Data'
sap_color = document->list_group
sap_fontsize = document->LARGE
sap_fontstyle = document->standard
sap_emphasis = document->strong.
ENDFORM. "HTML_TOP_OF_PAGE
Thanks & Regards
Ashu SIngh -
How to get header in the ALV report
Hi
I want to print header in the ALV report.But i am not getting that.Plz see my program it is getting error and also not printing header.If there is any error means plz give me the solution.In this program there is an error.
REPORT ZREPORT_ALV .
TYPE-POOLS : slis.
tables:vbak,vbap.
DATA: report_id LIKE sy-repid.
DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV.
data: heading TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
events TYPE slis_t_event.
data: l_string type c.
data: ivariant(1) type c,
itvariant like disvariant,
w_variant like disvariant.
initialization.
REPORT_ID = SY-REPID.
PERFORM pgm. "F1000_LAYOUT_INIT. "using I_LAYOUT.
ivariant = 'A'.
*PERFORM init.
itvariant = w_variant.
select-options:so_vbeln for vbap-vbeln.
data:itab like vbak occurs 0 with header line.
data:itab1 like vbap occurs 0 with header line.
start-of-selection.
select * from vbak into table itab where vbeln in so_vbeln.
if not itab[] is initial.
select * from vbap into table itab1
for all entries in itab
where vbeln = itab-vbeln.
endif.
data:ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat1 TYPE slis_t_fieldcat_alv.
****For alv display
IF NOT itab1[] IS INITIAL.
DEFINE ls_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-outputlen = &2.
ls_fieldcat-seltext_l = &3.
ls_fieldcat-emphasize = &4.
append ls_fieldcat to lt_fieldcat1.
clear ls_fieldcat.
END-OF-DEFINITION.
ls_fieldcat 'VBELN' '10' 'Sales Order Number'.
ls_fieldcat 'POSNR' '6' 'SO Item'.
ls_fieldcat 'MATNR' '13' 'Material No'.
m_fieldcat1 'NETWR' '13' 'Amount'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = lt_fieldcat1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = ITVARIANT
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab1
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.
endif.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = ivariant
CHANGING
CS_VARIANT = itvariant
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3
OTHERS = 4
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 pgm. "F1000_LAYOUT_INIT. "USING I_LAYOUT TYPE SLIS_LAYOUT_ALV.
CLEAR I_LAYOUT.
i_layout-colwidth_optimize = 'X'.
I_LAYOUT-key_hotspot = u2018Xu2019.
I_LAYOUT-hotspot_fieldname = MATNR.
ENDFORM.
*regarding logo and header,,,,
*first store the logo in T-code OAOR, then call that in your report.....
*data: heading TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
events TYPE slis_t_event.
To display TOP_OF_PAGE.
FORM top_of_page.
DATA : text(40),txtdt(40).
CLEAR l_string.
l_string = 'JCB India Limited'(hd2).
wa_header-typ = 'H'.
wa_header-info = l_string.
APPEND wa_header TO heading. " index 1.
CLEAR l_string.
WRITE :'Number of records:' TO text,'dbcnt' TO text+20 LEFT-JUSTIFIED.
wa_header-typ = 'S'.
wa_header-info = text.
APPEND wa_header TO heading.
CLEAR l_string.
wa_header-typ = 'S'.
WRITE : 'Report Run Date :' TO txtdt,sy-datum TO txtdt+20 DD/MM/YY.
WRITE sy-datum TO dat DD/MM/YY.
wa_header-info = txtdt.
APPEND wa_header TO heading.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = heading.
CLEAR heading.
ENDFORM. "top_of_page
*to execute top-of-page you have to create events.
*for ex......
FORM create_event USING p_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_events.
READ TABLE p_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE formname_top_of_page TO ls_event-form.
APPEND ls_event TO p_events.
ENDIF.
ENDFORM. " create_eventHi,
Find below code for your question, you may get some idea,,
*& Report ZACTIONGRIDPRACTICE
REPORT ZACTIONGRIDPRACTICE.
*data declarations.....
TYPE-POOLS SLIS.
TABLES : T529T ,PA0000.
data : gd_repid type sy-repid.
DATA : LD_COLOR(10) TYPE N.
DATA : GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV.
Data: is_fieldcat TYPE slis_fieldcat_alv.
DATA : GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : GD_DATUM TYPE DATUM.
DATA : BEGIN OF WA_TABLE,
MASSN TYPE T529T-MASSN,
MNTXT TYPE T529T-MNTXT,
userg type userg,
TOTAL TYPE I ,
begda type begda,
endda type endda,
april type i,
SLNO TYPE I,
LINE_COLOR(4) TYPE C,
END OF WA_TABLE,
IT_TABLE LIKE TABLE OF WA_TABLE.
data : april type i.
DATA : TEMP TYPE C.
data : LT_PA0000 TYPE TABLE OF PA0000,
LT_PA0000_T typE TABLE OF PA0000 with header line.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
DATA : IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS LIKE LINE OF IT_EVENTS.
wa_events-form = 'HEADER'.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
APPEND WA_EVENTS TO IT_EVENTS.
PERFORM HEADER.
DATA : SLNO TYPE I.
DATA : lv_output TYPE dats.
CALL FUNCTION 'ZHR_RE_BE_CALC_START_DATE'
EXPORTING
id_daberi = sy-datum
IMPORTING
ed_date_cor = lv_output.
select-options...
selection-screen BEGIN OF BLOCK B WITH FRAME TITLE TEXT-003.
select-options : s_date for sy-datum OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B.
lv_output = sy-datum - 27.
INITIALIZATION.
S_DATE-LOW = lv_output.
S_DATE-HIGH = SY-DATUM.
S_DATE-SIGN = 'I'.
S_DATE-OPTION = 'BT'.
APPEND s_date.
*AT SELECTION-SCREEN ON S_DATE.
*SELECT MASSN INTO TABLE IT_TABLE FROM PA0000 WHERE BEGDA IN S_DATE.
*SELECT STATEMENTS....
start-of-selection.
SELECT t529t~MASSN t529t~MNTXT INTO TABLE IT_table FROM T529T where SPRSL EQ 'E' and t529t~massn in ('10','13','16','20','28','30','45','01','03') .
DATUM IN S_DATE.
PERFORM LAYOUT.
loop at it_table into wa_table.
LD_COLOR = 2.
LD_COLOR = LD_COLOR + 1.
if LD_COLOR = 8.
LD_COLOR = 1.
endif.
concatenate 'C' '1' '11' into wa_table-LINE_COLOR . "='C410'.
modify it_table from wa_table.
endloop.
LOOP AT IT_TABLE INTO WA_TABLE." = 'C410'.
select massn from pa0000 into table lt_pa0000 where begda in s_date and massn = wa_table-massn.
*write : / sy-dbcnt. gt s_date-low and endda lt s_date-high
*DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
move sy-dbcnt to wa_table-total.
READ TABLE lt_pa0000 INTO LT_PA0000_T WITH KEY MASSN = wa_TABLE-MASSN BINARY SEARCH.
DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
MOVE LV_LINES to wa_TABLE-TOTAL.
MODIFY IT_TABLE FROM WA_TABLE.
MOVE SY-TABIX TO WA_TABLE-SLNO.
MODIFY IT_TABLE FROM WA_TABLE.
REFRESH : LT_PA0000_t.
CLEAR : LV_LINES.
ENDLOOP.
loop at it_table into wa_table.
SELECT MASSN FROM PA0000 INTO TABLE lt_pa0000 where begda between '01.02.2008' and '20.02.2008'.
MOVE SY-DBCNT TO WA_TABLE-APRIL.
MODIFY IT_TABLE FROM WA_TABLE.
*endloop.
*PERFORM STATEMENTS...
PERFORM FCAT USING '1' 'MASSN' 'ACTIONCODE'.
PERFORM FCAT USING '2' 'MNTXT' 'ACTION TYPE'.
PERFORM fcat USING '3' 'TOTAL' 'TOTAL'.
DEFINE m_fieldcat.
is_fieldcat-fieldname = &1.
is_fieldcat-hotspot = &2.
is_fieldcat-seltext_m = &3.
is_fieldcat-col_pos = &4.
is_fieldcat-outputlen = &5.
is_fieldcat-hotspot = &6.
append is_fieldcat to it_fcat.
clear is_fieldcat.
END-OF-DEFINITION.
m_fieldcat 'SLNO' '' Text-012 '1' '17' ''.
m_fieldcat 'MASSN' '' Text-010 '2' '40' ''.
m_fieldcat 'MNTXT' '' Text-009 '3' '50' '' .
m_fieldcat 'TOTAL' '' Text-011 '4' '10' 'X'.
m_fieldcat 'april' '' Text-013 '5' '10' 'X'.
*FOR DISPLAYING THE RECORDS...
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gd_repid
IS_LAYOUT = GD_LAYOUT
I_CALLBACK_USER_COMMAND = ' '
I_GRID_TITLE = 'REPORT'
IS_LAYOUT = gd_LAYOUT
IT_FIELDCAT = IT_FCAT
I_SAVE = 'X'
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = IT_TABLE.
**& Form FCAT
*FORM FCAT USING FP_COL_POS
FP_FIELDNAME
FP_SELTEXT_M.
WA_FCAT-COL_POS = FP_COL_POS.
WA_FCAT-FIELDNAME = FP_FIELDNAME.
wa_fcat-seltext_m = fp_seltext_m.
APPEND WA_FCAT TO IT_FCAT.
ENDFORM.
*& Form HEADER
text
--> p1 text
<-- p2 text
form header .
DATA : IT_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER LIKE LINE OF it_header.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'ACTION TYPE REPORT'.
APPEND WA_HEADER TO IT_HEADER.
wa_header-typ = 'S'.
wa_header-key = Text-022.
CONCATENATE s_date-low+6(2) '.'
s_date-low+4(2) '.'
s_date-low(4)
temp
'. TO .'
s_date-high+6(2) '.'
s_date-high+4(2) '.'
s_date-high(4)
INTO wa_header-info SEPARATED BY space.
APPEND wa_header TO it_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_HEADER
I_LOGO = 'HRRU_51050061'.
*select single bstkd into CORRESPONDING FIELDS OF gt_vbkd
*from vbkd where vbeln = rt_outtab-vgbel
*and posnr = '000000'.
*rt_outtab-bstkd = gt_vbkd-bstkd.
ENDFORM. " HEADER
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
GD_LAYOUT-NO_INPUT = ''.
gd_layout-colwidth_optimize = ''.
gd_layout-totals_text = 'TOTALS'(201).
gd_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " LAYOUT -
SSRS 2008 R2 - Dynamic header data stays the same when exporting
Background:
I have a SSRS 2008 R2 report with a single Tablix.
The data is grouped by InvoiceID, with each appearing on a separate page.
I'm displaying some of the detail data in the group header row using Expressions similar to the following:
="Invoice # " & ReportItems!InvoiceID.Value"
The data referred to by my ReportItems statements are all hidden in the detail row (Advanced Mode, the Hidden Value for the Static Row Group is set to false).
Problem:
When I Preview the report in Visual Studio, everything looks as it should - the dynamic header data changes correctly with each group.
However, whenever I export the results (I've tried all the formats), the header data is the same for every group - its taking the values from the first group and using it in all the groups.
I've copied the same expressions into my Totals row, and the data is correct when exported; its only happening in my header rows.
Any help in resolving this is greatly appreciated, thank you.Hi Alex,
According to your description, you have a header with expression contains ReportItems. Now you find it shows incorrect result when exporting to a file. Right?
In Reporting Services, it has reported some similar issue that the ReportItem returns unexpected result when exporting. In this scenario, since you just want to show the group name in each page as a header for detail rows. So you can make the
detail rows group on the Group. Then delete the Group column but still keep the group. After that add a row above detail row (Out side of group) and put in "=Fields!InvoiceID.Value". Now it will show the corresponding Group name
when you set page break between each group instance. We have tested this case in our local environment. Here are screenshots for your reference:
Reference:
SSRS
field expressions using ReportItem refrences have unexpected results when exporting
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Error whil adding Header to the ALV grid using OO
Hi Guys,
I want to display the Header for the ALV grid using Splitter .
when i am doing like that .I am getting a screen on the top of that screen I am getting a EMPTY screen .I don't know why likat.
What i need is just to display a Grid with header?Can anybody Please help me reagarding this problem.
the Code is Below.
*& Report Z_TEST_PGM
REPORT Z_TEST_PGM NO STANDARD PAGE HEADING
LINE-SIZE 120 MESSAGE-ID zotc.
Tables : CKMLMV003 , CKMLMV001.
TYPE-POOLS: slis.
Types : Begin of t_CKMLMV003_out,
WERKS type CKMLMV003-WERKS,
MATNR type CKMLMV003-MATNR,
MISCH_VERH type CKMLMV003-MISCH_VERH,
KALNR_BAL type CKMLMV003-KALNR_BAL,
GJAHR type CKMLMV003-GJAHR,
PERIO type CKMLMV003-PERIO,
MGTYP type CKMLMV003-MGTYP,
End of t_CKMLMV003_out,
Begin of t_CKMLMV001_out,
MATNR type CKMLMV001-MATNR,
KALNR type CKMLMV001-KALNR,
LIFNR_ND type CKMLMV001-LIFNR_ND,
EKORG_ND type CKMLMV001-EKORG_ND,
End of t_CKMLMV001_out,
Begin of t_CKMLMV003_Temp,
MATNR type CKMLMV003-MATNR,
GJAHR type CKMLMV003-GJAHR,
PERIO type CKMLMV003-PERIO,
End of t_CKMLMV003_Temp,
Begin of t_Final_out,
MATNR type CKMLMV003-MATNR,
GJAHR type CKMLMV003-GJAHR,
PERIO type CKMLMV003-PERIO,
WERKS type CKMLMV003-WERKS,
LIFNR_ND1 type CKMLMV001-LIFNR_ND,
MISCH_VERH1 type CKMLMV003-MISCH_VERH,
LIFNR_ND2 type CKMLMV001-LIFNR_ND,
MISCH_VERH2 type CKMLMV003-MISCH_VERH,
LIFNR_ND3 type CKMLMV001-LIFNR_ND,
MISCH_VERH3 type CKMLMV003-MISCH_VERH,
LIFNR_ND4 type CKMLMV001-LIFNR_ND,
MISCH_VERH4 type CKMLMV003-MISCH_VERH,
LIFNR_ND5 type CKMLMV001-LIFNR_ND,
MISCH_VERH5 type CKMLMV003-MISCH_VERH,
LIFNR_ND6 type CKMLMV001-LIFNR_ND,
MISCH_VERH6 type CKMLMV003-MISCH_VERH,
LIFNR_ND7 type CKMLMV001-LIFNR_ND,
MISCH_VERH7 type CKMLMV003-MISCH_VERH,
LIFNR_ND8 type CKMLMV001-LIFNR_ND,
MISCH_VERH8 type CKMLMV003-MISCH_VERH,
LIFNR_ND9 type CKMLMV001-LIFNR_ND,
MISCH_VERH9 type CKMLMV003-MISCH_VERH,
LIFNR_ND10 type CKMLMV001-LIFNR_ND,
MISCH_VERH10 type CKMLMV003-MISCH_VERH,
LIFNR_ND11 type CKMLMV001-LIFNR_ND,
MISCH_VERH11 type CKMLMV003-MISCH_VERH,
LIFNR_ND12 type CKMLMV001-LIFNR_ND,
MISCH_VERH12 type CKMLMV003-MISCH_VERH,
LIFNR_ND13 type CKMLMV001-LIFNR_ND,
MISCH_VERH13 type CKMLMV003-MISCH_VERH,
End of t_Final_out,
Begin of t_Final_out1,
MATNR type CKMLMV003-MATNR,
GJAHR type CKMLMV003-GJAHR,
PERIO type CKMLMV003-PERIO,
LIFNR_ND1 type CKMLMV001-LIFNR_ND,
MISCH_VERH1 type CKMLMV003-MISCH_VERH,
LIFNR_ND2 type CKMLMV001-LIFNR_ND,
MISCH_VERH2 type CKMLMV003-MISCH_VERH,
LIFNR_ND3 type CKMLMV001-LIFNR_ND,
MISCH_VERH3 type CKMLMV003-MISCH_VERH,
LIFNR_ND4 type CKMLMV001-LIFNR_ND,
MISCH_VERH4 type CKMLMV003-MISCH_VERH,
LIFNR_ND5 type CKMLMV001-LIFNR_ND,
MISCH_VERH5 type CKMLMV003-MISCH_VERH,
LIFNR_ND6 type CKMLMV001-LIFNR_ND,
MISCH_VERH6 type CKMLMV003-MISCH_VERH,
LIFNR_ND7 type CKMLMV001-LIFNR_ND,
MISCH_VERH7 type CKMLMV003-MISCH_VERH,
LIFNR_ND8 type CKMLMV001-LIFNR_ND,
MISCH_VERH8 type CKMLMV003-MISCH_VERH,
LIFNR_ND9 type CKMLMV001-LIFNR_ND,
MISCH_VERH9 type CKMLMV003-MISCH_VERH,
LIFNR_ND10 type CKMLMV001-LIFNR_ND,
MISCH_VERH10 type CKMLMV003-MISCH_VERH,
LIFNR_ND11 type CKMLMV001-LIFNR_ND,
MISCH_VERH11 type CKMLMV003-MISCH_VERH,
LIFNR_ND12 type CKMLMV001-LIFNR_ND,
MISCH_VERH12 type CKMLMV003-MISCH_VERH,
LIFNR_ND13 type CKMLMV001-LIFNR_ND,
MISCH_VERH13 type CKMLMV003-MISCH_VERH,
End of t_Final_out1.
Global Structures *
Data : i_CKMLMV003_str type t_CKMLMV003_out,
i_CKMLMV001_str type t_CKMLMV001_out,
i_Final_str type t_Final_out,
i_Final_str1 type t_Final_out,
i_CKMLMV003_Temp type t_CKMLMV003_Temp.
Global Internal Tables *
Data : i_CKMLMV003_out type standard table of t_CKMLMV003_out,
i_CKMLMV001_out type standard table of t_CKMLMV001_out,
i_Final_out type standard table of t_Final_out,
i_Final_out1 type standard table of t_Final_out.
ALV Report Internal tables *
DATA : t_fieldcatalog TYPE slis_t_fieldcat_alv,
s_fieldcatalog TYPE slis_fieldcat_alv,
t_basic_fieldcatalog TYPE slis_t_fieldcat_alv,
s_basic_fieldcatalog TYPE slis_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv,
v_repid TYPE sy-repid.
*ALV Header declarations
Data: t_header type slis_t_listheader,
i_header_str type slis_listheader,
i_line_event_str TYPE slis_alv_event,
i_events TYPE slis_t_event,
wa_layout type slis_layout_alv.
Data : grid1 type ref to cl_gui_alv_grid,
g_custom_container1 type ref to cl_gui_custom_container,
grid2 type ref to cl_gui_alv_grid,
g_custom_container2 type ref to cl_gui_custom_container,
i_FCAT TYPE LVC_T_FCAT,
i_FCAT_str type lvc_s_fcat,
Structure for layout
i_layout_s TYPE lvc_s_layo,
gt_final1 type table of t_Final_out.
DATA: CCCONTAINER1 TYPE SCRFNAME VALUE 'CCCONTAINER1',
CCCONTAINER2 TYPE SCRFNAME VALUE 'CCCONTAINER2',
G_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER ,
G_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
G_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
G_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER.
Global Variables *
Data :cnt(4) type n value '0',
g_plant type CKMLMV003-WERKS ,
g_QuanTStr type CKMLMV003-MGTYP ,
g_PurchOrg type CKMLMV001-EKORG_ND,
flag type n value '0',
g_cnt6 type n value '0',
g_cnt7 type n value '0',
g_cnt8 type n value '0',
g_cnt9 type n value '0',
g_cnt10 type n value '0',
g_cnt11 type n value '0',
g_cnt12 type n value '0',
g_cnt13 type n value '0'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-006 for field s_matnr.
Select-Options : S_MATNR for CKMLMV003-MATNR .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-007 for field S_WERKS.
SELECT-OPTIONS:S_WERKS for CKMLMV003-WERKS Default '2003'.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-008 for field S_GJAHR.
SELECT-OPTIONS:S_GJAHR for CKMLMv003-GJAHR default Sy-DATUM(4) .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-009 for field S_PERIO.
SELECT-OPTIONS:S_PERIO for CKMLMV003-PERIO .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(25) TEXT-010 for field P_MGTYP.
Parameters : P_MGTYP type CKMLMV003-MGTYP .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN END OF BLOCK b1 .
At Selection-Screen on s_matnr .
Perform Validate_MatNumber.
At Selection-Screen on s_werks .
Perform Validate_CostingPlant.
At Selection-Screen on s_GJAHR .
Perform Validate_FiscalYear.
At Selection-Screen on s_PERIO .
Perform Validate_Period.
At Selection-Screen on p_MGTYP .
Perform Validate_QuantityStrType.
*& Form Validate_MatNumber
text
Form Validate_MatNumber.
DATA l_MATNR TYPE CKMLMV003-MATNR.
IF NOT S_MATNR[] IS INITIAL .
CLEAR L_MATNR.
SELECT single MATNR FROM CKMLMV003
INTO l_MATNR
WHERE MATNR = s_MATNR-LOW or MATNR = s_MATNR-HIGH.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e999 WITH
'Enter a Valid Material Number'(001).
ENDIF.
ENDIF.
ENDFORM. "Validate_MatNumber
*& Form Validate_CostingPlant
text
Form Validate_CostingPlant.
DATA l_werks TYPE CKMLMV003-WERKS.
IF NOT S_WERKS[] IS INITIAL .
CLEAR L_WERKS.
SELECT single WERKS FROM T001W
INTO l_WERKS
WHERE WERKS = s_WERKS-low or WERKS = s_WERKS-high.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e999 WITH
'Enter a Valid Costing Plant'(002).
ENDIF.
ENDIF.
ENDFORM. "Validate_CostingPlant
*& Form Validate_FiscalYear
text
Form Validate_FiscalYear.
DATA l_GJAHR TYPE CKMLMV003-GJAHR.
IF NOT S_GJAHR-low IS INITIAL or S_GJAHR-high IS INITIAL.
CLEAR L_GJAHR.
SELECT SINGLE GJAHR FROM CKMLMV003
INTO l_GJAHR
WHERE GJAHR LE sy-DATUM(4) .
IF NOT S_GJAHR-low LE sy-DATUM(4) or S_GJAHR-high LE sy-DATUM(4).
MESSAGE e999 WITH
'Enter a Valid Fiscal year'(003).
ENDIF.
ENDIF.
ENDFORM. "Validate_FiscalYear
*& Form Validate_Period
text
Form Validate_Period.
DATA l_PERIO TYPE CKMLMV003-PERIO.
IF NOT S_PERIO[] IS INITIAL .
CLEAR L_PERIO.
SELECT single PERIO FROM CKMLMV003
INTO l_PERIO
WHERE PERIO GE 1 and PERIO LE 12 .
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e999 WITH
'Enter a Valid Period'(004).
ENDIF.
ENDIF.
ENDFORM. "Validate_Period
*& Form Validate_QuantityStrType
text
Form Validate_QuantityStrType.
DATA l_MGTYP TYPE CKMLMV003-MGTYP.
IF NOT p_MGTYP IS INITIAL.
CLEAR L_MGTYP.
SELECT SINGLE MGTYP FROM CKMLMV003
INTO l_MGTYP
WHERE MGTYP = p_MGTYP .
IF sy-subrc NE 0.
MESSAGE e999 WITH
'Enter a Valid Quantity Structure Type'(005).
ENDIF.
ENDIF.
ENDFORM. "Validate_QuantityStrType
INITIALIZATION of Fields
Class LCL_EVENT_HANDLER DEFINITION.
Public section.
Methods:
TOP_OF_PAGE for Event TOP_OF_PAGE OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD TOP_OF_PAGE.
Top-of-page event <br />
PERFORM EVENT_TOP_OF_PAGE USING G_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
Data : G_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
Initialization.
v_repid = sy-repid.
Start-of-Selection.
Perform get_CKMLMV003.
Perform get_CKMLMV001.
Perform Get_Finaldata.
Perform Layout_FieldCatalog.
call screen '101'.
Perform ALVGrid_Final_Display.
*& Form Layout_FieldCatalog
text
Form Layout_FieldCatalog.
s_fieldcatalog-col_pos = 1.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-024.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 2.
s_fieldcatalog-fieldname = 'GJAHR'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-012.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 3.
s_fieldcatalog-fieldname = 'PERIO'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-013.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 4.
s_fieldcatalog-fieldname = 'WERKS'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-025.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 5.
s_fieldcatalog-fieldname = 'LIFNR_ND1'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-014.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 6.
s_fieldcatalog-fieldname = 'MISCH_VERH1'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-015.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 7.
s_fieldcatalog-fieldname = 'LIFNR_ND2'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-016.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 8.
s_fieldcatalog-fieldname = 'MISCH_VERH2'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-017.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 9.
s_fieldcatalog-fieldname = 'LIFNR_ND3'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-018.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 10.
s_fieldcatalog-fieldname = 'MISCH_VERH3'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-019.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 11.
s_fieldcatalog-fieldname = 'LIFNR_ND4'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-020.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 12.
s_fieldcatalog-fieldname = 'MISCH_VERH4'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-021.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 13.
s_fieldcatalog-fieldname = 'LIFNR_ND5'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 14.
s_fieldcatalog-fieldname = 'MISCH_VERH5'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
if g_cnt6 <> '0'.
s_fieldcatalog-col_pos = 14.
s_fieldcatalog-fieldname = 'LIFNR_ND6'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 15.
s_fieldcatalog-fieldname = 'MISCH_VERH6'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt7 <> '0'.
s_fieldcatalog-col_pos = 16.
s_fieldcatalog-fieldname = 'LIFNR_ND7'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 17.
s_fieldcatalog-fieldname = 'MISCH_VERH7'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt8 <> '0'.
s_fieldcatalog-col_pos = 18.
s_fieldcatalog-fieldname = 'LIFNR_ND8'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 19.
s_fieldcatalog-fieldname = 'MISCH_VERH8'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt9 <> '0'.
s_fieldcatalog-col_pos = 20.
s_fieldcatalog-fieldname = 'LIFNR_ND9'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 21.
s_fieldcatalog-fieldname = 'MISCH_VERH9'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt10 <> '0'.
s_fieldcatalog-col_pos = 22.
s_fieldcatalog-fieldname = 'LIFNR_ND10'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 23.
s_fieldcatalog-fieldname = 'MISCH_VERH10'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt11 <> '0'.
s_fieldcatalog-col_pos = 24.
s_fieldcatalog-fieldname = 'LIFNR_ND11'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 25.
s_fieldcatalog-fieldname = 'MISCH_VERH11'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt12 <> '0'.
s_fieldcatalog-col_pos = 26.
s_fieldcatalog-fieldname = 'LIFNR_ND12'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 27.
s_fieldcatalog-fieldname = 'MISCH_VERH12'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
if g_cnt13 <> '0'.
s_fieldcatalog-col_pos = 29.
s_fieldcatalog-fieldname = 'LIFNR_ND13'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-022.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
s_fieldcatalog-col_pos = 30.
s_fieldcatalog-fieldname = 'MISCH_VERH13'.
s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
s_fieldcatalog-seltext_l = Text-023.
append s_fieldcatalog to t_fieldcatalog.
clear s_fieldcatalog.
ENDIF.
ENDFORM. "Layout_FieldCatalog
*& Form get_CKMLMV003
text
Form get_CKMLMV003.
Select WERKS
MATNR
MISCH_VERH
KALNR_BAL
GJAHR
PERIO
MGTYP
from CKMLMV003
into table i_CKMLMV003_out
Where ( MATNR in s_MATNR and
WERKS in s_WERKS and
GJAHR in s_GJAHR and
PERIO in s_PERIO and
MGTYP = p_MGTYP ).
Sort i_CKMLMV003_out by MATNR KALNR_BAL.
ENDFORM. "get_CKMLMV003
*& Form get_CKMLMV001
text
Form get_CKMLMV001.
If Not i_CKMLMV003_out is Initial.
Select MATNR
KALNR
LIFNR_ND
EKORG_ND
from CKMLMV001
into Table i_CKMLMV001_out
for all entries in i_CKMLMV003_out
Where ( KALNR = i_CKMLMV003_out-KALNR_BAL
and WERKS = i_CKMLMV003_out-WERKS
and MATNR = i_CKMLMV003_out-MATNR ).
sort i_CKMLMV001_out by MATNR KALNR.
ENDIF.
ENDFORM. "get_CKMLMV001
*& Form Get_Finaldata
text
Form Get_Finaldata.
Loop at i_CKMLMV001_out into i_CKMLMV001_str.
Loop at i_CKMLMV003_out into i_CKMLMV003_str.
If ( i_CKMLMV001_str-KALNR = i_CKMLMV003_str-KALNR_BAL and i_CKMLMV003_str-MATNR = i_CKMLMV001_str-MATNR ) .
If ( flag = 0 ).
g_plant = i_CKMLMV003_str-WERKS.
g_PurchOrg = i_CKMLMV001_str-EKORG_ND.
g_quantstr = i_CKMLMV003_str-MGTYP.
flag = 1.
ENDIF.
Move i_CKMLMV003_str-MATNR to i_Final_str-MATNR.
Move i_CKMLMV003_str-WERKS to i_Final_str-WERKS.
Move i_CKMLMV003_str-GJAHR to i_Final_str-GJAHR.
Move i_CKMLMV003_str-PERIO to i_Final_str-PERIO.
Move i_CKMLMV003_str-MISCH_VERH to i_Final_str-MISCH_VERH1.
Move i_CKMLMV001_str-LIFNR_ND to i_Final_str-LIFNR_ND1.
Move-Corresponding i_CKMLMV003_str to i_CKMLMV003_temp.
Append i_Final_str to i_Final_out.
Clear : i_CKMLMV003_str .
ENDIF.
ENDLOOP.
Clear : i_CKMLMV001_str , i_Final_str , i_CKMLMV003_temp.
ENDLOOP.
Sort i_Final_out by WERKS MATNR GJAHR PERIO .
Loop at i_Final_out into i_Final_str.
if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO and i_Final_str-WERKS = i_Final_str1-WERKS.
cnt = cnt + 1.
Case cnt.
When 2.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH2.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND2.
When 3.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH3.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND3.
When 4.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH4.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND4.
When 5.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH5.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND5.
When 6.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH6.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND6.
g_cnt6 = 1.
When 7.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH7.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND7.
g_cnt7 = 1.
When 8.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH8.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND8.
g_cnt8 = 1.
When 9.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH9.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND9.
g_cnt9 = 1.
When 10.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH10.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND10.
g_cnt10 = 1.
When 11.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH11.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND11.
g_cnt11 = 1.
When 12.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH12.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND12.
g_cnt12 = 1.
When 13.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH13.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND13.
g_cnt13 = 1.
ENDCASE.
ELSE.
if cnt GE 1 .
append i_Final_str1 to i_Final_out1.
Clear : i_Final_str1.
ENDIF.
Move-Corresponding i_Final_str to i_Final_str1.
cnt = 0.
cnt = cnt + 1.
ENDIF.
Clear : i_Final_str.
Endloop.
append i_Final_str1 to i_Final_out1.
if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO .
cnt = cnt + 1.
Case cnt.
When 2.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH2.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND2.
When 3.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH3.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND3.
When 4.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH4.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND4.
When 5.
Move i_Final_str-MISCH_VERH1 to i_Final_str1-MISCH_VERH5.
Move i_Final_str-LIFNR_ND1 to i_Final_str1-LIFNR_ND5.
ENDCASE.
**Move-Corresponding i_Final_str to i_Final_str1.
ELSE.
if cnt GE 1 .
append i_Final_str1 to i_Final_out1.
Clear : i_Final_str1.
ENDIF.
Move-Corresponding i_Final_str to i_Final_str1.
cnt = 0.
cnt = cnt + 1.
ENDIF.
Clear : i_Final_str.
Endloop.
append i_Final_str1 to i_Final_out1.
ENDFORM. "Get_Finaldata
*& Form top_of_page
text
Form top_of_page.
clear t_header.
refresh t_header.
i_header_str-typ = 'H'.
I_header_Str-info = Text-035.
append I_header_str to t_header.
clear I_header_str.
Date
I_header_str-typ = 'S'.
I_header_str-key = Text-036.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO I_header_str-info. "todays date
append I_header_str to t_header.
clear: I_header_str.
i_header_str-typ = 'S'.
I_header_Str-Key = 'Quantity Structure Type :'.
I_header_Str-info = g_QuantStr.
append I_header_str to t_header.
clear I_header_str.
i_header_str-typ = 'S'.
I_header_Str-Key = 'Purchase Org :'.
I_header_Str-info = g_PurchOrg.
append I_header_str to t_header.
clear I_header_str.
i_header_str-typ = 'S'.
I_header_Str-Key = 'Plant :'.
I_header_Str-info = g_Plant.
append I_header_str to t_header.
clear I_header_str.
CLEAR i_line_event_str.
i_line_event_str-name = 'TOP_OF_PAGE'.
APPEND i_line_event_str TO i_events.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
ENDFORM. "top_of_page
*& ALVGrid_Final_Display
Form ALVGrid_Final_Display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_DEFAULt = c_valx
i_callback_top_of_page = 'TOP_OF_PAGE'
i_Save = c_valx
it_fieldcat = t_fieldcatalog
it_sort = t_sort
it_events = I_events
TABLES
t_outtab = i_final_out1.
ENDFORM. "ALVGrid_Final_Display
*& Form ALVGRID_OO_Display
text
Form ALVGRID_OO_Display.
i_FCAT_str-col_pos = 1.
i_FCAT_str-fieldname = 'MATNR'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_fcat_str-seltext = 'MATERIAL'.
i_fcat_str-scrtext_m = Text-024.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 2.
i_FCAT_str-fieldname = 'GJAHR'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_fcat_str-scrtext_m = Text-012.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 3.
i_FCAT_str-fieldname = 'PERIO'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_fcat_str-scrtext_m = Text-013.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 4.
i_FCAT_str-fieldname = 'WERKS'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-025.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 5.
i_FCAT_str-fieldname = 'LIFNR_ND1'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_fcat_str-scrtext_m = Text-014.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 6.
i_FCAT_str-fieldname = 'MISCH_VERH1'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-015.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 7.
i_FCAT_str-fieldname = 'LIFNR_ND2'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-016.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 8.
i_FCAT_str-fieldname = 'MISCH_VERH2'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-017.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 9.
i_FCAT_str-fieldname = 'LIFNR_ND3'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-018.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 10.
i_FCAT_str-fieldname = 'MISCH_VERH3'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-019.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 11.
i_FCAT_str-fieldname = 'LIFNR_ND4'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-020.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 12.
i_FCAT_str-fieldname = 'MISCH_VERH4'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-021.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 13.
i_FCAT_str-fieldname = 'LIFNR_ND5'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-022.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 14.
i_FCAT_str-fieldname = 'MISCH_VERH5'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
i_FCAT_str-scrtext_m = Text-023.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
if g_cnt6 <> '0'.
i_FCAT_str-col_pos = 15.
i_FCAT_str-fieldname = 'LIFNR_ND6'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
i_FCAT_str-scrtext_m = Text-022.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
i_FCAT_str-col_pos = 16.
i_FCAT_str-fieldname = 'MISCH_VERH6'.
i_FCAT_str-tabname = 'I_FINAL_OUT1'.
s_fieldcatalog-NO_OUT = 'X'.
i_FCAT_str-scrtext_m = Text-023.
append i_FCAT_str to i_FCAT.
clear i_FCAT_str.
ENDIF.
*if not grid1 is Initial.
If sy-SUBRC = 0.
Call Method grid1->set_table_for_first_display
CHANGING
it_outtab = i_final_out1[]
it_fieldcatalog = I_FCAT
EXCEPTIONS
Invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
Others = 4.
If sy-subrc <> 0.
ENDIF.
CALL METHOD G_DYNDOC_ID->INITIALIZE_DOCUMENT
EXPORTING
BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.
Processing events <br />
CALL METHOD GRID1->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = G_DYNDOC_ID.
Call Method grid2->set_table_for_first_display
CHANGING
it_outtab = i_final_out1[]
it_fieldcatalog = I_FCAT
EXCEPTIONS
Invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
Others = 4.
If sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
Endform. "ALVGRID_OO_Display
Form EVENT_TOP_OF_PAGE using DG_DYNDOC_ID
TYPE REF TO CL_DD_DOCUMENT.
DATA : DL_TEXT(255) TYPE C.
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Flight Details'
SAP_STYLE = CL_DD_AREA=>HEADING
SAP_FONTSIZE = CL_DD_AREA=>LARGE
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
Endform.
*& Module STATUS_0101 OUTPUT
text
MODULE STATUS_0101 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
Create Object G_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
if g_custom_container1 is initial .
create object g_custom_container1
Exporting
Container_name = CCCONTAINER1
Exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
Others = 5.
Create Object G_SPLITTER
Exporting PARENT = g_custom_container1.
CALL METHOD G_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = G_PARENT_TOP.
*Assigning the Part 2 to GRID
CALL METHOD G_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = g_parent_grid.Hi,
Check if any event is triggered from the event handler class, upon selection.
Usually, the events are handled on double click or on hotspot etc.
Regards,
Satish Kanteti -
Header row in ALV Grid, based on the data in the table
Hi All,
I have a requirement wherein, based on the data in the table used for ALV, i need to add rows as sort of header in the ALV display.
For e.g. my table has
Appl No. Item Material Desc. Cost -> Column Heading
1 10 400 Excavation 10.00 -> Data
1 20 400 Footing 10.00
2 10 400 Excavation 10.00
2 20 400 Footing 10.00
For every new Appl No., i need to add a row, or sort of header specifying the appl no. details. means
Appl No. Item Material Desc. Cost
Appli. No. 1 Date: 01/01/1009 -> my requirement
1 10 400 Excavation 10.00
1 20 400 Footing 10.00
Appli. No. 2 Date: 02/01/1009
2 10 400 Excavation 10.00
2 20 400 Footing 10.00
Is this possible in ALV my any means? Currently i m using normal ALV Grid
Regards,
JanakiHi..
Try like this... I think u have Application number and date in ur table ... First get the total table data into internal table.. and to add the row
*Declare the var1 as 0 and var2.
loop at internal table
*var1 = var1 +1
when application number =var1
concatenate : 'Appli. No.' (table- appli no field) 'Date:' (table-date field) into var2.
perform display(some name)
*endloop.
*form display...
alv display part.. first give that var2 like eg.. wa_alv-field= 'var2'.
end form.
Hope this will help u .....
Regards,
Abaper -
Variable Text not working as dynamic header in Crystal report
Dear Experts,
I'm working Crystal report that connected to Query BEX SAP BW trough SAP integration kit,
currently i have case that need report dynamic header using variable text from BEX query, but seem the variable text not working in Crystal reports. the header in Crystal report shown as Desription\technical name, not result from the variable text in Query BEX in SAP.
In https://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal%20Reports%20and%20BW%20query%20elements stated that the "Text variable" with "replacement path" is supported, but i don't know in my query is not working.
i already set in Database -> options-> table and fields -> Show Both, but the text variable still not working.
can you help me
Crystal Reports 2008 12.2.0.290
SAP Integration KIT 12.1.0.890
Thanks
LuqmanPost your question BEX and B1 and classic SAP data source issues to the Integration Kit forum
-
Dynamic Header for a website. DOUBLE POINTS FOR ANSWER!!
I don't even know where to start with this one, let me try explain this:
I am looking for ideas on how to create some sort of dynamic header for an affiliate website, we have launched a new affiliate program for http://www.africancures.com/ the affiliate program is done through 1shoppingcart.com and each affiliate is given an ID like:
http://www.1shoppingcart.com/app/?af=812264
Once the affiliate signs up they choose their own website URL like: mikeshealth.com, then we point the affiliate URL mikeshealth.com to http://www.1shoppingcart.com/app/?af=812264 which in turn comes to our main website: http://www.africancures.com/ now here is where the problem comes in, how do I make the website display Mikes Health instead of African Cures .
I hope I was able to explain this well enough as it seems to be a bit confusing to me when I write it down. I really hope there is someone out there who has worked on something like this before or if there is someone who thinks they know how to do this.
Thank you
So here is something else I was thinking of, but I am not much of a programmer anymore:
Have a list of all the affiliate ids and their corresponding website names, eg:
Affiliate ID=812264 Website name= Mikes Health, then when someone comes to the site the jave works out which affiliate id sent them to the site, eg
Get(AffiliateID)from Refering.URL then Display.Header(AffiliateID) on main page, do you think you could help me now Sabre150?I'm still trying to see what this has to do with Java. Each host name such as mikeshealth.com will need to be registered with name servers with the IP address of www.1shoppingcart.com. Your web server will then need to be configured to perform perform any mapping.
Again, what has this to do with Java? -
Hi all,
I created an Adobe Form and defined on the MasterPage a header, a footer and a main area (content are) in-between. The areas were defined with a fixed size (somehow it was the only way because "fit height" and "fit width" was innactive).
Because the form is used in different countries the amount of information in the different areas is not the same. Therefore I am looking for a dynamic header and footer (and main area). That should help to optimise the space exploitation on a page. The header should grow from top of the page down, the footer bottom up and the main area fill the gap.
I know that this is a very sophisticated demand. Nevertheless, I hope that someone else had similar ideas and could solve that task.
I appreciate any help, hints and good advices which leads to a solution of my problem.
Thanks & regards,
PhilHi Andres,
thanks a lot for your quick answer!
In your MasterPage, add only the items that will remain static during the execution.
Every object that will behave in a dynamic manner should go in the BodyPage.
Very good hint, thanks!
What you can do is set a Subform with flowed Western Text between your Header/Footer
(Static) of your MasterPage. Within that main Subform set three more, "Western Text" as well.
One will be for your Dynamic Header, the middle one for your Main and the bottom one for your
Dynamic Footer.
I think I did not really get it! As far as I understand this works for one page...my form - when filled with data - can have more than one page!
Some questions came up when I read your solution:
1) why is the flowed content "western text" and not "top to bottom"?
2) what happens exactly with the area of the static header / footer? It's above the dynamic header and below dynamic footer -> is that space not wasted in the end?
3) The dynamic footer is directly below the main area - not necessarily at the bottom of the page!?
4) How is the "pagination" defined for each of the three dynamic areas (header / main / footer)?
I hope you'll find the time to answer my question soon!
Thanks & regards,
Phil
Maybe you are looking for
-
Page wise display through a query
hi all, i have a 3 records displayed block and i have more than 30 rows/records from a select query. i want display all the data page wise one by one by clicking specified 4 buttons . i have 4 buttons 1st for first page, 2nd for nest page, 3rd for la
-
hello gurus! Someboody can send me the program name for making performance analysis in queries and infocube, please? Thanks a lot. BR.
-
In report i should have to display only single country
Hello.. In myreport its dispalying company,costelemt and many more fields,users want some changes they have to display only one country and also courency also.they should have to enter the country name starting letter. thanks...
-
I received the second email notification, that my subscription payment was refused the second time, probably due to, that the related credit card is no longer exist. For buying Skype Credit I use a new credit card but probably the subscription renewa
-
Apache : One httpd process running as root instead of nobody
Hello, Running mediawiki under apache 2.2.8-2, I see strange messages saying that some files under /root/.texmf-var/ do not exist ! I was sure that apache was configured to run as the user nobody ! After doing a ps|grep, I get : # ps auxw | grep http