Change Column Heading in ALV Report
Hi,
I have developed a ALV Report, showing correct output.
Problem is that Column Heading is not showing correct...means it is showing as per field name. But We want to change as per our understand. i.e. One column heading is like Unrestricted Stock but we want Unrestricted Stock...(BILF is an indicator)..
We have write in the code..
FORM build_fieldcat10.
CLEAR fieldcat_ln.
ADD 1 TO col_pos.
fieldcat_ln-ref_tabname = 'MARD'.
fieldcat_ln-fieldname = 'LABST'.
fieldcat_ln-seltext_m = 'BILF Unrest.Stock'.
fieldcat_ln-key = space.
fieldcat_ln-do_sum = space.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-no_out = space.
fieldcat_ln-qfieldname = space.
fieldcat_ln-hotspot = space.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " BUILD_FIELDCAT1
But after change the selection text...not showing correct text..How can i change Column heading???
Please help me..
Thanks a lot dear..
My problem resolved by using SCRTEXT_L.
Similar Messages
-
Change column header dynamically at report run time
how to use LOV In report column definition under column attributes for display..
If it suceeded will it dynamicaly change header name at time of running report
my requirement is actually to change column header dynamically at time of run report
is it possible with above mentioned way?
Apex 4.1, Oracle 11g, PL/SQL Gateway configuration
Please help me on this
ThanksHi,
by making use of specific report column templates and column template conditions you can change the headers dynamically.
See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ui_templt.htm#HTMDB25708 for more info.
regards,
Erik-jan -
Change Column Headings in ALV Report Using OO
Hi Friends,
I am using OO to display a report with ALV Grid
I tried to change the column names but it still takes the column names from the DDIC.
My declaration is as follows
Data: num type dmbtr.
TRY.
lr_column ?= lr_columns->get_column( columnname = 'NUM' ).
lr_column->set_output_length('7').
lr_column->set_long_text( ' Value' ).
lr_column->set_short_text( ''() ).
lr_column->set_medium_text( 'Value' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- display report
gr_table->display( ).
CATCH cx_salv_msg.
WRITE: 'Error displaying grid! - cx_salv_msg'(044).
CATCH cx_salv_not_found.
WRITE: 'Error displaying grid! - cx_salv_not_found'(004).
CATCH cx_salv_data_error.
WRITE: 'Error displaying grid! - cx_salv_data_error'(005).
CATCH cx_salv_existing.
WRITE: 'Error displaying grid! - cx_salv_existing'(006).
I need the column name as VALUE but it displays as Amount LC in the alv report.
Thanks
chaithanyaHey hello,
you have to change short medium and log text
look at this:
gr_columns = (Table got from factory)->get_columns( ).
gr_column = gr_columns->get_column('NAme').
gr_column->set_long_text('new name long').
gr_column->set_medium_text('new name medium').
gr_column->set_short_text('new name short ).
it will help
thanks
Edited by: Alfito on Nov 28, 2011 9:31 AM -
Change column headers in ALV report
Hi experts,
I have created a new simple ALV report (it uses only internal tables, no structures). I would like to change the names of column headers in the ALV report. Is this possible? How can I do it?
Thanks in advanced.Thanks for your reply,
I am trying to use the code mentioned in the link but I think that something
is missing, probably a CASE statement before WHEN in the LOOP.
Can you help me? What do I have to put before WHEN statement?
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = <program name>
i_structure_name = <DDIC structure>
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = gi_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3. "#EC *
LOOP AT gi_fieldcat INTO wa_fieldcat.
WHEN 'XXXX'.
wa_fieldcat-seltext_s = 'Fac'.
wa_fieldcat-seltext_m = 'Factory'.
wa_fieldcat-seltext_l = 'Factory'.
wa_fieldcat-reptext_ddic = 'Factory'.
MODIFY gi_fieldcat FROM wa_fieldcat.
ENDLOOP. -
Two line column heading in ALV Report
Hi Experts,
My requirement is that I have to create an ALV report with columns having two lines of headings. Like a main heading called Consultants under which 5 to 10 columns of departments(Dept Num, Num of Ppl , Manager etc. ) and then Contractors(Name, Address Etc ) underwhich there would be 5 to 10 departments. Right now my report has the depts of...
How can i do that . If u would suggest by CL_SALV_TABLE then it would be great.
Thanks a lot !
Saui don't think you can do it using cl_gui_alv_grid or cl_salv_table.
-
How to Change Column header in ALV List
hello,
is there a way to change the column header/label of an ALV list other than inheriting it from the source table it is bound to?
thanks,
sidYes, you can. If you are using a field catalog, you can change the field labels in your program.
For example.
data: fc_tmp type slis_fieldcat_alv .
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
<b> fc_tmp-reptext_ddic = 'Material Number'.</b>
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
If you are using the MERGE funciton module to get your field catalog, then you just need to loop thru it and change the field which is holding the description, then modify the line of the field catalog.
REgards,
Rich Heilman -
Two column header in ALV Report
Hi Experts,
Can I have 2 headers in ALV report kind of one header and one sub header below that.
like i have to display a report having the same information for 3 systems so in header I can have the system name and below that
usual headers.
Thanks
Yogesh Guptait is is not possible using the ALV GRID function, ALV OO.
it is possible with ALV List function. you might loose some functionalities layout etc.
check this sample..
cehck this image..
http://img100.imageshack.us/img100/3846/output6ef.th.gif
REPORT ZTEST_ALV message-id zz .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT type slis_layout_alv,
x_events type slis_alv_event,
it_events type SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
MALE type i,
female type i,
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'MALE'.
X_FIELDCAT-SELTEXT_L = 'MALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'FEMALE'.
X_FIELDCAT-SELTEXT_L = 'FEMALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
x_events-NAME = SLIS_EV_TOP_OF_PAGE.
x_events-FORM = 'TOP_OF_PAGE'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
L_LAYOUT-NO_COLHEAD = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC ne 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM TOP_OF_PAGE.
*-To display the headers for main list
FORMAT COLOR COL_HEADING.
WRITE: / SY-ULINE(103).
WRITE: / SY-VLINE,
(8) ' ' ,
SY-VLINE,
(8) ' ' ,
SY-VLINE,
(19) '***'(015) centered,
sy-vline.
WRITE: / SY-VLINE,
(8) 'VBELN'(013) ,
SY-VLINE,
(8) 'POSNR'(014) ,
SY-VLINE,
(8) 'MALE'(016) ,
sy-vline,
(8) 'FMALE'(017) ,
sy-vline.
FORMAT COLOR OFF.
ENDFORM. -
Only one column header in delimited report ?
Hi!
Is there a way to put only one line of column header on delimited report?
(By default the Report builder puts the header in every record line...
as well the delimited_hdr = no command prompt property is not good, because puts out no header)
Thanks!
(I use RB 6i)Hello,
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/cmdline/common/bld_delim_hdr.htm
DELIMITED_HDR command line keyword
DELIMITED_HDR is used to remove boilerplate text (such as the report header) when running a report with DESFORMAT=DELIMITED or DESFORMAT=DELIMITEDDATA.
This parameter exists in Reports 6i too .
Regards -
How to catch changed column values in alv oops using grid
My requirement needs to catch changed column values in alv oops using grid .any method to do this.
please help me out ,
Tks in advanceHave a look into the SAP standarad Programs those programs have the edit option on the ALV output.
BCALV_EDIT_01
BCALV_EDIT_02
BCALV_EDIT_10.
Regards,
Gopi ,
Reward points if helpfull. -
How can i change column header value dynamically in IR report
HI,
I have created report with the help of collections. Report query has been changing dynamically but i got problem with report header names and headers names has not been changing dynamically it is always showing like c001,c002....etc so, i have created global item(G_ITEM) in shared components--->Applications items after that
I have created process(before headers) and assigning some value to G_ITEM and used &G_ITEM to column headres in IR Report but here &G_ITEM is not showing any value.
How can i achieve dynamic headers names by using *&G_ITEM(global items)* Please guide me to achieve this.
Thanks in advance.
Regards
Narender BNarender wrote:
HI,
I have created report with the help of collections. Report query has been changing dynamically but i got problem with report header names and headers names has not been changing dynamically it is always showing like c001,c002....etc so, i have created global item(G_ITEM) in shared components--->Applications items after thatWhy didn't you answer the questions in the other thread to see if there was a better approach than this?
I have created process(before headers) and assigning some value to G_ITEM and used &G_ITEM to column headres in IR Report but here &G_ITEM is not showing any value.
How can i achieve dynamic headers names by using *&G_ITEM(global items)* Please guide me to achieve this.The static text exact substitution method of referencing the value of an APEX item requires a terminating dot ("."):
&G_ITEM. -
How to change column heading in line item report
Hello Experts,
How to change the column heading in the line item report CJI4 or CJI3 ?
for eg: The field WBS will show as Object in the heading. Here I would like to change to WBS.
Is there a way to do this without changing ABAP code
FATMANNot possible through standard I guess.
Enhancement you should be looking is COOMEP01 which includes the component EXIT_SAPLKAEP_009
i.e., Line Item Reports: Customer-specific Formatting of the Lists.You use this enhancement to modify column headings.
Regards
Sreenivas -
Change Column Heading dynamically in ABAP report
Hi,
is it possible to have the selection screen values in the column heading of the result screen in a report?
Currently list heading / column heading values are maintained in a Goto-> Text elements -> List headings
but I would like to have values there that are entered by user, is it possible?
Regards,
MindaugasHi,
User can Maintain the Column Heading's, by the way you mentioned....
Else you can use TOP-OF-PAGE event to build Dynamic Coulmn Headers. -
Hi Experts,
I want to dispaly a P/L acount in ALV report format as given below , the items will diplay should be in Excel format as:
1.Current Month and YTD should be under in current Year Column it and again in next column Current
month and YTD should be under Last Year Column.
Current Year Last Year
ITEM No Current Month YTD Current Month YTD
Please reply me ASAP.
Thanksexample:
REPORT ZHIERSEQ_ALV.
TYPE-POOLS: slis. " ALV Global types
CONSTANTS :
c_x VALUE 'X',
c_gt_vbap TYPE slis_tabname VALUE 'GT_VBAP',
c_gt_vbak TYPE slis_tabname VALUE 'GT_VBAK'.
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.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_2 FOR FIELD p_expand. "#EC NEEDED
PARAMETERS p_expand AS CHECKBOX DEFAULT c_x.
SELECTION-SCREEN END OF LINE.
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
erdat TYPE vbak-erdat, " Creation date
waerk TYPE vbak-waerk, " SD document currency
expand TYPE xfeld,
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
arktx TYPE vbap-arktx, " Material description
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'.
v_2 = 'With ''EXPAND'' field'.
START-OF-SELECTION.
Read Sales Document: Header Data
SELECT vbeln kunnr netwr waerk erdat
FROM vbak
UP TO p_max ROWS
INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
IF gt_vbak[] IS NOT INITIAL.
Read Sales Document: Item Data
SELECT vbeln posnr matnr arktx netwr waerk
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE gt_vbap
FOR ALL ENTRIES IN gt_vbak
WHERE vbeln = gt_vbak-vbeln.
ENDIF.
END-OF-SELECTION.
PERFORM f_display.
Form F_DISPLAY
FORM f_display.
Macro definition
DEFINE m_fieldcat.
ls_fieldcat-tabname = &1.
ls_fieldcat-fieldname = &2.
ls_fieldcat-ref_tabname = &3.
ls_fieldcat-cfieldname = &4. " Field with currency unit
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.
IF p_expand = c_x.
ls_layout-expand_fieldname = 'EXPAND'.
ENDIF.
Build field catalog and sort table
m_fieldcat c_gt_vbak 'VBELN' 'VBAK' ''.
m_fieldcat c_gt_vbak 'KUNNR' 'VBAK' ''.
m_fieldcat c_gt_vbak 'NETWR' 'VBAK' 'WAERK'.
m_fieldcat c_gt_vbak 'WAERK' 'VBAK' ''.
m_fieldcat c_gt_vbak 'ERDAT' 'VBAK' ''.
m_fieldcat c_gt_vbap 'POSNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'MATNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'ARKTX' 'VBAP' ''.
m_fieldcat c_gt_vbap 'NETWR' 'VBAP' 'WAERK'.
m_fieldcat c_gt_vbap 'WAERK' 'VBAP' ''.
m_sort c_gt_vbak 'KUNNR'.
m_sort c_gt_vbap 'NETWR'.
ls_keyinfo-header01 = 'VBELN'.
ls_keyinfo-item01 = 'VBELN'.
ls_keyinfo-item02 = 'POSNR'.
Dipslay Hierarchical list
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 = c_gt_vbak
i_tabname_item = c_gt_vbap
is_keyinfo = ls_keyinfo
i_save = 'A'
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 c_gt_vbap.
WHEN c_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 -
Heading in ALV report is showing up blank
Hello Friends
First of all thanks to you all for giving so much of help. I appreciate it.
I would appreciate if some could please let me know, why my code is not printing the header in my ALV report. It shows up as blank. I have written the Form 'TOP-OF-PAGE'.
Thanks a lot in advance
RamThis coding will give u the solution ....
this is an interactive ALV ...
*& Report ZMR001_MATERIAL_STOCK_VALUE
REPORT zmr001_material_stock_value.
MODULE MMxxxxxxxx. *
Objective :.......................................... *
Program : Updates Tables ( ) Downloads data ( ) *
Outputs List ( ) *
Technical Spec No ............... *
Date Created 07/12/2006 *
Author Jayakumar.T.... *
Location April Business / Banglore *
LDB ..... *
External Dependencies *
Amendment History *
Who Change ID Reason *
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ *
XXXXXXXXX AADDMMYYYY Where XXXX = Developers Name................. *
AA- Developers Initial ................................ *
Includes *
*INCLUDE : *
Tables *
*TABLES : *
TABLES : mchb , mara , mbew , tvkos , t001w.
Types Begin with TY_ *
*TYPES : *
TYPES : BEGIN OF ty_mchb,
matnr LIKE mchb-matnr,
charg LIKE mchb-charg,
clabs LIKE mchb-clabs,
werks LIKE mchb-werks,
spart LIKE mara-spart,
maktx LIKE makt-maktx,
value LIKE mchb-clabs,
total LIKE mchb-clabs,
END OF ty_mchb.
TYPE-POOLS: slis.
CONSTANTS:
c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA gt_list_top_of_page TYPE slis_t_listheader.
Constants Begin with C_ *
*CONSTANTS: *
Data Begin with W_ *
*DATA : *
Infotypes ( HR Module Specific) *
*INFOTYPES : *
Internal tables Begin with IT_ *
*DATA : *
DATA : it_mchb TYPE TABLE OF ty_mchb,
wa_mchb TYPE ty_mchb ,
it_final TYPE TABLE OF ty_mchb,
wa_final TYPE ty_mchb,
it_temp TYPE TABLE OF ty_mchb,
wa_temp TYPE ty_mchb,
it_temp1 TYPE TABLE OF ty_mchb,
wa_temp1 TYPE ty_mchb
DATA: it_listheader TYPE slis_t_listheader.
Field Symbols Begin with FS_ *
*FIELD-SYMBOLS: *
Insert *
*INSERT : *
Select Options Begin with SO_ *
*SELECT-OPTIONS : *
Parameters Begin with PR_ *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
PARAMETERS : pr_vkorg LIKE tvko-vkorg OBLIGATORY .
SELECT-OPTIONS : so_werks FOR mchb-werks.
SELECT-OPTIONS : so_spart FOR mara-spart.
SELECTION-SCREEN END OF BLOCK b1.
Initialisation *
*INITIALISATION :
DATA: wa_variant LIKE disvariant , "Variant
wa_fieldcat TYPE slis_fieldcat_alv ,
it_fieldcat TYPE slis_t_fieldcat_alv ,
it_fieldcat1 TYPE slis_t_fieldcat_alv ,
wa_layout TYPE slis_layout_alv ,
wa_print TYPE slis_print_alv ,
it_sort TYPE slis_t_sortinfo_alv ,
it_sp_group TYPE slis_t_sp_group_alv ,
it_events TYPE slis_t_event ,
it_list_top_of_page TYPE slis_t_listheader,
w_title1 TYPE lvc_title,
w_datum LIKE sy-datum.
DATA slis_ev_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA w_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'. " for top of page
DATA it_event TYPE slis_t_event.
INITIALIZATION.
PERFORM eventtab_build USING it_event[].
*set pf-status '002'.
At selection-screen *
AT SELECTION-SCREEN.
SELECT SINGLE * FROM tvkos WHERE vkorg = pr_vkorg AND spart IN so_spart.
IF sy-subrc NE 0 .
MESSAGE text-008 TYPE 'E'.
ENDIF.
SELECT SINGLE * FROM t001w WHERE vkorg = pr_vkorg AND werks IN so_werks.
IF sy-subrc NE 0 .
MESSAGE text-009 TYPE 'E'.
ENDIF.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
SELECT mc~matnr charg clabs werks spart maktx
INTO CORRESPONDING
FIELDS OF TABLE it_mchb FROM mchb AS mc
INNER JOIN mara AS ma
ON mamatnr = mcmatnr
INNER JOIN makt AS mt
ON mamatnr = mtmatnr
WHERE werks IN so_werks AND
spart IN so_spart
AND spras = 'EN'
it_temp[] = it_mchb[].
SORT it_temp BY matnr.
DELETE ADJACENT DUPLICATES FROM it_temp COMPARING matnr.
LOOP AT it_temp INTO wa_temp.
it_temp1[] = it_mchb[].
DELETE it_temp1 WHERE matnr NE wa_temp-matnr.
LOOP AT it_temp1 INTO wa_temp1.
SUM.
EXIT.
ENDLOOP.
wa_final-matnr = wa_temp1-matnr.
wa_final-charg = wa_temp1-charg.
wa_final-maktx = wa_temp1-maktx.
wa_final-clabs = wa_temp1-clabs.
wa_final-werks = wa_temp1-werks.
wa_final-spart = wa_temp1-spart.
APPEND wa_final TO it_final.
ENDLOOP.
SORT it_mchb BY matnr.
LOOP AT it_mchb INTO wa_mchb.
ON CHANGE OF wa_mchb-matnr.
IF wa_final-matnr IS NOT INITIAL.
SELECT SINGLE * FROM mbew WHERE matnr = wa_final-matnr
AND bwkey = wa_final-werks.
IF mbew-vprsv = 'V'.
wa_final-value = mbew-verpr.
ELSEIF mbew-vprsv = 'S'.
wa_final-value = mbew-stprs.
ENDIF.
wa_final-total = wa_final-value * wa_final-clabs.
APPEND wa_final TO it_final.
CLEAR wa_final.
ENDIF.
ENDON.
wa_final-clabs = wa_mchb-clabs + wa_final-clabs .
wa_final-matnr = wa_mchb-matnr.
wa_final-werks = wa_mchb-werks.
wa_final-charg = wa_mchb-charg.
wa_final-maktx = wa_mchb-maktx.
ENDLOOP.
IF it_final IS INITIAL.
MESSAGE text-010 TYPE 'I'.
ELSE.
PERFORM fieldcat.
PERFORM display_data.
ENDIF.
LOOP AT it_mchb INTO wa_mchb.
WRITE : / , wa_mchb-matnr , wa_mchb-charg , wa_mchb-maktx , wa_mchb-clabs , wa_mchb-werks , wa_mchb-spart .
ENDLOOP.
WRITE : / , 'Jaya'.
LOOP AT it_final INTO wa_final.
WRITE : / , wa_final-matnr , wa_final-charg , wa_final-maktx , wa_final-clabs , wa_final-werks , wa_final-spart .
ENDLOOP.
*GET XX.
*END-OF-SELECTION.
E N D O F S E L E C T I O N *
At line selection *
*AT LINE-SELECTION.
User Command Processing *
*AT USER-COMMAND.
Top Of Page *
*TOP-OF-PAGE.
End Of Page *
*END-OF-PAGE.
FORM eventtab_build USING rt_events TYPE slis_t_event.
*"Registration of events to happen during list display
DATA: ls_event TYPE slis_alv_event.
to get the events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events.
READ TABLE rt_events INTO ls_event WITH KEY name = slis_ev_top_of_page
IF sy-subrc = 0.
ls_event-form = slis_ev_top_of_page.
MODIFY rt_events FROM ls_event TRANSPORTING form WHERE
name = ls_event-form.
ENDIF.
READ TABLE rt_events INTO ls_event WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
ls_event-form = 'USER_COMMAND'.
MODIFY rt_events FROM ls_event TRANSPORTING form WHERE name = ls_event-name.
ENDIF.
ENDFORM. "eventtab_build
*& Form fieldcat
FORM fieldcat .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = text-002 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-seltext_m = text-003 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'CLABS'.
wa_fieldcat-seltext_m = text-004 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'VALUE'.
wa_fieldcat-seltext_m = text-006 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-seltext_m = text-007 .
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. "fieldcat
*& Form display_data
FORM display_data .
PERFORM comment_build USING gt_list_top_of_page[].
wa_layout-info_fieldname = 'LINE_COLOR'. " Line Color
wa_print-no_coverpage = 'X'.
wa_print-no_print_listinfos = 'X'. " Remove the default first page.
to get thr grid display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_background_id = 'ALV_BACKGROUND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_user_command = 'USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fieldcat
i_default = 'X'
i_save = 'A'
it_events = it_event[]
is_print = wa_print
TABLES
t_outtab = it_final
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. " eventtab_build
*& Form comment_build
FORM comment_build USING lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
to get the company text
DATA w_name(50) TYPE c.
ls_line-info = text-005 .
APPEND ls_line TO lt_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = ''.
APPEND ls_line TO lt_top_of_page.
ENDFORM. "comment_build
*& Form top_of_page
to print at top of page
FORM top_of_page.
to pass the comment bulid for the top of page into the alv
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. "top_of_page
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
MESSAGE 'jj' TYPE 'I'.
READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
PERFORM build_fieldcatlog.
PERFORM event_call USING it_event[].
PERFORM POPULATE_EVENT_EKPO.
PERFORM data_retrieval.
PERFORM build_listheader USING it_listheader.
PERFORM DISPLAY_ALV.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG
text
FORM build_fieldcatlog.
clear it_fieldcat1[].
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = text-002 .
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-seltext_m = text-003 .
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'CHARG'.
wa_fieldcat-seltext_m = text-003 .
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'CLABS'.
wa_fieldcat-seltext_m = text-004 .
APPEND wa_fieldcat TO it_fieldcat1.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
text
-->RT_EVENTS text
FORM event_call USING rt_events TYPE slis_t_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events
EXCEPTIONS
LIST_TYPE_WRONG = 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. "event_call
*& Form DATA_RETRIEVAL
text
FORM data_retrieval.
it_temp[] = it_mchb[].
DELETE it_temp WHERE matnr NE wa_final-matnr.
ENDFORM. "DATA_RETRIEVAL
*& Form BUILD_LISTHEADER
text
-->I_LISTHEADEtext
FORM build_listheader USING i_listheader TYPE slis_t_listheader.
DATA: hline1 TYPE slis_listheader.
hline1-typ = 'H'.
hline1-info = 'CHECKING PGM'.
ENDFORM. "BUILD_LISTHEADER
FORM DISPLAY_ALV.
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 = 'F_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = TITLE_EKPO
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = It_FIELDCAT1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = it_EVENTS[]
TABLES
T_OUTTAB = IT_temp[]
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. -
How can I change column name in ALV table in WebDynpro ABAP?
Hi Everyone,
I have created an ALV table in WebDynpro ABAP. I have created a context node and added the required attributes there - for the ALV display.
Now I want to change one columnn name of the ALV table.... Currently it is showing the description of the data element, which I don't want to show. I cannot create a new DE only for this purpose.
Please let me know how can I change the name of the column.
RegardsHi,
This may help you to define your own column text in the ALV Table of webdynpro.
see the below code.
Here 'STATUS_ICON' is the column of the the output display of the ALV Table of webdynpro.
"change the label of the report.
DATA: lr_weeknum TYPE REF TO cl_salv_wd_column.
CALL METHOD l_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'STATUS_ICON'
RECEIVING
value = lr_weeknum.
SET THE LABEL OF THE COLUMN
DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
CALL METHOD lr_weeknum->get_header
RECEIVING
value = hr_weeknum.
CALL METHOD lr_weeknum->set_resizable
EXPORTING
value = abap_false.
hr_weeknum->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
set the text of the column
CALL METHOD hr_weeknum->set_text
EXPORTING
value = 'C Form'.
regarads,
balu
Maybe you are looking for
-
Slow performance on a iMac 27" (maybe originated by the HDD)
Hello, Well, I've had my iMac for 10 months now, but have never really paid attention to its performance since it was my first Mac and I was upgrading from a quite old computer, so it obviously proved to be a far superior machine. However, I noticed
-
Creating materail in non sap system when it is create in sap
Hi, As with the help of IDOC we can perform the activity in multiple sap server, like creation of material master if it is created in one system it can be created in other, I have one requirement , we are suing one non sap systems there we are per
-
Hi , I would like to create a variant for a custom report with time being dynamic.Purpose is to execute this report every hour as background job with time also as an input .ie suppose job is running every hour , report should fetch data within this
-
Hi, I got this bug as shown in the pic.. [http://www.colin-java.co.uk/pics/bug.png] When the white square on the upper left is dragged, a chunk of the cube goes missing. Its only on the image shown behind the white square (on the cube) that gets cut
-
Hi All, I am evaluating Webcenter and Portlets, specifically ADF portlets. I followed Peter Moskovi's article on portletizing an ADF taskflow (http://pmoskovi.wordpress.com/2008/07/18/jsr-301-the-jsf-portlet-bridge/). This is an excellent demo to gui