Field catalog issue using REUSE_ALV_FIELDCATALOG_MERGE
Hello experts,
I am using FM REUSE_ALV_FIELDCATALOG_MERGE and the field catalog is created fron the program.
The field catalog finds the date field from the program but my internal table has been changed to make the date output YYYY/MM/DD.
When I input the internal table in FM REUSE_ALV_GRID_DISPLAY the output displays the date as DD/MM/YYYY which is not what I want.
How can I get FM REAUSE_ALV_GRID_DISPLAY to output the date in the format YYYY/MM/DD which is in my input table.
I have spent a lot of time researching SDN on this but cannot find a similar solution however I did find some examples of changing the field catalogue. Can anybody suggest this is the way to go and if I would use the edit mask field in the field catalog or is there a better way.
Thanks for any suggestions
I think you can use a field exit for this.
This means creating a field element and a domain in the data dictionary, the domain will need to have a conversion exit set by putting an entry in the 'Convers. Routine' field, eg MYDAT.
You will need to create two function mdules as below:
eg, CONVERSION_EXIT_MYDAT_OUTPUT
and CONVERSION_EXIT_MYDAT_INPUT
Your internal table will now need to refer to the data element you have created instead of the one you are currently using. ALV should automatically pick up the conversion exits and show the ouitput as you desire.
FUNCTION CONVERSION_EXIT_MYDAT_OUTPUT.
""Local Interface:
*" IMPORTING
*" REFERENCE(INPUT) TYPE DATS
*" EXPORTING
*" REFERENCE(OUTPUT)
concatenate input(4) '/' input4(2) '/' input6
into output.
ENDFUNCTION.
FUNCTION CONVERSION_EXIT_MYDAT_INPUT.
""Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT) TYPE DATS
data l_string type string.
l_string = input.
replace all occurrences of '/' in l_string with ' '.
output = l_string.
ENDFUNCTION.
Similar Messages
-
Hi ppl
I am building a field catalog for standard table 'API_VALI' , why am I not getting field catalog in xfield?
TYPE-POOLS: slis.
DATA: xfield TYPE slis_t_fieldcat_alv,
Code:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'API_VALI'
CHANGING
ct_fieldcat = xfield
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.As ABAP_TECHINCAL has written, for standard tables you don't have to send the parameter i_internal_tabname . Instead you have to send the table name in the parameter i_structure_name.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'API_VALI'
CHANGING
ct_fieldcat = xfield
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
See the sample program given in the link below. It shows, how to create Field Catalog for INTERNAL TABLES
http://www.erpgenie.com/abap/code/abap28.htm
Also check the link
field catalog generation using merge function -
Field catalog generation using merge function
i am trying to generate the field catalog using the below finction module, but i am not able to generate one and it is showing that 'FIeld catalog not generated'
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = LV_prog_name
I_INTERNAL_TABNAME = 'UT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = LV_prog_name
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = LT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
please help.Hello Pramod
The following sample report show how to use definitions of internal tables for creating (SLIS) fieldcatalogs. The data include contains the data definition that is commented (below INCLUDE statement).
*& Report ZUS_SDN_FIELDCATALOG_1
REPORT zus_sdn_fieldcatalog_1.
TYPE-POOLS: slis.
include zus_sdn_slisfcat_Data.
*DATA: BEGIN OF ty_s_list.
*DATA: bukrs LIKE knb1-bukrs.
*DATA: kunnr LIKE knb1-kunnr.
*DATA: vkorg TYPE knvv-vkorg. " type does not work !!!
*DATA: END OF ty_s_list.
DATA:
gs_list LIKE ty_s_list,
gt_list LIKE ty_s_list OCCURS 0.
DATA:
gt_fcat TYPE slis_t_fieldcat_alv.
START-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = syst-repid
i_internal_tabname = 'TY_S_LIST'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = 'ZUS_SDN_SLISFCAT_DATA'
I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = gt_fcat
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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_structure_name = 'LVC_S_FCAT'
TABLES
t_outtab = gt_fcat
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.
END-OF-SELECTION.
Regards
Uwe -
Field catalog issue in Data archiving
Hi Experts,
We are facing issue in SAP CRM Data Archiving info structure. I have created the fieldcatlog for the service Ticket( CRM_SERORD archive object) and Act On ( CRM_ACT_ON archive Object).
in our scenario, multiple Business partner(Consumer, orgnisational and employee) are attached to each Service ticket, in my ZARxx tables are storing the one entry means one service ticket and one Business partner.
My requirment is it should show all the business partners for each service ticket.
Could you please help me on this.
Regards,
SriniHi Srini,
We have the same problem for our project. Did you find a solution for this problem ?
Best regards,
Nevets -
Dear friends.
I kindly ask you to.I am using 'REUSE_ALV_FIELDCATALOG_MERGE' and 'REUSE_ALV_GRID_DISPLAY functions and in my field catalog as you can see below field catalog is used.How can I change the column names which has been in field catalog.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_structure_name = 'ZSOMT_MALZ'
i_client_never_display = 'X'
i_inclname = sy-repid
i_bypassing_buffer = 'X'
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = lt_slis_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3Hi yusuf,
1. just copy paste
2. important code is marked in bold
3.
report abc.
TYPE-POOLS : slis.
<b>DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvfcwa TYPE slis_fieldcat_alv.</b>
data : begin of itab occurs 0.
include structure usr02.
data : end of itab.
START-OF-SELECTION.
select * from usr02
into table itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IMPORTANT
LOOP AT ALVFC INTO ALVFCWA.
IF ALVFCWA-FIELDNAME = 'BNAME'.
ALVFCWA-DDICTXT = 'L'.
ALVFCWA-SELTEXT_L = 'HELLO HELLO'.
MODIFY ALVFC FROM ALVFCWA.
ENDIF.
ENDLOOP.
</b>
Display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
regards,
amit m.
Message was edited by: Amit Mittal -
Issue while generating Field catalog using LVC_VARIANT_SELECT
Hello Folks,
When i passed the default field catalog to the function module LVC_VARIANT_SELECT... for which the field name that is passed is standard field and the table name i was passing is Internal table ( Which is mandatory for my Req). As i am not passing the table name that exists at the DB level to the default field catalog .. this function module LVC_VARIANT_SELECT is returning all the field types as CHAR ( Irrespective of the field). This is causing me a problem in calculating totals ( standard functionality - throwing me message 'Column cannot be calculated' ) in my ALV_tree.
I have to use the Function Module LVC_VARIANT_SELECT ( Since i have a variant logic associated) and the Internal table to generate the field catalog .and i want to achieve the functionality of total,Avg ,,,,etc.. Any idea is appreciated.Got the Solution ... Passes Ref-table and Ref-field ... it gives totals for currency and quantity fields
-
How to display the fields in ALV Output without using Field catalog?
How to display the fields in ALV Output without using Field catalog?
Could you pls tell me the coding?
Akshitha.Hi,
u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
data: itab type table of mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = itab
CHANGING
ct_fieldcat = lt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*Pass that field catalog into the fillowing FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_grid_title = 'REPORTING'
is_layout = gt_layout
it_fieldcat = lt_fieldcat[]
tables
t_outtab = itab. -
Doubt in using field catalog merge function
hi all,
When I am using the function maodule reuse_alv_fieldcatalog_merge for building the field catalog in alv list,it was giving abend message as
'Field catalog is empty'.
what might be the reason for such message?can some one help me out with the solution to get rid of that.
I cant populate the catalog manually because I need to display nearly 40 fields in the output.
Thanks in advance.hI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_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 t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
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 DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL -
ALV report using the field catalog
which is the quickest way to generate an ALV report using the field catalog merge. without needing to build the field catalog manually .
is it easier to create a structure and passe it in the field catalog merge . if yes can i have an example plzzzzhI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_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 t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
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 DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL -
Error in field catalog in ALV grid display using classes at do_sum = "X'.
Hi,
I'm using classes in ALV Grid display.
the code for the field catalog is going to dump because of the statement in the field catalog for field 'netwr',do_sum = 'X'.
that do_sum = 'X' is not working and going to dump when executed.with out that do_sum it is working fine. the error in dump analysys is showing sap standard incude LSLVCF01.
assign component
<ls_fieldcat>-fieldname of structure rt_data to <g_field>.
if sy-subrc ne 0.
message x000(0k).
endif.
sy-subrc is 4 when the program is being executed.
CODE:
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
ls_fcat-fieldname = 'VBELN1'.
ls_fcat-ref_field = 'VBELN'.
ls_fcat-ref_table = 'VBRK'.
ls_fcat-coltext = 'Invoice No'.
ls_fcat-seltext = 'Invoice No'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'BUDAT'.
ls_fcat-ref_table = 'BKPF'.
ls_fcat-coltext = 'Invoice Date'.
ls_fcat-seltext = 'Invoice Date'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'NETWR'.
ls_fcat-ref_field = 'NETWR'.
ls_fcat-ref_table = 'VBRK'.
ls_fcat-coltext = 'Value of Invoice'.
ls_fcat-seltext = 'Value of Invoice'.
ls_fcat-datatype = 'CURR'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ENDFORM.
can u please look in the code and rectify the error,
would appeciate ur response.
regards,
veera.Hi,
try this..
ls_fcat-fieldname = 'NETWR'.
ls_fcat-ref_field = 'NETWR'.
ls_fcat-ref_table = 'VBRK'.
ls_fcat-coltext = 'Value of Invoice'.
ls_fcat-seltext = 'Value of Invoice'.
ls_fcat-datatype = 'CURR'.
ls_fcat-do_sum = 'X'.
<b>ls_fcat-cfieldname = 'WAERS'.</b>
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
Regards
vijay -
Field catalog not generated using semi automatic method
Hi,
I have this structure defined in my program.
TYPE: BEGIN OF TY_OUTPUT,
BUKRS TYPE BUKRS,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1,
BUSAB TYPE BUSAB,
KONZS TYPE KONZS,
LAND1 TYPE LAND1,
WAERS TYPE WAERS,
BALAN TYPE WRBTR,
CAT01 TYPE WRBTR,
CAT02 TYPE WRBTR,
CAT03 TYPE WRBTR,
CAT04 TYPE WRBTR,
CAT05 TYPE WRBTR,
CAT06 TYPE WRBTR,
PYAMT TYPE PYAMT,
WROFF TYPE WRBTR,
END OF TY_OUTPUT.
Using this structure i m creating field catalog semi automatically passing structure name as an exporting parameter.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'TY_OUTPUT'
CHANGING
CT_FIELDCAT = P_GT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
But P_GT_FIELDCAT table is initial after the function hence grid is not displayed.
Can anyone suggest me what to do??you need to pass a standard or z-structure created using se11 in parameter
I_STRUCTURE_NAME.
you need to create this structure in se11 instead of creating it using TYPE statement.
I_STRUCTURE_NAME is of type DD02L-TABNAME.
Regards
Suvi -
Use of field TEXT_FIELDNAME in Field Catalog for ALV
Hi Experts,
Could any one pls tell me the relevance (purpose) of the field TEXT_FIELDNAME in Field catalog for an ALV ?
How is it different from the fields such as seltext_l, seltext_m, seltext_s ? When is it necessary to assign a value to this field ?
Thanks & Regards
AbhijithHi Abhijit
Refer to the following
<b>TEXT_FIELDNAME :</b> Field name of internal table field. You can use this field to define a reference to a field that is used as the description for the current field. If a subtotal is calculated for the current field, the ALV Grid Control displays the descriptions in the field assigned.
Example: Your output table contains one column for material numbers and one column for the description of what these numbers mean (such as clockwork). If you calculate subtotals for the material numbers, only these numbers are usually displayed as the subtotals text. Based on the link to TXT_FIELD , you can refer to the corresponding column with the material description. This description is then used as the subtotals text.
<b>SELTEXT_L :</b> Long key word (40 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
<b>SELTEXT_M :</b> Medium key word (20 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
<b>SELTEXT_S :</b> Short key word (10 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
Award points if found useful.
Regards
Inder -
Using instruction for creating field catalog to archive object "MM_MATNR"
Hi all,
I need a using instruction for creating a new field catalog to archive object "MM_MATNR". I'd like to create a field catalog using some fields of tables mara, makt, mvke and marc.
Thanks for your help!Hi,
Go to following link;
[Material Master Archiving|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90f75a80-867f-2d10-7aa6-ac164e43e89f?quicklink=index&overridelayout=true] -
Simple way to create field catalogs in ALV Reports using subroutine
In ALV Reports When creating field catalog, instead of giving field catalog for every field seperatly we can use following simple method to create field catalog.
This method makes your code very easy to read as well as to understand. I am going to show code only to prepare field catalog to make this method easy to understand. Their also contains code for fetching data from requires table and calling function module for ALV . I am not including it in this program but it should be their in program -
REPORT ZALV_INTERACTIVE_REPORT.
TYPE-POOLS SLIS.
TYPES : BEGIN OF TY_MARA,
MATNR TYPE MATNR,
MTART TYPE MTART,
MBRSH TYPE MBRSH,
MEINS TYPE MEINS,
END OF TY_MARA.
DATA IT_MARA TYPE STANDARD TABLE OF TY_MARA.
DATA WA_MARA TYPE TY_MARA.
" Internal table and work area for Field Catalog
DATA IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA WA_FIELDCAT LIKE LINE OF IT_FIELDCAT.
START-OF-SELECTION.
* PERFORM FETCH_DATA .
" FIELDS IN FIELD CATALOG (PASSED IN SUBROUTINE):-
" 'FIELDNAME'<SPACE> 'SELTEXT_M' <SPACE>'KEY'<SPACE> 'HOTSPOT'
PERFORM PREP_CATALOG USING : 'MATNR' 'MATERIAL NO.' 'X' 'X' ,
'MTART' 'MATERIAL TYPE' ' ' ' ' ,
'MBRSH' 'IND SECTOR' ' ' ' ' ,
'MEINS' 'UOM' ' ' ' ' .
* PERFORM CALL_ALV_FM .
" Subroutine to create field catalog
FORM PREP_CATALOG USING VALUE(P_FIELDNM)
VALUE(P_SELTEXT)
VALUE(P_KEY)
VALUE(P_HOTSPOT) .
WA_FIELDCAT-FIELDNAME = P_FIELDNM .
WA_FIELDCAT-SELTEXT_M = P_SELTEXT .
WA_FIELDCAT-KEY = P_KEY .
WA_FIELDCAT-HOTSPOT = P_HOTSPOT .
APPEND WA_FIELDCAT TO IT_FIELDCAT .
ENDFORM .
Above code will repeat the execution of subroutine PREP_CATALOG for every set of values passed to subroutine because we used
USING : (chain operator) to pass value to subroutine.
Subroutine will assign passed values to corresponding field and simply appends those values in ITAB created for field catalog(IT_FIELDCAT). It repeates this process until all the passed values are appended into ITAB.
This method will reduce complexity of the code as well as time required to write code for every field's field catalog seperatly. It does lots of work in very few lines of codes.Scott,
I don't think there is a way to divide all numbers by a million in one shot, but you could divide the numbers by million by writing code for each amount field as needed: <?FIELD1 div 1000000?> and the use the round function <?xdoxslt:round(2.777,2)?>
combined function: <?xdoxslt:round((12345605.6 div 1000000),2)?>
Thanks,
Bipuser -
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
Maybe you are looking for
-
HT3819 How do I transfer my entire library from one computer to another?
How do I transfer my entire library from one computer to another?
-
I can't update iTunes to 12.0.1
Hello, I can't update itunes to 12.0.1. When I click "update", it gets loaded from the app store, but doesn't do the update. I tried several times, also after rebooting. The (not working) update is in the list of past updates though: http://cl.ly/ima
-
Screen Share connection problems
I have an iMac and a MacBookPro on my home network. I used to be able to share screens between them quickly, trivially, painlessly. For a while now, though, it never (or rarely) works. Not sure, but possibly began after I upgraded to Snow Leopard. Se
-
A previous thread noted that, to enable security-related settings (including commenting) in Reader for an Acrobat-generated PDF, you have to select Extend features in Adober Reader from the Advanced menu. Does any one know if there's a setting in Acr
-
Please help installing Adobe Air
Adobe Air registers as being successfully installed, but when I try to use it computer asks for installation again