<?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: Inserting data to ZTable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794351#M341438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure which itab you are referring to. I've debugged through the code - and even just before i insert records to my ztable i have to 2 recs in the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Nov 2006 14:21:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-30T14:21:59Z</dc:date>
    <item>
      <title>Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794345#M341432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 2 tables (t_account and t_item)  from the FM. Table t_item has the quantity of items and t_account has the records equating to the item quantity in t_item. Thus t_item will have 1 rec with field quantity = 3, then t_account with have 3 recs with all the relevant data for the assets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a scenario where 2 out of 3 items are being receipted. i only need to update my Ztable with just the details for the 2 items and not pull through data from t_accoutn for all items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though i've put in the check to restrict only 2 of 3 items to be updated and not all three. The 3rd item's data is still transferred to the ztable. i'm not sure why its pulling through the 3rd item. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE flt_val.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****-- CONFIRMATION --****&lt;/P&gt;&lt;P&gt;    WHEN 'BUS2203'.&lt;/P&gt;&lt;P&gt;      break ebb1109.&lt;/P&gt;&lt;P&gt;      CLEAR: l_header, t_item, t_account, l_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get confirmation details&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL FUNCTION 'BBP_PD_CONF_GETDETAIL'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_guid          = iv_doc_guid&lt;/P&gt;&lt;P&gt;          i_with_itemdata = 'X'&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          e_header        = l_header&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          e_item          = t_item&lt;/P&gt;&lt;P&gt;          e_account       = t_account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE l_header-guid TO iv_doc_guid.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        READ TABLE t_item INTO l_item WITH KEY parent = iv_doc_guid.&lt;/P&gt;&lt;P&gt;        IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check that category_id is in table zbbp_asset_class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          SELECT SINGLE * FROM zbbp_asset_class&lt;/P&gt;&lt;P&gt;                          INTO l_asset&lt;/P&gt;&lt;P&gt;                          WHERE catid EQ l_item-category_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;            CLEAR: l_account, wa_serial_upd, it_serial_upd, t_serial, cnt.&lt;/P&gt;&lt;P&gt;            LOOP AT t_account INTO l_account WHERE p_guid = l_item-guid&lt;/P&gt;&lt;P&gt;                                              AND acc_cat = 'AS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check that asset_no is not already updated to table zbbp_serial_upd&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              SELECT SINGLE * FROM zbbp_serial_upd&lt;/P&gt;&lt;P&gt;              INTO CORRESPONDING FIELDS OF wa_serial_upd&lt;/P&gt;&lt;P&gt;              WHERE assetmst EQ l_account-asset_no&lt;/P&gt;&lt;P&gt;              AND acc_no EQ l_account-acc_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if not then start mapping data for later use.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;                MOVE: l_account-asset_no TO wa_serial_upd-assetmst,&lt;/P&gt;&lt;P&gt;                      l_account-acc_no TO wa_serial_upd-acc_no,&lt;/P&gt;&lt;P&gt;                      l_header-object_id TO wa_serial_upd-confirm_no,&lt;/P&gt;&lt;P&gt;                      l_item-be_refobj TO wa_serial_upd-po_num,&lt;/P&gt;&lt;P&gt;                      l_item-be_refobj_item TO wa_serial_upd-po_itemno.&lt;/P&gt;&lt;P&gt;                ADD 1 TO cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if the number of records exceed the number of items then exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                IF cnt &amp;gt; l_item-quantity.&lt;/P&gt;&lt;P&gt;                  CLEAR: wa_serial_upd, l_account.&lt;/P&gt;&lt;P&gt;                  EXIT.&lt;/P&gt;&lt;P&gt;                ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;else update internal table it_serial_upd&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                  APPEND wa_serial_upd TO it_serial_upd.&lt;/P&gt;&lt;P&gt;                  CLEAR: wa_serial_upd, l_account.&lt;/P&gt;&lt;P&gt;                ENDIF.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CLEAR: l_serial, wa_serial_upd, fieldname, cnt.&lt;/P&gt;&lt;P&gt;            LOOP AT it_serial_upd INTO wa_serial_upd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              ADD 1 TO num.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              IF num &amp;gt; 50.&lt;/P&gt;&lt;P&gt;                CLEAR: l_account, wa_serial_upd.&lt;/P&gt;&lt;P&gt;                EXIT.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get serial number from table l_item, and map to relevant record&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              SHIFT num LEFT DELETING LEADING '0'.&lt;/P&gt;&lt;P&gt;              CONCATENATE 'L_ITEM-ZZSERNR'&lt;/P&gt;&lt;P&gt;                           num INTO fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              ASSIGN (fieldname) TO &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              MOVE:  &amp;lt;fs&amp;gt;  TO wa_serial_upd-serial_num.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;update internal table it_serial_upd with serial numbers&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              MODIFY it_serial_upd FROM wa_serial_upd INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;              CLEAR: wa_serial_upd .&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            break ebb1109.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;transfer data to z table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           CLEAR wa_serial_upd.&lt;/P&gt;&lt;P&gt;            LOOP AT it_serial_upd INTO wa_serial_upd&lt;/P&gt;&lt;P&gt;                            WHERE serial_num  IS NOT INITIAL .&lt;/P&gt;&lt;P&gt;              INSERT INTO  zbbp_serial_upd VALUES wa_serial_upd .&lt;/P&gt;&lt;P&gt;              CLEAR wa_serial_upd.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CLEAR: it_serial_upd, wa_serial_upd.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 12:59:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794345#M341432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T12:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794346#M341433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ur final internal tale is having all 3 records...u need to check some condition and delete the record from this final table so that only the 2 entries are inserted into table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 13:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794346#M341433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T13:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794347#M341434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Christine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Can u tell me at what point in ur code u are doing the following restriction. So that we can check that condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Even though i've put in the check to restrict only 2 of 3 items to be updated and not all three. The 3rd item's data is still transferred to the ztable. i'm not sure why its pulling through the 3rd item.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;   Jayaram...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 13:13:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794347#M341434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T13:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794348#M341435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jayaram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing the check when within my first loop as i loop through table t_account. Thus i'll only pick up the number of recods equivallent to the items i'm receipting to later update my ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                ADD 1 TO cnt.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if the number of records exceed the number of items then exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                IF cnt &amp;gt; l_item-quantity.&lt;/P&gt;&lt;P&gt;                  CLEAR: wa_serial_upd, l_account.&lt;/P&gt;&lt;P&gt;                  EXIT.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chrs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 13:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794348#M341435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T13:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794349#M341436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Try with the following code. Ur code will check for the no of records greater than the quantity items. but not less than that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ADD 1 TO cnt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if the number of records exceed the number of items then exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF cnt = l_item-quantity-1.&lt;/P&gt;&lt;P&gt;CLEAR: wa_serial_upd, l_account.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Jayaram..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 13:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794349#M341436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T13:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794350#M341437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jayaram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code doesn't work this way. E.g If  l_item-quantity = 3, and i'm only receipting 2 times - the FM automatically reads my receipt quantity and sets l_item-quantity = 2 .  i don't need to further reduce my l_item-quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I manage to pick up the right amount of records with my original code, only that it updates my ztable with recods that were not even passed to my itab in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ta&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Christine Masipa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 14:16:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794350#M341437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T14:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794351#M341438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure which itab you are referring to. I've debugged through the code - and even just before i insert records to my ztable i have to 2 recs in the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 14:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794351#M341438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T14:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data to ZTable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794352#M341439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Split the process into different BADIs:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Change&lt;/P&gt;&lt;P&gt;2. Check&lt;/P&gt;&lt;P&gt;3. Update&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 11:12:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inserting-data-to-ztable/m-p/1794352#M341439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T11:12:32Z</dc:date>
    </item>
  </channel>
</rss>

