<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: adding a few fields to MB51 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264663#M780139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a perfom build_fieldcatalog but I was not able to understand the way it is coded.Can anyone here please let me know how a field catalog is decalred for this heirarchial alv of MB51.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2008 04:02:02 GMT</pubDate>
    <dc:creator>kiran_k8</dc:creator>
    <dc:date>2008-02-18T04:02:02Z</dc:date>
    <item>
      <title>adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264662#M780138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to add two new fields to store the SAD which is a calucation of Amount in Local currency * 0.39 of the corresponding Movement Type.Can anyone here please let me know how to add these two new fields in the fieldcatalog of the heirarchical alv output.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 09:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264662#M780138</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-01-08T09:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264663#M780139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a perfom build_fieldcatalog but I was not able to understand the way it is coded.Can anyone here please let me know how a field catalog is decalred for this heirarchial alv of MB51.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 04:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264663#M780139</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-02-18T04:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264664#M780140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT  ZMB51 .&lt;/P&gt;&lt;P&gt;DATA LIST_TAB TYPE TABLE OF ABAPLIST.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF olist OCCURS 0,&lt;/P&gt;&lt;P&gt;      filler1(1500)   TYPE c,&lt;/P&gt;&lt;P&gt;      END OF olist.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF temp OCCURS 0,&lt;/P&gt;&lt;P&gt;      filler1(1500)   TYPE c,&lt;/P&gt;&lt;P&gt;      END OF temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:I type i value 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;     matnr  like mara-matnr,&lt;/P&gt;&lt;P&gt;     maktx like makt-maktx,&lt;/P&gt;&lt;P&gt;     werks like vbrp-werks,&lt;/P&gt;&lt;P&gt;     name1 like lfa1-name1,&lt;/P&gt;&lt;P&gt;     lgort like mseg-lgort,&lt;/P&gt;&lt;P&gt;     sloc like zmmstoragebin-storage,&lt;/P&gt;&lt;P&gt;     bwart like mseg-bwart,&lt;/P&gt;&lt;P&gt;     mblnr like mseg-mblnr,&lt;/P&gt;&lt;P&gt;     zeile like mseg-zeile,&lt;/P&gt;&lt;P&gt;     budat like bkpf-budat,&lt;/P&gt;&lt;P&gt;     menge like mseg-menge,&lt;/P&gt;&lt;P&gt;     meins like mara-meins,&lt;/P&gt;&lt;P&gt;     end of itab1.&lt;/P&gt;&lt;P&gt;*Declarations for ALV.&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt;DATA : itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : itrepid TYPE sy-repid.&lt;/P&gt;&lt;P&gt;itrepid = sy-repid.&lt;/P&gt;&lt;P&gt;DATA : itevent TYPE slis_t_event.&lt;/P&gt;&lt;P&gt;DATA : itlistheader TYPE slis_t_listheader.&lt;/P&gt;&lt;P&gt;DATA : walistheader LIKE LINE OF itlistheader.&lt;/P&gt;&lt;P&gt;DATA : itlayout TYPE slis_layout_alv.&lt;/P&gt;&lt;P&gt;DATA : top TYPE slis_formname.&lt;/P&gt;&lt;P&gt;DATA : itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : itsort1 TYPE slis_sortinfo_alv.&lt;/P&gt;&lt;P&gt;DATA : itprintparams TYPE slis_print_alv.&lt;/P&gt;&lt;P&gt;DATA : itvariant TYPE disvariant.&lt;/P&gt;&lt;P&gt;data : title type lvc_title.&lt;/P&gt;&lt;P&gt;field-symbols &amp;lt;fs&amp;gt; type LVC_TITLE.&lt;/P&gt;&lt;P&gt;concatenate 'Material Document List' ' ' into title separated by space.&lt;/P&gt;&lt;P&gt;assign title to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform submitmb51.&lt;/P&gt;&lt;P&gt;perform processfiller.&lt;/P&gt;&lt;P&gt;perform alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  submitmb51&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form submitmb51 .&lt;/P&gt;&lt;P&gt;submit RM07DOCS EXPORTING LIST TO MEMORY&lt;/P&gt;&lt;P&gt;                 AND RETURN.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LIST_FROM_MEMORY'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    LISTOBJECT = LIST_TAB&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    NOT_FOUND  = 1&lt;/P&gt;&lt;P&gt;    OTHERS     = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'LIST_TO_ASCI'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      LIST_INDEX         = -1&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      LISTASCI           = oLIST&lt;/P&gt;&lt;P&gt;      LISTOBJECT         = LIST_TAB&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      EMPTY_LIST         = 1&lt;/P&gt;&lt;P&gt;      LIST_INDEX_INVALID = 2&lt;/P&gt;&lt;P&gt;      OTHERS             = 3.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endform.                    " submitmb51&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  processfiller&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form processfiller .&lt;/P&gt;&lt;P&gt;*Deleteing the Junk Characters&lt;/P&gt;&lt;P&gt;loop at olist.&lt;/P&gt;&lt;P&gt;if sy-tabix &amp;gt;= 5 and&lt;/P&gt;&lt;P&gt;   olist-filler1 &amp;lt;&amp;gt; '---' .&lt;/P&gt;&lt;P&gt;move-corresponding olist to temp.&lt;/P&gt;&lt;P&gt;append temp.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;*&lt;STRONG&gt;Creating Internal table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at temp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i = i + 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-matnr = temp-filler1+1(18).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-maktx = temp-filler1+18(40).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-werks = temp-filler1+61(4).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-name1 = temp-filler1+66(29).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read table temp index i.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-lgort = temp-filler1+1(4).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-bwart = temp-filler1+6(3).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-mblnr = temp-filler1+12(10).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;itab1-zeile = temp-filler1+23(04).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;append itab1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;clear temp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In the same way I want to fill the rest of the fields but I am having a problem when there is more than one material.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endform.                    " processfiller&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  alv&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form alv .&lt;/P&gt;&lt;P&gt;IF itab1[] IS INITIAL.&lt;/P&gt;&lt;P&gt;MESSAGE 'No Values exist for the Selection.' TYPE 'S'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  DEFINE m_fieldcat.&lt;/P&gt;&lt;P&gt;    itfieldcat-fieldname = &amp;amp;1.&lt;/P&gt;&lt;P&gt;    itfieldcat-col_pos   = &amp;amp;2.&lt;/P&gt;&lt;P&gt;    itfieldcat-seltext_l = &amp;amp;3.&lt;/P&gt;&lt;P&gt;    itfieldcat-do_sum    = &amp;amp;4.&lt;/P&gt;&lt;P&gt;    itfieldcat-outputlen = &amp;amp;5.&lt;/P&gt;&lt;P&gt;    itfieldcat-edit      = &amp;amp;6.&lt;/P&gt;&lt;P&gt;    append itfieldcat to itfieldcat.&lt;/P&gt;&lt;P&gt;    clear itfieldcat.&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;*MSEG&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MBLNR'   '' 'Material Doc.No'      '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MJAHR'   '' 'Mat.Doc.Yr'           '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'ZEILE'   '' 'Item in Mat.Doc'      '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BWART'   '' 'Movement Type'        '' 03 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MATNR'   '' 'Material'             '' 18 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'WERKS'   '' 'Plant'                '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'LGORT'   '' 'Storage Location'     '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'CHARG'   '' 'Batch'                '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'SOBKZ'   '' 'Spcl Stock Indicator' '' 01 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'LIFNR'   '' 'Vendor No.'           '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'NAME1'   '' 'Vendor Name'          '' 40 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'KDAUF'   '' 'Sales Order No.'      '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'SHKZG'   '' 'Debit/Credit.'        '' 01 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'WAERS'   '' 'Currency.'            '' 03 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'DMBTR'   '' 'Amnt in Loc.Curr'     '' 13 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BWTAR'   '' 'Valutation Type'      '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MENGE'   '' 'Quantity'             '' 13 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MEINS'   '' 'Base UoM'             '' 06 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'ERFMG'   '' 'Qty in UoE   '        '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'ERFME'   '' 'Unit of Entry'        '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'EBELN'   '' 'Purchase Order'       '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'EBELP'   '' 'Purchase Ord Item'    '' 05 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'KOSTL'   '' 'Cost Center'          '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'AUFNR'   '' 'Order No.'            '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'ANLN1'   '' 'Main Asset No.'       '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'ANLN2'   '' 'Asset Sub Number'     '' 10 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BUKRS'   '' 'Company Code'         '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'RSNUM'   '' 'Reservation No.'      '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'KZBEW'   '' 'Movement Indicator'   '' 01 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'KZVBR'   '' 'Consumption Posting'  '' 01 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'KZZUG'   '' 'Receipt Indicator'    '' 01 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'PS_PSP_PNR' '' 'WBS Element'       '' 04 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BSTMG'   '' 'Qty in Order Unit'    '' 03 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BSTME'   '' 'Order Unit'           '' 03 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BTEXT'   '' 'Movement Type Text'   '' 20 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'MAKTX'   '' 'Material Description' '' 40 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BWTAR'   '' 'Valuation Type'       '' 03 ''.&lt;/P&gt;&lt;P&gt;*MKPF&lt;/P&gt;&lt;P&gt;  m_fieldcat 'VGART'      '' 'Transctn/Evnt Typ' '' 03 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BLDAT'      '' 'Document Date'     '' 08 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BUDAT'      '' 'Posting Date'      '' 08 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'CPUDT'      '' 'Entry Date'        '' 08 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'USNAM'      '' 'User Name.'        '' 18 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'XBLNR'      '' 'Ref.Doc.No'        '' 25 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'BKTXT'      '' 'Doc.Header Text'   '' 25 ''.&lt;/P&gt;&lt;P&gt;  m_fieldcat 'XABLN'      '' 'GR/GI Slip No.'    '' 10 ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_callback_program      = sy-repid&lt;/P&gt;&lt;P&gt;      is_layout               = itlayout&lt;/P&gt;&lt;P&gt;      i_callback_user_command = ' '&lt;/P&gt;&lt;P&gt;      I_GRID_TITLE            = &amp;lt;fs&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    i_callback_top_of_page  = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_fieldcat             = itfieldcat[]&lt;/P&gt;&lt;P&gt;      i_save                  = 'A'&lt;/P&gt;&lt;P&gt;      it_events               = itevent[]&lt;/P&gt;&lt;P&gt;      it_sort                 = itsort[]&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      t_outtab                = itab1&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      program_error           = 1&lt;/P&gt;&lt;P&gt;      OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endform.                    " alv&lt;/P&gt;&lt;P&gt;I want to create an internal table having the MB51 output as data.Can anyone here let me know how to go further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 03:26:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264664#M780140</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-02-19T03:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264665#M780141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: begin of itab_enh.&lt;/P&gt;&lt;P&gt;include structure itab1.&lt;/P&gt;&lt;P&gt;field1 type table-field.&lt;/P&gt;&lt;P&gt;field2 type table-field.&lt;/P&gt;&lt;P&gt;data: end of itab_enh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this itab_enh in reuse FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

"this is a macro... defining here... similar to form.. in subroutine..

DEFINE m_fieldcat.
itfieldcat-fieldname = &amp;amp;1.
itfieldcat-col_pos = &amp;amp;2.
itfieldcat-seltext_l = &amp;amp;3.
itfieldcat-do_sum = &amp;amp;4.
itfieldcat-outputlen = &amp;amp;5.
itfieldcat-edit = &amp;amp;6.
append itfieldcat to itfieldcat.
clear itfieldcat.
END-OF-DEFINITION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"calling the macro with fields
&amp;amp;1 = MBLNR
&amp;amp;2 = blank "&amp;lt;&amp;lt;no value
&amp;amp;3 = Material Doc.No
&amp;amp;4 = blank "&amp;lt;&amp;lt;no value
&amp;amp;5 = blank "&amp;lt;&amp;lt;no value
&amp;amp;6 = 10
m_fieldcat 'MBLNR' '' 'Material Doc.No' '' 10 ''.


and finally appending to the field catalog table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 03:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264665#M780141</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-02-19T03:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264666#M780142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jay,&lt;/P&gt;&lt;P&gt;I didn't get what you mean to say by defining a macro for the fieldcat which can be used merely for display.I am having a problem in creating an internal table having the MB51 output as data.Can you please be clear on what you mean to say.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 03:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264666#M780142</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-02-19T03:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264667#M780143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Did you find a way to add new fields to the ALV table in MB51?&lt;/P&gt;&lt;P&gt;We have the same requirement and are struggling to find how this can be achieved.&lt;/P&gt;&lt;P&gt;Many thxs Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 05:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264667#M780143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T05:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264668#M780144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes we did and it is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want add a new field in the selection screen then follow as per the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap123.com/showthread.php?p=359" target="test_blank"&gt;http://www.sap123.com/showthread.php?p=359&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to add news field in the ALV and populate them based on some logic then we need to change the code but beaware there is a section of code which is not supposed to be changed manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INCLUDE RM07DOCS_GENERATED I had used as it is because the Code is a GENERATED one and shouldn't be changed manually I guess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had copied the INCLUDE RM07ALVI  and RM07DOCS_CONTROL as ZRM07ALVI and ZRMO7D0CS_CONTROL without any changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RM07DOCS I had copied as ZRM07DOCS and then went ahead with the changes as per the requirement.The final internal table which is having all the fields is LIST.So I have taken one more internal table  say ITFINAL of the same structure but with three more new fields and processing this final internal table for the final output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ignore the code I had pasted in the above thread as it is just a crude piece of code and not the working one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert if you have any queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 05:23:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264668#M780144</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-08-21T05:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: adding a few fields to MB51</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264669#M780145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran.&lt;/P&gt;&lt;P&gt;Can you please elaborate more on the above mentioned solution.&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Rahul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 16:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-few-fields-to-mb51/m-p/3264669#M780145</guid>
      <dc:creator>rahul2000</dc:creator>
      <dc:date>2008-09-24T16:39:15Z</dc:date>
    </item>
  </channel>
</rss>

