<?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: Row Addition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058833#M91232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the form data retrieval, you are doing this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITABVBAK WHERE VBELN = VBAP-VBELN.
  ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.
  MODIFY ITABVBAK.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you have the value of VBAP-VBELN in there. Why did you even use VBAP-VBELN where condition there. You can just do the following.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITABVBAK.
  ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.
  MODIFY ITABVBAK.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Oct 2005 12:34:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-20T12:34:49Z</dc:date>
    <item>
      <title>Row Addition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058829#M91228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi please correct this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wanted to add the rows of netpr and nerwr...i wanted to  show the total as a new field...i have done but not coming the result..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EPORT  ZKAGTB                                  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:   vbap, vbak, MARA, mbew , KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : BEGIN OF itabVBAK occurs 0,&lt;/P&gt;&lt;P&gt;       matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;       NETWR type vbap-netwr,&lt;/P&gt;&lt;P&gt;       BATOT LIKE VBAP-NETPR, &amp;lt;b&amp;gt;(new field)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;       NAME1 type kna1-name1,&lt;/P&gt;&lt;P&gt;       end of itabvbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: batot like VBAP-NETPR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: fieldcatalog type slis_t_fieldcat_alv with header line,&lt;/P&gt;&lt;P&gt;      gd_tab_group type slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;      gd_layout    type slis_layout_alv,&lt;/P&gt;&lt;P&gt;      gd_repid     like sy-repid,&lt;/P&gt;&lt;P&gt;      gt_events    type slis_t_event,&lt;/P&gt;&lt;P&gt;      gd_prntparams type slis_print_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;perform data_retrieval.&lt;/P&gt;&lt;P&gt;perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;perform build_layout.&lt;/P&gt;&lt;P&gt;perform build_events.&lt;/P&gt;&lt;P&gt;perform build_print_params.&lt;/P&gt;&lt;P&gt;perform display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE m_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  add 1 to ls_fieldcat-col_pos.&lt;/P&gt;&lt;P&gt;  ls_fieldcat-fieldname   = &amp;amp;1.&lt;/P&gt;&lt;P&gt;  ls_fieldcat-ref_tabname = &amp;amp;2.&lt;/P&gt;&lt;P&gt;  append ls_fieldcat to lt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'VBELN'. &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'BATOT'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'BALANCE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 11.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_layout.&lt;/P&gt;&lt;P&gt;  gd_layout-no_input          = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-colwidth_optimize = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-totals_text       = 'Totals'(201).&lt;/P&gt;&lt;P&gt;  gd_layout-totals_only       = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gd_layout-info_fieldname    = 'LINE_COLOR'.&lt;/P&gt;&lt;P&gt;  gd_layout-info_fieldname    = 'WS_COLOR'.&lt;/P&gt;&lt;P&gt;  gd_layout-zebra             = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;  gd_repid = sy-repid.&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      = gd_repid&lt;/P&gt;&lt;P&gt;            i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM&lt;/P&gt;&lt;P&gt;            i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;            is_layout               = gd_layout&lt;/P&gt;&lt;P&gt;            it_fieldcat             = fieldcatalog[]&lt;/P&gt;&lt;P&gt;            it_events               = gt_events&lt;/P&gt;&lt;P&gt;            is_print                = gd_prntparams&lt;/P&gt;&lt;P&gt;            i_save                  = 'X'&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab                = itabvbak&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt;data: ld_color(1) type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     select                mara~matnr&lt;/P&gt;&lt;P&gt;                           -&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;                           -&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;                           -&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;                           KNA1~name1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               into corresponding fields of table itabvbak from VBAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        inner join VBAK&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;vbeln = VBAK&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                        inner join mara&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;matnr = mara&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                        inner join mbew&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;matnr = mbew&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                        inner join KNA1&lt;/P&gt;&lt;P&gt;                             on VBAK&lt;SUB&gt;KUNNR = KNA1&lt;/SUB&gt;KUNNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                          where        VBAK~kunnr in s_kunn1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LOOP AT ITABVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITABVBAK WITH KEY VBELN = VBAP-VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " DATA_RETRIEVAL&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u correct this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raju&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: mpr raju&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:08:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058829#M91228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-20T12:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Row Addition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058830#M91229</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;Or you use LOOP or READ command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITABVBAK WHERE VBELN = VBAP-VBELN.&lt;/P&gt;&lt;P&gt; ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.&lt;/P&gt;&lt;P&gt; MODIFY READ TABLE ITABVBAK&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't know how you find out VBAP-VBELN and I think you have as many rows as positions are for every document in ITABVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: max bianchi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:13:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058830#M91229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-20T12:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Row Addition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058831#M91230</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;LOOP AT ITABVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITABVBAK WITH KEY VBELN = VBAP-VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;  Modify ITABVBAK&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058831#M91230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-20T12:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Row Addition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058832#M91231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried both of ur suggestions but not worked...this is my entire code ..pls correct this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZKAGTB                                  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:   vbap, vbak, MARA, mbew , KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : BEGIN OF itabVBAK occurs 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       LBKUM type mbew-lbkum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       VTWEG type vbak-vtweg,&lt;/P&gt;&lt;P&gt;       VKORG type vbak-vkorg,&lt;/P&gt;&lt;P&gt;       KUNNR type vbak-kunnr,&lt;/P&gt;&lt;P&gt;       AUART type vbak-auart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       AUDAT type vbap-audat,&lt;/P&gt;&lt;P&gt;       NETPR type vbap-netpr,&lt;/P&gt;&lt;P&gt;       ARKTX type vbap-arktx,&lt;/P&gt;&lt;P&gt;       VBELN type vbap-vbeln,&lt;/P&gt;&lt;P&gt;       VRKME type vbap-vrkme,&lt;/P&gt;&lt;P&gt;       WAERK type vbap-waerk,&lt;/P&gt;&lt;P&gt;       NETWR type vbap-netwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       BATOT LIKE VBAP-NETPR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       NAME1 type kna1-name1,&lt;/P&gt;&lt;P&gt;       line_color(1) type c,     "Used to store row color attributes&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     color_line(2) TYPE c,           " Line color&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     color_cell    TYPE lvc_t_scol,  " Cell color&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     celltab type LVC_T_STYL,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       end of itabvbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data: batot like VBAP-NETPR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: fieldcatalog type slis_t_fieldcat_alv with header line,&lt;/P&gt;&lt;P&gt;      gd_tab_group type slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;      gd_layout    type slis_layout_alv,&lt;/P&gt;&lt;P&gt;      gd_repid     like sy-repid,&lt;/P&gt;&lt;P&gt;      gt_events    type slis_t_event,&lt;/P&gt;&lt;P&gt;      gd_prntparams type slis_print_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********************&lt;STRONG&gt;SELECTION SCEREEN&lt;/STRONG&gt;*******************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;STRONG&gt;BLOCK 2&lt;/STRONG&gt;*********************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN begin of block blk5 with frame title text-004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********&lt;STRONG&gt;CHECK BOX&lt;/STRONG&gt;******&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*parameter: P_c2 as checkbox USER-COMMAND CHECK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data: cursorfield(20) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************&lt;STRONG&gt;BLOCK 2 SUB&lt;/STRONG&gt;******************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN begin of block 6 with frame title text-005.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT-OPTIONS:&lt;/P&gt;&lt;P&gt;                s_audat for vbap-audat no-extension, "Document Date.&lt;/P&gt;&lt;P&gt;                s_kunn1 for vbak-kunnr no-extension ,&lt;/P&gt;&lt;P&gt;                                              "DEFAULT '5525' .&lt;/P&gt;&lt;P&gt;                s_LBKUM for mbew-lbkum no-extension no-display,&lt;/P&gt;&lt;P&gt;                s_matnr for mara-matnr no-extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN end of block 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************&lt;STRONG&gt;BLOCK 2 SUB&lt;/STRONG&gt;******************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN begin of block 7 with frame title  text-006.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT-OPTIONS:&lt;/P&gt;&lt;P&gt;                s_auart for vbak-auart no-extension no intervals,&lt;/P&gt;&lt;P&gt;                s_vtweg for vbak-vtweg no-extension no intervals ,&lt;/P&gt;&lt;P&gt;                s_vkorg for vbak-vkorg no-extension no intervals,&lt;/P&gt;&lt;P&gt;          s_netpr for vbap-netpr no-extension no intervals no-display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN end of block 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN end of block blk5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************&lt;STRONG&gt;test&lt;/STRONG&gt;********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;color management.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;DATA  : wa_color    TYPE lvc_s_scol.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for color management.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA : it_color    TYPE TABLE          OF lvc_s_scol.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;itab for input enabling.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: lt_celltab TYPE lvc_t_styl. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************&lt;STRONG&gt;endtest&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform data_retrieval.&lt;/P&gt;&lt;P&gt;perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;perform build_layout.&lt;/P&gt;&lt;P&gt;perform build_events.&lt;/P&gt;&lt;P&gt;perform build_print_params.&lt;/P&gt;&lt;P&gt;perform display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE m_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  add 1 to ls_fieldcat-col_pos.&lt;/P&gt;&lt;P&gt;  ls_fieldcat-fieldname   = &amp;amp;1.&lt;/P&gt;&lt;P&gt;  ls_fieldcat-ref_tabname = &amp;amp;2.&lt;/P&gt;&lt;P&gt;  append ls_fieldcat to lt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'VBELN'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Verkaufsbeleg'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-outputlen   = 10.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  fieldcatalog-hotspot     = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C511'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MATNR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Materialnummer'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C511'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  fieldcatalog-hotspot     = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'ARKTX'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Bezeichnung'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 2.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C110'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'NETPR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Nettopries'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-do_sum     = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 3.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'VRKME'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Mengeneinheit'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize = 'C300'. "Column colur, Bold and Inverse off&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  fieldcatalog-col_pos     = 4.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'WAERK'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Währung'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C600'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  fieldcatalog-col_pos     = 5.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'AUDAT'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Belegdatum'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 6.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize = 'C500'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'NETWR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Nettowert'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-do_sum     = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 7.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize = 'C400'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'AUART'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Verkaufsbelegart'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 8.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C110'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'KUNNR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Kunde'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 9.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-hotspot     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C500'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'NAME1'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Kunde name'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 10.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-hotspot     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C500'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'BATOT'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'BALANCE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 11.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-hotspot     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-emphasize   = 'C500'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form build_layout.&lt;/P&gt;&lt;P&gt;  gd_layout-no_input          = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-colwidth_optimize = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-totals_text       = 'Totals'(201).&lt;/P&gt;&lt;P&gt;  gd_layout-totals_only       = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-f2code           = 'DISP'.  "Sets fcode for when double&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                        "click(press f2)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gd_layout-info_fieldname    = 'LINE_COLOR'.&lt;/P&gt;&lt;P&gt;  gd_layout-info_fieldname    = 'WS_COLOR'.&lt;/P&gt;&lt;P&gt;  gd_layout-zebra             = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-group_change_edit = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gd_layout-header_text       = 'helllllo'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;  gd_repid = sy-repid.&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      = gd_repid&lt;/P&gt;&lt;P&gt;            i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM&lt;/P&gt;&lt;P&gt;            i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_grid_title           = outtext&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            is_layout               = gd_layout&lt;/P&gt;&lt;P&gt;            it_fieldcat             = fieldcatalog[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_special_groups      = gd_tabgroup&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            it_events               = gt_events&lt;/P&gt;&lt;P&gt;            is_print                = gd_prntparams&lt;/P&gt;&lt;P&gt;            i_save                  = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_variant             = z_template&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab                = itabvbak&lt;/P&gt;&lt;P&gt;&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CALL FUNCTION REUSE_ALV_COMMENTARY_WRITE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     I_LOGO = 'W3MI'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Retrieve data form VBAK table and populate itab it_VBAK&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ld_color(1) type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     select                mara~matnr&lt;/P&gt;&lt;P&gt;                           MBEW~lbkum&lt;/P&gt;&lt;P&gt;                           VBAK~VTWEG&lt;/P&gt;&lt;P&gt;                           VBAK~VKORG&lt;/P&gt;&lt;P&gt;                           VBAK~KUNNR&lt;/P&gt;&lt;P&gt;                           VBAK~AUART&lt;/P&gt;&lt;P&gt;                           VBAP~AUDAT&lt;/P&gt;&lt;P&gt;                           VBAP~NETPR&lt;/P&gt;&lt;P&gt;                           VBAP~ARKTX&lt;/P&gt;&lt;P&gt;                           VBAP~VRKME&lt;/P&gt;&lt;P&gt;                           VBAP~WAERK&lt;/P&gt;&lt;P&gt;                           VBAP~NETWR&lt;/P&gt;&lt;P&gt;                           VBAP~vbeln&lt;/P&gt;&lt;P&gt;                           KNA1~name1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               into corresponding fields of table itabvbak from VBAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        inner join VBAK&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;vbeln = VBAK&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                        inner join mara&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;matnr = mara&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                        inner join mbew&lt;/P&gt;&lt;P&gt;                             on VBAP&lt;SUB&gt;matnr = mbew&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                        inner join KNA1&lt;/P&gt;&lt;P&gt;                             on VBAK&lt;SUB&gt;KUNNR = KNA1&lt;/SUB&gt;KUNNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                          where        VBAK~kunnr in s_kunn1&lt;/P&gt;&lt;P&gt;                                   and VBAP~AUDAT in s_AUDAT&lt;/P&gt;&lt;P&gt;                                   and MBEW~LBKUM in s_LBKUM&lt;/P&gt;&lt;P&gt;                                   and MARA~MATNR in s_MATNR&lt;/P&gt;&lt;P&gt;                                   and VBAK~AUART in s_AUART&lt;/P&gt;&lt;P&gt;                                   and VBAK~VTWEG in s_VTWEG&lt;/P&gt;&lt;P&gt;                                   and VBAK~VKORG in s_VKORG&lt;/P&gt;&lt;P&gt;                                   and VBAP~NETPR in s_NETPR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITABVBAK WHERE VBELN = VBAP-VBELN.&lt;/P&gt;&lt;P&gt;ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.&lt;/P&gt;&lt;P&gt;MODIFY ITABVBAK.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;Form  TOP-OF-PAGE                                                 *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&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;ALV Report Header                                                 *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Form top-of-page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV Header declarations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_header type slis_t_listheader,&lt;/P&gt;&lt;P&gt;      wa_header type slis_listheader,&lt;/P&gt;&lt;P&gt;      t_line like wa_header-info,&lt;/P&gt;&lt;P&gt;      ld_lines type i,&lt;/P&gt;&lt;P&gt;      ld_linesc(10) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Title&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_header-typ  = 'H'.&lt;/P&gt;&lt;P&gt;  wa_header-info = 'Kundenanalyse'.&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear wa_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_header-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  wa_header-key = 'Date: '.&lt;/P&gt;&lt;P&gt;  CONCATENATE  sy-datum+6(2) '.'&lt;/P&gt;&lt;P&gt;               sy-datum+4(2) '.'&lt;/P&gt;&lt;P&gt;               sy-datum(4) INTO wa_header-info.   "todays date&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear: wa_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Total No. of Records Selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  describe table itabvbak lines ld_lines.&lt;/P&gt;&lt;P&gt;  ld_linesc = ld_lines.&lt;/P&gt;&lt;P&gt;  concatenate 'Total No. of Records Selected: ' ld_linesc&lt;/P&gt;&lt;P&gt;                    into t_line separated by space.&lt;/P&gt;&lt;P&gt;  wa_header-typ  = 'A'.&lt;/P&gt;&lt;P&gt;  wa_header-info = t_line.&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear: wa_header, t_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_COMMENTARY_WRITE'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            it_list_commentary =  t_header&lt;/P&gt;&lt;P&gt;            i_logo             = 'ENJOYSAP_LOGO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;      FORM USER_COMMAND                                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&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; R_UCOMM                                                *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      --&amp;gt; RS_SELFIELD                                            *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM user_command USING r_ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;                  rs_selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check function code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CASE r_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN '&amp;amp;IC1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Check field clicked on within ALVgrid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF rs_selfield-fieldname = 'VBELN'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Read data table, using index of row user clicked on&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE itabvbak INTO itabvbak INDEX rs_selfield-tabindex.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                    with key VBELN = rs_selfield-value&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Set parameter ID for transaction screen field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SET PARAMETER ID 'AUN' FIELD itabvbak-vbeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Sxecute transaction VL02N, and skip initial data entry screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF rs_selfield-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;      READ TABLE itabvbak INTO itabvbak INDEX rs_selfield-tabindex.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Set parameter ID for transaction screen field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SET PARAMETER ID 'MAT' FIELD itabvbak-matnr.&lt;/P&gt;&lt;P&gt;      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF rs_selfield-fieldname = 'KUNNR'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     READ TABLE itabvbak INTO itabvbak INDEX rs_selfield-tabindex.&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;    Set parameter ID for transaction screen field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     SET PARAMETER ID 'KUN' FIELD itabvbak-matnr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CALL TRANSACTION 'VD03' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_EVENTS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Build events table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form build_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: ls_event type slis_alv_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_EVENTS_GET'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_list_type = 1&lt;/P&gt;&lt;P&gt;       importing&lt;/P&gt;&lt;P&gt;            et_events   = gt_events[].&lt;/P&gt;&lt;P&gt;  read table gt_events with key name =  slis_ev_end_of_page&lt;/P&gt;&lt;P&gt;                           into ls_event.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    move 'END_OF_PAGE' to ls_event-form.&lt;/P&gt;&lt;P&gt;    append ls_event to gt_events.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    read table gt_events with key name =  slis_ev_end_of_list&lt;/P&gt;&lt;P&gt;                           into ls_event.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    move 'END_OF_LIST' to ls_event-form.&lt;/P&gt;&lt;P&gt;    append ls_event to gt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_EVENTS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_PRINT_PARAMS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;      Setup print parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_print_params.&lt;/P&gt;&lt;P&gt;  gd_prntparams-reserve_lines = '9'.   "Lines reserved for footer&lt;/P&gt;&lt;P&gt;  gd_prntparams-no_coverpage = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_PRINT_PARAMS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  END_OF_PAGE&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form END_OF_PAGE.&lt;/P&gt;&lt;P&gt;  data: listwidth type i,&lt;/P&gt;&lt;P&gt;        ld_pagepos(10) type c,&lt;/P&gt;&lt;P&gt;        ld_page(10)    type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write: sy-uline(50).&lt;/P&gt;&lt;P&gt;  skip.&lt;/P&gt;&lt;P&gt;  write:/40 'Page:', sy-pagno .&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  END_OF_LIST&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form END_OF_LIST.&lt;/P&gt;&lt;P&gt;  data: listwidth type i,&lt;/P&gt;&lt;P&gt;        ld_pagepos(10) type c,&lt;/P&gt;&lt;P&gt;        ld_page(10)    type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  skip.&lt;/P&gt;&lt;P&gt;  write:/40 'Page:', sy-pagno .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raju.................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058832#M91231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-20T12:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Row Addition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058833#M91232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the form data retrieval, you are doing this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITABVBAK WHERE VBELN = VBAP-VBELN.
  ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.
  MODIFY ITABVBAK.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you have the value of VBAP-VBELN in there. Why did you even use VBAP-VBELN where condition there. You can just do the following.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITABVBAK.
  ITABVBAK-BATOT = ITABVBAK-NETPR + ITABVBAK-NETWR.
  MODIFY ITABVBAK.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/row-addition/m-p/1058833#M91232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-20T12:34:49Z</dc:date>
    </item>
  </channel>
</rss>

