Doubt in using field catalog merge function
hi all,
When I am using the function maodule reuse_alv_fieldcatalog_merge for building the field catalog in alv list,it was giving abend message as
'Field catalog is empty'.
what might be the reason for such message?can some one help me out with the solution to get rid of that.
I cant populate the catalog manually because I need to display nearly 40 fields in the output.
Thanks in advance.
hI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
Similar Messages
-
ALV int report using field catalog merge
Hi folks,
Can anyone here please provide me an alv interactive report?
K.Kiran.report zialv_edit_simple1 .
include <icon>.
Definition of Grid event-handler class
class lcl_grid_event_receiver definition.
public section.
methods:
toolbar for event toolbar
of cl_gui_alv_grid
importing e_object
e_interactive
,user_command for event user_command
of cl_gui_alv_grid
importing e_ucomm
. " Period
endclass.
*mplementation of Grid event-handler class
class lcl_grid_event_receiver implementation.
Method for handling all creation/modification calls to the toolbar
method toolbar.
data : ls_toolbar type stb_button.
Define Custom Button in the toolbar
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EDIT' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'EDIT' to ls_toolbar-text.
move icon_change_text to ls_toolbar-icon.
move 'Click2Edit' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'UPDA' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'UPDATE' to ls_toolbar-text.
move icon_system_save to ls_toolbar-icon.
move 'Click2Update' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EXIT' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move 'EXIT' to ls_toolbar-text.
move icon_system_end to ls_toolbar-icon.
move 'Click2Exit' to ls_toolbar-quickinfo.
append ls_toolbar to e_object->mt_toolbar.
endmethod.
Method to handle user commands from toolbar
method user_command.
case e_ucomm .
when 'EDIT'.
perform set_input.
when 'UPDA'.
perform refresh_disp.
perform update_table.
when 'EXIT'.
leave program.
endcase.
endmethod.
endclass.
Declarations
parameters:
p_intab type dfies-tabname default 'SAPLANE'.
data :
dref type ref to data,
it_grid_fcat type lvc_t_fcat,
struct_grid_lset type lvc_s_layo,
tab_info like table of dfies.
field-symbols :
<fs_tab> like line of tab_info,
Output Structure****
<it_disptab> type table.
data :
ok_code like sy-ucomm
,save_ok like sy-ucomm
Container Object [grid_container]
,grid_container type ref to cl_gui_custom_container
Control Object [grid]
,grid type ref to cl_gui_alv_grid
Event-Handler Object [grid_handler]
,grid_handler type ref to lcl_grid_event_receiver
. " period
Begin of process logic
start-of-selection.
call screen '0100'.
*& Module STATUS_0100 OUTPUT
PBO module ...Displays the Grid
module status_0100 output.
A L V G R I D
if grid_container is initial.
create object grid_container
exporting
container_name = 'CCONTAINER1'.
create object grid
exporting
i_appl_events = 'X'
i_parent = grid_container.
create object grid_handler.
set handler:
grid_handler->user_command for grid,
grid_handler->toolbar for grid .
*Assigning the input value to <fs_tab>-tabname
assign p_intab to <fs_tab>-tabname .
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = <fs_tab>-tabname
changing
ct_fieldcat = it_grid_fcat.
*Creating internal table
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_grid_fcat
importing
ep_table = dref.
assign dref->* to <it_disptab>.
perform populate_grid_data .
call method grid->set_ready_for_input
exporting
i_ready_for_input = 0.
*Enabling the grid to edit mode,
*setting table name as title of the grid
struct_grid_lset-edit = 'X'. "To enable editing in ALV
struct_grid_lset-grid_title = p_intab.
call method grid->set_table_for_first_display
exporting
is_layout = struct_grid_lset
changing
it_outtab = <it_disptab>
it_fieldcatalog = it_grid_fcat
. " Period
endif.
endmodule.
*& Module USER_COMMAND_0100 INPUT
module user_command_0100 input.
****User Commands are handled as events in method user_command.
endmodule. " USER_COMMAND_0100 INPUT
*& Form EXIT_PROGRAM
form exit_program.
call method grid_container->free.
call method cl_gui_cfw=>flush.
leave program.
endform. " EXIT_PROGRAM
*& Form populate_grid_data
form populate_grid_data.
select * from (p_intab) into corresponding fields of table <it_disptab>.
endform. " populate_grid_data
FORM refresh_disp *
form refresh_disp.
call method grid->refresh_table_display.
endform.
FORM update_table *
form update_table.
modify (p_intab) from table <it_disptab>.
call method grid->set_ready_for_input
exporting
i_ready_for_input = 0.
endform.
FORM set_input *
form set_input.
call method grid->set_ready_for_input
exporting
i_ready_for_input = 1.
endform.
Screen Logic :
process before output.
module status_0100.
process after input.
module user_command_0100. -
Field catalog merge in Classes
Hi,
I need to use field catalog merge without using FM . not manual field catalog.I want to call Class and use in ALV.
Regards,
NandhaHi Nandha,
why you can't use FM?
it's common to use LVC_FIELDCATALOG_MERGE using ALV GRID CONTROLL (with class). -
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. -
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 -
Radio button in ALV without using field catalog
Hi All,
My requirement is i want to create a RFC function module to display the header table.
while executing the function module the output is of alv grid format.
i have used the structure for this.
i didnt create a layout and fieldcatalog.
now i need to add a radio button in that alv grid display.
how to create the radio button without using field catalog.
Thank in Advance.Hi Aishwarya,
You need to use the field catalog for displaying a field as a radio button in ALV grid.
Please refer to this link for doing so. [Radio buttons in ALV Grid|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
You can use LVC_FIELDCATALOG_MERGE wherein you can use your structure and the Icon for Radiobutton.
Refer to this link -[Radiobuttons in ALV Grid 2|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02535ce-9eaf-2910-ae8c-f2f2afc1c8e7?quicklink=index&overridelayout=true]
Best Regards,
Sharmila
Edited by: Sharmila Subramanian on Mar 18, 2011 12:34 PM -
Is there a way of using a mail merge function while on the iphone or ipad, i wish to email a "Word style, ot TXT" document to 250 of my contacts, I have tried downloading my contacts to my PC's outlook but only 1 contact comes across at a time despite the fact that Icloud says downloading namedperson + 249 other contacts to a CSV file
Hi everyone!
Looking also for an app that allows me to merge email and send them out to each recipient individually. Apparently that's not possible yet. Here's what the guys at RedbitsApps told me about Group Email capabilities:
"The current version of the app relies on the device operating system to send the emails. For this reason, sending individual email instead of a single email to multiple recipients is not possible. Apple doesn't allow apps to send single emails to many recipients easily. We may use a custom sending software in a future version."
Let's keep looking guys... -
When do we need field catalog merge in ALV
Hi all,
When do we actually need fieldcatalog merge in ALV's
Regards
Saroja.Hi
When you want the field catalog to be populated directly from the internal table or a structure, you can use this function module. If you are populating the field catalog from an internal table in an include other than your top include, then the include name also has to be passed to the function module.
reward if helpful
regards,
madhu -
Hi ,
I have passed the internal table name which is going to be displayed in the output to the parameter I_Tablename in REUSE_ALV_FIELDCATALOG_MERGE, but its going to the short dump... If i pass the structure name say zstru to I_Structurename in the function module its not going to the dump... Any one can please explain where exactly the problem is ... and one more thing i am working with ECC 6.0 Version..
Thank & Regards.
Laxman.P
B'lore.Paas the name of internal table in CAPS and within commas
eg
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = 'GT_HEAD'
I_STRUCTURE_NAME = 'ZHRG_MED'
CHANGING
CT_FIELDCAT = P_FCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
U can also try the following code without commas
FORM init_fieldcat USING itab type any
incl type any.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
i_repid LIKE sy-repid.
i_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = itab
I_STRUCTURE_NAME =
i_client_never_display = 'X'
i_inclname = incl
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 0
program_error = 0
OTHERS = 0.
ENDFORM. " INIT_FIELDCAT
Reward points , if useful -
Write stat below alv report .if i use field catalog.
hi experts,
i want to use write statment after alv report.
note: i am useing fieldcatalog.
i got it if i use standard table with : end_of_list event event.
thank you.Hi snk,
1. It won't work in GRID display.
2. The reason is when grid comes,
it comes on a screen which has container and the grid control.
3. Write statement is displayed on a special screen,
which is generally used for list output.
Normal screens (where we can put textboxes/checkboxes etc),
do not support write statements.
regards,
amit m. -
When I use Field catalog merge I get an error
i Get a runtime error where it says the internal table passes to field catalog marge has a different fields than I_INTERNAL_TABNAME . What could be the problem.
Thank youAre you passing the internal table name and field name as the same or different and also check the data type of the fieldcatalog internal table that you are passing to this FM
Check this code for ur reference.
REPORT ZMK_SHIPMENT_ALV
no standard page heading
line-size 105
line-count 50(5)
message-id zz.
TABLES *
tables : vttk, "Shipment Header
vttp, " Shipment Item
lips. " Delivary Item
***TYPE-POOLS *
type-pools : slis.
*WORK AREAS *
Work area for field catalog table
data : wa_fldcat type slis_fieldcat_alv.
Work area for Events table
data : wa_events type slis_alv_event.
Work area for layout.
data : wa_layout type slis_layout_alv.
*INTERNAL TABLES *
Shimpment Details
data : begin of itab occurs 0,
tknum like vttk-tknum,
shtyp like vttk-shtyp,
tpnum like vttp-tpnum,
vbeln like vttp-vbeln,
end of itab.
data : begin of itab1 occurs 0,
vbeln like lips-vbeln,
posnr like lips-posnr,
matnr like lips-matnr,
lfimg like lips-lfimg,
meins like lips-meins,
end of itab1.
For field catalog table
data : it_fldcats type slis_t_fieldcat_alv.
For Events table
data : it_event type slis_t_event.
For layout.
data : it_layout type slis_layout_alv.
For field catalog table
data : it_fldcats1 type slis_t_fieldcat_alv.
For Events table
data : it_event1 type slis_t_event.
data : v_repid like sy-repid.
*Data Declaration
data: v_index type sy-index,
v_vbeln like lips-vbeln.
*SELECT-OPTIONS
selection-screen begin of block b with frame title text-001.
select-options : s_tknum for vttk-tknum .
selection-screen end of block b.
*INITIALIZATION
initialization.
v_repid = sy-repid.
*START-OF-SELCTION
start-of-selection.
perform populate-data.
sort itab by tknum.
top-of-page.
write : 'Shipment wise Delivary Report'.
end-of-selection.
perform build-fieldcatalog.
perform modify-fieldcatalog.
perform build-events.
perform modify-events.
perform set-layout.
perform set-pfstatus.
perform list-display.
*& Form populate-data
Retrives the Shipment data depending on the selection criteria *
FORM populate-data.
select vttk~tknum
vttk~shtyp
vttp~tpnum
vttp~vbeln
into table itab
from vttk
join vttp
on vttptknum = vttktknum
where vttk~tknum in s_tknum.
if sy-subrc <> 0.
message e999 with 'NO DATA FOUND'.
exit.
endif.
ENDFORM. " populate-data
*& Form build-fieldcatalog
text
--> p1 text
<-- p2 text
form build-fieldcatalog.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
changing
ct_fieldcat = it_fldcats
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. " BUILD-FIELDCATALOG
*& Form build-events
text
--> p1 text
<-- p2 text
FORM build-events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = it_event
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. " build-events
*& Form set-layout
text
--> p1 text
<-- p2 text
FORM set-layout.
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-no_colhead = space.
wa_layout-no_vline = space.
ENDFORM. " set-layout
*& Form list-display
text
--> p1 text
<-- p2 text
FORM list-display.
CALL FUNCTION 'REUSE_ALV_LIST_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 = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fldcats
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = it_event
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 = itab
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
*& Form modify-fieldcatalog
text
--> p1 text
<-- p2 text
FORM modify-fieldcatalog.
loop at it_fldcats into wa_fldcat.
case wa_fldcat-fieldname.
when 'TKNUM'.
wa_fldcat-seltext_l = 'Ship No.'.
wa_fldcat-col_pos = 1.
wa_fldcat-ddictxt = 'L'.
when 'SHTYP'.
wa_fldcat-seltext_l = 'Ship Type'.
wa_fldcat-col_pos = 2.
wa_fldcat-ddictxt = 'L'.
when 'TPNUM'.
wa_fldcat-seltext_l = 'Item No.'.
wa_fldcat-col_pos = 3.
wa_fldcat-ddictxt = 'L'.
when 'VBELN'.
wa_fldcat-seltext_l = 'Delivary No.'.
wa_fldcat-hotspot = 'X'.
wa_fldcat-col_pos = 4.
wa_fldcat-ddictxt = 'L'.
endcase.
modify it_fldcats from wa_fldcat.
endloop.
ENDFORM. " modify-fieldcatalog
*& Form modify-events
text
--> p1 text
<-- p2 text
form modify-events.
read table it_event with key name =
slis_ev_top_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'HEADER-OF-REPORT'.
modify it_event from wa_events index sy-tabix.
clear wa_events.
endif.
read table it_event with key name =
slis_ev_end_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'FOOTER-OF-REPORT'.
modify it_event from wa_events index sy-tabix.
clear wa_events.
endif.
endform. " modify-events
*& Form HEADER-OF-REPORT
text
--> p1 text
<-- p2 text
FORM HEADER-OF-REPORT.
write : 'Shipment Wise Delivary Report'.
ENDFORM. " HEADER-OF-REPORT
*& Form FOOTER-OF-REPORT
text
--> p1 text
<-- p2 text
FORM FOOTER-OF-REPORT.
write : 'End of Report'.
ENDFORM. " FOOTER-OF-REPORT
*& Form USER_COMMAND
User command for Calling Transaction VT03N, Execute and Refresh
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
V_INDEX = P_SELFIELD-TABINDEX. " holds the selected table index
CASE p_ucomm.
WHEN '&IC1'.
IF p_selfield-fieldname eq 'VBELN'.
perform secondary_list.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND
*& Form secondary_list
text
--> p1 text
<-- p2 text
FORM secondary_list.
perform get_data1.
perform build-fieldcatalog1.
perform modify-fieldcatalog1.
perform build-events1.
perform modify-events1.
perform set-layout.
perform set-pfstatus.
perform list-display1.
ENDFORM. " secondary_list
*& Form build-fieldcatalog1
text
--> p1 text
<-- p2 text
FORM build-fieldcatalog1.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'ITAB1'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
changing
ct_fieldcat = it_fldcats1
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. " build-fieldcatalog1
*& Form modify-fieldcatalog1
text
--> p1 text
<-- p2 text
FORM modify-fieldcatalog1.
loop at it_fldcats into wa_fldcat.
case wa_fldcat-fieldname.
when 'VBELN'.
wa_fldcat-seltext_l = 'Delivary No.'.
wa_fldcat-col_pos = 1.
wa_fldcat-ddictxt = 'L'.
when 'POSNR'.
wa_fldcat-seltext_l = 'Item No'.
wa_fldcat-col_pos = 2.
wa_fldcat-ddictxt = 'L'.
when 'MATNR'.
wa_fldcat-seltext_l = 'Material'.
wa_fldcat-col_pos = 3.
wa_fldcat-ddictxt = 'L'.
when 'LFIMG'.
wa_fldcat-seltext_l = 'Quantity'.
wa_fldcat-col_pos = 4.
wa_fldcat-ddictxt = 'L'.
when 'MEINS'.
wa_fldcat-seltext_l = 'Unit of Measure'.
wa_fldcat-col_pos = 5.
wa_fldcat-ddictxt = 'L'.
endcase.
modify it_fldcats from wa_fldcat.
endloop.
ENDFORM. " modify-fieldcatalog1
*& Form build-events1
text
--> p1 text
<-- p2 text
FORM build-events1.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = it_event1
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. " build-events1
*& Form modify-events1
text
--> p1 text
<-- p2 text
FORM modify-events1.
read table it_event1 with key name =
slis_ev_top_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'HEADER_OF_REPORT_2'.
modify it_event1 from wa_events index sy-tabix.
clear wa_events.
endif.
ENDFORM. " modify-events1
*& Form list-display1
text
--> p1 text
<-- p2 text
FORM list-display1.
CALL FUNCTION 'REUSE_ALV_LIST_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 = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fldcats1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = it_event1
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 = itab1
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-display1
*& Form get_data1
text
--> p1 text
<-- p2 text
FORM get_data1.
READ TABLE itab INDEX V_INDEX.
v_vbeln = itab-vbeln.
select vbeln
posnr
matnr
lfimg
meins
from lips
into table itab1
where vbeln eq v_vbeln.
ENDFORM. " get_data1
*& Form header_of_report_2
text
--> p1 text
<-- p2 text
FORM header_of_report_2.
write: 'Delivary item list'.
ENDFORM. " header_of_report_2
*-- callling a transaction code by passing the initial screen value.
*& Form USER_COMMAND
form user_command using p_ucomm like sy-ucomm
p_selfield type slis_selfield.
data : l_index like sy-index,
l_refbn like cooi-refbn.
l_index = p_selfield-tabindex. " holds the selected table index
clear l_refbn.
case p_ucomm.
when '&IC1'.
clear l_refbn.
read table it_outtab index l_index.
if sy-subrc eq 0.
l_refbn = it_outtab-refbn.
if not l_refbn is initial.
set parameter id 'BES' field l_refbn.
call transaction 'ME23' and skip first screen.
endif.
else.
message e999 with text-014.
endif.
endcase.
endif. -
Translation of the Field label that is passe in the field catalog on ALV
Hiii
i there a way to make ALV column field label in different language
let say i have 3 radio button language english , french , and dutch
depending on the radio button selected i want my alv column fields to be display in that language.
note i am using field catalog merge and alv list.
i know that can be done by forcing value in the fieldcat-fieldname
something like that
IF english
fieldcat-fieldname = English
If frence
fieldcat-fieldname = french
if dutch
fieldcat-fieldname = dutch
but suppose i have 50 field then i must do that with all 50 field for each language
i there some more easier way like setting sy-langu or setting language in the fieldcatHi newbie82 c,
the easiest way is to use the SAP logon language and have all texts in program defines as text fields. The text fields are translated once and fetched always correct according to logon language.
If you want to switch languages by radiobutton, you may define one create_fieldcat routine for each language.
Regards,
Clemens -
ALV report using the field catalog
which is the quickest way to generate an ALV report using the field catalog merge. without needing to build the field catalog manually .
is it easier to create a structure and passe it in the field catalog merge . if yes can i have an example plzzzzhI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL -
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. -
Hi ABAPers,
I have defined an internal table I_ACV in the following manner.
DATA: BEGIN OF i_acv_new OCCURS 0.
INCLUDE STRUCTURE zzscmm003.
DATA: multi(1) TYPE c,
z_ebeln TYPE ekko-ebeln,
z_elikz TYPE ekpo-elikz,
END OF i_acv_new.
DATA: i_acv LIKE i_acv_new OCCURS 0 WITH HEADER LINE.
now , while creating the field catalog, the function module doesnt work. The field catalog is blank.
REFRESH gt_fieldcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'I_ACV'
i_inclname = sy-repid
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
Any way in which this can be worked around?
Help is much appreciated.
Thanks in advance.HI,
Please concentrate on Bold part below
it eill helpful to come out from ur problem.
*& Report ZMV_ALV_GRID
REPORT ZMV_ALV_GRID.
TYPE-POOLS : SLIS.
TABLES : KNA1.
TYPES : BEGIN OF ty_kna1 ,
kunnr LIKE kna1-kunnr,
name1 LIKE kna1-name1,
land1 LIKE kna1-land1,
END OF ty_kna1.
DATA: it_kna1 TYPE TABLE OF ty_kna1,
WA_KNA1 TYPE TY_KNA1.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : wa_layout TYPE slis_layout_alv .
DATA : it_events TYPE slis_t_event ,
wa_events TYPE slis_alv_event.
DATA : it_listheader TYPE slis_t_listheader,
wa_listheader TYPE slis_listheader,
it1_listheader TYPE slis_t_listheader,
wa1_listheader TYPE slis_listheader.
data : num type sy-pagno.
INITIALIZATION.
PERFORM getevents using it_events.
PERFORM desinlayout.
START-OF-SELECTION.
PERFORM desinfieldcat.
PERFORM datafetching.
PERFORM display.
*& Form getevents
FORM getevents USING P_IT_EVENTS TYPE SLIS_T_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_IT_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.
READ TABLE p_it_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.
wa_events-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_events TRANSPORTING form WHERE name = wa_events-name.
READ TABLE p_it_events INTO wa_events WITH KEY name = 'END_OF_LIST'.
IF sy-subrc = 0.
wa_events-form = 'END_OF_LIST'.
MODIFY it_events FROM wa_events TRANSPORTING form WHERE name = wa_events-name.
ENDIF.
ENDFORM. " getevents
*& Form top-of-page
FORM TOP_OF_PAGE.
wa_listheader-typ = 'H'.
wa_listheader-info = 'Customer Details'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo = 'EDSLOGO'
I_END_OF_LIST_GRID =
I_ALV_FORM =
REFRESH it_listheader.
ENDFORM. "top-of-page
*& Form end-of-page
FORM END_OF_LIST.
wa1_listheader-typ = 'H'.
wa1_listheader-info = 'Address Details'.
append wa1_listheader to it1_listheader.
clear wa1_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it1_listheader
i_logo =
I_END_OF_LIST_GRID =
I_ALV_FORM =
REFRESH it1_listheader.
ENDFORM. "end-of-page
*& Form desinlayout
FORM desinlayout .
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
*wa_layout-edit = 'X'.
wa_layout-edit_mode = 'X'.
ENDFORM. " desinlayout
*& Form desinfieldcat
FORM desinfieldcat .
wa_fieldcat-row_pos = 1.*
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'KUNNR'.
wa_fieldcat-seltext_l = 'Cust Num'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-outputlen = 10.
wa_fieldcat-tabname = 'IT_KNA1'.
wa_fieldcat-key = 'X'.
wa_fieldcat-hotspot = 'X'.*
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-row_pos = 2.*
wa_fieldcat-col_pos = 2.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-seltext_l = 'Name'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-outputlen = 35.
wa_fieldcat-tabname = 'IT_KNA1'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-row_pos = 3.*
wa_fieldcat-col_pos = 3.
wa_fieldcat-fieldname = 'LAND1'.
wa_fieldcat-seltext_l = 'Country'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-outputlen = 10.
wa_fieldcat-tabname = 'IT_KNA1'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " desinfieldcat----
*& Form datafetching
FORM datafetching .
SELECT kunnr name1 land1
FROM kna1
INTO TABLE it_kna1
WHERE kunnr IN s_kunnr.
UP TO 30 ROWS.
ENDFORM. " datafetching
*& Form display
text
FORM display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_KNA1
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
Rewards points if helpful.
Maybe you are looking for
-
Process Chain - Transfering Files to Application Server
Hi guys, I have been trying to use BW Process Chain to load data from a flat file (CSV) into an InfoCube. I understand for it to work, the file has to reside on the Application Server, and not the local workstation. However, can anyone tell me exactl
-
Macbook Air 11" Overheat Grey Screen.
Help Help Help !!!! I have a 2010 11" MBA 128Gb 4Gb RAM running Lion. About 1 month ago whilst attempting to upload a video to youtube (which was going to take about 3 hours) about half way through I came back to the room to find my display had a gre
-
Hi, I would like to know the reason why the JCO part is not included after the extraction of EWA Report on Solution Manager? What could be the reason behind this? What are the possible solutions to eliminate this type of issue? The customer actually
-
Movement Types Consignment (cust.)
There is a standard Movement Types to trasfer a material from a Consignment (cust.) into another Consignment (cust.)? It is ok also in the same plant. Thanks.
-
Help!!! Content engine
my configuration is follow the attached file. I don't know what is wrong with my content engine using as a cache server. when i connect this CE to my network, i can make my user access to the internet fast only 2 days, but after 2 days it makes my us