SM30 BDC example
There is very simple example how to run transaction SM30 in BDC with certain view name directly reaching its display mode skipping annoying popup window.
TABLES sscrfields.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_it_bdcdata LIKE LINE OF it_bdcdata,
opt TYPE ctu_params.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-program = 'SAPMSVMA'.
wa_it_bdcdata-dynpro = '100'.
wa_it_bdcdata-dynbegin = 'X'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'VIEWNAME'.
wa_it_bdcdata-fval = '/NAMESPACE/T_EMAIL'.
APPEND wa_it_bdcdata TO it_bdcdata.
" code for display button
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_OKCODE'.
wa_it_bdcdata-fval = '=SHOW'.
APPEND wa_it_bdcdata TO it_bdcdata.
opt-dismode = 'E'. " it skips OKCODE popup in "A" mode
CALL TRANSACTION 'SM30' USING it_bdcdata OPTIONS FROM opt.