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,
Sri
Hi
U need to use the fm REUSE_ALV_GRID_LAYOUT_INFO_SET, here you can change the catalog table.
Max
Similar Messages
-
Error in updating ALV field catalog in selection tool for Planning Book
Hi ,
I am Implementing BADI '/SAPAPO/SDP_SELECTOR' to upload Custom Fields Data in Planning Book Selection Window under APO Location Product. These Custom Fields are maintained in Custom Table.So from Table whatever Custom Fields are availabe all the fields needs to be available in for selection. Once selection is done the same data to be uploaded into Planning Book.
This BADI is working Fine upto 4 fields but if any extra fields are added in the table 'Error in updating ALV field catalog in selection tool' error Pop Up is coming. Here i am using Folloowing Methods
1). INIT_OBJECT_LIST
2). F4
3). LOC_PROD_VALUE_LIST
Please help on the same if u have any idea or clue.
Thanks.Hi Srinivas!
Where did you get your implementation from?
It would be nice if you could debug your code!
For the F4 method, have you seen this note?
Note 544904 - Sample source code f.BAdI /SAPAPO/SDP_SELECTOR ('F4'method)
Also check this note. It contains selection modifications in the BAdI:
Note 376902 - SDP selector: Basis corrections for BADI
I do not know your release and support package in your SCM, but you can find a lot of notes related to this BAdI.
Thank you!
Will
SCM Support Consultant -
Error in updating ALV field catalog in selection
Dear all,
I'm trying to use the standard transaction /SAPAPO/TSKEYFMAIN in order to check the TS values.
After filling the selection variant, the system shows the following error:
'Error in updating ALV field catalog in selection'
Could you please provide me with further details about the error? What could be the possible solution to avoid it?
Many thanks,
SMHi Marius,
thanks for your answer.
I would like to use the /SAPAPO/TSKEYFMAIN transaction to check massively the values in the time series KFs and not just the consistency of them.
So do you know any other transaction to do it or do you have an idea about the error of /SAPAPO/TSKEYFMAIN?
Thanks for your help!
SM -
Reg: Dynamic Field catalog in ALV
Hi ,
Can any one guide me to build a dynamic field catalog in ALV report?
Below is the format which i expect..........
Material | Plant1 | Plant2 | Plant3 | ....................| Plant 20 |
Qty
Val
Qty
Val
Qty
Val
Qty
Val
The plant 1 to 20 has to be brought dynamically as headings from T001W table. (Horizontally populate)
Below each plant i need sub-headings "QTY" and "VAL". (Horizontally populate)
List of Materials should be brought vertically from MARA table. (Vertically populate)
Can anyone suggest how to bring out this format for populating data accordingly into the o/p format?
Ur help will be appreciated.
Thanks,
K.S.Kannanyour part of the code is present in routine
perform dynamic_table.
*& Report ZCS_NAC_MAT_CHARACTERISTICS
2/ Description ...: Business requirement is to get all materials
without any characteristic values maintained in SAP
which are given in the selection screen.
REPORT znac_material_char.
TYPE-POOLS : abap,
slis.
TABLES : kssk,
klah,
mara,
makt,
cabn,
t134,
t023.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv ,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : w_layout TYPE slis_layout_alv.
DATA : st_layout TYPE slis_layout_alv.
DATA : t_header TYPE slis_t_listheader,
w_header TYPE slis_listheader.
TYPES : BEGIN OF ty_cabn,
atinn TYPE cabn-atinn,
atnam TYPE cabn-atnam,
END OF ty_cabn.
DATA : i_cabn TYPE STANDARD TABLE OF ty_cabn WITH HEADER LINE.
DATA : w_cabn LIKE i_cabn.
TYPES : BEGIN OF ty_ausp,
objek TYPE ausp-objek,
atinn TYPE ausp-atinn,
klart TYPE ausp-klart,
END OF ty_ausp.
DATA : i_ausp TYPE STANDARD TABLE OF ty_ausp WITH HEADER LINE.
DATA : w_ausp LIKE i_ausp.
TYPES : BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
prdha TYPE mara-prdha,
mstae TYPE mara-mstae,
mstde TYPE mara-mstde,
END OF ty_mara.
DATA : i_mara TYPE STANDARD TABLE OF ty_mara WITH HEADER LINE.
DATA : w_mara LIKE i_mara.
DATA : i_mara_temp TYPE STANDARD TABLE OF ty_mara WITH HEADER LINE.
DATA : w_mara_temp LIKE i_mara_temp.
TYPES :BEGIN OF ty_data,
atnam TYPE cabn-atnam,
atinn TYPE cabn-atinn,
objek TYPE ausp-objek,
klart TYPE ausp-klart,
matnr TYPE mara-matnr,
maktx TYPE makt-maktx,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
prdha TYPE mara-prdha,
mstae TYPE mara-mstae,
mstde TYPE mara-mstde,
END OF ty_data.
DATA : i_data TYPE STANDARD TABLE OF ty_data WITH HEADER LINE.
DATA : w_data LIKE i_data.
DATA : i_class TYPE STANDARD TABLE OF sclass WITH HEADER LINE.
DATA : w_class LIKE i_class.
DATA : i_class_temp TYPE STANDARD TABLE OF sclass WITH HEADER LINE.
DATA : w_class_temp LIKE i_class_temp.
DATA : i_objdata TYPE STANDARD TABLE OF clobjdat WITH HEADER LINE.
DATA : w_objdata LIKE i_objdata.
TYPES : BEGIN OF ty_objdata_temp.
TYPES: matnr TYPE mara-matnr.
TYPES: maktx TYPE makt-maktx.
INCLUDE STRUCTURE clobjdat.
TYPES : prdha TYPE mara-prdha.
TYPES : mstde TYPE mara-mstde.
TYPES : END OF ty_objdata_temp.
DATA : i_objdata_temp TYPE STANDARD TABLE OF ty_objdata_temp WITH HEADER LINE.
DATA : w_objdata_temp LIKE i_objdata_temp.
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
<fs_dyntable>,
<fs_fldval> TYPE ANY.
DATA: t_newtable TYPE REF TO data,
t_newline TYPE REF TO data,
fs_fldcat TYPE slis_t_fieldcat_alv,
t_fldcat1 TYPE lvc_t_fcat,
wa_it_fldcat TYPE lvc_s_fcat,
wa_colno(2) TYPE n,
wa_flname(30) TYPE c.
DATA: fieldname(20) TYPE c.
DATA: fieldvalue(40) TYPE c.
DATA: index(3) TYPE c,
v_time(60) TYPE c.
DATA: wa_cat LIKE LINE OF fs_fldcat.
CONSTANTS : c_nac TYPE klah-class VALUE 'NAC',
c_klart TYPE ausp-klart VALUE '001',
c_check TYPE c VALUE 'X' .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (28) text-001 .
SELECT-OPTIONS: s_atnam FOR cabn-atnam NO INTERVALS OBLIGATORY. " Characteristic name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1 .
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_matnr FOR mara-matnr. " material Number
SELECT-OPTIONS: s_mtart FOR mara-mtart. " material type
SELECT-OPTIONS: s_matkl FOR mara-matkl. " material type
SELECT-OPTIONS: s_mstae FOR mara-mstae. " X-Plant material status
PARAMETERS : s_date LIKE sy-datum OBLIGATORY DEFAULT sy-datum . " date
SELECTION-SCREEN END OF BLOCK b2 .
AT SELECTION-SCREEN ON s_atnam.
SELECT SINGLE * FROM cabn WHERE atnam IN s_atnam.
IF sy-subrc 0.
MESSAGE text-003 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_matnr.
SELECT SINGLE * FROM mara WHERE matnr IN s_matnr.
IF sy-subrc 0.
MESSAGE text-004 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_mtart.
SELECT SINGLE * FROM t134 WHERE mtart IN s_mtart.
IF sy-subrc 0.
MESSAGE text-005 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_matkl.
SELECT SINGLE * FROM t023 WHERE matkl IN s_matkl.
IF sy-subrc 0.
MESSAGE text-006 TYPE 'E'.
ENDIF.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_data_keydate.
PERFORM material_all_charname.
PERFORM get_classification.
PERFORM dynamic_table.
*& Form dynamic_table
text
--> p1 text
<-- p2 text
FORM dynamic_table.
PERFORM fieldcatalog.
PERFORM dynamic_table_create.
PERFORM final_data.
PERFORM final_fieldcatalog.
PERFORM layout_build.
PERFORM grid_display.
ENDFORM. " fieldcat
*& Form layout_build
text
FORM layout_build .
st_layout-zebra = c_check.
st_layout-no_vline = ''.
st_layout-colwidth_optimize = c_check.
st_layout-detail_popup = c_check.
st_layout-detail_initial_lines = c_check.
st_layout-detail_titlebar = text-021.
ENDFORM. " layout_build
*& Form alv_top_of_page
text
FORM alv_top_of_page.
REFRESH t_header.
CLEAR t_header.
w_header-typ = 'H'. "H=Header, S=Selection, A=Action
w_header-key = ' '.
w_header-info = text-019.
APPEND w_header TO t_header.
CONCATENATE sy-datum4(2) '-' sy-datum6(2) '-' sy-datum0(4) ' / ' sy-uzeit0(2) ':' sy-uzeit2(2) ':' sy-uzeit4(2) INTO v_time.
w_header-typ = 'S'. "H=Header, S=Selection, A=Action
w_header-key = text-020.
w_header-info = v_time.
APPEND w_header TO t_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. "alv_top_of_page
*& Form grid_display
text
--> p1 text
<-- p2 text
FORM grid_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'ALV_TOP_OF_PAGE'
it_fieldcat = fs_fldcat
is_layout = st_layout
i_default = c_check
i_save = 'A'
it_events = v_events[]
TABLES
t_outtab = <t_dyntable>.
ENDFORM. " grid_display
*& Form FINAL_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM final_fieldcatalog .
wa_cat-fieldname = text-009.
wa_cat-seltext_m = text-015.
wa_cat-outputlen = 18.
APPEND wa_cat TO fs_fldcat.
wa_cat-fieldname = text-011.
wa_cat-seltext_m = text-016.
wa_cat-outputlen = 40.
APPEND wa_cat TO fs_fldcat.
LOOP AT s_atnam.
CLEAR wa_cat.
wa_cat-fieldname = s_atnam-low.
wa_cat-seltext_m = s_atnam-low.
wa_cat-outputlen = '15'.
APPEND wa_cat TO fs_fldcat.
ENDLOOP.
wa_cat-fieldname = text-012.
wa_cat-seltext_m = text-017.
wa_cat-outputlen = 18.
APPEND wa_cat TO fs_fldcat.
wa_cat-fieldname = text-013.
wa_cat-seltext_m = text-018.
wa_cat-outputlen = 8.
APPEND wa_cat TO fs_fldcat.
ENDFORM. " FINAL_FIELDCATALOG
*& Form FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM fieldcatalog .
wa_it_fldcat-fieldname = text-009.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 18.
APPEND wa_it_fldcat TO t_fldcat1.
wa_it_fldcat-fieldname = text-011.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 40.
APPEND wa_it_fldcat TO t_fldcat1.
LOOP AT s_atnam.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = s_atnam-low.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 30.
APPEND wa_it_fldcat TO t_fldcat1.
ENDLOOP.
wa_it_fldcat-fieldname = text-012.
wa_it_fldcat-datatype = text-010.
wa_it_fldcat-intlen = 18.
APPEND wa_it_fldcat TO t_fldcat1.
wa_it_fldcat-fieldname = text-013.
wa_it_fldcat-datatype = text-014.
wa_it_fldcat-intlen = 8.
APPEND wa_it_fldcat TO t_fldcat1.
ENDFORM. " FIELDCATALOG
*& Form DYNAMIC_TABLE_CREATE
text
--> p1 text
<-- p2 text
FORM dynamic_table_create .
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat1
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO <t_dyntable>.
Create dynamic work area and assign to FS
CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
ASSIGN t_newline->* TO <fs_dyntable>.
ENDFORM. " DYNAMIC_TABLE_CREATE
*& Form FINAL_DATA
text
--> p1 text
<-- p2 text
FORM final_data .
LOOP AT i_objdata_temp INTO w_objdata_temp.
*assign w_objdata_temp-matnr to <fs_dyntable>.
AT NEW matnr.
wa_flname = text-009.
fieldvalue = w_objdata_temp-matnr.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
ENDAT.
wa_flname = text-011.
fieldvalue = w_objdata_temp-maktx.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = w_objdata_temp-atnam.
fieldvalue = w_objdata_temp-ausp1.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = text-012.
fieldvalue = w_objdata_temp-prdha.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
wa_flname = text-013.
fieldvalue = w_objdata_temp-mstde.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
AT END OF matnr.
APPEND <fs_dyntable> TO <t_dyntable>.
ENDAT.
ENDLOOP.
ENDFORM. " FINAL_DATA
*& Form GET_CLASSIFICATION
text
--> p1 text
<-- p2 text
FORM get_classification .
LOOP AT i_data INTO w_data.
SELECT SINGLE * FROM klah WHERE class = c_nac.
IF sy-subrc = 0.
IF w_data-mstde >= klah-vondt.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
class = c_nac
classtext = c_check
classtype = c_klart
clint = 0
features = c_check
language = sy-langu
object = w_data-objek
TABLES
t_class = i_class
t_objectdata = i_objdata
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
LOOP AT i_class INTO w_class.
MOVE w_class TO w_class_temp.
APPEND w_class_temp TO i_class_temp.
ENDLOOP .
LOOP AT s_atnam.
READ TABLE i_objdata INTO w_objdata WITH KEY atnam = s_atnam-low.
IF sy-subrc = 0.
MOVE w_data-matnr TO w_objdata_temp-matnr.
MOVE w_data-maktx TO w_objdata_temp-maktx.
MOVE-CORRESPONDING w_objdata TO w_objdata_temp.
MOVE w_data-prdha TO w_objdata_temp-prdha.
MOVE w_data-mstde TO w_objdata_temp-mstde.
APPEND w_objdata_temp TO i_objdata_temp.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " GET_CLASSIFICATION -
HI All,
I am hoping someone on here can help.
I have an ALV grid program where I build a field catalog.
I have been asked to add 2 more fields.
When I add these fields they do not display in the list but can be added through 'Change Layout'.
I have tried setting the output length of the new fields, I have tried making sure no_out is initial.
I have tried re-positioning them where other fields wre displayed. The old fields are gone but my new fields do not appear and have to be added through the 'change layout' option.
eg. these are my two added extra fields.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 35.
ls_fieldcat-fieldname = 'FEE_EARNER_BP'.
ls_fieldcat-seltext_m = 'Client'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-no_out = ''.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 36.
ls_fieldcat-fieldname = 'FEBP_NAME'.
ls_fieldcat-seltext_m = 'Client Name'.
ls_fieldcat-outputlen = 123.
ls_fieldcat-no_out = ''.
APPEND ls_fieldcat TO e01_lt_fieldcat.
Any help/advice appreciated.
Many Thanks
DavidHi.
The usual cause of this is that the ALV is using a particular display variant, which of course does not "know" about the two new fields.
Perhaps this display variant is being specified in your selection screen. Or perhaps one of the display variants has been set as the default display variant.
John -
Hello Experts,
To prepare the field catalog for a ALV Grid Display, i created a DDIC structure which looks as below.
DDIC structure from SE11.These are total 12 fields.
DOKAR
Types
DOKAR
CHAR
3
0
Document Type
DOKNR
Types
DOKNR
CHAR
25
0
Document number
DOKTL
Types
DOKTL
0
0
Documentation - text lines
DOKVR
Types
DOKVR
CHAR
2
0
Document Version
DKTXT
Types
DKTXT
CHAR
40
0
Document description
DOSTX
Types
DOSTX
CHAR
16
0
Description of document status
KTXT
Types
TDWOT_KTXT
CHAR
20
0
Object Description
STABK
Types
STABK
CHAR
2
0
Status of a document (language-dependent)
CAD_POS
Types
CAD_POS
CHAR
1
0
CAD: Assignment document <-> material
VRKSTAT
Types
VRKSTAT
CHAR
1
0
Link status of a document
CVHIER
Types
CVHIER
CHAR
1
0
Document is in Hierarchy
REVLV
Types
REVLV
CHAR
2
0
Revision Level
When i try to run the FM:LVC_FIELDCATALOG_MERGE to generate field catalog i get 19 columns. Where as i should get only 12.
Below are the columns,
COL_POS FIELDNAME
1 DOKAR
2 DOKNR
3 ID
4 OBJECT
5 LANGU
6 TYP
7 DOKVERSION
8 LINE
9 DOKFORMAT
10 DOKTEXT
11 DOKVR
12 DKTXT
13 DOSTX
14 KTXT
15 STABK
16 CAD_POS
17 VRKSTAT
18 CVHIER
19 REVLV
Can you let understand why the DDIC scan giving result like this ?
Thanks,
NareshHello,
This is because the type DOKTL: -
Hello there,
I am having problem changing a classic ABAP report to ALV as am hitting the error "field catalog not found".
I am using this 2 functions to help me convert it to ALV format.
and a snippet from my code :
MODIFY gt_i_data FROM wa_i_data TRANSPORTING priokx.
ENDLOOP .
gt_report[] = gt_i_data[].
perform f_assign_alv.
perform f_display_alv.
1.f_assign_alv
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = c_repid
i_internal_tabname = 'GT_REPORT'
i_inclname = c_repid
CHANGING
ct_fieldcat = gt_fieldcat.
2._display_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_title = v_grid_title
is_layout = v_layout
it_fieldcat = gt_fieldcat
TABLES
t_outtab = GT_REPORT
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
I noticed during debug,inside 'REUSE_ALV_GRID_DISPLAY' the possible location of error cud be at :
if i_screen_start_column is initial and -
>all these values are empty
i_screen_start_line is initial and
i_screen_start_column is initial and
i_screen_end_line is initial.
gt_grid-flg_popup = space.
call screen 500. else. -
>point of error
gt_grid-flg_popup = 'X'.
call screen 700
starting at i_screen_start_column i_screen_start_line
ending at i_screen_end_column i_screen_end_line.
endif.
Need your expert advice, please guide.Thanks so much!!Hi Neesha,
If you are using FM 'REUSE_ALV_FIELDCATALOG_MERGE', during data/types declaration, you have to use the LIKE keyword and not the TYPE keyword.
If you use TYPE, the fieldcat will not be populated.
DATA: BEGIN OF GT_REPORT OCCURS 0,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
werks LIKE ekpo-werks,
menge LIKE ekpo-menge,
netpr LIKE ekpo-netpr,
peinh LIKE ekpo-peinh,
netwr LIKE ekpo-netwr,
END OF GT_REPORT.
Regards,
Jovito.
Edited by: dsouzajovito on Jan 10, 2011 11:32 AM -
Problem Modifying ALV Field Catalog
Hi,
One grid of my ALV report displays material numbers as 0100.2000. But when I use method FILE_SAVE_DIALOG to save ALV report to Excel, the material number changes to 100.2.
I have tried modifying my field catalog as shown at end of this message, but it doesn't change the output in Excel.
Does anyone have a fix for this problem? I will award points! - Beth
FORM build_fieldcatalog.
DATA: ls_fieldcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZBOM_ALV'
CHANGING
ct_fieldcat = gt_fieldcat.
LOOP AT gt_fieldcat INTO ls_fieldcat where fieldname eq 'COLUMN3'.
ls_fieldcat-DATATYPE = 'NUMC'.
ls_fieldcat-LZERO = 'X'.
ls_fieldcat-REF_TABLE = ''.
ls_fieldcat-DECIMALS_O = '4'.
ls_fieldcat-INTTYPE = 'N'.
ls_fieldcat-OUTPUTLEN = '20'.
MODIFY gt_fieldcat FROM ls_fieldcat.
ENDLOOP.
ENDFORM. " build_fieldcatalogHi,
If you want to save any data like 0100.2000 in the excel, you need to write it as Number with decimal places 4, so it will take 4 decimal places . coming to your ALV, you need to pass the same structure to the Excel i mean the passing variable should be lilke Number with 4 decimal places ..
Regards
Sudheer -
Regarding alv field catalog!
hi. iam new to ALV. my query is,
iam building the fieldcatalog manualy by populating the internal table fields individually and then appending the rows. This method is most time consuming.
Can anyone suggest alternate method with an example? points will be rewarded.!!Hi Padamshree,
you can use MACRO to build field catalog.
like i used here for building and
then call FM "'REUSE_ALV_GRID_DISPLAY' for ALV grid.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'BSIK'.
ls_fieldcat-do_sum = &2.
ls_fieldcat-cfieldname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'BUKRS' '' ''.
m_fieldcat 'LIFNR' '' ''.
m_fieldcat 'GJAHR' '' ''.
m_fieldcat 'BELNR' '' ''.
m_fieldcat 'HKONT' '' ''.
m_fieldcat 'WRBTR' '' ''.
m_fieldcat 'WAERS' '' ''.
m_fieldcat 'SHKZG' '' ''.
m_sort 'BUKRS' 'X'.
m_sort 'LIFNR' 'X'.
m_sort 'GJAHR' ''.
m_sort 'BELNR' ''.
m_sort 'BUDAT' ''.
ls_layout-cell_merge = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
TABLES
t_outtab = ITAB1.
ENDFORM. " DISPLAY_DATA
Regards,
Sachin. -
Hi All,
I want to include all the fields of PRPS in the ALV list.How can i build a field catalog having all fields of PRPS?
Thanks,
Rakesh.hi
Actually fieldcatalog is used if we are selecting only a set of fields in a table..then we need to build a fieldcatalog fo those
fields.
Here ur requirement is for all the fields of the table PRPS.So
u code like this: include structure PRPS
In the Reuse_alv_list_display --pass the structure name to
I_STRUCTURE_NAME.
this solves ur problem..
thnx
sravani
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 5:07 PM -
Hi All
I am doing field catalog merge for a structure using the FM
'LVC_FIELDCATALOG_MERGE' . I am passing the structure to this FM.
Initially there were 14 fields in the structure. I added a new field
and activated the structure. But it still shows only 14 fields instead of 15.
Please Reply ASAP.
Thanks.
Praveena.Yes, go in debug mode.Keep a break point at K_KKB_FIELDCAT_MERGE.
This fm has following code. Keep a break point in second ALV_CHECK_BUFFER.
call function 'ALV_CHECK_BUFFER'
exporting
i_buffer_type = 'A'
i_buffer_active = i_buffer_active
i_bypassing_buffer = i_bypassing_buffer
i_refresh_buffer = ' '
importing
e_import = l_import
e_export = l_export
e_delete = l_delete.
call function 'ALV_CHECK_BUFFER'
exporting
i_buffer_type = 'B'
i_buffer_active = i_buffer_active
i_bypassing_buffer = i_bypassing_buffer
i_refresh_buffer = ' '
importing
e_import = l_import_b
e_export = l_export_b
e_delete = l_delete_b.
After the second ALV_CHECK_BUFFER executes, clear value of variable l_import_b. This will help you to see new added fields to your structure in report output. -
Alv field catalog include structure
Hi I have declared the tables like this :
TYPES: BEGIN OF tt_vbak,
cbox TYPE c.
INCLUDE STRUCTURE vbak.
TYPES: END OF tt_vbak.
DATA: lt_vbak TYPE STANDARD TABLE OF tt_vbak,
wa_vbak TYPE tt_vbak.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
* i_internal_tabname = 'LT_VBAK'
i_structure_name = 'LT_VBAK'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_INCLNAME =
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = g_fieldcat_tab[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
I am not getting the field catalog...Hi
That fm doesn't work if the internal table is defined using TYPE, but u need to use LIKE:
DATA: BEGIN lt_vbak OCCURS 0.
CBOX(1) TYPE C.
DATA: INCLUDE STRUCTURE VBAK,
END OF IT_VBAK.
DATA: GT_REPORT TYPE SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = GT_REPORT
i_internal_tabname = 'LT_VBAK'
i_include_name = GT_REPORT
CHANGING
ct_fieldcat = g_fieldcat_tab[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
If you want to use the TYPES defination, u can do in this way:
TYPES: BEGIN OF tt_vbak,
cbox TYPE c.
INCLUDE STRUCTURE vbak.
TYPES: END OF tt_vbak.
DATA: lt_vbak TYPE STANDARD TABLE OF tt_vbak,
wa_vbak TYPE tt_vbak.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'LT_VBAK'
i_structure_name = 'VBAK'
CHANGING
ct_fieldcat = g_fieldcat_tab[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Max -
Hi friends,
I am trying create a field catalog with FM for my internal table. I know I must use "Like" for my internal fields. But I have same field types in my internal. If I use like this. I cann't create field catalog with catalog merge ( I must use this FM for hide/show columns -my prev. message-)
What is your recommend to me for definiton of my internal table. How can create field catalog using REUSE_ALV_FIELDCATALOG_MERGE FM.
My internal table is :
Types : Begin Of TRapor,
Renk, "Satır Rengi
Bilesen_Kodu Like Mseg-Matnr, "Malzeme Numarası
Tanim Like Makt-Maktx, "Malzeme Kısa Metni
Batch Like Mseg-Charg, "Parti Numarası - Batch
Birim Like Mseg-Meins, "Temel ölçü birimi
Malzeme_Fire(12) Type P Decimals 2, "Teorik Malzeme Fire % si
Batch_Fire(12) Type P Decimals 2, "Teorik Batch Fire % si
OMiktar Like Mseg-Menge, "Önceki Dönem Miktar
OYuzde(12) Type P Decimals 2, "Önceki Dönem Yuzde
OTeorik Like Mseg-Menge, "Önceki Dönem Teorik
OSapma_Deger Like Mseg-Menge, "Önceki Dönem Sapma Değeri
OSapma_Oran(12) Type P Decimals 2, "Önceki Dönem Sapma Oranı
SMiktar Like Mseg-Menge, "Seçim Dönemi Miktar
SYuzde(16) Type P Decimals 2, "Seçim Dönemi Yüzde
STeorik Like Mseg-Menge, "Seçim Dönemi Teorik
SSapma_Deger Like Mseg-Menge, "Seçim Dönemi Sapma Değeri
SSapma_Oran(12) Type P Decimals 2, "Seçim Dönemi Sapma Oranı
Hareket Like Mseg-Bwart,
Isyeri Like Crhd-Arbpl,
End Of TRapor.
Data : IRapor Type Standard Table Of TRapor With Header Line.:((( It dowsn't work. What is wrong :((( I give NO_FIELDCATALOG_AVAILABLE error. When I debugging After processing merge FM my alvfc is empty (0x172)
Type-Pools : Slis.
Tables : Mseg, S226, Mara, Mkpf, Crhd, Plpo, Mkal.
Types : Begin Of TRapor,
Renk(4) Type C, "Satır Rengi
Bilesen_Kodu Like Mseg-Matnr, "Malzeme Numarası
Tanim Like Makt-Maktx, "Malzeme Kısa Metni
Batch Like Mseg-Charg, "Parti Numarası - Batch
Birim Like Mseg-Meins, "Temel ölçü birimi
Malzeme_Fire(12) Type P Decimals 2, "Teorik Malzeme Fire % si
Batch_Fire(12) Type P Decimals 2, "Teorik Batch Fire % si
OMiktar Like Mseg-Menge, "Önceki Dönem Miktar
OYuzde(12) Type P Decimals 2, "Önceki Dönem Yuzde
OTeorik Like Mseg-Menge, "Önceki Dönem Teorik
OSapma_Deger Like Mseg-Menge, "Önceki Dönem Sapma Değeri
OSapma_Oran(12) Type P Decimals 2, "Önceki Dönem Sapma Oranı
SMiktar Like Mseg-Menge, "Seçim Dönemi Miktar
SYuzde(16) Type P Decimals 2, "Seçim Dönemi Yüzde
STeorik Like Mseg-Menge, "Seçim Dönemi Teorik
SSapma_Deger Like Mseg-Menge, "Seçim Dönemi Sapma Değeri
SSapma_Oran(12) Type P Decimals 2, "Seçim Dönemi Sapma Oranı
Hareket Like Mseg-Bwart,
Isyeri Like Crhd-Arbpl,
End Of TRapor.
*Data : IRapor Type Table Of TRapor With Header Line.
Data : IRapor Type Standard Table Of TRapor With Header Line.
Data : ZRapor Type TRapor Occurs 0 With Header Line.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvwa TYPE slis_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ZRAPOR'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*---------------Display
LOOP AT alvfc INTO alvwa WHERE fieldname = 'BILESEN_KODU'.
alvwa-ddictxt = 'L'.
alvwa-seltext_l = 'Heading'.
alvwa-outputlen = 15.
MODIFY alvfc FROM alvwa.
ENDLOOP.
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 = zrapor
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " Gecici
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
LOOP AT alvfc INTO alvwa.
IF alvwa-fieldname = 'BUTXT'.
if alvwa-no_out = 'X'.
alvwa-no_out = ''.
else.
alvwa-no_out = 'X'.
endif.
*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 = 'ZRAPOR'
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 = zrapor
EXCEPTIONS
program_error = 1
OTHERS = 2.
*----------- IMPORTANT.
*----------- IMPORTANT.
whatrow-exit = 'X'.
ENDFORM. "itab_user_command -
I tried to build the field catalog as below but it is erroring saying it_fieldcat allows certain data types and ls_fieldcatalog uses a different data type
TYPE-POOLS: slis.
data ls_fieldcatalog type SLIS_T_FIELDCAT_ALV
with header line.
DATA: i_repid type sy-repid.
i_repid = sy-repid.
ls_fieldcatalog-fieldname = 'Co Code'.
ls_fieldcatalog-inttype = 'C'.
ls_fieldcatalog-col_pos = '0'.
APPEND ls_fieldcatalog to ls_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'Document No'.
ls_fieldcatalog-inttype = 'N'.
ls_fieldcatalog-col_pos = '1'.
APPEND ls_fieldcatalog to ls_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'GL Account'.
ls_fieldcatalog-inttype = 'N'.
ls_fieldcatalog-col_pos = '2'.
APPEND ls_fieldcatalog to ls_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'Posting Date'.
ls_fieldcatalog-inttype = 'D'.
ls_fieldcatalog-col_pos = '3'.
APPEND ls_fieldcatalog to ls_fieldcatalog.
clear ls_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
IT_FIELDCAT = ls_fieldcatalog
I_SAVE = 'A'
TABLES
t_outtab = it_tab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2Please fined the below code
data ls_fieldcatalog type SLIS_FIELDCAT_ALV
lt_fieldcatlog type SLIS_T_FIELDCAT_ALV
DATA: i_repid type sy-repid.
i_repid = sy-repid.
ls_fieldcatalog-fieldname = 'Co Code'.
ls_fieldcatalog-inttype = 'C'.
ls_fieldcatalog-col_pos = '0'.
APPEND ls_fieldcatalog to lt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'Document No'.
ls_fieldcatalog-inttype = 'N'.
ls_fieldcatalog-col_pos = '1'.
APPEND ls_fieldcatalog to lt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'GL Account'.
ls_fieldcatalog-inttype = 'N'.
ls_fieldcatalog-col_pos = '2'.
APPEND ls_fieldcatalog to lt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'Posting Date'.
ls_fieldcatalog-inttype = 'D'.
ls_fieldcatalog-col_pos = '3'.
APPEND ls_fieldcatalog to lt_fieldcatalog.
clear ls_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
IT_FIELDCAT = lt_fieldcatalog
I_SAVE = 'A'
TABLES
t_outtab = it_tab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2 -
Attribute text_fieldname of alv field catalog
Hi all,
There is a attribute called text_fieldname in alv fieldcatalog(slis_fieldcat_alv) . Has anyone used it ? Or does anyone know its purpose?
Regards,
KavithaHai Kavitha,
TEXT_FIELDNAME : 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.
Maybe you are looking for
-
Dear Someone who care Please do contact with the really owner of the Iphone i was bought from someone ( the fourth or fifth user) who dont have really Icloud ID and password Please let me know how can i do that Many thanks
-
How can I make a simple 1D array filter.
When I aquire my data I get a 1D array with anywhere from 10 - 30 data points. There are always ten good data points the rest are noise or false triggeres. a good data point is in the range of .1-.2 a bad point is .001-.01 how can I filter out thse b
-
Arabic Language compatability- Will XI accept Arabic accept arabic language
Hi, I just wanted to know whether XI is compatible with Arabic langauge.I mean , if a message comes in XI which has Arabic text in some fields ,then will XI process this Arabic languae and send the same arabic text to the traget system.I found some t
-
I am having problems with the site I have built in iWeb. Every time I create a new page, iWeb puts a copy of the navigation bar images, and page title image in a folder for that page. How can I get iWeb to take a copy of the image file from the image
-
Iphoto quit unexpectedly and I lost all the pictures I downloaded
Iphoto quit unexpectedly and I lost all of the pictures I had downloaded and one I edited. They were all gone I had just did the major update that morning Has anyone else been experiencing problems like this?