<?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 Problem with modifying Internal table using work area in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870988#M673593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi I am working on a BADI development&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a trouble changing a particular parameter et_reqcap using work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameter ET_REQCAP is of table type /SAPAPO/PPM_TTD_REQCAP... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ET_REQCAPX is of table type /SAPAPO/PPM_TTX_REQCAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have any syntax errors but when I am executing it the BADI triggers but I see the short dump.. You attempted to change, delete or create a line in the internal table "???", but no valid cursor exists for the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But will table type have a index ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD /sapapo/if_ex_ppm_calc~calc_bucket_cons.

  DATA: w_reqcap     TYPE /sapapo/reqcap,
        w_etreqcap_x TYPE /SAPAPO/PPM_TEX_REQCAP,
        w_etreqcap   TYPE /SAPAPO/PPM_TED_REQCAP. "/SAPAPO/PPM_TED_REQCAP

  LOOP AT it_reqcap INTO w_reqcap.
    IF w_reqcap-cap2 &amp;lt;&amp;gt; 1.

      w_etreqcap-cap2   = 1.
      w_etreqcap_x-cap2 = 'X'.

      MODIFY et_reqcap    from w_etreqcap   index 1 TRANSPORTING cap2.
      MODIFY et_reqcap_x  from w_etreqcap_x index 1 TRANSPORTING cap2.
    ENDIF.
  ENDLOOP.

  BREAK-POINT.

ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2007 13:43:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-19T13:43:47Z</dc:date>
    <item>
      <title>Problem with modifying Internal table using work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870988#M673593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi I am working on a BADI development&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a trouble changing a particular parameter et_reqcap using work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameter ET_REQCAP is of table type /SAPAPO/PPM_TTD_REQCAP... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ET_REQCAPX is of table type /SAPAPO/PPM_TTX_REQCAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have any syntax errors but when I am executing it the BADI triggers but I see the short dump.. You attempted to change, delete or create a line in the internal table "???", but no valid cursor exists for the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But will table type have a index ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD /sapapo/if_ex_ppm_calc~calc_bucket_cons.

  DATA: w_reqcap     TYPE /sapapo/reqcap,
        w_etreqcap_x TYPE /SAPAPO/PPM_TEX_REQCAP,
        w_etreqcap   TYPE /SAPAPO/PPM_TED_REQCAP. "/SAPAPO/PPM_TED_REQCAP

  LOOP AT it_reqcap INTO w_reqcap.
    IF w_reqcap-cap2 &amp;lt;&amp;gt; 1.

      w_etreqcap-cap2   = 1.
      w_etreqcap_x-cap2 = 'X'.

      MODIFY et_reqcap    from w_etreqcap   index 1 TRANSPORTING cap2.
      MODIFY et_reqcap_x  from w_etreqcap_x index 1 TRANSPORTING cap2.
    ENDIF.
  ENDLOOP.

  BREAK-POINT.

ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 13:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870988#M673593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T13:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with modifying Internal table using work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870989#M673594</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;Yes tables do have an index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the LOOP, you can use the SY-TABIX variable, which points always to the last used record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is tricky, becaus if you give a READ TABLE statement within the LOOP, the SY-TABIX will point at the found record what READ TABLE provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you to put a break-point into the code and you will see, what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 13:48:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870989#M673594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T13:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with modifying Internal table using work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870990#M673595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this error happens beacuse your internal table et_reqcap_x is empty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so when using INDEX 1 for this table, a short dump happens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 13:51:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870990#M673595</guid>
      <dc:creator>franois_henrotte</dc:creator>
      <dc:date>2007-09-19T13:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with modifying Internal table using work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870991#M673596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does et_reqcap and et_reqcap_x contains data that needs to be modified? If that is, there should be no problem. An error will occur if it has no data and your pointing to index 1 which don't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do you want to modify or save the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use APPEND if you're inserting new data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 13:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870991#M673596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T13:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with modifying Internal table using work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870992#M673597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will check at runtime how many records IT_REQCAP possesses.. if it has only 1 during runtime all the time the I can directly read it and change the valyes of EQ_REQCAP..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should simplify things.. anyways let me test it and then get back&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 14:03:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-modifying-internal-table-using-work-area/m-p/2870992#M673597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T14:03:06Z</dc:date>
    </item>
  </channel>
</rss>

