Issue in ALV reporting
Dear All,
I have an issue in ALV reporting. Pls look at the follow table.
<u>Duty Post</u> <u>Date</u> <u>Time</u>
jurong 12/06 3.45
jurong 13/06 3.50
jurong 14/06 4.50
In the above table jurong is repeated. I do not want jurong to be repeated but other fields should be present.
Kindly help me solve it.
Regards,
Karthikeyan
<u></u><u></u>
Hi Karthik,
Another way of handling this without doing if else comparision is using the SORT functionality.
I am giving an example here:
Sort data in the output based on Duty_Post
CLEAR itab_sort.
itab_sort-fieldname = 'DUTY_POST' . (Replace DUTY_POST with the actual field name used in ur report)
itab_sort-up = c_x.
APPEND itab_sort.
CLEAR itab_sort.
Then while calling the ALV FM: include the ITAB_SORT table also.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_call_back_pgm
i_grid_title = w_text
it_fieldcat = itab_fldcat
it_sort = itab_sort[]
is_layout = w_layout
it_events = itab_events[]
i_default = 'X'
i_save = 'A'
IMPORTING
e_exit_caused_by_caller = w_exit_by_caller
es_exit_caused_by_user = w_exit_by_user
TABLES
t_outtab = itab_output_gr
EXCEPTIONS
program_error = 1
OTHERS = 2.
This way data would not repeat.
Hope this helps.
Rgds,
HR
Similar Messages
-
Hi,
I have a issue in ALV Report for displaying one field's data into output.
I am getting data into all other fields in ALV Report except for this field.
This field & related fields are declared as below: in final internal table.
sta_no TYPE z3status,
status(10) TYPE c,
Here z3status is of type Char(1).
In Report
I have put a condition :
IF i_tab-sta_no EQ 1.
i_tab-status = 'Created'.
ELSE.
i_tab-status = 'Closed'.
ENDIF.
and to field catalog also i am passing right information as for every other field in ALV Report.
Till the point use of REUSE_ALV_LIST_DISPLAY F.M also final internal table is having status field filled.
But in output nothing gets displayed for Status field.
Can anybody tell me what can be the issue!
Thanks in advance.
Thanks,
Deep.Hi,
I have no problem in data fetching into final internal table.
Everything is coming well to REUSE_ALV_DISPLAY F.M.
But still Status field data is not getting displayed.
I have posted some code for reference:
LOOP AT t_z3manboxid INTO wa_z3manboxid.
wa_result-manifest_no = wa_z3manboxid-zmanno.
wa_result-item_no = wa_z3manboxid-item_no.
IF l_item_no NE wa_z3manboxid-item_no.
wa_result-piece_quantity = wa_z3manboxid-vemng.
wa_result-unit = wa_z3manboxid-vemeh.
wa_result-manifester = wa_z3manboxid-usnam.
wa_result-manifest_sta_no = wa_z3manboxid-z3status.
IF wa_result-manifest_sta_no EQ 1.
wa_result-manifest_status = c_created.
ELSEIF wa_result-manifest_sta_no EQ 2.
wa_result-manifest_status = c_in_transit.
ELSEIF wa_result-manifest_sta_no EQ 3.
wa_result-manifest_status = c_arrived.
ELSEIF wa_result-manifest_sta_no EQ 4.
wa_result-manifest_status = c_closed.
ENDIF.
ENDIF.
l_item_no = wa_z3manboxid-item_no.
APPEND wa_result TO t_result.
CLEAR: wa_result, wa_z3manboxid.
ENDLOOP.
Building field catalog following code is added:
For status call is as below:
PERFORM f_build_fieldcat USING c_tab
c_manifest_status
c_space
c_space
c_mannf_status
c_space1
15.
FORM f_build_fieldcat USING p_tabname p_fldname
p_rtabname p_rfldname
p_fldhdg p_check
p_length.
CLEAR t_fieldcat_ln1.
ADD 1 TO g_col_pos.
t_fieldcat_ln1-tabname = p_tabname.
t_fieldcat_ln1-fieldname = p_fldname.
t_fieldcat_ln1-ref_tabname = p_rtabname.
t_fieldcat_ln1-ref_fieldname = p_rfldname.
t_fieldcat_ln1-ddictxt = c_l.
t_fieldcat_ln1-seltext_l = p_fldhdg.
t_fieldcat_ln1-no_zero = space.
t_fieldcat_ln1-do_sum = space.
t_fieldcat_ln1-col_pos = g_col_pos.
t_fieldcat_ln1-no_out = space.
t_fieldcat_ln1-just = c_c.
t_fieldcat_ln1-qfieldname = space.
t_fieldcat_ln1-checkbox = p_check.
t_fieldcat_ln1-input = p_check.
t_fieldcat_ln1-reptext_ddic = p_fldhdg.
IF p_fldname EQ c_manno.
t_fieldcat_ln1-key = c_x.
t_fieldcat_ln1-hotspot = c_x.
ELSE.
t_fieldcat_ln1-key = space.
t_fieldcat_ln1-hotspot = p_check.
ENDIF.
t_fieldcat_ln1-outputlen = p_length.
t_fieldcat_ln1-intlen = p_length.
t_fieldcat_ln1-ddic_outputlen = p_length.
APPEND t_fieldcat_ln1 TO t_fieldcat1.
ENDFORM. " f_build_fieldcat
FORM f_build_sortcat USING p_fldname.
CLEAR t_sortcat_ln1.
ADD 1 TO g_col_pos.
t_sortcat_ln1-spos = g_col_pos.
t_sortcat_ln1-fieldname = p_fldname.
t_sortcat_ln1-up = c_x.
t_sortcat_ln1-down = space.
t_sortcat_ln1-subtot = c_x.
APPEND t_sortcat_ln1 TO t_sortcat1.
ENDFORM. " f_build_sortcat
FORM f_build_layout.
t_layout1-zebra = c_x.
t_layout1-no_vline = c_space1.
t_layout1-reprep = c_x.
t_layout1-detail_popup = c_x.
t_layout1-window_titlebar = text-005.
t_layout1-no_scrolling = c_space1.
t_layout1-detail_titlebar = text-005.
t_layout1-numc_sum = c_x.
t_layout1-get_selinfos = c_x.
t_layout1-min_linesize = 132.
ENDFORM. " f_build_layout
DATA: l_pgm TYPE syrepid,
l_exit(1) TYPE c.
CLEAR: l_pgm,
l_exit.
l_pgm = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = l_pgm
i_callback_user_command = c_user_command
is_layout = t_layout1
it_fieldcat = t_fieldcat1
i_save = c_a
it_events = t_eventcat1
IMPORTING
e_exit_caused_by_caller = l_exit
TABLES
t_outtab = t_result
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
l_exit = l_exit.
ENDIF.
To ALV F.M t_result table is updated with correct data.
But it is not getting displayed.
What can be the reason!
Can anybody give the solution!
Thanks for your replies.
Thanks,
Deep. -
Data Displaying issue in ALV report
Hi,
I have made a ALV report, the presetn display layout is as below
it is displaying the material shortage reprot against issued production order
ORDER NO. Order Qty. MATERIAL TOTAL QTY SHORTAGE QTY
3000000 100 610 100 5
3000000 100 101 200 43
3000000 100 8795 400 400
3000000 100 456 100 67
3000001 50 548 50 33
3000004 62 710 62 3
3000005 15 7895 15 15
3000020 11 456 22 10
now the user requirement is the report should come as per below formate
AT EACH NEW ORDER NUMBER :
****************first display main order no. and order qty.
ORDER NO. Order Qty
3000000 100
************************then below this display the indiviual material and qty.
MATERIAL TOTAL QTY SHORTAGE QTY
610 100 5
101 200 43
8795 400 400
456 100 67
*******again at new order******
ORDER NO. Order Qty
3000001 50
**********then below display the items
MATERIAL TOTAL QTY SHORTAGE QTY
548 50 33
how to do this is there any output layout with this i can get this formate in LAV report
regards,
zafarHi Zafar,
You can populate your internal table as per the requirement.
at new order only.
itab-Order = 3000000 .
itab-Order quantity = 100.
append itab
for all materials for that order
itab-MATERIAL = 610 .
itab-TOTAL QTY = 100 .
itab-SHORTAGE QTY = 5.
append itab.
Cheers,
Suhail -
HI all,
I have developed an ALV Report. In the ALV display, i would like to sum see the Sum (Total) of few fields like Qty, Net value etc when i select that particular column and click the 'SUM" icon.
In my Report when i do so, the Program is displaying Runtime Error.
How to resolve this issue?
Any idea?
Regards
PavanYou must make sure that these columns are defined correctly in the field catalog and in the internal table. For example, make sure that the quantity field is typed as such in the internal table.
data: begin of itab occurs 0,
qty type p decimals 2,
end of itab.
And then in your field catalog, make sure that the DATATYPE is set correctly.
ls_fcat-datatype = 'QUAN'.
Do this may help your situation. Also make sure that the data in these columns is all numeric.
Regards,
Rich Heilman -
Field Length issue in ALV Report
Hi,
I am using FM REUSE_ALV_GRID_DISPLAY to display few fields. Among them I have a field with length 200 characters text.
During ALV report display I am able to see only 128 characters, But when I download it and see the field, the it is showing complete text.
Can anybody help me out?
Thanks,
RamakrishnaCheck out the last answer of this post.
Re: ALV Grid Display - 255 characters
<i>I found a SAP document called "Using ALV for list display.pdf" that says the following:
"Size of data fields: While the list-based ALVList can display only tables of up to 90 columns, the control-based ALVGrid and ALVFullscreen have the limitation of 128 characters per data cell."</i>
Please make sure to award point for helpful answers and mark the post as solved. Thanks.
Regards,
Rich HEilman -
Reg : Print Issue in ALV Report
Hi Experts,
I have created an ALV Report for USER Requirement and it is working fine. While taking printout the SORTED Field is not working, it gets repeated in the Print... How to rectify..?hi,
did u use SORT-UP equal to 'X'?
wa_sort-up = c_x.
ags. -
Hi all,
I've created an ALV report which is having a editable checkbox box field and some more fields that are not editable.
My requirement is that when i check any checkbox, some of the fields in that particular row should become editable.
In table control it can be done easily but can it be done in ALV.
Note: I have created the ALV through container as it was required.
Thanks in Advance.
Regards
DheerajHi,
Basically you will have to first register the data change event after you display the grid as follows:-
CALL METHOD y_lobj_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED
EXCEPTIONS
error = 1
OTHERS = 2.
Here Y_LOBJ_GRID is my grid object of type CL_GUI_ALV_GRID.
Then you will have to set a handler method for this.
SET HANDLER y_obj_evt_handler->y_m_handle_cell_modified
FOR Y_LOBJ_GRID.
Here y_obj_evt_handler is a local class in your program and y_m_handle_cell_modified is the method of that class.
In this method you can change the fields to make then editable or non editable.
Regards,
Ankur Parab -
An issue in ALV reports.
Hi,
I am new to ALV reporting. I have one doubt. When I am declaring the internal table as
itab type standard table of stucture.
and then using merge catalog and reuse list disp FM it is not showing any output.
I want to know why is this happening?
Experts please help me out.Hai Abir
Go through the following Code
*& Report ZALV_BLOCK *
REPORT ZALV_BLOCK NO STANDARD PAGE HEADING
LINE-SIZE 150
LINE-COUNT 60(4)
MESSAGE-ID Z00.
*..Type Definitions for ALV Report
TYPE-POOLS SLIS.
*..Includes
*for ICONs
*INCLUDE <ICON>.
Table/Structure declarations. *
TABLES: MARA,
MARC,
T134.
Types Declaration *
TYPES: BEGIN OF typ_mara,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MATKL TYPE MARA-MATKL,
MEINS TYPE MARA-MEINS,
NTGEW TYPE MARA-NTGEW,
END OF typ_mara.
TYPES: BEGIN OF typ_marc,
WERKS TYPE MARC-WERKS,
LADGR TYPE MARC-LADGR,
MTVFP TYPE MARC-MTVFP,
DISPR TYPE MARC-DISPR,
DISMM TYPE MARC-DISMM,
DISPO TYPE MARC-DISPO,
END OF typ_marc.
Intrnal tables Declaration *
DATA: it_mara TYPE STANDARD TABLE OF typ_mara WITH HEADER LINE.
DATA: it_marc TYPE STANDARD TABLE OF typ_marc WITH HEADER LINE.
ALV Type declaration *
DATA:V_NO_DATA TYPE C.
ALV Type declaration *
DATA:V_REPID TYPE SYREPID.
DATA: IT_FIELDCATALOG_MARA TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCATALOG_MARA TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCATALOG_MARC TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCATALOG_MARC TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCATALOG_MATKL TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCATALOG_MATKL TYPE SLIS_FIELDCAT_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT,
WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
Selection Screen. *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR ,
S_MTART FOR MARA-MTART .
SELECTION-SCREEN END OF BLOCK B1.
Event:Initialization *
INITIALIZATION.
*Report Name
V_REPID = SY-REPID.
AT Selection Screen. *
AT SELECTION-SCREEN.
Event: Start-of-Selection *
START-OF-SELECTION.
PERFORM FETCH_DATA.
Event: End-of-Selection *
END-OF-SELECTION.
IF V_NO_DATA = ''.
MESSAGE I010 WITH 'NO DATA TO DISPLAY ! '.
EXIT.
ELSE.
PERFORM FILL_FIELDCAT_MARA.
PERFORM FILL_FIELDCAT_MAKT.
PERFORM FILL_FIELDCAT_MARC.
PERFORM FILL_LAYOUT.
PERFORM CALL_ALV_INIT.
PERFORM ADD_LISTS.
PERFORM DISPLAY_BLOCK_LIST.
ENDIF.
FORM DEFINITIONS *
*& Form FETCH_DATA
text
--> p1 text
<-- p2 text
FORM FETCH_DATA.
SELECT MATNR
MTART
MATKL
MEINS
NTGEW
INTO CORRESPONDING FIELDS OF TABLE IT_MARA
FROM MARA
WHERE MATNR IN S_MATNR
AND MTART IN S_MTART.
IF SY-SUBRC <> 0.
V_NO_DATA = ''.
ELSE.
V_NO_DATA = 'X'.
SELECT WERKS
LADGR
MTVFP
DISPR
DISMM
DISPO
INTO CORRESPONDING FIELDS OF TABLE IT_MARC
FROM MARC
WHERE MATNR IN S_MATNR.
ENDIF.
ENDFORM. " FETCH_DATA
*& Form FILL_FIELDCAT_MARA
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT_MARA.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'IT_MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCATALOG_MARA
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_FIELDCATALOG_MARA INTO WA_FIELDCATALOG_MARA.
CASE WA_FIELDCATALOG_MARA-FIELDNAME.
WHEN 'MATNR'.
WA_FIELDCATALOG_MARA-COL_POS = '1'.
WA_FIELDCATALOG_MARA-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARA-SELTEXT_L = 'Material NO'.
WHEN 'MTART'.
WA_FIELDCATALOG_MARA-COL_POS = '2'.
WA_FIELDCATALOG_MARA-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARA-SELTEXT_L = 'Mat Type'.
WHEN 'MATKL'.
WA_FIELDCATALOG_MARA-COL_POS = '3'.
WA_FIELDCATALOG_MARA-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARA-SELTEXT_L = 'Mat Group'.
WHEN 'MEINS'.
WA_FIELDCATALOG_MARA-COL_POS = '4'.
WA_FIELDCATALOG_MARA-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARA-SELTEXT_L = 'Measure Unit'.
WHEN 'NTGEW'.
WA_FIELDCATALOG_MARA-COL_POS = '5'.
WA_FIELDCATALOG_MARA-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARA-SELTEXT_L = 'Net Wt'.
WA_FIELDCATALOG_MARA-DO_SUM = 'X'.
ENDCASE.
MODIFY IT_FIELDCATALOG_MARA FROM WA_FIELDCATALOG_MARA INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " FILL_FIELDCAT_MARA
*& Form FILL_FIELDCAT_MARC
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT_MARC.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_MARC'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCATALOG_MARC
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_FIELDCATALOG_MARC INTO WA_FIELDCATALOG_MARC.
CASE WA_FIELDCATALOG_MARC-FIELDNAME.
WHEN 'WERKS'.
WA_FIELDCATALOG_MARC-COL_POS = '1'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'PLANT NAME'.
WHEN 'LADGR'.
WA_FIELDCATALOG_MARC-COL_POS = '2'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'Loading Group'.
WHEN 'MTVFP'.
WA_FIELDCATALOG_MARC-COL_POS = '3'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '20'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'Checking group'.
WHEN 'DISPR'.
WA_FIELDCATALOG_MARC-COL_POS = '4'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'MRP PROFILE'.
WHEN 'DISMM'.
WA_FIELDCATALOG_MARC-COL_POS = '5'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'MRP TYPE'.
WHEN 'DISPO'.
WA_FIELDCATALOG_MARC-COL_POS = '6'.
WA_FIELDCATALOG_MARC-OUTPUTLEN = '15'.
WA_FIELDCATALOG_MARC-SELTEXT_L = 'MRP CONTROLLER'.
ENDCASE.
MODIFY IT_FIELDCATALOG_MARC FROM WA_FIELDCATALOG_MARC INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " FILL_FIELDCAT_MARC
*& Form FILL_FIELDCAT_MAKT
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT_MAKT.
ENDFORM. " FILL_FIELDCAT_MAKT
*& Form CALL_ALV_INIT
text
--> p1 text
<-- p2 text
FORM CALL_ALV_INIT.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IT_EXCLUDING =
ENDFORM. " CALL_ALV_INIT
*& Form ADD_LISTS
text
--> p1 text
<-- p2 text
FORM ADD_LISTS.
*ADD IT_MARA TABLE TO THE OUTPUT
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCATALOG_MARA
I_TABNAME = 'IT_MARA'
IT_EVENTS = IT_EVENTS
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
**ADD IT_MARC TABLE TO THE OUTPUT
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCATALOG_MARC
I_TABNAME = 'IT_MARC'
IT_EVENTS = IT_EVENTS
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARC
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
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. " ADD_LISTS
*& Form FILL_LAYOUT
text
--> p1 text
<-- p2 text
FORM FILL_LAYOUT.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
ENDFORM. " FILL_LAYOUT
*& Form DISPLAY_BLOCK_LIST
text
--> p1 text
<-- p2 text
FORM DISPLAY_BLOCK_LIST.
WA_KEYINFO-HEADER01 = 'MATNR'.
WA_KEYINFO-ITEM01 = 'MATNR'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
IS_PRINT =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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_BLOCK_LIST .
Thanks & regards
Sreenivasulu P -
Hi All,
I have used the following code...Header is getting displayed properly.
But Footer is not getting printed.....
perform build_event.
perform build_comment.
FORM build_event .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'gt_list_top_of_page'.
FS_EVENTCAT-FORM = 'build_comment'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'gt_list_end_of_page'.
FS_EVENTCAT-FORM = 'f_write_summary'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " build_event
FORM build_comment .
DATA: lv_info TYPE string,
l_comcode type string,
l_plant type string,
ls_line TYPE slis_listheader.
CLEAR ls_line.
**-- Title
ls_line-typ = 'H'.
ls_line-info = 'List of Sales Orders Blocked from Production and Delivery'.
APPEND ls_line TO gt_list_top_of_page.
clear ls_line.
ENDFORM. " build_comment
FORM F_WRITE_SUMMARY.
data: v_date1(12) type c.
data: v_time(10) type c.
data: v_dtime(25) type c.
concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into v_date1 separated by '-'.
concatenate sy-uzeit0(2) sy-uzeit2(2) sy-uzeit+4(2) into v_time separated by '.'.
concatenate v_date1 v_time into v_dtime separated by ' / '.
ls_line-typ = c_s.
ls_line-key = 'Date/Time:'.
ls_line-info = v_dtime.
append ls_line to gt_list_end_of_page.
ENDFORM. " F_WRITE_SUMMARY
Please help me....Refer this example -
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
Regards,
Amit
Reward all helpful replies. -
Issue in ALV reporting in ME2L transaction
Hi All,
I have a default layout setting in the ME2L out put ( In ECC6.0,ALV grid option),where in the sort order tab,I have subtotals fuction.
If I choose other layout,in the sort order tab,I dont find subtotals function.
What could be the reason.
Thanks,
SesahdriHi
You will have sub total option only in ALV grid display, you will not have it in classical output display.
Regards
Prasad -
Sub totals and Sort Text issue in ALV report
Hi,
I have requirement for list of Purchase orders.
1st. sort the list by vendor (This i did by using sort)
2nd. Vendor name should be display after sorting the lines.
3rd should count the no lines which has mark 'X' in field ELIKZ and sum the total counts and display it for every vendor after the sorted line.
I could sort the list by vendors. but don't know how to display the vendor name after those lines. then sub total also.
Please help
Moderator Message: spec-dumping is not allowed. Please use the availble resources and put some effort from your end.
Edited by: kishan P on Oct 27, 2010 3:02 PMHi,
I have requirement for list of Purchase orders.
1st. sort the list by vendor (This i did by using sort)
2nd. Vendor name should be display after sorting the lines.
3rd should count the no lines which has mark 'X' in field ELIKZ and sum the total counts and display it for every vendor after the sorted line.
I could sort the list by vendors. but don't know how to display the vendor name after those lines. then sub total also.
Please help
Moderator Message: spec-dumping is not allowed. Please use the availble resources and put some effort from your end.
Edited by: kishan P on Oct 27, 2010 3:02 PM -
Hi
I have some issue in ALV report.
If i run this particular ALV report in Development/Quality box, there is no issue.
If i run this report in Production i can not see the ALV output screen. i can see the Excel output only.
How can i control this in Production?hi,
I guess you might be using a default variant where the fields are not selected to display ... Remove the default varinat and run the same ..
In the output screen press 'Change Layout' button in the displayed columns tab ... make sure all the fields are on the right side ... if not move them with the buttons ...
regards,
Santosh -
ALV report in ECC 6.0 'TOP-OF-PAGE'
Hi Friends,
Please, Kindly help me on below issue with Alv report for 'TOP-OF-PAGE' in ECC 6.0.
I have written the following code for "top-of-page' which is not getting the text given on this event, please help me if i committed any mistake in code.
type-pools : slis.
TABLES : KNA1,VBAK.
TYPES: BEGIN OF ty_kna1,
kunnr TYPE kna1-kunnr,
land1 TYPE kna1-land1,
name1 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
END OF ty_kna1.
TYPES: BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
ernam TYPE vbak-ernam,
netwr TYPE vbak-netwr,
END OF ty_vbak.
DATA : W_KNA1 TYPE TY_KNA1,
W_VBAK TYPE TY_VBAK,
I_KNA1 TYPE STANDARD TABLE OF TY_KNA1,
I_VBAK TYPE STANDARD TABLE OF TY_VBAK.
DATA : W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : V_REPID LIKE SY-REPID.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCAT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
END-OF-SELECTION.
PERFORM DISPLAY_DATA.
*& Form BUILD_FIELDCAT
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT .
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'KUNNR'.
W_FIELDCAT-SELTEXT_M = 'CUST NAME'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'LAND1'.
W_FIELDCAT-SELTEXT_M = 'COUNTRY'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'NAME1'.
W_FIELDCAT-SELTEXT_M = 'NAME'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'ORT01'.
W_FIELDCAT-SELTEXT_M = 'CITY'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
endform. " BUILD_FIELDCAT
*& Form DATA_RETRIEVAL
text
--> p1 text
<-- p2 text
form DATA_RETRIEVAL .
SELECT KUNNR LAND1 NAME1 ORT01 FROM KNA1
INTO TABLE I_KNA1
WHERE KUNNR IN S_KUNNR.
endform. " DATA_RETRIEVAL
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
form DISPLAY_DATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_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 =
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_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 = I_KNA1
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_DATA
*& Form BUILD_LISTHEADER
text
-->P_IT_LISTHEADER text
form BUILD_LISTHEADER using i_listheader TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'CUSTOMER DETAILS'.
HLINE-TYP = 'H'.
append hline to it_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
endform. " BUILD_LISTHEADER
*& Form EVENT_CALL
text
--> p1 text
<-- p2 text
form EVENT_CALL .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_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 POPULATE_EVENT
text
--> p1 text
<-- p2 text
form POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
Thanks in Advance,
Chandra.type-pools : slis.
TABLES : KNA1,VBAK.
TYPES: BEGIN OF ty_kna1,
kunnr TYPE kna1-kunnr,
land1 TYPE kna1-land1,
name1 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
END OF ty_kna1.
TYPES: BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
ernam TYPE vbak-ernam,
netwr TYPE vbak-netwr,
END OF ty_vbak.
DATA : W_KNA1 TYPE TY_KNA1,
W_VBAK TYPE TY_VBAK,
I_KNA1 TYPE STANDARD TABLE OF TY_KNA1,
I_VBAK TYPE STANDARD TABLE OF TY_VBAK.
DATA : W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : V_REPID LIKE SY-REPID.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCAT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
END-OF-SELECTION.
PERFORM DISPLAY_DATA.
*& Form BUILD_FIELDCAT
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT .
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'KUNNR'.
W_FIELDCAT-SELTEXT_M = 'CUST NAME'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'LAND1'.
W_FIELDCAT-SELTEXT_M = 'COUNTRY'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'NAME1'.
W_FIELDCAT-SELTEXT_M = 'NAME'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-TABNAME = 'I_KNA1'.
W_FIELDCAT-FIELDNAME = 'ORT01'.
W_FIELDCAT-SELTEXT_M = 'CITY'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
endform. " BUILD_FIELDCAT
*& Form DATA_RETRIEVAL
text
--> p1 text
<-- p2 text
form DATA_RETRIEVAL .
SELECT KUNNR LAND1 NAME1 ORT01 FROM KNA1
INTO TABLE I_KNA1
WHERE KUNNR IN S_KUNNR.
endform. " DATA_RETRIEVAL
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
form DISPLAY_DATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_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 =
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_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 = I_KNA1
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_DATA
*& Form BUILD_LISTHEADER
text
-->P_IT_LISTHEADER text
form TOP_OF_PAGE using i_listheader TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'CUSTOMER DETAILS'.
HLINE-TYP = 'H'.
append hline to it_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
endform. " BUILD_LISTHEADER
*& Form EVENT_CALL
text
--> p1 text
<-- p2 text
form EVENT_CALL .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_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 POPULATE_EVENT
text
--> p1 text
<-- p2 text
form POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
just change the code as i have u will get it
plz reward points if useful -
SAPGUI JAVA 7.10 rev 3 (OSX 10.5.2): ALV reports freeze
Dear All,
I've tried to use rev 3 of sapgui for java for mac osx. I have serious issues with ALV reports that makes it unusable (rev 2 is ok so far).
With big lists ALV freezes after showing about half of the first screen lines.
Is anyone experiencing the same issue? Any news about a rev 4 version?
Many thanks,
LorenzoHi Lorenzo,
did you double check if selecting multiple columns works with SAP GUI for Windows in the same report?
If yes, I suggest to file a bug report so we can do a remote logon to run your custom report.
If not it might be because of REUSE_ALV_GRID_DISPLAY itself or your parameters calling REUSE_ALV_GRID_DISPLAY.
Best regards
Rolf-Martin -
ALV Report Output Print issue with more Columns
Hi Experts ,
I'm facing an issue while printing an ALV report which has around 22 columns .If i reduce the column display in the code . I'm able to print but not with 22 columns.. I have used Line-size = 1023 and line-count = 60 , but still the problem persists .
I also searched in SDN with similar issue but managed to get only the above solution which is not working .
Any other ways of doing it , kindly suggest .
Many Thanks,
Kumaran175 characters is the maximum number of characters that can be generated in a line of a spool (next characters are stored on the next line of the spool). When the spool is printed, these line feeds are respected.
What is possible (I don't know) is that ALV chooses its own format type instead of the format type you have chosen when you run your program in background. To check that, just look at spool attributes (SP01).
Maybe you are looking for
-
Report for Issued component Quantity vs Subcontracting PO component qntity
Dear Expert, My client wants to know a report on issued Component quantity (what is issued against a Sub- contraction PO) with PO component quantity (what is maintained in a subcontracting PO component). Is there any standard report available for the
-
Photoshop plug in for HP C4180
Is there a plug-in for scanning from the HP C4180 into Photoshop. I would deeply appreciate any help in finding one. I have downloaded the HP Photosmart software but it fails to find my device.
-
We are in the process of purchasing an upgrade to NNMi. We are currently running version 9.23. The part number for the upgrade is TA064AAE . I need to know if that will upgrade us to version 10. Please note I cannot contact HP support directly becaus
-
Hello All. I am in need of assistance in creating a query link for a sharepoint 2013 list. I would like to create a link that will query a column other than the Item ID: http://somesite.aspx?QuerySearch={ItemId}. Is there a way to accomplish this, l
-
AnySidedDie and possibly unfair
/**Hi, I'm new writing java. I have actually read most of my book and have actually overview the posting in the forums. I understand the concept when I'm reading the code, but when it comes **to writing I go blind. I have this assignment, which I'm a