How to add the double headings in Alv Report.
Hi All,
Plz suggest me how to add the double headings in ALv Report.
Ram
Hi,
Try out this program....
REPORT ypm_historycard_rep.
TYPE-POOLS : slis.
DATA : it_cbm TYPE STANDARD TABLE OF mara.
DATA : it_layout TYPE STANDARD TABLE OF slis_layout_alv WITH HEADER LINE,
wa_fcat TYPE slis_fieldcat_alv,
it_fcat TYPE slis_t_fieldcat_alv.
START-OF-SELECTION.
SELECT *
FROM mara
INTO CORRESPONDING FIELDS OF TABLE it_cbm
where matnr = 'D80K7'.
END-OF-SELECTION.
it_layout-zebra = 'X'.
it_layout-colwidth_optimize = 'X'.
it_layout-f2code = '&ETA'.
APPEND it_layout.
DEFINE macro4fcat.
wa_fcat-col_pos = &1.
wa_fcat-fieldname = &2.
wa_fcat-tabname = &3.
wa_fcat-seltext_l = &4.
append wa_fcat to it_fcat.
clear wa_fcat.
END-OF-DEFINITION.
macro4fcat '1' 'MATNR' 'IT_CBM' 'MATERIAL NO' .
DESCRIBE TABLE it_cbm.
IF sy-ucomm = '&F03'.
MESSAGE 'hi hello good morning "press enter button" this is quiz' TYPE 'S'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
is_layout = it_layout
it_fieldcat = it_fcat
i_save = 'A'
TABLES
t_outtab = it_cbm
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 html_top_of_page
* text
* -->TOP text
FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
DATA: l_text(255) TYPE c.
DATA: text1(255) TYPE c.
DATA: t_header TYPE REF TO cl_dd_table_element ,
wa_header TYPE REF TO cl_dd_table_area.
CALL METHOD top->add_gap
EXPORTING
width = 10.
CALL METHOD top->add_text
EXPORTING
text = 'hello'
sap_style = 'HEADING'
CALL METHOD top->add_gap
EXPORTING
width = 20.
CALL METHOD top->add_text
EXPORTING
text = 'HOW ARE YOU'
sap_style = 'HEADING'.
CALL METHOD TOP->new_line
* EXPORTING
* repeat =
CALL METHOD top->add_gap
EXPORTING
width = 50.
CALL METHOD top->add_text
EXPORTING
text = '____________________________________________________________'
sap_style = 'HEADING'.
CALL METHOD TOP->new_line
* EXPORTING
* repeat =
CALL METHOD top->add_gap
EXPORTING
width = 90.
CALL METHOD top->add_text
EXPORTING
text = 'YOU CAN TRY LIKE THIS'
sap_style = 'HEADING'.
ENDFORM. "html_top_of_page
Regards
Debarshi
Similar Messages
-
How to get the actual data in ALV report
I am doing some upgradation work in that i am using Submit & And return and also i am using some function modules like LIST FROM MEMORY , LIST TO TXT wnd WRITE LIST , it gives output in normal list format , But i need to print in ALV report .
With the use of set table for 1st display i got the ALV report but not with actual data, (some junk value is showing) , So can any 1 suggest me how to get the actual data in ALV report, With the use of Any Function Module or with Coding,
with regards,Hi Saravana
I am sure you must be getting the values in tables of table parameters from every FM.
consolidate the values from tables of all FMs in one table and built ALV for that table only.
I hope this way you can show the actual data in ALV.
thanks
Lalit -
How to get the total pages in ALV report?
Hi guys,
Since I used page breaks can somebody please help me on how to get the total pages in ALV report?sincerely please...thanks guys.automatic display total page.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
r -
HOW TO ADD NEW VARIABLE DATAS ON ALV REPORT
Hi gurus,
I have cretaed one alv report using
REUSE_ALV_GRID_DISPLAY.
I HAVE CALCULATED SOME TOTALS AND STORED ON
ONE VARIABLE .
that variable name is 'toterror'.
now i want to add this variable on first line OF ALV REPORT.
that is i should get LIKE THIS.
PERNR TEXT ACTION [ TITLES OF FIELDS ].THEN
TOTAL ERROR RECORDS '900'.
THEN THE CORRESPONDING FIELDS DATA SHOULD BE DISPLAYED.
HELP ME.
THANKS IN ADVANCE.Hi
Thanks Ajeet.
The scenario is that I have to create a formula (contract end date-current date) and have to display the result using exeption to highlight the contracts ending in 30-60 days.
The problem is that the info provider does not have any infoobject for date(only valid to and validity start date)
I have created a formula variable on valid to date using replacement path. But dont have any variable to use for current date.
The only time char in the cube is Fiscal yera variant.
How should I go futher creating such formula? Shall I user customer exit variable? But I dont have any date char to create on.
Can you shed some light on this problem
Thanks -
How to extract the column width in ALv report if its executed in background
I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
I have executed in background and checked the spool and for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALVHi Deepthi,
you can try with the above mentioned suggestions ,if its worked its fine ,
If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
or you can use docking container alone for both operations.
Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
IF CCON IS INITIAL. (ccon is container name )
*Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
*Run in foreground
CREATE OBJECT CCON
EXPORTING
CONTAINER_NAME = 'CON1'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = parent_1.
ELSE.
*Run in background
CREATE OBJECT GRID1
EXPORTING
I_PARENT = G_DOCK1.
ENDIF.
ENDIF.
B&R,
Saravana.S -
How to print the Grid title in ALV Report?
Hi All,
I write ALV Report.When i am going to print this report it is not printing the Grid Header(ie.Title ).even in Print Preview Also i m not getting the title.It shows the Gird with Values.How Can i print the title Also...
Regards,RaviHi,
u will declare the data as below like this
DATA: LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA : ST_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
ST_EVENT TYPE SLIS_ALV_EVENT,
IT_EVENT TYPE SLIS_T_EVENT.
DATA : ST_LIST TYPE SLIS_LISTHEADER,
IT_LIST TYPE SLIS_T_LISTHEADER,
IT_LIST1 TYPE SLIS_T_LISTHEADER,
IT_LIST2 TYPE SLIS_T_LISTHEADER.
START-OF-SELECTION.
IF G_FLAG = SPACE.
W_REPID = SY-REPID.
G_TOP_PAGE = 'TOP-PAGE'.
ST_LIST-INFO = ' Title Name '.
APPEND ST_LIST TO IT_LIST.
ST_LIST-INFO = ' second Name'.
APPEND ST_LIST TO IT_LIST.
ELSE.
ENDIF.
FORM TOP-PAGE .
DATA: V_LOGO(15).
V_LOGO = 'LOGO'.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LIST
I_LOGO = V_LOGO.
I_END_OF_LIST_GRID =
ENDFORM. "TOP-PAGE -
How To Add the Double Quotation Marks Around a String
In the statement below, the recipientField.getEmailAddress() give me an e-mail address:
theEmailAddressList.add( recipientField.getEmailAddress() );The e-mail address has to be wrapped within a pair of double quotation marks. Therefore, I have to do the concatenation. Do I wrap each double quotation mark with a pair of single quotation marks?
theEmailAddressList.add( '"' + recipientField.getEmailAddress() + '"' );I do not understand.
I am asking if the statement below does what I intend to do:
theEmailAddressList.add( '"' + recipientField.getEmailAddress() + '"' ); -
How to add the "Source" information in our report!!??
Hello BW Exports,
My clients require the Source details also to be appeared in the report. As there are varied source systems for which we have generated a report.
Our clint requires the Source system details also to be displayed in the generated report eg: from XML,DB,Non-SAP syetms,SAP etc.. for all the reports.. as we have varied legacy systems!!
Plz let me know!!
Thanks & Regards,
Sapster.Hi Siva..
Thanks for ur response. yeah I remember now about this 0LOGSYS field details in a table called RSBASIDOC... thats a real good information for me.
But how is that we could actually get that data if we allot a place in our model.. are there any exits that we need to fill the data for it from that table to our target to make it available for reports??
Any other inputs from rest of the BW Experts Plzzz??
Thanks & Regards,
Sapster. -
How to add new fields to standard alv report
Hi,
Tcode(VL10G) .ie.out put list will not showing one new field.I want to add one more field to output list. append the field(VIKP-SDABW) In the SHP_VL10_ITEM structure .And write the logic in the exit LV50R_VIEWG05----
>USEREXIT_PREPARE_LAYOUT_FILL.Please expain what is the process?
Why i have write the code?what logic i will write?
Thanks & Regards,
sairamFORM ZI004_FIELDCAT_MOULD .
wa_fieldcat-fieldname = 'ZMLDCDID' . "Mould Code ID
wa_fieldcat-tabname = 'IT_MLDETAILS' .
wa_fieldcat-outputlen = 40 .
wa_fieldcat-seltext_l = text-010 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ZMLDID' . "Mould ID
wa_fieldcat-tabname = 'IT_MLDETAILS' .
wa_fieldcat-outputlen = 20 .
wa_fieldcat-seltext_l = text-011 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ZMLDCODE' . "Mould Code
wa_fieldcat-tabname = 'IT_MLDETAILS' .
wa_fieldcat-outputlen = 40 .
wa_fieldcat-seltext_l = text-012 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
endform. -
How to Add the cost centre in the KSBB report
Hi Experts,
How can we add cost centre in KSBB report. Is it possible to add? if yes could any one guide me how to add the cost centre in KSBB report?
waiting for your replies,
RegardsHi,
I see only three possible explanations:
a) no data on this cost centre
b) authorizations
c) 'hard-coded' filter in the relevant report (only if it's user-developed report)
Regards,
Eli -
How to add the REFRESH button in OOPs ALV grid
how to add the REFRESH button in OOPs ALV grid
Hi Naidu.
Check the below code:
Local Class Definition and implementation For events handeling
CLASS LCL_EVENT DEFINITION .
PUBLIC SECTION.
METHODS :TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT,
USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS.
CLASS LCL_EVENT IMPLEMENTATION.
METHOD TOOLBAR.
WA_TOOL-FUNCTION = 'ZFC1'.
WA_TOOL-TEXT = 'TEST'.
WA_TOOL-ICON = '@EA@'.
APPEND WA_TOOL TO E_OBJECT->MT_TOOLBAR.
ENDMETHOD. "DISPLAY
METHOD USER_COMMAND.
IF E_UCOMM = 'ZFC1'.
ENDIF.
ENDMETHOD. "USER_COMMAND
ENDCLASS. "LCL_EVENT IMPLEMENTATION
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZALV_BTON'.
SELECT * FROM VBAK INTO TABLE GT_VBAK
UP TO 30 ROWS.
**** CREATE CONTAINER OBJECT
CREATE OBJECT MY_CONTAINER
EXPORTING
CONTAINER_NAME = 'CC1'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6 .
****** GRID TO CONTAINER
CREATE OBJECT ALV
EXPORTING
I_PARENT = MY_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
CREATE OBJECT OBJ.
SET HANDLER : OBJ->TOOLBAR FOR ALV.
SET HANDLER : OBJ->USER_COMMAND FOR ALV.
****** ALV DISPLAY
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'VBAK'
CHANGING
IT_OUTTAB = GT_VBAK[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
* text
MODULE USER_COMMAND_0200 INPUT.
IF SY-UCOMM EQ 'BACK'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0200 INPUT
Regards
Kumar M -
working in Work order report, this report has different level , for example
0 level transaction
1 level transaction
in subtotal don't want to add 0 level transaction,
when I did the sub total it added all the level , so in sub total amount double up because of that
how to add the expression so I can the level 0 take out from sub total , so it does not include in sub total
can some one please help me with this
thanks in advanceHi Simon_ Hou
I tried the expr the way you suggested , it did not work getting error message, the exp I added is below
this the expression I added on sub total where is highlighted in Yellow, under Cost amount column,
I really appreciate the help
=Sum(IIF(Fields!COLLECTREFLEVEL.Value=
"0",0,Fields!CostAMOUNT.Value),"DataSet1")
please see below my QUERY, can you please help and let me know what I did wrong in my exp
SELECT PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
PRODCALCTRANS.LINENUM
FROM PRODTABLE INNER JOIN
PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID
WHERE (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
(PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate) -
How to find out the total, subtotal in alv report
hi dears,
how to find out the total, subtotal in alv report?
pls tell me logic ,
i will be waiting for eply
regards
eswarHi,
<b>ALV Grid List with sub-totals</b>
REPORT z_demo_alv_sort.
* This program lists orders (VBAK) with sort and sub-total for *
* 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG) *
TABLES : vbak.
TYPE-POOLS: slis. " ALV Global types
SELECT-OPTIONS :
s_vkorg FOR vbak-vkorg, " Sales organization
s_kunnr FOR vbak-kunnr, " Sold-to party
s_vbeln FOR vbak-vbeln. " Sales document
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA:
BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg, " Sales organization
kunnr LIKE vbak-kunnr, " Sold-to party
vbeln LIKE vbak-vbeln, " Sales document
netwr LIKE vbak-netwr, " Net Value of the Sales Order
waerk LIKE vbak-waerk, " Document currency
END OF gt_vbak.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
* Form f_read_data
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak
UP TO p_max ROWS
WHERE kunnr IN s_kunnr
AND vbeln IN s_vbeln
AND vkorg IN s_vkorg.
ENDFORM. " F_READ_DATA
* Form f_display_data
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-do_sum = &2.
ls_fieldcat-cfieldname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'NETWR' 'X' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
m_sort 'VKORG' 'X'. " Sort by vkorg and subtotal
m_sort 'KUNNR' 'X'. " Sort by kunnr and subtotal
m_sort 'VBELN' ''. " Sort by vbeln
ls_layout-cell_merge = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA
***************** END OF PROGRAM Z_DEMO_ALV_SORT **********************
Regards
Sudheer -
How to find the selected item in alv grid or table control
can any one tell me please
how to find the selected item in alv grid or table controlIn table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
IN PAI
LOOP AT it_tkhdr.
FIELD it_tkhdr-sel_row
MODULE tab_tkhdr_mark ON REQUEST.
ENDLOOP.
MODULE tab_tkhdr_mark INPUT.
MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
ENDMODULE. " tab_tkhdr_mark INPUT
here it_TKHDR is internal table sel_row is field for selection
After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
regards,
Gagan -
How to add Select event in dynamic ALV
Hi,
I have created dynamic ALV and now i want to checked the selected row value.
If in the selected row contain 'A' value then i have to disable the Button given on the screen.
If in the selected row contain B' value then i have to enable the Button given on the screen.
How to add the event once I select the row.
I have done like this . but it is not
lw_api_2->do_dynamic_navigation(
source_window_name = 'ZWDCHHR_EX_TASK_DELE'
source_vusage_name = 'ZWDVHHR_EX_TASK_DELE_USAGE_1'
source_plug_name = 'TO_ALV'
target_component_name = 'SALV_WD_TABLE'
target_component_usage = 'ALV_USAGE1'
target_view_name = 'TABLE'
target_plug_name = 'DEFAULT'
target_embedding_position = 'ZWDVHHR_EX_TASK_DELE/VIEW_DELEG_MY_TASKS' ).
register event handler
lw_cmp_usage_2->add_event_handler(
listener = lw_api_2
handler_name = 'ONSELECT_TAB1'
controller_name = 'INTERFACECONTROLLER'
event_name = 'ON_SELECT' ).
Thanks and regards
Amita GandhiHi Amita,
You can try fetch the number of the row which was leadselected through R_PARAM->INDEX. (This would be just a normal integer variable. You can try check this out in debugging mode. ) Now you can just read the data of this row from the context node by saying as GET_ATTRIBUTE up on the nodes reference with the index as R_PARAM->INDEX.
Regards,
Uday
Maybe you are looking for
-
BI and ECC Reconciliation report giving blank value instead of ZERO
Hi, We have a report for reconciliation where in if the ECC and BI balance matches, it will show Zero (0) in the final field. My question is *for some of them it is showing Zero(0) and for few rows it is givng blank values* even after ECC and BI b
-
I wonder if anyone has a solution for this problem. My friend got a great Core 2 black macbook for Christmas, and he loves it. But lately it's having word processing problems, and that's very bad since he's a writer. First, Word for Mac took forever
-
Hi Win2003 EEx64 10gR2 (RAC) On RAC1 every think works fine but on rac2..... D:\oracle\product\db\BIN>emctl start dbconsole Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0 Copyright (c) 1996, 2006 Oracle Corporation. All rights rese
-
Recovery of photos after reformatting
Hi, I had to reformat and reinstall Snow Leopard OS X 10.6.8 after a hard drive problem. Unfortunately I have not backed up my photos and videos as I was using the mac rarely so I thought nothing can go wrong. Now I know better! I would like to know
-
Service Reuqest Custom Fields on Reports
Hi, I Added 3 new custom fields of type "Integer" to Service Reuqest. Now, when I come to combine them in an analysis (Going to Reports -> Design Analysis -> under REPORTING choosing "Service Reuqests" I can't see these fields, when looking in "Servi