Create fieldcatalog from internal table
class-methods lvc_fcat_from_internal_table
importing
it_table type any table
returning value(rt_fcat) type lvc_t_fcat.
method lvc_fcat_from_internal_table.
data: table type ref to data.
create data table like it_table.
assign table->* to field-symbol(<table>).
try.
cl_salv_table=>factory( importing
r_salv_table = data(salv_table)
changing
t_table = <table> ).
rt_fcat = cl_salv_controller_metadata=>get_lvc_fieldcatalog(
r_columns = salv_table->get_columns( ) " ALV Filter
r_aggregations = salv_table->get_aggregations( ) " ALV Aggregations
).
catch cx_root.
endtry.
endmethod.
CL_PROGRESS_INDICATOR VS direct call of SAPGUI_PROGRESS_INDICATOR
Battleships game (two players)
Game is very simple, firstly you have to build your own map with ships. Just to remind you, there are 2 submarines, 2 destroyers, 1 cruiser, 1 battleship and 1 aircraft carrier. Map is created with CL_GUI_ALV_GRID. Once you click on status button to add one of the ships, map will show you in which place you can start ship. When you'll select position of the start it will show you possible fields for end.

Popup with multi-select ALV
constants: c_ccname_grid_popup type scrfname value 'CC_GRID_POPUP'.
data: go_popup_custom_cont type ref to cl_gui_custom_container.
data: go_popup_grid type ref to cl_gui_alv_grid.
data: gs_popup_layout type lvc_s_layo.
data: gs_popup_variant type disvariant.
data: gt_popup_fcat type lvc_t_fcat.
data: g_popup_question type char70.
field-symbols: <gt_popup_outtab> type standard table.

Mass replace popup for ALV grid
GOS - How to add business documents at creation of object
GOS - Link Business Documents from PR to PO
EWB Components allocation to routing operation (multilevel BOM)

ESDUS, ESRUO - MM settings table - Part 3/3
data: fs_esruo type esruo.
data: ft_esruo type standard table of esruo.
data: f_active type esdus-active.
data: ft_esduscom type standard table of esduscom.
select * into corresponding fields of table ft_esruo
from esruo
where uname eq sy-uname
and object_typ eq 'BUS2105'.
sort ft_esruo by timestamp descending.
read table ft_esruo index 1 into fs_esruo.
concatenate fs_esruo-object_id 'A' into f_active.
call function 'ES_READ_USER_SETTINGS'
exporting
iaction = 'MEPO'
* IUNAME = IUNAME
* IDB = IDB
* ILIKE = ILIKE
tables
iesdus = ft_esduscom
.
call function 'ES_DELETE_USER_SETTINGS'
exporting
iaction = 'MEPO'
ielement = 'Application Req_Process'
* iactive =
* IUNAME = IUNAME
* isave = 'X'
* TABLES
* IESDUS = IESDUS
exceptions
not_found = 1
others = 2
.
if sy-subrc eq 0.
endif.
call function 'ES_APPEND_USER_SETTINGS'
exporting
iaction = 'MEPO'
ielement = 'Application Req_Process'
iactive = f_active
* IUNAME = IUNAME
isave = 'X'
* TABLES
* IESDUS = IESDUS
.
ESDUS, ESRUO - MM settings table - Part 2/3
ESDUS table keeps parameters mostly for MM transactions, here is the list of t-codes for which I found some entries inside ESDUS:
- IA05
- MB24
- MB25
- MB51
- MB52
- MB59
- MB5TD
- ME21N
- ME22N
- ME23N
- ME25
- ME2K
- ME32K
- ME3K
- ME51N
- ME52N
- ME53N
- ME54N
- ME55
- ME56
- ME57
- ME58
- ME5A
- ME5F
- ME5K
- ME5W
- ME80AN
- ME80FN
- ME80RN
- MIGO
- MIRO
- ML81N
- SA38
- SE38
ESDUS, ESRUO - MM settings table - Part 1/3
Let's discus following scenarios with MM standard transactions:
When you open one of the MM t-codes like ME22N, ME51N or MIGO you see that always you got on the screen one of the latest open document there. Sometimes not last but one of the lasts and you want to make it always last.
You create MM documents using BAPI and you want that next time you open MM t-code which is used to display/edit this document then your document appears on the screen (of course if in the meantime user haven't created anything new)
You have created your own transaction to handle standard process, like creation of purchase orders or purchase requisitions. This transaction is used only in some special occasion like only in case of account assignment category is equal to 'A'. In such case for all documents which are created by your Z-transaction you've set up in user-exit that when standard transaction is called, then you leave it to your Z-transaction. In this case often MM transactions remembers last opened document, which was created by Z-transaction and at each run it will leave to it, so you want to clear the info about last called document from standard t-code.
You want to clear some default settings for the user (or set them) for standard t-code. This could be default value for some fields or toggle status of the section (for example header always expanded, items always collapsed.
- ESRUO (MM: Recently Used Objects)
- ESDUS (MM: Dynamic User Settings)
- ES_READ_USER_OBJECTS
- ES_APPEND_USER_OBJECTS
- ES_DELETE_USER_OBJECTS
- ES_SAVE_USER_OBJECTS
- ES_READ_USER_SETTINGS
- ES_APPEND_USER_SETTINGS
- ES_SAVE_USER_SETTINGS
- ES_DELETE_USER_SETTINGS
Enhanced MB51 Part 6 - ZMB51 program
types: begin of t_alv.
include type t_list.
types: dispo like marc-dispo,
ekgrp like marc-ekgrp,
verid like blpk-verid,
spart like mara-spart,
bklas like mbew-bklas,
rows type epsssrows,
vendor_name type mepo_vendor,
grtxt like t157e-grtxt,
xabln like mkpf-xabln,
bldat type mkpf-bldat,
end of t_alv.
- If one of the additional select-options is used then it does preselection and manipulates select-options passed to MB51
- Call of MB51
- Import of results and additional selection done on a base of the result table
- Output display
Enhanced MB51 Part 5 - Export from MB51

it_list type any table
Add a commentEnhanced MB51 Part 4 - Call MB51
export no_list from m_flag to memory id 'MB51_NOLIST'.
export flag from m_flag to memory id 'MB51_FLAG'.
export flag from m_flag to memory id 'ZMB51_FULLLIST_EXPORT'.
- import export to mt_list from memory id 'ZMB51_FULLLIST_EXPORT'.