1 1 1 1 1 Rating 0% (0 Votes)
Access this URL (http://abapblog.com/files/nugg/ZAB_MB51_CALL.nugg)ZAB_MB51_CALL.nugg
I've decided which way should I go, so now time to do it. I need to do following things to get what I desired:
  • Create a function group or class to be able to reuse the solution in other programs also
  • Create implicit enhancement in MB51 to be able to export it's results and stop MB51 if it's called from outside
  • Create a program with selection screen fields from MB51 + my own desired additional filters. This program should call standard MB51 and display some additional fields in ALV Grid.
I prefer to create a class in which I will store all needed methods to call MB51 with selection-options filled and to get back the results. 
I will need a type for the structure which will be used as a base type to all copy / move functions from MB51 to class and program. Bellow you'll find a type t_list which contains most of the fields which are available in MB51 (structure list in RM07DOCS). Just after t_list you'll find type tt_list which is just table type for t_list.

* type which is equal or at least have most fields from structure list
* in program RM07DOCS
    typesbegin of t_list,
         anln1 type  anln1,
         anln2 type  anln2,
         aplzl type  cim_count,
         aufnr type  aufnr,
         aufpl type  co_aufpl,
         bktxt type  bktxt,
         bpmng type  bpmng,
         bprme type  bbprm,
         bstme type  bstme,
         bstmg type  mb_bstmg,
         budat type  budat,
         budat_mkpf  type  budat,
         bukrs type  bukrs,
         bwart type  bwart,
         bwtar type  bwtar_d,
         charg type  charg_d,
         cpudt type  cpudt,
         cpudt_mkpf  type  cpudt,
         cputm type  cputm,
         cputm_mkpf  type  cputm,
         dmbtr type  dmbtr,
         ebeln type  bstnr,
         ebelp type  ebelp,
         erfme type  erfme,
         erfmg type  erfmg,
         exbwr type  exbwr,
         exvkw type  exvkw,
         grund type  mb_grbew,
         insmk type  mb_insmk,
         kdauf type  kdauf,
         kdein type  kdein,
         kdpos type  kdpos,
         kostl type  kostl,
         kunnr type  ekunn,
         kzbew type  kzbew,
         kzvbr type  kzvbr,
         kzzug type  kzzug,
         lgort type  lgort_d,
         lifnr type  elifn,
         matnr type  matnr,
         mblnr type  mblnr,
         meins type  meins,
         menge type  menge_d,
         mjahr type  mjahr,
         nplnr type  nplnr,
         ps_psp_pnr  type  ps_psp_pnr,
         rsnum type  rsnum,
         rspos type  rspos,
         sakto type  saknr,
         sgtxt type  sgtxt,
         shkzg type  shkzg,
         sobkz type  sobkz,
         umlgo type  umlgo,
         umwrk type  umwrk,
         usnam type  usnam,
         usnam_mkpf  type  usnam,
         vgart type  vgart,
         vgart_mkpf  type  vgart,
         vkwrt type  vkwrt,
         waers type  waers,
         wempf type  wempf,
         werks type  werks_d,
         xauto type  mb_xauto,
         xblnr type  xblnr,
         xblnr_mkpf  type  xblnr,
         zeile type  mblpo,
         maktx type  maktx,
         name1 type  name1,
         btext type  bwtxt,
         pspid type  ps_posid,
         vornr type  vornr,
         longnum type  /sappspro/longnum,
         matnr_ext type  matnr_ext,
         color type  slis_t_specialcol_alv ,
      end of t_list.

    typestt_list type table of t_list .