Refresh REUSE_ALV_GRID_DISPLAY with Field Catalog
Hi Gurus.
Basicly : How can I refresh my ALV grid via field catalog?
Detail : I want refresh my ALV Grid (I am using Reuse_Alv_Grid_Display) with field catalog. Our end users want show/hide some columns. I have been adding a button at toolbar. If user click this. My ALV grid going refresh and show/hide columns. I have a global variable for this. If user click this I set its value X or ''. I set my catalog
Wa_cat-No_out = p_show
p_show will be 'X' or ''.
Perform Create_Alv_Catalog.
Perform ALVDisplay Tables IRapor.
If I re execute this lines. It is open another grid. It is not working clearly
Hi Mehmet,
1. Due to some reasons, this
technique DOES NOT WORK.
2. However, we have a WORKAROUND
and it works FANTASTIC.
3. the key is
slis_selfield-EXIT = 'X'.
(in the call back FORM)
4. In the call back form,
do the following things :
a) reconstruct field catalogue,
b) show alv AGAIN
c) slis_selfield-EXIT = 'X'.
5. just copy paste this code in new program
a) it will show t001 (company info)
b) on double-clicking,
it will HIDE company text.
6.
REPORT abc.
TYPE-POOLS : slis.
Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvwa TYPE slis_fieldcat_alv.
Select
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
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.
Display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid
i_callback_user_command = 'ITAB_USER_COMMAND'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
LOOP AT alvfc INTO alvwa.
IF alvwa-fieldname = 'BUTXT'.
alvwa-no_out = 'X'.
MODIFY alvfc FROM alvwa.
ENDIF.
ENDLOOP.
*------- Field Catalogue
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.
Display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid
i_callback_user_command = 'ITAB_USER_COMMAND'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IMPORTANT.
IMPORTANT.
whatrow-exit = 'X'.
ENDFORM. "itab_user_command
regards,
amit m.
Similar Messages
-
How to download alv grid output(with field catalog) into excel file format
Hi all,
How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
Please help.
Regards,
Satya.Hi,
On list where alv is displayed, select export icon( green color -> ),select spread sheet.
This will display records in Excel sheet. -
ALV program with Field Catalog
Hi ,
Can any body please provide me sample ALV programs with Field Catalog and GRID DISPLAY. and also please give me the steps for writing the program.
Thanks in advance.
KPHi,
For ALV GRID DISPLAY (using <b>OOPS</b>),
1)Create an object of the <b>container</b>(an instance of a class like cl_gui_custom_container).
2)Create an object of the <b>ALV using class cl_gui_alv_grid</b> and give the CONTAINER name that you define in your screen layout as the parent of the ALV.
3)Call the method <b>SET_TABLE_FOR_FIRST_DISPLAY</b> of the class cl_gui_alv_grid.
4)<b>Field catalog</b> is used when you want a variation of the standard structure to be displayed on your ALV.A variable of table type <b>LVC_T_FCAT</b> is defined and variations can be made as per the requirements.The variable is then passed in the method SET_TABLE_FOR_FIRST_DISPLAY.
<b>A SAMPLE PROGRAM:</b>
REPORT SAMPLE:
*-- GLOBAL DATA DECLARATIONS FOR ALV
<b>DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.</b>
DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
<b>DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.</b>
DATA gt_fieldcat TYPE lvc_t_fcat.
Data:i_spfli type table of spfli.
*The value CC_ALV is given to the custom container in the screen layout
START-OF-SELECTION.
select * from spfli into table i_spfli.
Call screen 100.
MODULE STATUS_0100 OUTPUT
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
*Create container
<b>CREATE OBJECT gr_ccontainer
EXPORTING container_name = gc_custom_control_name.</b>
*Create ALV
<b>CREATE OBJECT gr_alvgrid
EXPORTING i_parent = gr_ccontainer.</b>
*field catalog
<b>PERFORM prepare_field_catalog CHANGING gt_fieldcat.</b>
*to display the ALV
<b>CALL METHOD gr_alvgrid->set_table_for_first_display</b>
EXPORTING
I_STRUCTURE_NAME = 'SPFLI'
CHANGING
it_outtab = i_spfli[]
it_fieldcatalog = gt_fieldcat.
ENDMODULE. "display_alv OUTPUT
MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
IF sy-ucomm = 'BACK' OR
sy-ucomm = 'EXIT' OR
sy-ucomm = 'CANCEL'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
*& Form prepare_field_catalog
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
ls_fcat-ref_table = 'SPFLI'.
ls_fcat-fieldname = 'CARRID'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'CONNID'.
ls_fcat-ref_table = 'SPFLI'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'DEPTIME'.
ls_fcat-ref_table = 'SPFLI'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'ARRTIME'.
ls_fcat-ref_table = 'SPFLI'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
endform.
<b>For more sample programs refer:</b>http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
<b>-->download the PDF from following link.</b>
www.abap4.it/download/ALV.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
<b>Some more:</b>
http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://
<b>You can get all demo programs for ALV:</b>Go to se38 and type BCALV* and press F4 for all demo porgrams.
Regards,
Beejal
**Reward if this helps -
Problem with field catalog after upgrade from 4.0
Hi experts,
We have recently upgraded from CRM 4.0 to 5.2.
I am now experiencing a problem with generation of a transport request for field catalog in transaction CTFC_CRM. I can generate the field catalog without errors.
The problem is that when I want to create the transport request in our dev system a pop up appears saying "Create object directory entry". Here I have to enter a package for some of the fields in the field catalog. The special thing is that the fields are not custom fields but rather SAP standard fields (using standard data elements). For example field BZIRK.
These are SAP standard fields but they are not standard in the field catalog. In 4.0 I did not get this prompt but this has apparently changed from 5.0.
What do I do? I guess if I need to create the objects I will need to use an SAP standard package. But how do I know what package to use?
Any comments or suggestions will be highly appreciated.
Best regards,
AndersHi,
If you did just install database, then you use Embed PL/SQL Gateway.
See this guide
Upgrading Oracle Application Express in Oracle Database Express Edition
I think you have not run step 5 script apxldimg.sql
Regards,
Jari -
Hi,
I am trying to create a condition table for inventory management. I require it at material group / movement type level. I added the fields ZZMATKL (type MATKL) and ZZBWART (type BWART) in the structure KOMPBZ2 (which is present in in the include of structure KOMPBME).
I also added the two above custom fields in table V_T161F. But when I try to create a condition table I dont find the above two fields in the field catalog.
Please help.
Am I using an incorrect structure?
Thanks!!
AroopHi Friend,
Looking at your code, I found that you have not the fieldcatalog at all.
You need to fill the fieldcatalog with all the fields you want to display in the alv.
Check the following links regarding field catalog:
http://abap-gallery.blogspot.com/2007/07/field-catalog-in-alv.html
Check this link for sample program:
http://www.****************/Tutorials/ALV/SampleALVGridProgram.htm
Hope this helps you.
Any queries, get back to me.
Regards,
Chandra Sekhar -
URGENT ISSUE ! PLS SEE IT ( related to cureency field in field catalog)
Hi Gurus,
I have populated the field catalog inf like this.
is_FIELDCATALOG-FIELDNAME = 'W_EXT_AMOUNT'.
is_FIELDCATALOG-SELTEXT_M = 'Extended Amount'.
is_FIELDCATALOG-COL_POS = 4.
IS_FIELDCATALOG-OUTPUTLEN = 16.
is_FIELDCATALOG-REF_FIELDNAME = 'WAERS'.
is_FIELDCATALOG-REF_TABNAME = 'T001'.
IS_FIELDCATALOG-CFIELDNAME = 'DMBTR'.
is_fieldcatalog-ctabname = 'BSIS'.
APPEND IS_FIELDCATALOG TO IT_FIELDCATALOG.
CLEAR IS_FIELDCATALOG.
Data : W_EXT_AMOUNT type DMBTR.
I calculated it using
W_EXT_AMOUNT = IS_ERROR-AMOUNT * P_NETAMT.( amount is of type
DMBTR)
in the out put Amount is displayed with value 0,00
W_EXT_AMOUNT displayed as blank
when i print it for spool generation, its giving following dump
DUMP analysis.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLKKBL" had to be terminated because
come across a statement that unfortunately cannot be executed.
You attempted to access an unassigned field symbol
(data segment 95).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
SourceCde
2785 case gs_out-field_colcount.
2786 when 001.
2787 if gs_out_flags-slave ne 'X'.
2788 assign <fm01> to <field>.
2789 gs_fc = gs_mfc01.
2790 else.
2791 assign <fs01> to <field>.
2792 gs_fc = gs_sfc01.
2793 endif.
2794 when 002.
2795 if gs_out_flags-slave ne 'X'.
2796 assign <fm02> to <field>.
2797 gs_fc = gs_mfc02.
2798 else.
2799 assign <fs02> to <field>.
2800 gs_fc = gs_sfc02.
2801 endif.
2802 when 003.
2803 if gs_out_flags-slave ne 'X'.
2804 assign <fm03> to <field>.
2805 gs_fc = gs_mfc03.
2806 else.
2807 assign <fs03> to <field>.
2808 gs_fc = gs_sfc03.
2809 endif.
2810 when 004.
2811 if gs_out_flags-slave ne 'X'.
>>>> assign <fm04> to <field>.2813 gs_fc = gs_mfc04.
2814 else.
2815 assign <fs04> to <field>.
2816 gs_fc = gs_sfc04.
2817 endif.
Note : problem may be with field catalog population since if i remove W_EXT_AMOUNT it is working fine, not giving any dump.
Pls see.
Thanks & Regards
Srinivas RaoHi see this code and try again.
REPORT zn_alv_complex .
TABLES : vbrk .
TYPE-POOLS : slis .
CONSTANTS : gc_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
TYPES : BEGIN OF ty_vbrk ,
vbeln TYPE vbrk-vbeln ,
vkorg TYPE vbrk-vkorg,
vtweg TYPE vbrk-vtweg,
kunrg TYPE vbrk-kunrg,
END OF ty_vbrk,
BEGIN OF ty_vbrp,
vbeln TYPE vbrp-vbeln,
posnr TYPE vbrp-posnr,
matnr TYPE vbrp-matnr,
netwr TYPE vbrp-netwr,
END OF ty_vbrp,
BEGIN OF ty_final,
vbeln TYPE vbrk-vbeln ,
posnr TYPE vbrp-posnr,
matnr TYPE vbrp-matnr,
netwr TYPE vbrp-netwr,
vkorg TYPE vbrk-vkorg,
vtweg TYPE vbrk-vtweg,
kunrg TYPE vbrk-kunrg,
END OF ty_final .
DATA : it_vbrk TYPE TABLE OF ty_vbrk,
it_vbrp TYPE TABLE OF ty_vbrp,
it_final TYPE TABLE OF ty_final ,
wa_vbrk TYPE ty_vbrk,
wa_vbrp TYPE ty_vbrp,
wa_final TYPE ty_final ,
git_event TYPE slis_t_event,
git_layout TYPE slis_layout_alv,
git_fieldcat TYPE slis_t_fieldcat_alv,
gwa_fieldcat TYPE slis_fieldcat_alv.
SELECT-OPTIONS : s_vbeln FOR vbrk-vbeln,
s_vkorg FOR vbrk-vkorg,
s_vtweg FOR vbrk-vtweg.
START-OF-SELECTION .
SELECT vbeln vkorg vtweg kunrg
FROM vbrk
INTO TABLE it_vbrk
WHERE vbeln IN s_vbeln
AND vkorg IN s_vkorg
AND vtweg IN s_vtweg .
SELECT vbeln posnr matnr netwr
FROM vbrp
INTO TABLE it_vbrp
FOR ALL ENTRIES IN it_vbrk
WHERE vbeln = it_vbrk-vbeln .
LOOP AT it_vbrp INTO wa_vbrp .
READ TABLE it_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbrp-vbeln .
wa_final-vbeln = wa_vbrk-vbeln.
wa_final-posnr = wa_vbrp-posnr.
wa_final-netwr = wa_vbrp-netwr.
wa_final-matnr = wa_vbrp-matnr.
wa_final-vkorg = wa_vbrk-vkorg.
wa_final-vtweg = wa_vbrk-vkorg.
wa_final-kunrg = wa_vbrk-kunrg.
APPEND wa_final TO it_final.
CLEAR : wa_vbrk , wa_vbrp , wa_final .
ENDLOOP .
PERFORM sub_fieldcatalog.
PERFORM sub_layout_init CHANGING git_layout.
PERFORM sub_build_event USING git_event[] .
PERFORM sub_alv_display.
*& Form SUB_FIELDCATALOG
text
FORM sub_fieldcatalog.
REFRESH git_fieldcat.
gwa_fieldcat-col_pos = 0.
gwa_fieldcat-fieldname = 'VBELN'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 14.
gwa_fieldcat-seltext_l = 'Billing Doc.' .
gwa_fieldcat-seltext_m = 'Billing Doc.' .
gwa_fieldcat-seltext_s = 'Billing Doc.' .
APPEND gwa_fieldcat TO git_fieldcat .
gwa_fieldcat-col_pos = 1.
gwa_fieldcat-fieldname = 'POSNR'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 5.
gwa_fieldcat-seltext_l = 'Item.' .
gwa_fieldcat-seltext_m = 'Item' .
gwa_fieldcat-seltext_s = 'Item' .
APPEND gwa_fieldcat TO git_fieldcat .
gwa_fieldcat-col_pos = 2.
gwa_fieldcat-fieldname = 'VKORG'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 14.
gwa_fieldcat-seltext_l = 'Sales Org' .
gwa_fieldcat-seltext_m = 'Sales Org' .
gwa_fieldcat-seltext_s = 'Sales Org' .
APPEND gwa_fieldcat TO git_fieldcat .
gwa_fieldcat-col_pos = 3.
gwa_fieldcat-fieldname = 'VTWEG'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 14.
gwa_fieldcat-seltext_l = 'Dist. Ch.' .
gwa_fieldcat-seltext_m = 'Dist. Ch.' .
gwa_fieldcat-seltext_s = 'Dist. Ch.' .
APPEND gwa_fieldcat TO git_fieldcat .
gwa_fieldcat-col_pos = 4.
gwa_fieldcat-fieldname = 'MATNR'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 18.
gwa_fieldcat-seltext_l = 'Material' .
gwa_fieldcat-seltext_m = 'Material' .
gwa_fieldcat-seltext_s = 'Material' .
APPEND gwa_fieldcat TO git_fieldcat .
gwa_fieldcat-col_pos = 5.
gwa_fieldcat-fieldname = 'NETWR'.
gwa_fieldcat-tabname = 'IT_FINAL'.
gwa_fieldcat-outputlen = 14.
gwa_fieldcat-seltext_l = 'Price' .
gwa_fieldcat-seltext_m = 'Price' .
gwa_fieldcat-seltext_s = 'Price' .
gwa_fieldcat-do_sum = 'X' .
APPEND gwa_fieldcat TO git_fieldcat .
ENDFORM . "SUB_FIELDCATALOG
*& Form sub_alv_display
text
FORM sub_alv_display .
DATA : gv_repid TYPE sy-repid .
gv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gv_repid
i_callback_user_command = 'USER-COMMAND'
is_layout = git_layout
it_fieldcat = git_fieldcat
i_save = 'A'
it_events = git_event[]
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM . "sub_alv_display
*& Form
text
FORM sub_layout_init CHANGING xyt_layout TYPE slis_layout_alv.
CLEAR xyt_layout .
xyt_layout-colwidth_optimize = 'X'.
xyt_layout-zebra = 'X' .
ENDFORM. "SUB_LAYOUT_INIT
*& Form SUB_BUILD_EVENT
text
-->XT_EVENT text
FORM sub_build_event USING xt_event TYPE slis_t_event .
DATA : lwa_event TYPE slis_alv_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = xt_event
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE xt_event WITH KEY name = slis_ev_top_of_page INTO
lwa_event.
lwa_event-form = gc_top_of_page.
IF sy-subrc EQ 0 .
MODIFY xt_event FROM lwa_event TRANSPORTING form WHERE name =
gc_top_of_page.
ENDIF.
ENDFORM. "SUB_BUILD_EVENT
*& Form TOP_OF_PAGE
text
FORM top_of_page .
CONSTANTS : lc_s TYPE char01 VALUE 'S'.
DATA : lv_ecfld(250) TYPE c ,
lwa_header TYPE slis_listheader ,
lv_date(10) TYPE c,
lv_user(10) TYPE c,
lit_alv_header TYPE slis_t_listheader .
CLEAR : lv_user , lv_date .
CLEAR : lwa_header .
lwa_header-typ = 'S'.
lv_ecfld = 'User'.
lwa_header-key = lv_ecfld .
lwa_header-info = sy-uname.
APPEND lwa_header TO lit_alv_header .
CLEAR : lwa_header .
lwa_header-typ = 'S'.
lv_ecfld = 'Date'.
lwa_header-key = lv_ecfld .
lwa_header-info = sy-datum .
APPEND lwa_header TO lit_alv_header .
CLEAR : lwa_header .
lwa_header-typ = 'S'.
APPEND lwa_header TO lit_alv_header .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lit_alv_header.
ENDFORM . "TOP_OF_PAGE
Regards,
Nihar Swain . -
Field catalog for internal table in ALV
In my program the internal table consists many fields from various tables and structure doesn't belong to a single data table.
In order to get output in ALV grid following FM has been used
REUSE_ALV_GRID_DISPLAY
for field catalog the fields are defined specifically.
l_fieldcat-fieldname = 'VBELN'.
l_fieldcat-outputlen = 10.
l_fieldcat-seltext_l = 'Billing doc'.
l_fieldcat-no_zero = 'X'.
l_fieldcat-hotspot = 'X'.
append l_fieldcat to p_fieldtab.
..............and so on for all the fields.
Just wanted to know is there any other method to display all the fields of this internal table automatically so each field is not specified specifically.
anyaHi
Try this instead:
*& Form create_fieldcatalog
* Create a field catalogue from any internal table
* -->PT_TABLE Internal table
* -->PT_FIELDCAT Field Catalogue
FORM create_fieldcatalog
USING pt_table TYPE ANY TABLE
CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA:
lr_tabdescr TYPE REF TO cl_abap_structdescr
, lr_data TYPE REF TO data
, lt_dfies TYPE ddfields
, ls_dfies TYPE dfies
, ls_fieldcat TYPE lvc_s_fcat
CLEAR pt_fieldcat.
CREATE DATA lr_data LIKE LINE OF pt_table.
lr_tabdescr ?= cl_abap_structdescr=>describe_by_data_ref( lr_data ).
lt_dfies = cl_salv_data_descr=>read_structdescr( lr_tabdescr ).
LOOP AT lt_dfies
INTO ls_dfies.
CLEAR ls_fieldcat.
MOVE-CORRESPONDING ls_dfies TO ls_fieldcat.
APPEND ls_fieldcat TO pt_fieldcat.
ENDLOOP.
ENDFORM. "create_fieldcatalog -
New Field Addition in Allowed Field Catalogs -Pricing.
*Hi,
We have requirement of having Material Description field in the Allowed Field Catalogs in SPRO --> SD --> Basic Functions --> Pricing --> Pricing Controls --> Define Condition tables --> Allowed Field Catalogs in order to fetch the same for Pricing Condition Table creation with Mtrl Description as Key Combination.
Hence, as a first step, have added the MAKTX field inside the "ZStructure" (which was created before) inside Main Structure KOMP and activated the same. Then i have added the same field MAKTX in Allowed Field Catologs of Pricing using New Entries.
Now i have tried to create a new Pricing Condition Table with field catalog of Material Description (the added field), but there is no such field is available for selection.
Is there anything i missed to do, so that the newly added field is available during New Condition Table Creation with key combination of the added field.
Appreciate your promot response.*
Rgds,Hi,
Thanks for your response.
Have added the required field in Structure KOMG now and it is available for selection in Condition Table Field Catalogs. However, am allowed to select this field only when creating a New Condition Table and if i want to add this field in the already created condition table in change mode, it thows an error message - "Function Code cannot be selected".
How to proceed further.
Rgds, -
Reg: ALV Field catalog refresh
Hello All,
Initially I have to display an ALV grid. Upon a buttons click(User Command) , an additional col should be displayed for which the field catalog of the ALV needs to be changed. Iam using FM ''REUSE_ALV_GRID_DISPLAY'.My question is , how cld v refresh filedcatalog ? To refresh the grid data , we use selfield-refresh = 'X'. Is there any thing some thing like that to refresh fieldcat or v have to build the fieldcat again?
I have pasted part of code below:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'TRIGS_IGT_WRKLIST'
CHANGING
ct_fieldcat = c_tab_fieldcat_main.
LOOP AT c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>.
IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT' OR
<l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA' OR
<l_wa_fieldcat_main>-fieldname = 'VALUATION_CLASS' OR
<l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE' OR
<l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE' OR
<l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT' OR
<l_wa_fieldcat_main>-fieldname = 'SECURITY_ID' OR
<l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT' OR
<l_wa_fieldcat_main>-fieldname = 'POSDATE' OR
<l_wa_fieldcat_main>-fieldname = 'TRLDATE' OR
<l_wa_fieldcat_main>-fieldname = 'COMPANY_ID' OR
<l_wa_fieldcat_main>-fieldname = 'COUNTERPARTY' OR
<l_wa_fieldcat_main>-fieldname = 'UNITS' OR
<l_wa_fieldcat_main>-fieldname = 'POSITION_CURR' OR
<l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER' OR
<l_wa_fieldcat_main>-fieldname = 'POSITION_AMT' .
ELSE.
<l_wa_fieldcat_main>-no_out = 'X'.
ENDIF.
Assign postion
IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT'.
<l_wa_fieldcat_main>-col_pos = 2.
<l_wa_fieldcat_main>-ddictxt = 'M'.
<l_wa_fieldcat_main>-outputlen = '5'.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE'.
<l_wa_fieldcat_main>-col_pos = 3.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA'.
<l_wa_fieldcat_main>-col_pos = 4.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE'.
<l_wa_fieldcat_main>-col_pos = 5.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ID'.
<l_wa_fieldcat_main>-col_pos = 6.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT'.
<l_wa_fieldcat_main>-col_pos = 7.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER'.
<l_wa_fieldcat_main>-col_pos = 8.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT'.
<l_wa_fieldcat_main>-col_pos = 9.
<l_wa_fieldcat_main>-ddictxt = 'M'.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'POSDATE'.
<l_wa_fieldcat_main>-col_pos = 10.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'TRLDATE'.
<l_wa_fieldcat_main>-col_pos = 11.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_ID'.
<l_wa_fieldcat_main>-col_pos = 12.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'UNITS'.
<l_wa_fieldcat_main>-col_pos = 13.
ENDIF.
IF <l_wa_fieldcat_main>-fieldname = 'POSITION_AMT'.
<l_wa_fieldcat_main>-col_pos = 14.
ENDIF.
ENDLOOP.
CASE sy-ucomm.
WHEN 'MATCH'.
READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
WITH KEY fieldname = 'MATCHED'.
CHECK sy-subrc EQ 0.
<l_wa_fieldcat_main>-col_pos = 1.
<l_wa_fieldcat_main>-seltext_s = 'Matched Pairs'.
<l_wa_fieldcat_main>-seltext_m = 'Matched Pairs'.
<l_wa_fieldcat_main>-seltext_l = 'Matched Pairs'.
<l_wa_fieldcat_main>-no_out = ' '.
WHEN 'REVERSAL'.
READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
WITH KEY fieldname = 'ICON_REVERSAL'.
CHECK sy-subrc EQ 0.
<l_wa_fieldcat_main>-col_pos = 1.
<l_wa_fieldcat_main>-icon = 'X'.
<l_wa_fieldcat_main>-outputlen = 3.
<l_wa_fieldcat_main>-no_out = ' '.
ENDCASE.
Thanks,
SriHi
U need to use the fm REUSE_ALV_GRID_LAYOUT_INFO_SET, here you can change the catalog table.
Max -
Error ,Field catalog not found while doing billing with DP90
Dear Guru's
while doing billing with DP90 transaction code.i have given service order no xxxx and execute.Then i received the below error
Field catalog not found , Message no. 0K530.Kindly help me in solving the issue.
Thank u
S Babuhi naga suribabu,
I am also facing same issue. can you please help, where to check the configuration for this issue -
Hi experts,
Is it possible to display ALV report with out using field catalog ? If yes please tell me how .
Thanks,
UshaHi ,
use the FM 'REUSE_ALV_FIELDCATALOG_MERGE'
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'T_KNA1'
I_STRUCTURE_NAME = 'KNA1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = T_FCAT1
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.
Regards,
Vijay -
Field catalog does not agree with the fields of the functional area
G'day everyone,
I am using a generic extractor via infoset to extract data from R/3 source system.
Using RSA3, I have obtained an error message and no further details.
****ERROR MESSAGE
"Field catalog does not agree with the fields of the functional area
Message no. RSUQ134
****ERROR MESSAGE
I have checked and adjusted my infoset in SQ02 and they seems fine but still obtain the same error.
In BW, replicated the datasource and activate the transfer rules but still obtain the same error.
Anyone knows how to get more details for this type of error? Or how to fix this problem?
Regards
WayneI think I have just solved it.
Transaction RS02 delete and recreate after checking the structure in BW and Source system are the same.
Cheers -
Field catalog with INCLUDE TYPE
Hi all,
I want to build field catalog for internal table which has INCLUDE TYPE. Can anybody please help me.
Please note,
LVC_FIELDCATALOG_MERGE or REUSE_ALV_FIELDCATALOG_MERGE are not working -- Refer documentation of second FM..
Manual method is out of question, there are lot of tables / structure and i am doing lot of stuff dynamically.
Thanks,
Regards,
MohaiyuddinCannot do it with include.. I had defined all internal table instead of structures..
-
Field catalog in alv with classes(OOPS)
please refer the code below of field catalog prepared.
this code is for preparing field catalog using ALV and OOPS.In the below field catalog, do_sum is not working.it is going to dump.
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 = 'DMBTR'.
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-ref_table = 'BSAD'.
ls_fcat-coltext = 'Value of Invoice'.
ls_fcat-seltext = 'Value of Invoice'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ENDFORM. "PREPARE_FIELD_CATALOG
I would apreciate u response.
regards,
veera.Hello Veeranjaneyulu
I prefer to use function module <b>LVC_FIELDCATALOG_MERGE</b> to build my fieldcatalogs.
If you need fields from different structure that is no problem. Simply call the function module for each structure and collect the result in the same itab (e.g. lt_fcat).
Finally, you delete all fields that you do not need.
If the order is important to you then re-order the fields:
LOOP AT lt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY lt_fcat from ls_fcat.
ENDLOOP.
Regards
Uwe -
Round off at the field catalog with no decimals
Hi,
I'm using an ALV grid to display the data. The field catalog is defined as follows.
fieldcatalog TYPE slis_t_fieldcat_alv
Is it possible to round off at the field catalog itself. For example, i have qty as 100.696 in the itab, i want to make it 101.
What can be used to do this at the fieldcatalog stage?
Thanks
KeshiKeshini,
Why con't you round of the value while moving into itab.
Ex :
LOOP at Itab.
round ( itab-field ).
move itab-field to i_final-field.
endloop.
Ex :
DATA pack TYPE p VALUE '123.456'
DECIMALS 3.
WRITE pack DECIMALS 2. 123,46
WRITE: / pack ROUND -2, 12.345,600
/ pack ROUND -1, 1.234,560
/ pack ROUND 1, 12,346
/ pack ROUND 2. 1,235
ROUND <r> -
Type P fields are multiplied by 10**(-r) and then rounded.
Pls. Reward if useful
Maybe you are looking for
-
Are the Earpods under warranty?
I purchased the Apple EarPods a while ago separately from an iPhone and they are having problems can I have them exchanged? I was told at RadioShack, the place of purchase that they were covered under the Apple Care Warranty.
-
Hi friends. I need to create a check print linked with a banking account transfer document. My document has key 40 and 50 to accounts 12*1. Because this is not a payment document, but a document to make a transfer between accounts, I cannot print any
-
TCP/IP RFC dest entry not displaying in we21
Hi Experts, i have created an RFC Destination in sm59 with connection as TCP/IP. In we21 when i try to assign the RFC dest to the tRFC port, the dest entry was not displayed. No RFC dest belongs to TCP/IP connection was displayed there. Please giv
-
HT4623 how do i find out what is taking up the most stoarge on iphone 4?
how do i find out what is taking up the most storage on iphone 4?
-
Is there a way to attach a website to an email on my MacBook?
I want to attach a website in an email as an actual attachment, not just in the text. I only know how to attach files. Thanks to all who help!