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,
Ramakrishna
Check 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
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. -
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 -
How to create field catalog using field-symbols in normal alv report?
hi all,
how to create field catalog using field-symbols in normal alv report? i.e, using function modules...reuse_alv_list_display/grid_display?
regards,
jackHI
LIKE THIS
TYPE-POOLS : slis.
DATA : t_fieldcat TYPE slis_t_fieldcat_alv,
st_fieldcat TYPE slis_fieldcat_alv.
st_fieldcat-fieldname = 'STATUS'.
st_fieldcat-seltext_l = 'STATUS INDICATOR'.
st_fieldcat-outputlen = 17.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'VBELN'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Sales Document No.'.
st_fieldcat-outputlen = 10.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUDAT'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Document Date'.
st_fieldcat-outputlen = 10.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'VBTYP'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Document Type'.
st_fieldcat-outputlen = 4.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUART'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Category'.
st_fieldcat-outputlen = 1.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUGRU'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Reason'.
st_fieldcat-outputlen = 3.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'NETWR'.
st_fieldcat-do_sum = 'X'.
st_fieldcat-seltext_l = 'Net Amount'.
st_fieldcat-outputlen = 15.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'WAERK'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Unit'.
st_fieldcat-outputlen = 5.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
*sortinfo
st_sort-fieldname = 'AUART'.
st_sort-up = 'X'.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'VBTYP'.
st_sort-up = 'X'.
st_sort-subtot = ' '.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'WAERK'.
st_sort-up = 'X'.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'VBELN'.
st_sort-up = ' '.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_eventcat
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.
IF grid = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = g_program
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
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 =
it_fieldcat = t_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = t_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = 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.
REWARD IF USEFULL -
Need to remove space for a field when displayed in ALV Report
Hi,
I have material field of length 18, but the content is only 10 char. I need to remove the extra space when it is displayed on ALV Report.
Is there any option in ALV field catalogueuse statement condense.
condense zmatnr.
also giv output lenth of alv column as 10. -
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 -
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. -
Dynamic display of fields of table in ALV report.
To display the records of a table in ALV report dynamically such that first 10 fields of the table should only be displayed excluding 'mandt' field .
That is field no 2nd to 11th should be displayed.parameters: p_vari type slis_vari.
at selection-screen on value-request for p_vari.
perform alv_variant_f4 changing p_vari.
form alv_variant_f4 changing l_vari type slis_vari.
On F4 for layout selection - Get laouts created to this report.
data: l_variant type disvariant.
l_variant-report = sy-repid.
l_variant-username = sy-uname.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = l_variant
i_save = 'A'
importing
es_variant = l_variant
exceptions
others = 1.
if sy-subrc = 0.
l_vari = l_variant-variant.
endif.
Create a structure
data: wa_layout type disvariant.
fill up the layout with selected fields.
wa_layout-report = sy-repid.
wa_layout-username = sy-uname " Choose this if you want user specific
wa_layout-variant = p_vari.
Assign the same to the REUSE_ALV_GRID_DISPLAY
it is a import paramter IS_VARIANT = wa_layout.
All you have to do is first execute the report and save layouts what exactly you want
and then next time you run the report you will get a chance to select the layout of your own.
or
You can get rid of MANDT field from fieldcatalog and internal table by creating a new
structure. I mean, if you know you always want to display the field from 2 to 11 then simply
delete the field from fieldcatalog.
You can assign to different field catalog using Field symbols and change your internal
table as well since you have created a dynamic internal table.
Let me know if you need more. -
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 -
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 -
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 -
Sum hidden fields in web dynpro ALV reports
Hi everyone
Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
Thanks!
FedeHi everyone
Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
Thanks!
Fede -
How to make the field in the output ALV report editable ?
Hi,
I have a requirement to make fields like MATNR,WERKS in the output ALV report editable . Could any of you help me with this ?.
Thank you.
Moderator Message: Search.
Edited by: kishan P on Sep 6, 2010 6:35 PMHi
Please for available information on SCN. There are a lot of information on SCN about ALV wit hEDIT functionality.
Regards
Abhii -
How to show a value of a field in %(Percentage) in ALV report
Hi,
I would like to show % symbol in my ALV report.
Can anybody please let me know how to do this.
Thanks
Venkatplz refer this..
DATA : v_var(10) TYPE p DECIMALS 2,
v_char(12) .
v_var = '-3.12'.
IF v_var < 0 .
v_char = ABS( v_var ).
CONDENSE v_char.
CONCATENATE '-' v_char INTO v_char.
ELSE.
v_char = v_var.
ENDIF.
WRITE :/ v_var , -
Output field length issue in OO ALV
Hello Experts,
I have an requirement to download ALV grid output into Excel but some of columns having more than 128 characters, as per standard SAP will not support so I have included one more button and I have written the below code.
field-symbols: <fs_table> type standard table,
<fs_wa>.
* Get the current fields of the layout
CALL METHOD ALV_GRID->GET_FRONTEND_FIELDCATALOG
IMPORTING
ET_FIELDCATALOG = it_fcat.
* Generate dynamic internal table
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = it_fcatn
IMPORTING
EP_TABLE = dyn_table
assign dyn_table->* to <fs_table>.
create data dyn_line like line of <fs_table>.
assign dyn_line->* to <fs_wa>.
loop at lt_final into ls_final.
if ls_final-EBELP is not INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ls_final-EBELP
IMPORTING
OUTPUT = ls_final-EBELP.
endif.
MOVE-CORRESPONDING ls_final to <fs_wa>.
append <fs_wa> to <fs_table>.
endloop.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = FULLPATH
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = 'X'
CONFIRM_OVERWRITE = 'X'
TABLES
DATA_TAB = <fs_table>
FIELDNAMES = LT_HEADING
Now my problem is some of field output value getting truncated(in excel) but it displayed in Grid output.
eg.
lt_final having one text field(Doc. Type description) and the length is 20, actually printing 17 characters but we are not defining the output length.
Can you please anyone faced the problem earlier? Basically the SAP version is R/3 4.7.
Regards,
Vadamalai AHello All,
Before calling CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
we can define the length
WHEN 'BATXT'. wa_fcatn-OUTPUTLEN =
20.
Regards,
Vadamalai A.
We can close this thread.
Maybe you are looking for
-
Is it possible to edit a custom form created in SPD 2010 in Infopath 2010
I created a custom form in SPD, and need to use Infopath to further modify the form using features not available in SPD. But I can't get Infopath to open the custom form. Even if I selected the custom form in SPD and then click "Edit with Infopath"
-
I'd like to change monthly payment of Skype Number to yearly basis. How can I do? Solved! Go to Solution.
-
Functionality to copy SO working in quality but not in Production system -
HI Friends I have created a ztcode which uses bapi BAPI_SALESORDER_CREATEFROMDAT2 to create copies of a manually created sales order this function was working perfectly fine as till now we only had one line item per sales order last week we added a m
-
Error Mesage while creating second Loan (IT0045)
Dear All, We are having the Loan type of Computer loan, where as the employee can apply another computer loan once completing the repayment of First. When I am creating the second loan in IT0045, it throws the message of Computer Loan alrea
-
Java.lang.UnsatisfiedLinkError: no muxer in java.library.path
error while starting weblogic plz help me