<?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 Doubts using Assign statement in perform in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758135#M1304344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im having some doubs in order to use assign in a dynamical perform. This is the cenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 tables of the same structure and in a routine they all go to the same perform, and will update the same internal table. I want that the perform be a little dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Th problem it's that for each internal table, the field to be update it's diferent, and i want to know if it's possible to do what i want using the assign statement. I've allready tried, and the code example goes with my test , but it's not working because instead of update the table field that i want move the value to the field symbol..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here goes an example of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
....
**Docs 41
  CLEAR: str_valor, str_num.
  str_valor = 'TAB_LISTA-VALOR_41'.
  str_num = 'TAB_LISTA-NUM_DOCS_41'.

  PERFORM get_values TABLES tab_docs USING str_valor
                                         str_num.

*Docs 61
  CLEAR: str_valor, str_num.
  str_valor = 'TAB_LISTA-VALOR_61'.
  str_num = 'TAB_LISTA-NUM_DOCS_61'.
  PERFORM get_values TABLES tab_61 USING str_valor
                                         str_num.
.....
.....
....

FORM get_values TABLES   p_tab STRUCTURE tab_docs
                USING    p_valor
                             p_num_docs.

  DATA lv_bankl TYPE t012-bankl.
  DATA lv_hkont TYPE t012k-hkont.
  DATA lv_banks TYPE banks.

  FIELD-SYMBOLS: &amp;lt;valor&amp;gt; TYPE ANY,
                 &amp;lt;num_docs&amp;gt; TYPE ANY.


  ASSIGN: p_valor TO &amp;lt;valor&amp;gt;,
          p_num_docs TO &amp;lt;num_docs&amp;gt;.

  LOOP AT p_tab.
    CLEAR: lv_bankl, lv_hkont, lv_banks.

    MOVE: p_tab-hkont TO lv_hkont,
          0 TO lv_hkont+9(1).

*Determinação de Banco  - Descritivo
    SELECT SINGLE f~bankl f~banks INTO (lv_bankl, lv_banks)
      FROM t012 AS f INNER JOIN t012k AS g
      ON f~bukrs = g~bukrs
      AND f~hbkid = g~hbkid
      WHERE g~hkont = lv_hkont
      AND g~bukrs = pa_emp.

    SELECT SINGLE banka FROM bnka INTO tab_lista-banco
           WHERE bankl = lv_bankl
           AND banks = lv_banks.


**Calculos para os documentos 41
    MOVE: p_tab-hkont TO tab_lista-conta.

    WRITE p_tab-dmbtr TO &amp;lt;valor&amp;gt;. "This is where the field to be updated differs

    AT NEW belnr.
      MOVE 1 TO &amp;lt;num_docs&amp;gt;. "This is where the field to be updated differs
    ENDAT.

    COLLECT tab_lista.
  ENDLOOP.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me on this subject??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance, &lt;/P&gt;&lt;P&gt;Best Regards, &lt;/P&gt;&lt;P&gt;João Martins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2009 16:36:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-23T16:36:35Z</dc:date>
    <item>
      <title>Doubts using Assign statement in perform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758135#M1304344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im having some doubs in order to use assign in a dynamical perform. This is the cenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 tables of the same structure and in a routine they all go to the same perform, and will update the same internal table. I want that the perform be a little dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Th problem it's that for each internal table, the field to be update it's diferent, and i want to know if it's possible to do what i want using the assign statement. I've allready tried, and the code example goes with my test , but it's not working because instead of update the table field that i want move the value to the field symbol..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here goes an example of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
....
**Docs 41
  CLEAR: str_valor, str_num.
  str_valor = 'TAB_LISTA-VALOR_41'.
  str_num = 'TAB_LISTA-NUM_DOCS_41'.

  PERFORM get_values TABLES tab_docs USING str_valor
                                         str_num.

*Docs 61
  CLEAR: str_valor, str_num.
  str_valor = 'TAB_LISTA-VALOR_61'.
  str_num = 'TAB_LISTA-NUM_DOCS_61'.
  PERFORM get_values TABLES tab_61 USING str_valor
                                         str_num.
.....
.....
....

FORM get_values TABLES   p_tab STRUCTURE tab_docs
                USING    p_valor
                             p_num_docs.

  DATA lv_bankl TYPE t012-bankl.
  DATA lv_hkont TYPE t012k-hkont.
  DATA lv_banks TYPE banks.

  FIELD-SYMBOLS: &amp;lt;valor&amp;gt; TYPE ANY,
                 &amp;lt;num_docs&amp;gt; TYPE ANY.


  ASSIGN: p_valor TO &amp;lt;valor&amp;gt;,
          p_num_docs TO &amp;lt;num_docs&amp;gt;.

  LOOP AT p_tab.
    CLEAR: lv_bankl, lv_hkont, lv_banks.

    MOVE: p_tab-hkont TO lv_hkont,
          0 TO lv_hkont+9(1).

*Determinação de Banco  - Descritivo
    SELECT SINGLE f~bankl f~banks INTO (lv_bankl, lv_banks)
      FROM t012 AS f INNER JOIN t012k AS g
      ON f~bukrs = g~bukrs
      AND f~hbkid = g~hbkid
      WHERE g~hkont = lv_hkont
      AND g~bukrs = pa_emp.

    SELECT SINGLE banka FROM bnka INTO tab_lista-banco
           WHERE bankl = lv_bankl
           AND banks = lv_banks.


**Calculos para os documentos 41
    MOVE: p_tab-hkont TO tab_lista-conta.

    WRITE p_tab-dmbtr TO &amp;lt;valor&amp;gt;. "This is where the field to be updated differs

    AT NEW belnr.
      MOVE 1 TO &amp;lt;num_docs&amp;gt;. "This is where the field to be updated differs
    ENDAT.

    COLLECT tab_lista.
  ENDLOOP.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me on this subject??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance, &lt;/P&gt;&lt;P&gt;Best Regards, &lt;/P&gt;&lt;P&gt;João Martins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 16:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758135#M1304344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T16:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Doubts using Assign statement in perform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758136#M1304345</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;Here I see some problem on your coding:&lt;/P&gt;&lt;P&gt;Your original coding is:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ASSIGN: p_valor           TO &amp;lt;valor&amp;gt;,
              p_num_docs   TO &amp;lt;num_docs&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The coding should be:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ASSIGN: (p_valor)         TO &amp;lt;valor&amp;gt;,
              (p_num_docs) TO &amp;lt;num_docs&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Ramani N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 16:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758136#M1304345</guid>
      <dc:creator>former_member229729</dc:creator>
      <dc:date>2009-06-23T16:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Doubts using Assign statement in perform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758137#M1304346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your Subroutine try like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  ASSIGN: (p_valor) TO &amp;lt;valor&amp;gt;,
          (p_num_docs) TO &amp;lt;num_docs&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that TAB_LISTA is the global table in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 16:53:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758137#M1304346</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-06-23T16:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Doubts using Assign statement in perform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758138#M1304347</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;Based on what conditions the updatation of the fields differ? If you want to update the table using field-symbols then better while creating the field-symbols refer them to one of the internal table structures as all the internal tables have same structure. It will be easy to refer to the fields using &amp;lt;fs&amp;gt; else you can not do &amp;lt;fs&amp;gt;-field when the &amp;lt;fs&amp;gt; is being referenced to TYPE ANY. Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know on what conditions you are going to modify the internal table, please.&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;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anand Patil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 18:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubts-using-assign-statement-in-perform/m-p/5758138#M1304347</guid>
      <dc:creator>former_member189420</dc:creator>
      <dc:date>2009-06-23T18:29:03Z</dc:date>
    </item>
  </channel>
</rss>

