<?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: Submit report via function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674297#M29786</link>
    <description>&lt;P&gt;Thank you for valuable guidance.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 06:45:07 GMT</pubDate>
    <dc:creator>former_member491157</dc:creator>
    <dc:date>2018-10-16T06:45:07Z</dc:date>
    <item>
      <title>Submit report via function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674294#M29783</link>
      <description>&lt;P&gt;Dear Experts, &lt;BR /&gt;In one of Z* programs on double click event on some particular field of ALV grid the transaction LX02 is being launched via function module call:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'Z_MZ_CALL_LX02' STARTING NEW TASK 'LX02'
          EXPORTING
            iv_lgnum = lv_lgnum
            iv_matnr = &amp;lt;fs_outbound&amp;gt;-matnr
            iv_vlpla = &amp;lt;fs_outbound&amp;gt;-vlpla.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The source code for function module looks like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS : rsds.

  DATA :  it_seltab TYPE TABLE OF rsparams,
          ls_seltab  LIKE LINE OF it_seltab,
          wa_selopt TYPE rsdsselopt.
  DATA :  it_frange TYPE rsds_frange_t,
          wa_frange TYPE rsds_frange.
  DATA :  it_trange TYPE rsds_trange,
          wa_trange TYPE rsds_range.
  DATA :  it_texpr TYPE rsds_texpr,
          wa_texpr TYPE rsds_expr.


  wa_trange-tablename = 'LQUA'.
  wa_frange-fieldname = 'MATNR'.
  wa_selopt-sign      = 'I'.
  wa_selopt-option    = 'EQ'.
  wa_selopt-low       = iv_matnr.
  wa_selopt-high      = iv_matnr.


  APPEND wa_selopt TO wa_frange-selopt_t.
  APPEND wa_frange TO wa_trange-frange_t.
  CLEAR wa_selopt.
  CLEAR wa_frange.


  wa_frange-fieldname = 'LGNUM'.
  wa_selopt-sign    = 'I'.
  wa_selopt-option  = 'EQ'.
  wa_selopt-low     = iv_lgnum.
  wa_selopt-high    = iv_lgnum.
  APPEND wa_selopt TO wa_frange-selopt_t.
  APPEND wa_frange TO wa_trange-frange_t.
  CLEAR wa_selopt.
  CLEAR wa_frange.


  ls_seltab-selname = 'S1_LGNUM'.          " Name of parameter on submitted program
  ls_seltab-kind    = 'S'.
  ls_seltab-sign    = 'I'.
  ls_seltab-option  = 'EQ'.
  ls_seltab-low     = iv_lgnum.
  ls_seltab-high    = iv_lgnum.
  APPEND ls_seltab TO it_seltab.
  CLEAR ls_seltab.




  IF iv_vlpla IS NOT INITIAL.


    wa_frange-fieldname = 'LGPLA'.
    wa_selopt-sign = 'I'.
    wa_selopt-option    = 'EQ'.
    wa_selopt-low       = iv_vlpla.
    wa_selopt-high      = iv_vlpla.
    APPEND wa_selopt TO wa_frange-selopt_t.
    APPEND wa_frange TO wa_trange-frange_t.
    CLEAR wa_selopt.
    CLEAR wa_frange.








    ls_seltab-selname = 'S1_LGPLA'.
    ls_seltab-kind = 'S'.
    ls_seltab-sign = 'I'.
    ls_seltab-option = 'EQ'.
    ls_seltab-low = iv_vlpla.
    ls_seltab-high = iv_vlpla.
    APPEND ls_seltab TO it_seltab.
    CLEAR ls_seltab.
  ENDIF.


  APPEND wa_trange TO it_trange.


  CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
    EXPORTING
      field_ranges = it_trange
    IMPORTING
      expressions  = it_texpr.


  SUBMIT rls10020
    WITH SELECTION-TABLE it_seltab
    WITH FREE SELECTIONS it_texpr
    AND RETURN .


ENDFUNCTION.


&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The problem is that everything works fine when LX02 is being called first time. However, if I return back to ALV-grid and double click the field of the same column but different row, the field of LX02 kinda 'remember' the previous input. Is there a way to submit a report and clear everything in the buffer memory, so that each double click would call 'refreshed' LX02.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 07:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674294#M29783</guid>
      <dc:creator>former_member491157</dc:creator>
      <dc:date>2018-10-12T07:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Submit report via function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674295#M29784</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you are almost there...just need to put extra effort to debug more and find the variable holding these values which has to be cleared. check if below helps u...&lt;/P&gt;&lt;P&gt;unassign the field symbol which is used to populate it_seltab for calling LX02&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;            iv_lgnum = lv_lgnum
            iv_matnr =&amp;lt;fs_outbound&amp;gt;-matnr
            iv_vlpla =&amp;lt;fs_outbound&amp;gt;-vlpla.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2018 13:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674295#M29784</guid>
      <dc:creator>TMSingh_SAP</dc:creator>
      <dc:date>2018-10-12T13:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Submit report via function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674296#M29785</link>
      <description>&lt;P&gt;You should look in the caller program, not in the FM. Check the double click event.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 13:10:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674296#M29785</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2018-10-12T13:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Submit report via function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674297#M29786</link>
      <description>&lt;P&gt;Thank you for valuable guidance.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 06:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-report-via-function-module/m-p/674297#M29786</guid>
      <dc:creator>former_member491157</dc:creator>
      <dc:date>2018-10-16T06:45:07Z</dc:date>
    </item>
  </channel>
</rss>

