1 1 1 1 1 Rating 0% (0 Votes)
Attachments:
Access this URL (http://abapblog.com/files/nugg/ZAB_MB51_CALL.nugg)ZAB_MB51_CALL.nugg
I can already call MB51 from previously created method but still I need to add an implicit enhancement into RM07DOCS so I'll be able to export results from MB51 and leave the program without displaying them. Enhancement must be done at the end of form process_list. 
 
 
I'll create a method to do the export inside MB51 with only one changing parameter, which will check if we're calling MB51 from our class and if yes then it will copy results of MB51 to memory and leave the program.

it_list type any table

Implementation:

method export_list_to_memory.
  field-symbols<list> type any,
                 <comp> type any.
  datams_list type t_list.
  datamt_list type tt_list.
  datam_flag type c.
  import flag to m_flag from memory id 'ZMB51_FULLLIST_EXPORT'.
  if m_flag is not initial.
    check it_list[] is not initial.
    loop at it_list assigning <list>.
      move-corresponding <list> to ms_list.
      delete table it_list from <list>.
      append ms_list to mt_list.
    endloop.
    refreshit_list[].

    export export from mt_list to memory id 'ZMB51_FULLLIST_EXPORT'.
    refreshmt_list[].
    leave program.
  endif.
endmethod.

After we have the last needed method and it's called in MB51 we should create now our ZMB51 program.