Sub Headings in ALV
Dear friends,
Can i present ALV output with Main Heading and within there r subheadings like the following ?
Main Heading 01 Main Heading 02
Sub Head1 Sub Head2 sub Head3 sub Head4 sub Head5
In addition, can i print ALV output which is more than 255 characters long in A3 paper size, when i try to print there is no format available with more than 255 characters and columns gets truncated.
Kindly suggest,
Regards,
Praveen Lobo
Hi,
Using alv tree concept it is possible..
In sap standard layout allowed only 255 charters only.
Download your page in pdf format or same other format and take print out.
Regards,
Anki Reddy.
Similar Messages
-
Hi,
How to display sub headings in alv grid
output format should be:
<COL_HEADING1> <COL_HEADING2>
<SUB_HEADING1> <SUB_HEADING2> <SUB_HEADING1><SUB_HEADING2>
and i want separate templet with side headings?
could you tell me grid supports this?
thanks in advance
cheers
sriniHi Srinivas,
Look ALV grid Multiple Header ... ? which has got a slightly more comprehensive information
Regards,
Anand Mandalika. -
Hello Experts,
I am preparing a ALV report in that i want to display fields in a such a way that
under a heading i need to have two sub headings ie, for example under a material heading
i need to display material no and code as separate coloumn but both should look like
single coloumn under heading Material.Hi Dude,
For first header
wa_hader-type = 'H'.
wa_hader-info = 'Main Headding'.
append wa_heaer to it_header.
For Sub header
wa_hader-type = 'S'.
wa_hader-info = Sub Headding1.
append wa_heaer to it_header.
Finally call the function module
Reuse_Alv_commentray_write function module
then pass the parameter
exporting
it_list_commentary = it_header.
Try this
Hope it will work....
Thanks & Regards
Ramakrishna Pathi -
Hi,
Can any one tell me about the possibility to display sub headings for an ALV grid control i.e to have a group of columns under one column similar to the feature in excel?
Regards,
SujathaHi Sujatha, also check this code.
REPORT ZALV5_OBJECTS.
TABLES : EKKO.
TYPE-POOLS : SLIS.
TYPES : BEGIN OF TY_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 TY_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
IT_EKPO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
IT_EMPTYTAB TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
WA_EKKO TYPE TY_EKKO,
WA_EKPO TYPE TY_EKKO.
DATA: OK_CODE LIKE SY-UCOMM, "OK-Code
SAVE_OK LIKE SY-UCOMM.
*ALV data declarations
DATA: FIELDCATALOG TYPE LVC_T_FCAT WITH HEADER LINE.
DATA: GD_FIELDCAT TYPE LVC_T_FCAT,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
*ALVtree data declarations
CLASS CL_GUI_COLUMN_TREE DEFINITION LOAD.
CLASS CL_GUI_CFW DEFINITION LOAD.
DATA: GD_TREE TYPE REF TO CL_GUI_ALV_TREE,
GD_HIERARCHY_HEADER TYPE TREEV_HHDR,
GD_REPORT_TITLE TYPE SLIS_T_LISTHEADER,
GD_LOGO TYPE SDYDO_VALUE,
GD_VARIANT TYPE DISVARIANT.
*Create container for alv-tree
DATA: GD_TREE_CONTAINER_NAME(30) TYPE C,
GD_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
*Includes
*INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
*INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
*INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
*Start-of-selection.
START-OF-SELECTION.
ALVtree setup data
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
PERFORM BUILD_HIERARCHY_HEADER CHANGING GD_HIERARCHY_HEADER.
PERFORM BUILD_REPORT_TITLE USING GD_REPORT_TITLE GD_LOGO.
PERFORM BUILD_VARIANT.
Display ALVtree report
CALL SCREEN 100.
*& Form data_retrieval
text
--> p1 text
<-- p2 text
FORM DATA_RETRIEVAL .
SELECT EBELN
UP TO 10 ROWS
FROM EKKO
INTO CORRESPONDING FIELDS OF TABLE IT_EKKO.
LOOP AT IT_EKKO INTO WA_EKKO.
SELECT EBELN EBELP STATU AEDAT MATNR MENGE MEINS NETPR PEINH
FROM EKPO
APPENDING TABLE IT_EKPO
WHERE EBELN EQ WA_EKKO-EBELN.
ENDLOOP.
ENDFORM. " data_retrieval
*& Form build_fieldcatalog
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG .
Please not there are a number of differences between the structure of
ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
For example the field seltext_m is replace by scrtext_m in ALVtree.
FIELDCATALOG-FIELDNAME = 'EBELN'. "Field name in itab
FIELDCATALOG-SCRTEXT_M = 'Purchase Order'. "Column text
FIELDCATALOG-COL_POS = 0. "Column position
FIELDCATALOG-OUTPUTLEN = 15. "Column width
FIELDCATALOG-EMPHASIZE = 'X'. "Emphasize (X or SPACE)
FIELDCATALOG-KEY = 'X'. "Key Field? (X or SPACE)
fieldcatalog-do_sum = 'X'. "Sum Column?
fieldcatalog-no_zero = 'X'. "Don't display if zero
APPEND FIELDCATALOG TO GD_FIELDCAT.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELP'.
FIELDCATALOG-SCRTEXT_M = 'PO Iten'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 1.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'STATU'.
FIELDCATALOG-SCRTEXT_M = 'Status'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 2.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'AEDAT'.
FIELDCATALOG-SCRTEXT_M = 'Item change date'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 3.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MATNR'.
FIELDCATALOG-SCRTEXT_M = 'Material Number'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 4.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MENGE'.
FIELDCATALOG-SCRTEXT_M = 'PO quantity'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 5.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MEINS'.
FIELDCATALOG-SCRTEXT_M = 'Order Unit'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 6.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'NETPR'.
FIELDCATALOG-SCRTEXT_M = 'Net Price'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 7.
FIELDCATALOG-DATATYPE = 'CURR'.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'PEINH'.
FIELDCATALOG-SCRTEXT_M = 'Price Unit'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 8.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
ENDFORM. " build_fieldcatalog
*& Form build_layout
text
--> p1 text
<-- p2 text
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 build_hierarchy_header
text
<--P_GD_HIERARCHY_HEADER text
FORM BUILD_HIERARCHY_HEADER CHANGING
P_HIERARCHY_HEADER TYPE TREEV_HHDR.
P_HIERARCHY_HEADER-HEADING = 'Hierarchy Header'(013).
P_HIERARCHY_HEADER-TOOLTIP = 'This is the Hierarchy Header !'(014).
P_HIERARCHY_HEADER-WIDTH = 30.
P_HIERARCHY_HEADER-WIDTH_PIX = ''.
ENDFORM. " build_hierarchy_header
*& Form build_report_title
text
-->P_GD_REPORT_TITLE text
-->P_GD_LOGO text
FORM BUILD_REPORT_TITLE USING PT_REPORT_TITLE TYPE SLIS_T_LISTHEADER
P_GD_LOGO TYPE SDYDO_VALUE.
DATA: LS_LINE TYPE SLIS_LISTHEADER,
LD_DATE(10) TYPE C.
List Heading Line(TYPE H)
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
ls_line-key "Not Used For This Type(H)
LS_LINE-INFO = 'PO ALVTree Display'.
APPEND LS_LINE TO PT_REPORT_TITLE.
Status Line(TYPE S)
LD_DATE(2) = SY-DATUM+6(2).
LD_DATE+2(1) = '/'.
LD_DATE3(2) = SY-DATUM4(2).
LD_DATE+5(1) = '/'.
LD_DATE+6(4) = SY-DATUM(4).
LS_LINE-TYP = 'S'.
LS_LINE-KEY = 'Date'.
LS_LINE-INFO = LD_DATE.
APPEND LS_LINE TO PT_REPORT_TITLE.
Action Line(TYPE A)
CLEAR LS_LINE.
LS_LINE-TYP = 'A'.
CONCATENATE 'Report: ' SY-REPID INTO LS_LINE-INFO SEPARATED BY SPACE.
APPEND LS_LINE TO PT_REPORT_TITLE.
ENDFORM. " build_report_title
*& Form build_variant
text
--> p1 text
<-- p2 text
FORM BUILD_VARIANT .
Set repid for storing variants
GD_VARIANT-REPORT = SY-REPID.
ENDFORM. " build_variant
cheers,
Hema. -
hi friends,
I have to use sub-headings in the grid display.
please help me how to use the function REUSE_ALV_HIERSEQ_LIST_DISPLAY
for that.
! vendors from gujarat ! vendor from outof guj. !
! amount ! tax ! Discount ! Total ! amount ! tax ! Discount ! Total !
Please help.
thankshttps://forums.sdn.sap.com/click.jspa?searchID=20825514&messageID=6822637
Check this.
hope it helps. -
Sub columns in alv grid display
hi everyone,
can anyone tell me the way in which we can include sub-column headings in alv grid display. i.e., for example as shown below.
column1 column2 column3
scol1 scol2 scol3 scol4 scol5 scol6........................
thanks in advance. Here we are generating the column headings by using fm field catalog merge.
regards,
rajsekhar.kcheck this thread, check the sample code in my post
Re: multiple headers in ALV. -
Getting Main Heading and Under that sub heading In ALV-Display
Hi All,
I have a requirement to get ALV display with Main Headings and Under each Main heading there are Sub headings.
The Output is somewhat like shown below
Costing view | MEQ1 View
VER. ID | Desc. VER. ID | Desc.
If some one had already done such coding please help.
Its Urgent.
Thanks In Advance,
ShyamYou can use FM 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'.
Have a look at below report.
REPORT z_alv_hierseq_list.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(02) TYPE n DEFAULT '10' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
CONSTANTS :
c_x VALUE 'X'.
TYPES :
1st Table
BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln, " Sales document
kunnr TYPE vbak-kunnr, " Sold-to party
netwr TYPE vbak-netwr, " Net Value of the Sales Order
waerk TYPE vbak-waerk, " SD document currency
END OF ty_vbak,
2nd Table
BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln, " Sales document
posnr TYPE vbap-posnr, " Sales document
matnr TYPE vbap-matnr, " Material number
netwr TYPE vbap-netwr, " Net Value of the Sales Order
waerk TYPE vbap-waerk, " SD document currency
END OF ty_vbap.
DATA :
1st Table
gt_vbak TYPE TABLE OF ty_vbak,
2nd Table
gt_vbap TYPE TABLE OF ty_vbap.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
Read Sales Document: Header Data
SELECT vbeln kunnr netwr waerk
FROM vbak
UP TO p_max ROWS
INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
IF NOT gt_vbak[] IS INITIAL.
Read Sales Document: Item Data
SELECT vbeln posnr matnr netwr waerk
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE gt_vbap
FOR ALL ENTRIES IN gt_vbak
WHERE vbeln = gt_vbak-vbeln.
ENDIF.
PERFORM f_display.
Form F_DISPLAY
FORM f_display.
TYPE-POOLS: slis. " ALV Global types
Macro definition
DEFINE m_fieldcat.
ls_fieldcat-tabname = &1.
ls_fieldcat-fieldname = &2.
ls_fieldcat-ref_tabname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
ls_sort-tabname = &1.
ls_sort-fieldname = &2.
ls_sort-up = c_x.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_layout TYPE slis_layout_alv,
ls_keyinfo TYPE slis_keyinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
lt_sort TYPE slis_t_sortinfo_alv," Sort table
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv." Field catalog
ls_layout-group_change_edit = c_x.
ls_layout-colwidth_optimize = c_x.
ls_layout-zebra = c_x.
ls_layout-detail_popup = c_x.
ls_layout-get_selinfos = c_x.
Build field catalog and sort table
m_fieldcat 'GT_VBAK' 'VBELN' 'VBAK'.
m_fieldcat 'GT_VBAK' 'KUNNR' 'VBAK'.
m_fieldcat 'GT_VBAK' 'NETWR' 'VBAK'.
m_fieldcat 'GT_VBAK' 'ERDAT' 'VBAK'.
m_fieldcat 'GT_VBAK' 'WAERK' 'VBAK'.
m_fieldcat 'GT_VBAP' 'POSNR' 'VBAP'.
m_fieldcat 'GT_VBAP' 'MATNR' 'VBAP'.
m_fieldcat 'GT_VBAP' 'NETWR' 'VBAP'.
m_fieldcat 'GT_VBAP' 'WAERK' 'VBAP'.
m_sort 'GT_VBAK' 'KUNNR'.
m_sort 'GT_VBAP' 'NETWR'.
ls_keyinfo-header01 = 'VBELN'.
ls_keyinfo-item01 = 'VBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
i_tabname_header = 'GT_VBAK'
i_tabname_item = 'GT_VBAP'
is_keyinfo = ls_keyinfo
TABLES
t_outtab_header = gt_vbak
t_outtab_item = gt_vbap
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. " F_LIST_DISPLAY
FORM USER_COMMAND *
FORM user_command USING i_ucomm TYPE sy-ucomm
is_selfield TYPE slis_selfield. "#EC CALLED
DATA ls_vbak TYPE ty_vbak.
CASE i_ucomm.
WHEN '&IC1'. " Pick
CASE is_selfield-tabname.
WHEN 'GT_VBAP'.
WHEN 'GT_VBAK'.
READ TABLE gt_vbak INDEX is_selfield-tabindex INTO ls_vbak.
IF sy-subrc EQ 0.
Sales order number
SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
Display Sales Order
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. " USER_COMMAND
END OF PROGRAM Z_ALV_HIERSEQ_LIST ***********************
Best Regards,
Vibha
*Please mark all the helpful answers -
More than one Row Field headings in ALV
Hello Everyone,
i have one requirement wher i need to give more than one row of field heading. one main heading and sub field headings. Following is structure which will give an idea.
Current PIR Quantities| -> Main heading
Qty1|Date1Qty2|Date2| -> Sub headings
| | | | -> report values will come here
| | | | -> -
do----
Can you please let me know how can we get this lay out in field catalogue for field headings??
Thanks in Advance
Siva
Message was edited by:
Siva VelamaHi Atish,
Thanks for your reply. i dont have data in two levels for Hierarchial-sequential ALV. Data is just one row. But field headings(fieldcatalogue in alv) will have two rows. That means one row of main headings and second row with detailed fields. One main heading may have more than one subheading. ultimately we display values for Subheading fields.
hope you have understood the requirement.
Thanks
Siva -
FIeld headings in ALV Grid by label
Hi
I want disply the headings in alv grid display like this format.
I want write my own label in the output. (not in Normal LIST DISPLAY)
Sno | Sname | Marks
| | M1 | M2 | M3
How it is possible?
Edited by: Krishna Bommisetty on Sep 11, 2008 10:55 AMHi,
Check the below code.
WA_FCAT-SELTEXT_M = TEXT-073.
WA_FCAT-DDICTXT = 'M'.
We can define the name of the field label as mentioned above, where texto073 is nothing but the field label you want to give to the particular field.
DDICTXT you have to mention the length as small 'S', medium 'M' and large as 'L'. -
How to add the double headings in Alv Report.
Hi All,
Plz suggest me how to add the double headings in ALv Report.
RamHi,
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 -
Hi Max,
If you remember in one of my last post I asked for changing the column headings in ALV display for example from 'Material' to 'Material used'.
I am using
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = repid
IT_FIELDCAT = field_body
I_SAVE = g_save
IS_VARIANT = g_variant
IT_EVENTS = events
TABLES
T_OUTTAB = itab.
And you suggested me the following way....
loop at field_body into field_wa.
case field_wa-fieldname.
when 'Material'.
field_wa-seltext_l = 'Material used'.
field_wa-seltext_m = 'Material used'.
field_wa-seltext_s = 'Material used'.
endcase.
modify field_body from field_wa.
endloop.
It is working well. In ALV display the column heading is changed to what I wanted. But the question is when I export the displayed ALV to Excel using ALV functionality, Export->Spreadsheet... I see that <b>I dont get the Column Heading into Excel as it was in the ALV display.</b>
I get in the Excel as 'Material u' or 'Mat. Used'. But when I add this line in the code.....
when 'Material'.
field_wa-seltext_l = 'Material used'.
field_wa-seltext_m = 'Material used'.
field_wa-seltext_s = 'Material used'.
<b> field_wa-outputlen = 20.</b>
Then I see that I get the complete heading in the Excel. But this way the columns with outputlen 20 are taking much space in ALV display.
Is there any fix for this. May be not mentioning the outputlen but still get the column headings into Excel as it was in ALV display.
Anyone with ideas please respond. Waiting for replies. ThanksHi
The labels have a fixed size:
seltext_l is long text: 20 char
seltext_m is medium text: 15 char
seltext_s is short text: 10 char
The text 'Material used' is long 13 char so you should write:
field_wa-seltext_l = 'Material used'.
field_wa-seltext_m = 'Material used'.
field_wa-seltext_s = 'Mat. used'.
You can try to set the field colwidth_optimize of parameter IT_LAYOUT.
This field should optimize the width of the colunm
So
data layout type SLIS_LAYOUT_ALV.
layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = repid
IT_LAYOUT = layout
IT_FIELDCAT = field_body
I_SAVE = g_save
IS_VARIANT = g_variant
IT_EVENTS = events
TABLES
T_OUTTAB = itab.
and you can decide which label has to be used:
field_wa-seltext_l = 'Material used'.
field_wa-seltext_m = 'Material used'.
field_wa-seltext_s = 'Mat. used'.
If you want to set the short text
field_wa-ddictxt = 'S'.
...medium
field_wa-ddictxt = 'M'.
...long
field_wa-ddictxt = 'L'.
Max -
hi,
i am making report in alv in which i have to display the sub totals and den full total.
is it possible to display sub total in ALV acccording to material type wise or itemid wise.
plzz help me with some example.
If find useful he or she will definately rewarded.........Hi,
The following example for sub totall for ALV report..
u have to pass do_sum = 'X'. for perticuler fileds.
if it is use full answer reward me a points..
*& Report ZDEL_ALV1
*Description: This ALV interactive report is display Delivary
status
REPORT zdel_alv1 NO STANDARD PAGE HEADING LINE-SIZE 255 LINE-COUNT 60.
*TABLE DECLARATION
TABLES : likp, "Delivery Header Data
lips, "Delivery item Data
vbup. "sales document item status
TYPE-POOLS : slis.
*SRUCTURE DECLARATION
*THIS TABLE FOR HEADER DETAILS
TYPES : BEGIN OF t_likp ,
vbeln LIKE likp-vbeln, "Delivery number
kosta like vbup-kosta,
kunnr LIKE likp-kunnr, "Customer number
wadat LIKE likp-wadat, "Planned goods movement date
ernam LIKE likp-ernam, "Name of person
vkorg LIKE likp-vkorg, "Sales organization
lfart LIKE likp-lfart, "DELIVERY TYPE
ntgew LIKE likp-ntgew, "NET WEIGHT
END OF t_likp.
*THIS TABLE FOR ITEM DETAILS
TYPES : BEGIN OF t_lips ,
vbeln LIKE lips-vbeln, "Delivery number
posnr LIKE lips-posnr, "delivery item
matnr LIKE lips-matnr, "Material number
lfimg LIKE lips-lfimg, "Actual quantity delivered
ntgew LIKE lips-ntgew, "Net weight
exbwr LIKE lips-exbwr, "Externally entered posting amount
arktx LIKE lips-arktx, "Short text SO Item
END OF t_lips.
*THIS IS FOR FINAL OUTPUT
TYPES : BEGIN OF t_vbup ,
vbeln LIKE likp-vbeln, "Delivery number
kosta LIKE vbup-kosta, "Picking status/Putaway status
posnr LIKE vbup-posnr, "delivery item
matnr LIKE lips-matnr, "Material number
lfimg LIKE lips-lfimg, "Actual quantity delivered
ntgew LIKE lips-ntgew, "Net weight
exbwr LIKE lips-exbwr, "Externally entered posting amount
arktx LIKE lips-arktx, "SHORT text SO Item
description(20), "for display text
END OF t_vbup.
*INTERNAL TABLES
DATA : i_likp TYPE STANDARD TABLE OF t_likp.
DATA : i_lips TYPE STANDARD TABLE OF t_lips.
DATA : i_vbup TYPE STANDARD TABLE OF t_vbup.
DATA : repid LIKE sy-repid.
DATA : delivar1(10) TYPE c.
*WORK AREA
DATA : wa_likp TYPE t_likp.
DATA : wa_lips TYPE t_lips.
DATA : wa_vbup TYPE t_vbup.
DATA: i_vbup1 LIKE wa_vbup OCCURS 0 WITH HEADER LINE.
*SLIS TABLE DECLARATIONS
DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
i_events TYPE slis_t_event,
w_events TYPE slis_alv_event,
i_fieldcat1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
i_layout TYPE slis_layout_alv.
*SELECTING RANGE OF VALUES
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_vbeln FOR likp-vbeln,
s_kunnr FOR likp-kunnr,
s_wadat FOR likp-wadat.
SELECTION-SCREEN END OF BLOCK b1 .
*CHOOSE ONE CHECK BOX FOR DISPLAYING THE DELIVARY STATUS
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : cb_kostc AS CHECKBOX,"DEFAULT 'X',
cb_kosta AS CHECKBOX,
cb_kostb AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b2.
*INTIALIZATION CHECK
INITIALIZATION.
repid = sy-repid.
*START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_field.
PERFORM GET_EVENTS.
PERFORM display.
*END-OF-SELECTION
END-OF-SELECTION.
*& Form RUCOMM
This form getting details from lips table for displaying
the item details and all select statements for delivary status
-->R_UCOMM text
-->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield.
IF rs_selfield-fieldname = 'VBELN'.
delivar1 = rs_selfield-value.
ENDIF.
IF cb_kostc = 'X'.
SELECT VBELN KOSTA FROM VBUP
INTO TABLE I_VBUP
WHERE VBELN IN DELIVAR
AND KOSTA = 'C'.
SELECT VBELN MATNR LFIMG EXBWR INTO TABLE I_LIPS FROM LIPS
WHERE VBELN EQ DELIVAR1.
REFRESH i_vbup1[].
CLEAR i_vbup1.
SELECT avbeln akosta bposnr bmatnr blfimg bntgew b~exbwr
b~arktx
INTO TABLE i_vbup
FROM vbup AS a INNER JOIN lips AS b
ON avbeln = bvbeln
WHERE a~vbeln EQ delivar1
AND kosta = 'C'.
ELSEIF cb_kosta = 'X'.
SELECT VBELN KOSTA FROM VBUP
INTO TABLE I_VBUP
WHERE VBELN IN DELIVAR
AND KOSTA = 'A'.
SELECT avbeln akosta bposnr bmatnr blfimg bntgew b~exbwr
b~arktx
INTO TABLE i_vbup
FROM vbup AS a INNER JOIN lips AS b
ON avbeln = bvbeln
WHERE a~vbeln EQ delivar1
AND kosta = 'A'.
ELSEIF cb_kostb = 'X'.
SELECT VBELN KOSTA FROM VBUP
INTO TABLE I_VBUP
WHERE VBELN IN DELIVAR
AND KOSTA = 'B'.
SELECT avbeln akosta bposnr bmatnr blfimg bntgew b~exbwr
b~arktx
INTO TABLE i_vbup
FROM vbup AS a INNER JOIN lips AS b
ON avbeln = bvbeln
WHERE a~vbeln EQ delivar1
AND kosta = 'B'.
ENDIF.
CLEAR i_vbup1.
LOOP AT i_vbup INTO wa_vbup.
i_vbup1-vbeln = wa_vbup-vbeln.
i_vbup1-kosta = wa_vbup-kosta.
IF wa_vbup-kosta = 'C'.
i_vbup1-description = 'COMPLETELY PROCESSED'.
ELSEIF wa_vbup-kosta = 'B'.
i_vbup1-description = 'PARTIALLY PROCESSED'.
ELSEIF wa_vbup-kosta = 'A'.
i_vbup1-description = 'NOT YET PROCESSED'.
ENDIF.
i_vbup1-posnr = wa_vbup-posnr.
i_vbup1-matnr = wa_vbup-matnr.
i_vbup1-lfimg = wa_vbup-lfimg.
i_vbup1-ntgew = wa_vbup-ntgew.
i_vbup1-exbwr = wa_vbup-exbwr.
i_vbup1-arktx = wa_vbup-arktx.
APPEND i_vbup1 .
ENDLOOP.
SORT i_vbup1 BY vbeln matnr lfimg.
DELETE ADJACENT DUPLICATES FROM i_vbup1 COMPARING vbeln matnr lfimg.
SELECT VBELN MATNR LFIMG EXBWR INTO TABLE I_LIPS FROM LIPS
WHERE VBELN EQ DELIVAR1.
*This function module for displaying the item details
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
it_fieldcat = i_fieldcat1[]
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_user_command = 'USER_COMMAND1'
it_events = i_events
TABLES
t_outtab = i_vbup1
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.
CLEAR i_vbup1.
ENDFORM. "RUCOMM
*& Form USER_COMMAND1
text
-->R_UCOMM1 text
-->RS_SELFIELDtext
FORM user_command1 USING r_ucomm1 LIKE sy-ucomm rs_selfield1 TYPE
slis_selfield.
DATA: deliv(10) TYPE c.
IF rs_selfield1 = 'VBELN'.
deliv = rs_selfield1-value.
ENDIF.
SET PARAMETER ID 'VL' FIELD delivar1.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDFORM. "USER_COMMAND1
*& Form GET_DATA
This form for getting the data from likp table
--> p1 text
<-- p2 text
FORM get_data .
SELECT VBELN KUNNR WADAT FROM LIKP INTO TABLE I_LIKP
WHERE VBELN IN S_VBELN
AND KUNNR IN S_KUNNR
AND WADAT IN S_WADAT.
REFRESH i_likp[].
CLEAR i_likp.
IF cb_kostc = 'X' AND cb_kosta = ' ' AND cb_kostb = ''.
SELECT avbeln akosta bkunnr bwadat bernam bvkorg blfart bntgew
INTO TABLE i_likp
FROM vbup AS a INNER JOIN likp AS b
ON avbeln = bvbeln
WHERE
b~kunnr IN s_kunnr
AND b~vbeln IN s_vbeln
AND b~wadat IN s_wadat
AND a~kosta = 'C'.
ELSEIF cb_kosta = 'X' AND cb_kostb = ' ' AND cb_kostc = ''.
SELECT avbeln akosta bkunnr bwadat bernam bvkorg blfart bntgew
INTO TABLE i_likp
FROM vbup AS a INNER JOIN likp AS b
ON avbeln = bvbeln
WHERE
b~kunnr IN s_kunnr
AND b~vbeln IN s_vbeln
AND b~wadat IN s_wadat
AND a~kosta = 'A'.
ELSEIF cb_kostb = 'X' AND cb_kosta = '' AND cb_kostc = ''.
SELECT avbeln akosta bkunnr bwadat bernam bvkorg blfart bntgew
INTO TABLE i_likp
FROM vbup AS a INNER JOIN likp AS b
ON avbeln = bvbeln
WHERE
b~kunnr IN s_kunnr
AND b~vbeln IN s_vbeln
AND b~wadat IN s_wadat
AND kosta = 'B'.
ELSEIF cb_kostc = 'X' AND cb_kosta = 'X' AND cb_kostb = 'X'.
SELECT avbeln akosta bkunnr bwadat bernam bvkorg blfart bntgew
INTO TABLE i_likp
FROM vbup AS a INNER JOIN likp AS b
ON avbeln = bvbeln
WHERE
b~kunnr IN s_kunnr
AND b~vbeln IN s_vbeln
AND b~wadat IN s_wadat
AND kosta NE ' '.
ENDIF.
DELETE ADJACENT DUPLICATES FROM i_likp.
ENDFORM. " GET_DATA
*& Form GET_FIELD
This form for defining the every fields from likp & lips tables
FORM get_field .
*This fields are retrieving from header table(likp)
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'VBELN'.
i_fieldcat-seltext_m = 'SALES ORDER NO'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'KUNNR'.
i_fieldcat-seltext_m = 'CUSTOMER NO'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'WADAT'.
i_fieldcat-seltext_m = 'DATE'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'ERNAM'.
i_fieldcat-seltext_m = 'NAME OF PERSON'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'VKORG'.
i_fieldcat-seltext_m = 'SALES ORGANIZATION'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'LFART'.
i_fieldcat-seltext_m = 'DELIVERY TYPE'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-fieldname = 'NTGEW'.
i_fieldcat-seltext_m = 'NET WEIGHT'.
i_fieldcat-do_sum = 'X'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
*This fields are retrieving from item table(lips)
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'VBELN'.
i_fieldcat1-seltext_m = 'DELIVAR NO'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'POSNR'.
i_fieldcat1-seltext_m = 'DELIVERY ITEM'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'MATNR'.
i_fieldcat1-seltext_m = 'MATERIAL NO'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'LFIMG'.
i_fieldcat1-seltext_m = 'ACTUAL QUANTITY'.
i_fieldcat1-do_sum = 'X'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'NTGEW'.
i_fieldcat1-seltext_m = 'NET WEIGHT'.
i_fieldcat1-do_sum = 'X'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'EXBWR'.
i_fieldcat1-seltext_m = 'AMOUNT'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'ARKTX'.
i_fieldcat1-seltext_m = 'SHORT TEXT FOR so ITEM'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
i_fieldcat1-fieldname = 'DESCRIPTION'.
i_fieldcat1-seltext_m = 'PICKING STATUS'.
APPEND i_fieldcat1 TO i_fieldcat1.
CLEAR i_fieldcat1.
ENDFORM. " GET_FIELD
*& Form GET_EVENTS
This form defining the events
*FORM GET_EVENTS .
CLEAR W_EVENTS.
W_EVENTS-NAME = 'USER_COMMAND'.
W_EVENTS-FORM = 'RUCOMM'.
APPEND W_EVENTS TO I_EVENTS.
*ENDFORM. " GET_EVENTS
*& Form DISPLAY
This form is going to display header details from likp table
FORM display .
*This function module for displaying the header details
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = i_fieldcat[]
i_save = 'X'
it_events = i_events
TABLES
t_outtab = i_likp
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
*& Form TOP-OF-PAGE
This form is going to display top-of-page header text
FORM top-of-page.
DATA: i_list_comments TYPE slis_t_listheader.
DATA: w_list_comments TYPE slis_listheader.
CLEAR: i_list_comments[].
w_list_comments-typ = 'H'. "H=Header, S=Selection, A=Action
w_list_comments-info = 'DELIVERY ORDER DETAILS'.
APPEND w_list_comments TO i_list_comments.
w_list_comments-typ = 'A'. " H = Header, S = Selection, A = Action
w_list_comments-info = 'Basic list'.
APPEND w_list_comments TO i_list_comments.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'enjoy'
it_list_commentary = i_list_comments.
ENDFORM. "TOP-OF-PAGE
*& Form TOP_OF_PAGE
This form is going to display top-of-page item text
FORM top_of_page.
DATA: i_list_comments TYPE slis_t_listheader.
DATA: w_list_comments TYPE slis_listheader.
DATA : i_line LIKE w_list_comments-info.
CONCATENATE 'DELIVERY ITEM DETAILS :' delivar1 INTO i_line .
SEPARATED BY SPACE.
CLEAR: i_list_comments[].
w_list_comments-typ = 'H'. "H=Header, S=Selection, A=Action
w_list_comments-info = i_line.
APPEND w_list_comments TO i_list_comments.
w_list_comments-typ = 'A'. " H = Header, S = Selection, A = Action
w_list_comments-info = 'Secondary list'.
APPEND w_list_comments TO i_list_comments.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'enjoy'
it_list_commentary = i_list_comments.
ENDFORM. "TOP_OF_PAGE -
Interactive sub headings back and forth
Dear All,
I'm working on an ePub in InDesign CC and have chapter headings with sub headings under them. I would like people to be able to tap a sub-heading and jump ahead to that page with an interactive hyperlink, and I have successfully incorporated that interaction. Now I want my reader to be able to jump back to the sub-headings list so that they can choose another sub heading and jump ahead to that page, but I can't seem to do that. How can I accomplish a back and forth interaction from sub-heading list to heading and then back to sub-heading list? I've tried cross reference, but I don't think that's what I need to accomplish this task. Thanks.
Small Town GalDear Ariel,
InDesign CC seems more than a little quirky in this procedure, but I was finally able to get it to work. I have created my own website with Dreamweaver and have used hyperlinks in PDFs, so I am familiar with how to use them, but for some reason they sometimes don't show up in the hyperlinks panel in InDesgn CC after they are created, or the "reset" button doesn't clear up any errors. Deleting and re-creating seemed to be the only solution for one particular link, because it kept locating the wrong link rather than the one that I wanted. I finally got it cleared out and now everything works as I planned.
Also, I am working with an ePub, not a PDF. I find the PDFs easier to work with, although I realize that both PDF and ePub can be exported from the same document, but I'm slogging my way through. From past experience, it seemed to me that a two-way hyperlink should work, but it took me a bit of trying to find the correct combinations to accomplish it! Thanks again.
Small Town Gal -
Hi,
I am using key figures in Lead column,I would like to have sub heading in between the key figures, I tried in last screen of layout but its not saving. Can anyone help me out please.
My requirement
Revenue(key figure)
Grosmargin(KF)
REVENUE DRIVERS( Sub Headings)
Volume adjsutment(KF)
Price Adjustment(KF)
FORECAST BUSINESS( Sub Headings)
KF
KF
Thanks in Advance
Imranwhat do you mean "char as comparison"
If you select key figure in kea column, you can add also a char to the key column (first page of layout builder)
Then you got to the second page and for each key column-line you have to select the key figure and a value of the char.
If you use a char that ist normally restricted in header to a single value, you could put this one into the key column, restrict it to the single value again for your writeable key figures and for the empty line you select a value, that does not bring any values, giv the line a nice name and you should be done with it.
It works like restricted key figures in reporting.
Cornelia
Message was edited by:
Cornelia Lezoch -
Sub Headings in Web Application Reporting
Hai friends,
How can we insert Sub Headings in a WEB TEMPLATE in Web Application Designer... if possible ,plz give me the brief steps ...
example i'm using... filters for COUNTRY wise.. and STATE wise... and CITY wise..
so, how can we insert sub heainngs.. to this sub levels...
thnaks
@jayHI,
Can you elaborate little bit? where do u want sub heading. for webitem like chart?
Regards,
Senthil Kumar.P
Message was edited by:
Senthil Kumar
Maybe you are looking for
-
Order Settlement/S_ALR_87012993 - Orders: Actual/Plan/Variance
in the above report, is it proper to say, initially all costs are mentioned, and in the second level all setlled costs are mentioned. The costs are in possitive figures and the settled costs are in negative figures. is this a correct satement. What i
-
My iMac G5 w/isight display stays black on start up
This all started yesterday when I put my computer to sleep and came back to wake it up. While away my computer actually turned off and when I hit space to wake it it rebooted with no display. When I try to start it up it makes the start up noise, fan
-
Using ipod classic to store complete library to transfer to new hard drive:
My itunes files are about to outgrow my hard drive. Can I use an ipod classic (7th gen) to store my entire library, and then, after installing a larger hard drive, "re-copy" my library from the ipod onto the new hard drive? And would it retain the fi
-
Java ME SDK 3.x for Linux/Unix
Hi! There was talk the last couple of years of a Linux/Unix release for the Java ME SDK 3.x, but as of today I see nothing like that at the download site. Does anybody know the state of this? A Linux/Unix SDK would be very helpful to me in my develop
-
Hi, Is there any simple way to compare two range tables, something like RANGE1 IN RANGE2 ? I need to check if one range table is inside another or not. Thanks, Nuno