<?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: pass by value in BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456085#M550754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;go thru the code below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* calling the BAPI to update the Asset Master AS02
  loop at it_final into is_final.

* If updating of floor area only
    if p_farea = 'X'.
* passing new area value to the BAPI
      is_realestate-area     = is_final-grufl.
      is_realestatex-area    = 'X'.

      call function 'BAPI_FIXEDASSET_CHANGE'
           exporting
                companycode = is_final-bukrs
                asset       = is_final-anln1
                subnumber   = is_final-anln2
                realestate  = is_realestate
                realestatex = is_realestatex
           importing
                return      = it_return.

* If Asset Master is changed with out any errors
      read table it_return with key type = 'E'.
      if sy-subrc = 0.
        flag = ' '.
      else.
        flag = 'X'.
* Call the COMMIT BAPI
        call function 'BAPI_TRANSACTION_COMMIT'
             exporting
                  wait = 'X'.
        wait up to 2 seconds.
      endif.
* If the Asset Master is changed with out any errors
      if flag = 'X'.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_green.
          is_output-grufl_n = is_final-grufl.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting grufl_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      elseif flag = ' '.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_red.
          is_output-grufl_n = is_realestate-area.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting grufl_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      endif.

    endif.

* If updating of lease commencement date only
    if p_ldate = 'X'.
* Passing new lease start date value to the BAPI
      is_leasing-start_date  = is_final-leabg.
      is_leasingx-start_date = 'X'.

* Call the BAPI to change the Asset Master
      call function 'BAPI_FIXEDASSET_CHANGE'
           exporting
                companycode = is_final-bukrs
                asset       = is_final-anln1
                subnumber   = is_final-anln2
                leasing     = is_leasing
                leasingx    = is_leasingx
           importing
                return      = it_return.
* If Asset Master is changed with out any errors
      read table it_return with key type = 'E'.
      if sy-subrc = 0.
        flag = ' '.
      else.
        flag = 'X'.
* Call the COMMIT BAPI
        call function 'BAPI_TRANSACTION_COMMIT'
             exporting
                  wait = 'X'.
        wait up to 2 seconds.
      endif.

* If the Asset Master is changed with out any errors
      if flag = 'X'.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_green.
          is_output-leabg_n = is_final-leabg.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting leabg_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      elseif flag = ' '.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_red.
          is_output-leabg_n = is_leasing-start_date.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting leabg_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      endif.
    endif.

    clear : is_final, is_realestate, is_leasing,
            it_return, flag , is_output.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2007 05:31:07 GMT</pubDate>
    <dc:creator>gopi_narendra</dc:creator>
    <dc:date>2007-07-03T05:31:07Z</dc:date>
    <item>
      <title>pass by value in BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456084#M550753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi frnds,&lt;/P&gt;&lt;P&gt;            I am new to BAPI. I have a doubt why we hav to give... both import as well as export parameter as PASS BY VALUE....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I M ALSO IN DOUBT REGARDING FORMAL PARAMETER AND ACTUAL PARAMETERS.... If i can get a simple example in that i can clear my doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks to u all for helpful contribution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 05:27:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456084#M550753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-03T05:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: pass by value in BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456085#M550754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;go thru the code below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* calling the BAPI to update the Asset Master AS02
  loop at it_final into is_final.

* If updating of floor area only
    if p_farea = 'X'.
* passing new area value to the BAPI
      is_realestate-area     = is_final-grufl.
      is_realestatex-area    = 'X'.

      call function 'BAPI_FIXEDASSET_CHANGE'
           exporting
                companycode = is_final-bukrs
                asset       = is_final-anln1
                subnumber   = is_final-anln2
                realestate  = is_realestate
                realestatex = is_realestatex
           importing
                return      = it_return.

* If Asset Master is changed with out any errors
      read table it_return with key type = 'E'.
      if sy-subrc = 0.
        flag = ' '.
      else.
        flag = 'X'.
* Call the COMMIT BAPI
        call function 'BAPI_TRANSACTION_COMMIT'
             exporting
                  wait = 'X'.
        wait up to 2 seconds.
      endif.
* If the Asset Master is changed with out any errors
      if flag = 'X'.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_green.
          is_output-grufl_n = is_final-grufl.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting grufl_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      elseif flag = ' '.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_red.
          is_output-grufl_n = is_realestate-area.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting grufl_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      endif.

    endif.

* If updating of lease commencement date only
    if p_ldate = 'X'.
* Passing new lease start date value to the BAPI
      is_leasing-start_date  = is_final-leabg.
      is_leasingx-start_date = 'X'.

* Call the BAPI to change the Asset Master
      call function 'BAPI_FIXEDASSET_CHANGE'
           exporting
                companycode = is_final-bukrs
                asset       = is_final-anln1
                subnumber   = is_final-anln2
                leasing     = is_leasing
                leasingx    = is_leasingx
           importing
                return      = it_return.
* If Asset Master is changed with out any errors
      read table it_return with key type = 'E'.
      if sy-subrc = 0.
        flag = ' '.
      else.
        flag = 'X'.
* Call the COMMIT BAPI
        call function 'BAPI_TRANSACTION_COMMIT'
             exporting
                  wait = 'X'.
        wait up to 2 seconds.
      endif.

* If the Asset Master is changed with out any errors
      if flag = 'X'.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_green.
          is_output-leabg_n = is_final-leabg.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting leabg_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      elseif flag = ' '.
        read table it_output into is_output with key
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  binary search.
        if sy-subrc = 0.
*          is_output-c_icon  = c_red.
          is_output-leabg_n = is_leasing-start_date.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          modify it_output from is_output
                           transporting leabg_n message
                           where bukrs = is_output-bukrs
                             and anln1 = is_output-anln1
                             and anln2 = is_output-anln2.
        endif.
      endif.
    endif.

    clear : is_final, is_realestate, is_leasing,
            it_return, flag , is_output.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 05:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456085#M550754</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-07-03T05:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: pass by value in BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456086#M550755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf" target="test_blank"&gt;www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Go through the attached link.It might be of some help .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 05:32:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456086#M550755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-03T05:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: pass by value in BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456087#M550756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI's are generally RFC (Remote Function Calls) enabled function modules. In this type of FM's, we can not pass a parameter by reference. So, U see only Pass by Value option selected in both import and export parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actual parameters: Lets suppose that u r calling a subroutine where u have different kind of parameters like TABLES, USING and CHANGING... these parameters are called as Actual Parameters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example: PERFORM F_GET_DATA TABLES G_ITAB&lt;/P&gt;&lt;P&gt;                                 USING LV_VAR1&lt;/P&gt;&lt;P&gt;                              CHANGING LV_VAR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here G_ITAB, LV_VAR1 and LV_VAR2 are actual parameters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formal Parameters: Names given to the actual parameters in subroutine definition are called as formal paramaters or formal names given to actual parameters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example: FORM F_GET_DATA TABLES P_G_ITAB&lt;/P&gt;&lt;P&gt;                               USING P_LV_VAR1&lt;/P&gt;&lt;P&gt;                            CHANGING P_LV_VAR2.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here P_G_ITAB, P_LV_VAR1 and P_LV_VAR2 are formal parameters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it clears your doubt...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sivapuram Phani Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2007 05:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-by-value-in-bapi/m-p/2456087#M550756</guid>
      <dc:creator>PS_1978</dc:creator>
      <dc:date>2007-07-03T05:39:50Z</dc:date>
    </item>
  </channel>
</rss>

