<?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: Header and Item data in a module pool in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-and-item-data-in-a-module-pool/m-p/5543779#M1265922</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;you have to take one table.....in which u have to move the header and item data into that b'coz according to the header data the items are to be displayed.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select the data for which ever tables they came and then take a final table in which include all the fields of header and item .loop on all the tables from which data u have taken and inside it move the data of those fields into the fields of the final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ALV u need to call the function module to display the ALV with that final table in which ur all data is there and prepare a field catalog of those fields you want to display in the item list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example a sample code is there...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types:
  begin of type_s_vbak,
    vkorg type vbak-vkorg,             " Sales Organization
    aufnr type vbak-aufnr,             " Sales Order Number
    auart type vbak-auart,             " Sales Order Type
    kunnr type vbak-kunnr,             " Customer Number
    vbeln type vbak-vbeln,             " Sales Document
    knumv type vbak-knumv,             " Number of Document Condition
  end of type_s_vbak.                  " BEGIN OF TYPE_S_VBAK

types:
  begin of type_s_konv,
    kwert type konv-kwert,             " Condition Value
    kbetr type konv-kbetr,             " Rate (Condition Amount)
    knumv type konv-knumv,             " Number of Document Condition
    kschl type konv-kschl,             " Condition Type
  end of type_s_konv.                  " BEGIN OF TYPE_S_KONV


types:
  begin of type_s_material,
    kunnr      type vbak-kunnr,          " Customer Number
    matnr      type vbap-matnr,          " Material Number
    arktx       type vbap-arktx,          " Material Description
    steuc       type marc-steuc,          " Fiscal Classification
    kwmeng   type vbap-kwmeng,         " Quantity
    knumv      type vbak-knumv,          " Number of Document Condition
    vbeln        type vbak-vbeln,          " Document Number
    kwert       type konv-kwert,          " Condition Value
    total         type p length 14 decimals 2,
                                       " Total
    ipitype  type p length 9 decimals 3,
                                       " IPI Type
    ipivalue type konv-kwert,          " IPI Value
  end of type_s_material.              " BEGIN OF TYPE_S_MATERIAL


data:
  fs_vbak type type_s_vbak.

data:
  fs_mati type type_s_material.

data:
  fs_konv type type_s_konv.

data:
   t_vbak like
 standard table
       of fs_vbak.

data:
   t_konv like
 standard table
       of fs_konv.

data:
   t_mati like
 standard table
       of fs_mati.
loop at t_konv into fs_konv where kschl eq 'ZPNF'.
    move fs_konv-kwert to fs_mati-kwert.
    modify t_mati from fs_mati
    transporting kwert
    where knumv eq fs_konv-knumv.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying Total Field of Material Table.
  loop at t_mati into fs_mati.
    w_total = fs_mati-kwmeng * fs_mati-kwert.
    move  w_total to fs_mati-total.
    modify t_mati from fs_mati
    index sy-tabix
    transporting total.
    clear w_total.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying IPI-Type Field of Material Table.
  loop at t_konv into fs_konv where kschl eq 'IPI3'.
    w_total = fs_konv-kbetr div 10.
    move w_total to fs_mati-ipitype.
    modify t_mati from fs_mati
    transporting ipitype
    where knumv eq fs_konv-knumv.
    clear w_total.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying IPI-Value Field of Material Table.
  loop at t_konv into fs_konv where kschl eq 'IPI3'.
    move fs_konv-kwert to fs_mati-ipivalue.
    modify t_mati from fs_mati
    transporting ipivalue
    where knumv eq fs_konv-knumv.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV
and then fill the fieldcatalog and display the ALV&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Richa Tripathi on Apr 15, 2009 3:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2009 13:17:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-15T13:17:44Z</dc:date>
    <item>
      <title>Header and Item data in a module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-and-item-data-in-a-module-pool/m-p/5543778#M1265921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I designed a screen in that i have header data and item data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in my screen header i have vendor number,Vendor name,&lt;/P&gt;&lt;P&gt;bank Name, Branch, LC value and Due date fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for item details i have to take table control.In the item details i have the fields Sl No, PO Number and Po Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Two push buttons i need to put.SAVE and CANCEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i click on SAVE all my screen details should be saved in a ZTABLE and should generate a LCDOCUMENT-Number from the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is shell i take the two tables for header and item data or one is enough and if i take two tables(one is header and one is item data) how i write the logic to store into the ztables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i proceed.Plz provide me with ur inputs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 07:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-and-item-data-in-a-module-pool/m-p/5543778#M1265921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T07:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Header and Item data in a module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/header-and-item-data-in-a-module-pool/m-p/5543779#M1265922</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;you have to take one table.....in which u have to move the header and item data into that b'coz according to the header data the items are to be displayed.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select the data for which ever tables they came and then take a final table in which include all the fields of header and item .loop on all the tables from which data u have taken and inside it move the data of those fields into the fields of the final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ALV u need to call the function module to display the ALV with that final table in which ur all data is there and prepare a field catalog of those fields you want to display in the item list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example a sample code is there...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types:
  begin of type_s_vbak,
    vkorg type vbak-vkorg,             " Sales Organization
    aufnr type vbak-aufnr,             " Sales Order Number
    auart type vbak-auart,             " Sales Order Type
    kunnr type vbak-kunnr,             " Customer Number
    vbeln type vbak-vbeln,             " Sales Document
    knumv type vbak-knumv,             " Number of Document Condition
  end of type_s_vbak.                  " BEGIN OF TYPE_S_VBAK

types:
  begin of type_s_konv,
    kwert type konv-kwert,             " Condition Value
    kbetr type konv-kbetr,             " Rate (Condition Amount)
    knumv type konv-knumv,             " Number of Document Condition
    kschl type konv-kschl,             " Condition Type
  end of type_s_konv.                  " BEGIN OF TYPE_S_KONV


types:
  begin of type_s_material,
    kunnr      type vbak-kunnr,          " Customer Number
    matnr      type vbap-matnr,          " Material Number
    arktx       type vbap-arktx,          " Material Description
    steuc       type marc-steuc,          " Fiscal Classification
    kwmeng   type vbap-kwmeng,         " Quantity
    knumv      type vbak-knumv,          " Number of Document Condition
    vbeln        type vbak-vbeln,          " Document Number
    kwert       type konv-kwert,          " Condition Value
    total         type p length 14 decimals 2,
                                       " Total
    ipitype  type p length 9 decimals 3,
                                       " IPI Type
    ipivalue type konv-kwert,          " IPI Value
  end of type_s_material.              " BEGIN OF TYPE_S_MATERIAL


data:
  fs_vbak type type_s_vbak.

data:
  fs_mati type type_s_material.

data:
  fs_konv type type_s_konv.

data:
   t_vbak like
 standard table
       of fs_vbak.

data:
   t_konv like
 standard table
       of fs_konv.

data:
   t_mati like
 standard table
       of fs_mati.
loop at t_konv into fs_konv where kschl eq 'ZPNF'.
    move fs_konv-kwert to fs_mati-kwert.
    modify t_mati from fs_mati
    transporting kwert
    where knumv eq fs_konv-knumv.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying Total Field of Material Table.
  loop at t_mati into fs_mati.
    w_total = fs_mati-kwmeng * fs_mati-kwert.
    move  w_total to fs_mati-total.
    modify t_mati from fs_mati
    index sy-tabix
    transporting total.
    clear w_total.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying IPI-Type Field of Material Table.
  loop at t_konv into fs_konv where kschl eq 'IPI3'.
    w_total = fs_konv-kbetr div 10.
    move w_total to fs_mati-ipitype.
    modify t_mati from fs_mati
    transporting ipitype
    where knumv eq fs_konv-knumv.
    clear w_total.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV

* Modifying IPI-Value Field of Material Table.
  loop at t_konv into fs_konv where kschl eq 'IPI3'.
    move fs_konv-kwert to fs_mati-ipivalue.
    modify t_mati from fs_mati
    transporting ipivalue
    where knumv eq fs_konv-knumv.
  endloop.                             " LOOP AT T_KONV INTO FS_KONV
and then fill the fieldcatalog and display the ALV&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Richa Tripathi on Apr 15, 2009 3:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:17:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/header-and-item-data-in-a-module-pool/m-p/5543779#M1265922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:17:44Z</dc:date>
    </item>
  </channel>
</rss>

