What is Field catalog pls urgent
Right now I am working on ALV, in that I am using REUSE_ALV_GRID_DISPLAY FM, but the parameters for this FM are an internal table name and a field catalog so i am confused that what field catalog is? Please help me out its very urgent. Thanks in advance.
By Ashok V
Hi,
<b>Field catalog</b>
The field catalog describes the internal data table fields. It is itself an internal table containing an entry for each column in the data table. The field catalog entry determines column output options.
<b>Creating the field catalog</b>
The field catalog can be constructed in various ways:
<b>Manual</b>
Each field catalog entry is explicitly coded into the field catalog by the ALV caller.
Fields with DDIC link must have at least the following field catalog entries:
FIELDCAT-FIELDNAME " Internal output table field name
FIELDCAT-REF_TABNAME " DDIC reference structure name
Fields with no DDIC link must have at least the following field catalog entries:
FIELDCAT-FIELDNAME " Internal output table field name
FIELDCAT-DATATYPE " Internal output table field data type
FIELDCAT-OUTPUTLEN " Column width
and at least one of the four text fields FIELDCAT-SELTEXT_L, FIELDCAT-SELTEXT_M, FIELDCAT-SELTEXT_S, REPTEXT_DDIC.
The field FIELDCAT-TABNAME in the field catalog of hierarchical-sequential lists must also contain the name of the internal output table, to assign columns uniquely to the header or item table. This field must not be filled manually in simple lists.
<b>Automatic</b>
A field catalog need not be passed to ALV under the following condition:
the structure of the internal output table is identical to a DDIC structure or table.
The name of the structure or table is passed to ALV instead of the field catalog.
All columns in the structure are displayed.
<b>Semi-automatic</b>
This mode is a combination of automatic and manual:
the automatically created field catalog can be modified by a manually created field catalog.
If a structure name for an automatic field catalog and a field catalog are both passed, the system determines the field catalog information from them both:
If the manually created and passed field catalog contains entries for fields which are not described by the DDIC structure, they are added to the field catalog created by the System.
If the manually created and passed field catalog contains entries for fields which are also described by the DDIC structure, they overwrite the DDIC information.
The system creates field catalogs automatically and semi-automatically from the DDIC reference structure passed to ALV. ALV calls the function module REUSE_ALV_FIELDCATALOG_MERGE which creates the field catalog and adjusts it with an explicit field catalog (semi-automatic mode). This function module can also be called directly by the application (before ALV). This makes the creation of the field catalog by the application flexible.
Hope u understood.
Kindly reward points if u find it useful.
Thanks&Regards,
Ruthra
Similar Messages
-
Dear Gurus,
what is field catalog in pricing?
Thanks..hi,
check the link: [Field catalog|http://help.sap.com/erp2005_ehp_04/helpdata/EN/c8/19882043b111d1896f0000e8322d00/frameset.htm]
use help.sap.com your general queries...this is very usefull ..
Regards
Priyanka.P -
I saw in the forum field catalog using alv, reuse_alv_Fieldcatalog etc
Actually What is meant by field catalog?????
Can i know the purpose of it.
thanks arvindHi Aravind,
see the below code how to declare field catalog and declare the heading and output..
Declare field catalog..
DATA : gc_selfield TYPE slis_selfield,
gt_fieldcat_drd TYPE slis_t_fieldcat_alv WITH HEADER LINE.
All the fields declared in gt_fieldcat_drd-fieldname are fields in the Internal table and output tbale..
* Building field catalog
gt_fieldcat_drd-seltext_m = 'STO / ICSTO'.
gt_fieldcat_drd-fieldname = 'EBELN'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'Item '.
gt_fieldcat_drd-outputlen = 4.
gt_fieldcat_drd-fieldname = 'EBELP'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'Material'.
gt_fieldcat_drd-outputlen = 18.
gt_fieldcat_drd-fieldname = 'MATNR'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'Material Desc'.
gt_fieldcat_drd-outputlen = 30.
gt_fieldcat_drd-fieldname = 'MAKTX'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'RecPlnt'.
gt_fieldcat_drd-outputlen = 4.
gt_fieldcat_drd-fieldname = 'WERKS'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'ShipPlnt'.
gt_fieldcat_drd-outputlen = 4.
gt_fieldcat_drd-fieldname = 'RESWK'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
gt_fieldcat_drd-seltext_m = 'BatchNum'.
gt_fieldcat_drd-fieldname = 'CHARG'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
* Begin of PJ040809
gt_fieldcat_drd-seltext_m = 'Vendor Lot'.
gt_fieldcat_drd-outputlen = 30. "Field size declaration
gt_fieldcat_drd-fieldname = 'VENLOT'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
* End of PJ040809
gt_fieldcat_drd-seltext_m = 'OpenQty'.
gt_fieldcat_drd-fieldname = 'MENGE'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
if delivery date is not initial. "in the Outptu if delivery date is there the it will show column else it will not show
gt_fieldcat_drd-seltext_m = 'Delvry Date'. "Field Heading
gt_fieldcat_drd-fieldname = 'EINDT'.
APPEND gt_fieldcat_drd.
CLEAR : gt_fieldcat_drd.
endif.
Then call the function moduel to dispaly..
and pass the field catalog..
Regards,
Prabhudas -
AlV! Field Catalog Merge!
Hi!
What is Field catalog merge in ALVHi,
YOU HAVE TWO WAYS TO BUILD A FIELD CATALOG
1) FIRST METHOD
data w_fieldcat type slis_fieldcat_alv.
type-pools : slis.
tables : sflight.
data : i_fieldcat type slis_T_fieldcat_alv.
data v_repid like sy-repid.
data : begin of i_sflight occurs 0,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of i_sflight.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'CARRID'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'Carrie ID'.
w_fieldcat-seltext_M = 'Carrie ID'.
w_fieldcat-seltext_S = 'Carrie ID'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'CONNID'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'CONNI ID'.
w_fieldcat-seltext_M = 'CONNI ID'.
w_fieldcat-seltext_S = 'CONNIID'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'FLDATE'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'FLDATE.
w_fieldcat-seltext_M = 'FLDATE'.
w_fieldcat-seltext_S = 'FLDATE'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
2) SECOND METHOD
data w_fieldcat type slis_fieldcat_alv.
type-pools : slis.
tables : sflight.
data : i_fieldcat type slis_T_fieldcat_alv.
data v_repid like sy-repid.
data : begin of i_sflight occurs 0,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of i_sflight.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'I_SFLIGHT'
i_inclname = v_repid
changing
ct_fieldcat = I_fieldcatalog_TYPE.
Reward points if helpful
THANKS
Venki -
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 . -
What is the procedure to create field catalog in alv
what is the procedure to create field catalog in alv?
with a example please.Hi,
U can use the function module REUSE_ALV_FIELDCAT_MERGE...If we use a structure that is exactly
identical to the datadictionary other wise u hav to hard code as in the following example.
**ALV EXAMPLE
*& Report ZJE_ALV_EXAMPLE
REPORT zje_alv_example.
TYPE-POOLS: slis.
*type declaration for values from ekko
TYPES: BEGIN OF i_ekko,
ebeln LIKE ekko-ebeln,
aedat LIKE ekko-aedat,
bukrs LIKE ekko-bukrs,
bsart LIKE ekko-bsart,
lifnr LIKE ekko-lifnr,
END OF i_ekko.
*type declaration for values from ekpo
TYPES: BEGIN OF i_ekpo,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
menge LIKE ekpo-menge,
meins LIKE ekpo-meins,
netpr LIKE ekpo-netpr,
END OF i_ekpo.
DATA: it_ekko TYPE STANDARD TABLE OF i_ekko INITIAL SIZE 0,
wa_ekko TYPE i_ekko.
DATA: it_ekpo TYPE STANDARD TABLE OF i_ekpo INITIAL SIZE 0,
wa_ekpo TYPE i_ekpo .
*variable for Report ID
DATA: v_repid LIKE sy-repid .
*declaration for fieldcatalog
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: it_listheader TYPE slis_t_listheader.
declaration for events table where user comand or set PF status will
be defined
DATA: v_events TYPE slis_t_event,
wa_event TYPE slis_alv_event.
declartion for layout
DATA: alv_layout TYPE slis_layout_alv.
declaration for variant(type of display we want)
DATA: i_variant TYPE disvariant,
i_variant1 TYPE disvariant,
i_save(1) TYPE c.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: i_title_ekko TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.
DATA: i_title_ekpo TYPE lvc_title VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
v_repid = sy-repid.
PERFORM build_fieldcatlog.
PERFORM event_call.
PERFORM populate_event.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_listheader USING it_listheader.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATLOG
Fieldcatalog has all the field details from ekko
FORM build_fieldcatlog.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_m = 'PO NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_m = 'DATE.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'BUKRS'.
wa_fieldcat-seltext_m = 'COMPANY CODE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'BUKRS'.
wa_fieldcat-seltext_m = 'DOCMENT TYPE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-no_out = 'X'.
wa_fieldcat-seltext_m = 'VENDOR CODE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM event_call.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "EVENT_CALL
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM populate_event.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
READ TABLE v_events INTO wa_event WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
wa_event-form = 'USER_COMMAND'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-name.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form data_retrieval
retreiving values from the database table ekko
FORM data_retrieval.
SELECT ebeln aedat bukrs bsart lifnr
FROM ekko
INTO TABLE it_ekko.
ENDFORM. "data_retrieval
*& Form bUild_listheader
text
-->I_LISTHEADEtext
FORM build_listheader USING i_listheader TYPE slis_t_listheader.
DATA hline TYPE slis_listheader.
hline-info = 'this is my first alv pgm'.
hline-typ = 'H'.
ENDFORM. "build_listheader
*& Form display_alv_report
text
FORM display_alv_report.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = i_title_ekko
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'ZLAY1'
i_save = 'A'
is_variant = i_variant
it_events = v_events
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 TOP_OF_PAGE
text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
PERFORM build_fieldcatlog_ekpo.
PERFORM event_call_ekpo.
PERFORM populate_event_ekpo.
PERFORM data_retrieval_ekpo.
PERFORM build_listheader_ekpo USING it_listheader.
PERFORM display_alv_ekpo.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_EKPO
text
FORM build_fieldcatlog_ekpo.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_m = 'PO NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-seltext_m = 'LINE NO'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MENGE'.
wa_fieldcat-seltext_m = 'QUANTITY'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-seltext_m = 'UOM'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-seltext_m = 'PRICE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*& Form event_call_ekpo
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM event_call_ekpo.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "event_call_ekpo
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM populate_event_ekpo.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form TOP_OF_PAGE
text
FORM f_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM data_retrieval_ekpo.
SELECT ebeln ebelp matnr menge meins netpr
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. "DATA_RETRIEVAL_EKPO
*& Form BUILD_LISTHEADER_EKPO
text
-->I_LISTHEADER text
FORM build_listheader_ekpo USING i_listheader TYPE slis_t_listheader.
DATA: hline1 TYPE slis_listheader.
hline1-typ = 'H'.
hline1-info = 'CHECKING PGM'.
ENDFORM. "BUILD_LISTHEADER_EKPO
*& Form DISPLAY_ALV_EKPO
text
FORM display_alv_ekpo.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_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_title_ekpo
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
i_save = 'A'
IS_VARIANT =
it_events = v_events
TABLES
t_outtab = it_ekpo
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_EKPO
Reward if Helpful -
What is the field to be used in the field catalog
hi
what is the field to be used in the field catalog of an ALV report to hide the relevant column inthe listhi,
if you want to hide a particular column dont specify it in output list. it wont be displayed then.
or if you want to display that column when particular radio button is selected then use:
if radi1 = 'x'.
Order Number
wa_fldcat-fieldname = 'AUFNR'.
wa_fldcat-col_pos = l_pos.
wa_fldcat-scrtext_s = 'Order'.
wa_fldcat-scrtext_m = 'Order'.
wa_fldcat-scrtext_l = 'Order'.
APPEND wa_fldcat TO it_fldcat.
CLEAR wa_fldcat.
l_pos = l_pos + 1.
endif. -
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 -
External field catalog & Info object catalogs - Role - in Flexible upload
1) What is the role of Info Object catalogs maintained in the Data Basis & the Source Data Basis?
Please be kind enough to mention a scenario u2013 underlining their utility in the consolidation process.
Like u2026.
Are they used for loading master data from source system to the BCS system?
Can they be used in the flexible upload u2013 data collection function?
Are they used for as a source of AFD data?
I came across the below documentation on flexible upload - in an SAP material.
*When uploading from a field catalog, you also have the option of using mapping. In this case, the file structure no longer has to correspond with the structure of the data basis.*
Understood the above 2 points.
*Rather, you can assign a BW InfoObjectCatalog that acts as the data structure description for the file here. You specify this InfoObjectCatalog in Customizing for the data basis.*
2)Does the above statement implies that we need not do any setting in the field catalog tab of the flexible upload? If yes, what do we do?
In the flexible upload u2013 field catalog tab u2013 we define the data structure for the file we upload (correct me if Iu2019m wrong).
If you use an external field catalog, you have to specify how you want to map the data structure for the file to the structure for the data basis.
3)Pls give an example of an external field catalog.
4)Can we use an external field catalog in the upload of RFD?
Many Thanks
Kind Regards,
KumarThere are two possibilities of using Infoobject catalog in SEM-BCS (it is true for both catalogs, characteristics and key figures):
u2022 In a data basis. The system adds these chars and KFs that are sitting in the defined in the Data Basis catalogs to u201CAdditional Fieldsu201D of each data stream (the tab strip u201CData Stream Fieldsu201D in data basis. If you check some of these fields and generate data basis, these additional infoobjects will be placed into appropriate ODS/DSO objects and you will be able to use them for uploading of some extra information.
Without indicating the Infoobject Catalog for Chars youu2019ll not be able to configure a new functionality of "assets/liabilities" at all.
u2022 In a source data basis.
After including source data basis to your data basis youu2019ll be able to use external infoobjects catalog in a method of the category Flexible Upload. Tick the flag of using the external catalog and choose the SDB. In the mapping tab youu2019ll have a possibility to choose from those chars and KFs that are located in the catalogs.
This might be used for upload of ANY data, RFD, AFD or master data.
The scenarios, I guess, are rather obvious.
Hope this helps. -
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 -
hi friends,
i am using factory method to display my alv. now some of the fields in my internal table i have declared them as char fields, i want certain type of headings for these fields,so where can i give heading to these fields.
where exactly do we create a field catalog for factory method.
pls advice me on thishi
good
go throgh this code
*& Report Z_ALV_OOPS
REPORT Z_ALV_OOPS.
*Event class Definition "Event handler class
class event_handle definition.
public section.
methods: handle_user
for event user_command of cl_gui_alv_grid
importing e_ucomm.
endclass.
*Event class Implementation
class event_handle implementation.
method handle_user.
write:/ ''.
endmethod.
endclass.
Data: t_alv type ref to cl_gui_alv_grid, "ALV control
t_cont type ref to cl_gui_custom_container, "Cust Container
t_alv2 type ref to cl_gui_alv_grid, "ALV control
t_cont2 type ref to cl_gui_custom_container, "Cust Container
t_fieldcat type lvc_t_fcat with header line, "Field Cat
t_fieldcat2 type lvc_t_fcat with header line, "Field Cat
t_layout type lvc_s_layo, "Layout
t_event type ref to event_handle, "Event handler
t_sort type LVC_T_SORT with header line, "Sort
t_toolbar type ui_functions with header line. "Toolbar xclude
Types: begin of g_vbak, "Header Table
vbeln like vbak-vbeln,
auart like vbak-auart,
vkorg like vbak-vkorg,
vtweg like vbak-vtweg,
spart like vbak-spart,
kunnr like vbak-kunnr,
bstnk like vbak-bstnk,
seltab,
end of g_vbak.
Types: begin of g_vbap, "Item Table
vbeln like vbap-vbeln,
posnr(6) type c,
posrn like vbap-posnr,
matnr like vbap-matnr,
netwr like vbap-netwr,
waerk like vbap-waerk,
end of g_vbap.
Data: t_vbak type g_vbak occurs 0,
t_vbap type g_vbap occurs 0.
Start-Of-Selection.
*Fetch data from DB Table
select vbeln auart vkorg vtweg spart kunnr bstnk
from vbak into table t_vbak up to 20 rows.
End-Of-Selection.
*Call ALV screen
call screen 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ALV'.
SET TITLEBAR 'VBAK'.
if t_cont is initial.
create object t_cont
exporting
container_name = 'ALV'.
create object t_alv
exporting
i_parent = t_cont.
*Create event handlers
create object t_event.
set handler t_event->handle_user for t_alv.
perform build_fieldcatlog.
perform build_layout.
perform xclude_toolbar.
CALL METHOD t_alv->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = t_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING = t_toolbar[]
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_vbak[]
IT_FIELDCATALOG = t_fieldcat[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
Data: lt_rows type lvc_t_row,
wa_rows type line of lvc_t_row,
wa_vbak type g_vbak,
l_lines type i.
refresh: t_vbap.
case sy-ucomm.
when 'DET'. "Item details
Get selected rows from ALV
call method t_alv->get_selected_rows
importing
et_index_rows = lt_rows.
Fetch corresponding Item details from VBAP
loop at lt_rows into wa_rows.
read table t_vbak into wa_vbak index wa_rows-index transporting
vbeln.
select vbeln posnr matnr netwr waerk from vbap
appending corresponding fields of table t_vbap
where vbeln = wa_vbak-vbeln.
endloop.
Prepare fieldcatlog
Display Item details in ALV
call screen 200 starting at 8 5.
when 'SHOW'. "Display order
call method t_alv->get_selected_rows
importing
et_index_rows = lt_rows.
Describe table lt_rows lines l_lines.
if l_lines > 1.
message e999(z_error).
else.
read table lt_rows into wa_rows index 1.
read table t_vbak into wa_vbak index wa_rows-index transporting
vbeln.
set parameter id 'AUN' field wa_vbak-vbeln.
call transaction 'VA03' and skip first screen.
endif.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form build_fieldcatlog
text
form build_fieldcatlog .
clear t_fieldcat.
t_fieldcat-col_pos = '1'.
t_fieldcat-fieldname = 'VBELN'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'VBELN'.
append t_fieldcat.
t_fieldcat-col_pos = '2'.
t_fieldcat-fieldname = 'AUART'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'AUART'.
append t_fieldcat.
t_fieldcat-col_pos = '3'.
t_fieldcat-fieldname = 'VKORG'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'VKORG'.
append t_fieldcat.
t_fieldcat-col_pos = '4'.
t_fieldcat-fieldname = 'VTWEG'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'VTWEG'.
append t_fieldcat.
t_fieldcat-col_pos = '5'.
t_fieldcat-fieldname = 'SPART'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'SPART'.
append t_fieldcat.
t_fieldcat-col_pos = '6'.
t_fieldcat-fieldname = 'KUNNR'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'KUNNR'.
append t_fieldcat.
t_fieldcat-col_pos = '7'.
t_fieldcat-fieldname = 'BSTNK'.
t_fieldcat-ref_table = 'VBAK'.
t_fieldcat-ref_field = 'BSTNK'.
append t_fieldcat.
endform. " build_fieldcatlog
*& Module LEAVE INPUT
text
module LEAVE input.
case sy-ucomm.
when 'BACK' or 'EXIT' or 'CANCEL'.
leave program.
endcase.
endmodule. " LEAVE INPUT
*& Form build_layout
text
--> p1 text
<-- p2 text
form build_layout .
t_layout-zebra = 'X'.
t_layout-sel_mode = 'A'.
t_layout-grid_title = 'Header Details'.
endform. " build_layout
*& Form build_fcat_vbap
text
form build_fcat_vbap .
clear t_fieldcat2.
t_fieldcat2-scrtext_m = 'Sales Doc'.
t_fieldcat2-col_pos = 1.
t_fieldcat2-fieldname = 'VBELN'.
t_fieldcat2-tabname = 'T_VBAP'.
t_fieldcat2-no_zero = 'X'.
t_fieldcat2-ref_table = 'VBAP'.
t_fieldcat2-ref_field = 'VBELN'.
append t_fieldcat2.
clear t_fieldcat2.
t_fieldcat2-col_pos = 2.
t_fieldcat2-scrtext_m = 'Item'.
t_fieldcat2-fieldname = 'POSNR'.
t_fieldcat2-tabname = 'T_VBAP'.
t_fieldcat2-intlen = '6'.
t_fieldcat2-inttype = 'C'.
t_fieldcat2-no_zero = 'X'.
t_fieldcat2-ref_table = 'VBAP'.
t_fieldcat2-ref_field = 'POSNR'.
append t_fieldcat2.
clear t_fieldcat2.
t_fieldcat2-col_pos = 3.
t_fieldcat2-fieldname = 'MATNR'.
t_fieldcat2-ref_table = 'VBAP'.
t_fieldcat2-ref_field = 'MATNR'.
append t_fieldcat2.
clear t_fieldcat2.
t_fieldcat2-col_pos = 4.
t_fieldcat2-fieldname = 'NETWR'.
t_fieldcat2-ref_table = 'VBAP'.
t_fieldcat2-ref_field = 'NETWR'.
t_fieldcat2-do_sum = 'X'.
append t_fieldcat2.
clear t_fieldcat2.
t_fieldcat2-col_pos = 5.
t_fieldcat2-fieldname = 'WAERK'.
t_fieldcat2-ref_table = 'VBAP'.
t_fieldcat2-ref_field = 'WAERK'.
append t_fieldcat2.
endform. " build_fcat_vbap
*& Module STATUS_0200 OUTPUT
text
module STATUS_0200 output.
SET PF-STATUS 'ITEM1'.
SET TITLEBAR 'VBAP'.
perform build_fcat_vbap.
perform sort_alv2.
if t_cont2 is initial.
create object t_cont2
exporting
container_name = 'ITEM'.
create object t_alv2
exporting
i_parent = t_cont2.
t_layout-grid_title = 'Item Details'.
CALL METHOD t_alv2->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = t_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING = t_toolbar[]
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
it_outtab = t_vbap[]
IT_FIELDCATALOG = t_fieldcat2[]
IT_SORT = t_sort[]
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
else.
CALL METHOD t_alv2->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
FINISHED = 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.
endif.
endmodule. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
module USER_COMMAND_0200 input.
case sy-ucomm.
when 'GOBACK'.
leave to screen 0.
endcase.
endmodule. " USER_COMMAND_0200 INPUT
*& Form sort_alv2
text
--> p1 text
<-- p2 text
form sort_alv2 .
clear t_sort.
t_sort-spos = '1'.
t_sort-fieldname = 'VBELN'.
t_sort-up = 'X'.
t_sort-subtot = 'X'.
append t_sort.
endform. " sort_alv2
*& Form xclude_toolbar
text
--> p1 text
<-- p2 text
form xclude_toolbar .
t_toolbar = '&DETAIL'.
append t_toolbar.
t_toolbar = '&&SEP00'.
append t_toolbar.
t_toolbar = '&&SEP01'.
append t_toolbar.
t_toolbar = '&&SEP02'.
append t_toolbar.
t_toolbar = '&SORT_ASC'.
append t_toolbar.
t_toolbar = '&SORT_DSC'.
append t_toolbar.
t_toolbar = '&FIND'.
append t_toolbar.
t_toolbar = '&MB_FILTER'.
append t_toolbar.
t_toolbar = '&&SEP04'.
append t_toolbar.
t_toolbar = '&MB_SUM'.
append t_toolbar.
t_toolbar = '&MB_SUB_TOTAL'.
append t_toolbar.
t_toolbar = '&PRINT_BACK'.
append t_toolbar.
t_toolbar = '&MB_VIEW'.
append t_toolbar.
t_toolbar = '&MB_EXPORT'.
append t_toolbar.
t_toolbar = '&GRAPH'.
append t_toolbar.
t_toolbar = '&COLO'.
append t_toolbar.
t_toolbar = '&&SEP06'.
append t_toolbar.
t_toolbar = '&&SEP07'.
append t_toolbar.
t_toolbar = '&INFO'.
append t_toolbar.
t_toolbar = '&&SEP03'.
append t_toolbar.
endform. " xclude_toolbar
reward point if helpful.
thanks
mrutyun^ -
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 -
ALV Display - Error in field catalog
Hi ,
I am facing a problem in ALV... Field catalot is not getting populated... I am getting a message field catalog not found...
Can anyone please help me....... <URGENT DOES NOT EXIST HERE>...
I am enclosing my code also.. please go thourh it and help it....
REPORT ZINVENTORY
LINE-SIZE 120
LINE-COUNT 64.
MESSAGE-ID Z2
NO STANDARD PAGE HEADING..
type-pools : slis.
Tables *
tables: zasset,
anla,
itob,
equi.
data: v_repid LIKE sy-repid.
Selection Screen *
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
SELECT-OPTIONS : S_bukrs FOR anla-bukrs OBLIGATORY ,
S_kostl FOR itob-kostl .
SELECTION-SCREEN : END OF BLOCK B1 .
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
PARAMETERS: p_screen RADIOBUTTON GROUP gr1,
p_list RADIOBUTTON GROUP gr1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b2.
Internal Tables *
types: BEGIN OF ty_zasset, " occurs 0,
equnr like zasset-equnr,
ANLN1 LIKE zasset-ANLN1, " Asset number
ANLN2 LIKE zasset-ANLN2, " Sub Asset number
BUKRS LIKE zasset-BUKRS, " Company Code
KOSTL like zasset-kostl,
SCANNEDBY type zasset-scannedby,
SCANNINGDATE type zasset-SCANNINGDATE,
SCANNINGTIME type zasset-scanningtime,
UPDATEDATE type zasset-updatedate,
UPDATETIME type zasset-updatetime,
END OF ty_zasset.
DATA: wa_zasset TYPE ty_zasset.
DATA: it_zasset TYPE TABLE OF ty_zasset with header line..
types: BEGIN OF ty_zasset1, " occurs 0,
equnr TYPE equi-equnr,
ANLN1 LIKE anla-ANLN1, " Asset number
ANLN2 LIKE anla-ANLN2, " Sub Asset number
BUKRS LIKE anla-BUKRS, " Company Code
ernam like anla-ernam,
erdat like anla-erdat,
KOSTL like anlz-kostl,
SCANNEDBY type zasset-scannedby,
SCANNINGDATE type zasset-SCANNINGDATE,
SCANNINGTIME type zasset-scanningtime,
UPDATEDATE type zasset-updatedate,
UPDATETIME type zasset-updatetime,
END OF ty_zasset1.
DATA: wa_zasset1 TYPE ty_zasset1.
DATA: it_zasset1 TYPE TABLE OF ty_zasset1 with header line..
types: BEGIN OF ty_zasset2, " occurs 0,
equnr like itob-equnr,
ANLNr LIKE itob-ANLNr, " Asset number
ANLuN LIKE itob-ANLuN, " Sub Asset number
BUKRS LIKE itob-BUKRS, " Company Code
timbi like itob-timbi,
kostl like itob-kostl,
KOSTL like anlz-kostl,
SCANNEDBY type zasset-scannedby,
SCANNINGDATE type zasset-SCANNINGDATE,
SCANNINGTIME type zasset-scanningtime,
UPDATEDATE type zasset-updatedate,
UPDATETIME type zasset-updatetime,
END OF ty_zasset2.
DATA: wa_zasset2 TYPE ty_zasset2.
DATA: it_zasset2 TYPE TABLE OF ty_zasset2 with header line..
types: begin of ty_final , "occurs 0,
equnr like itob-equnr,
anln1 like anla-anln1,
anln2 like anla-anln2,
bukrs like anla-bukrs,
ernam
erdat
kostl like itob-kostl,
end of ty_final.
DATA: wa_final TYPE ty_final.
DATA: it_final TYPE TABLE OF ty_final with header line..
*DATA: it_zasset TYPE TABLE OF ty_zasset.
*data: it_zasset1 type table of ty_zasset1.
*data:wa_zasset type ty_zasset.
*data:wa_zasset1 type ty_zasset1.
Flags and Variables *
DATA : F_ERROR. " Flag for No Data
*pop field cat for f7
data: V_SYREPID LIKE SY-REPID,
IT_FLDCAT type slis_t_fieldcat_alv , "with header line,
wa_fldcat type slis_fieldcat_alv.
*DATA : IT_FLDCATS TYPE SLIS_T_FIELDCAT_ALV.
data: itab_events type slis_t_event,
wa_events type slis_alv_event.
*data: wa_layout type slis_layout_alv.
DATA : IT_COMMENTS TYPE SLIS_T_LISTHEADER,
WA_COMMENTS TYPE SLIS_LISTHEADER.
DATA : IT_SORTINFO TYPE SLIS_T_SORTINFO_ALV,
WA_SORTINFO TYPE SLIS_SORTINFO_ALV.
Initialization *
initialization.
SY-REPID = V_REPID.
At Selection Screen *
AT SELECTION-SCREEN.
PERFORM validation.
Start Of Selection *
start-of-selection.
perform select_data.
IF P_LIST = 'X'.
perform get_field_catalog.
PERFORM MODIFYFIELDCAT.
perform get_events.
perform write_comments.
perform grid_display.
*perform list_display.
ENDIF.
IF sy-subrc = 0.
IF p_list = 'X'.
loop at it_final.
perform get_events.
endloop.
endif.
endloop.
else.
*endif.
End Of Selection *
END-OF-SELECTION.
*perform display_Recorsds.
*loop at zasset.
*& Form validation
text
--> p1 text
<-- p2 text
FORM validation.
*Local variables.
DATA:
lv_bukrs type anla-bukrs,
lv_kostl type itob-kostl,
lv_anln1 TYPE anla-anln1, "MAterial Number
lv_anln2 TYPE anla-anln2.
*Validation for company code
if not s_bukrs is initial.
select single bukrs from anla
into lv_bukrs
where bukrs in s_bukrs.
if sy-subrc <> 0.
*Message used : Invalid company code.
endif.
endif .
Validation for cost center
if not s_kostl is initial.
select single kostl from itob
into lv_kostl
where kostl in s_kostl.
if sy-subrc <> 0.
*Message used : Invalid company code.
endif.
endif .
ENDFORM. " validation
*& Form display
text
--> p1 text
<-- p2 text
FORM display.
write :/15 it_final-anln1,
it_final-anln2,
sy-vline.
*-bukrs,
it_zasset-anln1.
ENDFORM. " display
*& Form get_field_catalog
text
--> p1 text
<-- p2 text
FORM get_field_catalog.
*REFRESH IT_FLDCAT.
*CLEAR IT_FLDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FLDCAT
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.
ENDFORM. " get_field_catalog
*& Form get_events
text
--> p1 text
<-- p2 text
FORM get_events.
WA_COMMENTS-TYP = 'H'.
WA_COMMENTS-KEY = 'THIS IS THE HEADING.'.
WA_COMMENTS-INFO = 'LIST OF SALES ORDERS'.
APPEND WA_COMMENTS TO IT_COMMENTS.
ENDFORM. " get_events
*& Form grid_display
text
--> p1 text
<-- p2 text
FORM grid_display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'FIRST PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'LIST OF FLIGHT DETAILS'
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = it_fldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = itab_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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
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.
ENDFORM. " grid_display
*& Form write_comments
text
--> p1 text
<-- p2 text
FORM write_comments.
WA_COMMENTS-TYP = 'H'.
WA_COMMENTS-KEY = 'THIS IS THE HEADING.'.
WA_COMMENTS-INFO = 'LIST OF SALES ORDERS'.
APPEND WA_COMMENTS TO IT_COMMENTS.
ENDFORM. " write_comments
*& Form select_data
text
--> p1 text
<-- p2 text
FORM select_data.
clear: it_zasset, it_zasset[].
select equnr "bukrs
anln1
anln2
bukrs
KOSTL
SCANNEDBY
SCANNINGDATE
SCANNINGTIME
UPDATEDATE
UPDATETIME
into table it_zasset "(g_anln1,g_anln2)
from zasset
where bukrs = zasset-bukrs..
and kostl = zasset-kostl.
if sy-subrc = 0.
sort it_zasset by anln1 anln2.
endif.
append it_zasset.
clear it_zasset1.
select
equnr
anln1
anln2
bukrs
ernam
erdat
bukrs
KOSTL
SCANNEDBY
SCANNINGDATE
SCANNINGTIME
UPDATEDATE
UPDATETIME
into table it_zasset1 "(g_anln1,g_anln2)
from anla
where bukrs = it_zasset-bukrs.
WHERE BUKRS IN S_BUKRS.
and kostl = anla-kostl.
if sy-subrc = 0.
select equnr
anlnr
anlun
bukrs
timbi
kostl
into table it_zasset2
from itob
for all entries in it_zasset1
where bukrs = it_zasset1-bukrs
WHERE anlnr = it_zasset1-anln1.
endif.
APPEND IT_ZASSET1.
IF SY-SUBRC = 0.
*loop at it_zasset1 into wa_zasset1.
loop at it_ZASSET1 into wa_zasset1.
move wa_zasset1-bukrs to wa_final-bukrs.
move wa_zasset1-anln1 to wa_final-anln1.
move wa_zasset1-anln2 to wa_final-anln2.
append wa_final to it_final.
endloop.
ENDIF.
sort it_final.
*LOOP AT IT_FINAL.
*ENDLOOP.
*ENDIF.
*if sy-subrc = 0.
*loop at it_zasset into wa_asset.
*read table it_zasset into wa_asset with key anln2 = wa_asset-anln2
*binary search.
*read table it_final into wa_final with key anln2 = wa_final-anln2
*binary search.
*if wa_asset-anln2 = wa_final-anln2.
*write : / 'error'.
*endif.
If sy-subrc <> 0.
f_error = 'X'.
write : 'No data Exists for the given selection in FA table'.
else.
loop at it_final.
perform display.
endloop.
records exits in anla table also.
endif.
ENDFORM. " select_data
*& Form MODIFYFIELDCAT
text
--> p1 text
<-- p2 text
FORM MODIFYFIELDCAT.
LOOP AT IT_FLDCAT INTO WA_FLDCAT.
CASE WA_FLDCAT-FIELDNAME.
WHEN 'EQUNR'.
WA_FLDCAT-COL_POS = 1.
WA_FLDCAT-SELTEXT_L = 'aSSET'.
WHEN 'ANLN1'.
wa_FLDCAT-KEY = 'X'.
WA_FLDCAT-COL_POS = 5.
WA_FLDCAT-SELTEXT_L = 'aSSET'.
WHEN 'ANLN2'.
WA_FLDCAT-KEY = 'X'.
WA_FLDCAT-COL_POS = 6.
wa_FLDCAT-HOTSPOT = 'X'.
WHEN 'BUKRS'.
WA_FLDCAT-CURRENCY = 'INR'.
WA_FLDCAT-SYMBOL = 'X'.
ENDCASE.
MODIFY IT_FLDCAT FROM WA_FLDCAT.
*IT_FLDCAT-fieldname = 'EQUNR'.
IT_FLDCAT-seltext_m = 'DOCUM_TYPE'.
IT_FLDCAT-col_pos = 1.
IT_FLDCAT-outputlen = 10.
IT_FLDCAT-emphasize = 'X'.
IT_FLDCAT-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append IT_FLDCAT TO IT_FLDCAT.
IT_FLDCAT-fieldname = 'ANLN1'.
IT_FLDCAT-seltext_m = 'DOCUM_TYPE'.
IT_FLDCAT-col_pos = 1.
IT_FLDCAT-outputlen = 10.
IT_FLDCAT-emphasize = 'X'.
IT_FLDCAT-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append IT_FLDCAT TO IT_FLDCAT.
ENDLOOP.
ENDFORM. " MODIFYFIELDCAT
*& Form list_display
text
--> p1 text
<-- p2 text
*FORM list_display.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_SYREPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'FRM_USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = wa_layout
IT_FIELDCAT = IT_FLDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = ITAB_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
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.
*ENDFORM. " list_display
Edited by: Craig Cmehil on Jul 18, 2008 10:01 AMThe problem is with this...
types: begin of ty_final , "occurs 0,
equnr like itob-equnr,
anln1 like anla-anln1,
anln2 like anla-anln2,
bukrs like anla-bukrs,
ernam
erdat
kostl like itob-kostl,
end of ty_final.
DATA: wa_final TYPE ty_final.
DATA: it_final TYPE TABLE OF ty_final with header line.
when you are using Fieldcatalog merge you have to avoid using the TYPES Declaration of the internal table.
Instead of that you can do this
data: begin of it_final occurs 0,
equnr like itob-equnr,
anln1 like anla-anln1,
anln2 like anla-anln2,
bukrs like anla-bukrs,
ernam
erdat
kostl like itob-kostl,
end of it_final. -
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. -
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
Maybe you are looking for
-
Ul won't stay in premade layout
Ok i making this site for school. My ul list won't stay inside one of dw premade layouts. The bullets go off the side of it. Anyone know why? here is html and css <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Untitled Document</title>
-
I was trying to sync my iPhone & iPad, and caused a working message to appear "Turning Off Safari Data..." It's been on for a day, and I can't make it stop. Please help!
-
Calling Instance Method in a Global Class
Hi All, Please can you tell me how to call a instance method created in a global class in different program. This is the code which I have written, data: g_cl type ref to <global class>. call method g_cl -> <method name> I am not able to create Creat
-
Using Java oracle.spatial.util.SampleShapefileToJGeomFeature : ESRI SHP
Hi, I am trying to import an ESRI shapefile using the Java class oracle.spatial.util. I have to add a remark, that I have set the classpath with the command set classpath=.;%ORACLE_HOME%\jdbc\lib\ojdbc14.jar I am using Oracle 11g and I don't have thi
-
Why no Data Guard tools shown on EM Console?
I have successfully created a 10g(10.1.0) physical standby database a broker on OEL5.0 Linux system. Then I configured the fast_start failover and observer on the Data Guard system. But no any Data Guard tools(GUI tools) shown on EM Console. How can