<?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: Typical problem in sapscript in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237075#M1381576</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;Try these changes and check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR WA_EXCDTL .

Loop at it_excdtl INTO WA_EXCDTL.
IF WA_excdtl-menge NE 0.
wa_excdtl_amt_unit = ( WA_excdtl-exbed / WA_excdtl-menge ).

WA_EXCDTL_ED_UNIT = ( WA_excdtl-ecs / WA_excdtl-menge ).

WA_EXCDTL_CVD_UNIT = ( WA_excdtl-exaed / WA_excdtl-menge ).

modify it_excdtl from wa_excdtl.
ENDIF.

PERFORM write_form2.

FORM write_form2 .

loop at it_excdtl.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'EMAIN2'
function = 'APPEND'
* function = 'SET'

type = 'BODY'
window = 'MAIN2'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
OTHERS = 9
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.

ENDFORM. " WRITE_FORM2
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Sep 2009 06:33:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-22T06:33:49Z</dc:date>
    <item>
      <title>Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237072#M1381573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Sapscript , i am facing very typical problem. The summary of the problem is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my final Internal table it_excdtl  there is 4 entries . I am doing some calculation and Writing the contents through Write_form,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only 1 set of value is coming in the Print out instead of 4 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one give me the tips :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance :&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;Sample code is attached :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR WA_EXCDTL .&lt;/P&gt;&lt;P&gt;  Loop at it_excdtl INTO WA_EXCDTL.&lt;/P&gt;&lt;P&gt;IF WA_excdtl-menge  NE 0.&lt;/P&gt;&lt;P&gt;      wa_excdtl_amt_unit  = ( WA_excdtl-exbed / WA_excdtl-menge ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        WA_EXCDTL_ED_UNIT  = ( WA_excdtl-ecs / WA_excdtl-menge ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_EXCDTL_CVD_UNIT  = ( WA_excdtl-exaed / WA_excdtl-menge ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM write_form2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM write_form2 .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOOP AT tj_1irg23d.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*Loop at fp_out_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      element                        = 'EMAIN2'&lt;/P&gt;&lt;P&gt;      function                       = 'APPEND'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     function                       = 'SET'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      type                           = 'BODY'&lt;/P&gt;&lt;P&gt;      window                         = 'MAIN2'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PENDING_LINES                  =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      element                        = 1&lt;/P&gt;&lt;P&gt;      function                       = 2&lt;/P&gt;&lt;P&gt;      type                           = 3&lt;/P&gt;&lt;P&gt;      unopened                       = 4&lt;/P&gt;&lt;P&gt;      unstarted                      = 5&lt;/P&gt;&lt;P&gt;      window                         = 6&lt;/P&gt;&lt;P&gt;      bad_pageformat_for_print       = 7&lt;/P&gt;&lt;P&gt;      spool_error                    = 8&lt;/P&gt;&lt;P&gt;      OTHERS                         = 9&lt;/P&gt;&lt;P&gt;               .&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " WRITE_FORM2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 06:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237072#M1381573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-22T06:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237073#M1381574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Kiro &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the loop &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop at it_excdtl INTO WA_EXCDTL&lt;/STRONG&gt;   and the  form &lt;STRONG&gt;write form&lt;/STRONG&gt;  is not in the loop so might be the problem is occuring in print since u r populating th e data for four entries ur not writing it for 4 .&lt;/P&gt;&lt;P&gt;&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;Swapnil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 06:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237073#M1381574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-22T06:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237074#M1381575</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;-&amp;gt; Please write your WRITE_FORM inside a LOOP at gt_itab...ENDLOOP when you have multiple records populated in the internal table. I see that you have commented the LOOP...ENDLOOP...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; If you think you have added it and it doesnt work yet, then check the size of the window in your SAP script. The size could have been small such that it can hold just one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; Debug to find if your internal table is populated with multiple records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 06:26:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237074#M1381575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-22T06:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237075#M1381576</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;Try these changes and check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR WA_EXCDTL .

Loop at it_excdtl INTO WA_EXCDTL.
IF WA_excdtl-menge NE 0.
wa_excdtl_amt_unit = ( WA_excdtl-exbed / WA_excdtl-menge ).

WA_EXCDTL_ED_UNIT = ( WA_excdtl-ecs / WA_excdtl-menge ).

WA_EXCDTL_CVD_UNIT = ( WA_excdtl-exaed / WA_excdtl-menge ).

modify it_excdtl from wa_excdtl.
ENDIF.

PERFORM write_form2.

FORM write_form2 .

loop at it_excdtl.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'EMAIN2'
function = 'APPEND'
* function = 'SET'

type = 'BODY'
window = 'MAIN2'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
OTHERS = 9
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.

ENDFORM. " WRITE_FORM2
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 06:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237075#M1381576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-22T06:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237076#M1381577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi, 
&amp;lt;li&amp;gt;Keep your &lt;STRONG&gt;PERFORM write_form2.&lt;/STRONG&gt; subroutine call inside *  LOOP - ENDLOOP.*

Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 06:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237076#M1381577</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-09-22T06:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem in sapscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237077#M1381578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Sap Script i have to print diffrent Text depanding upon the  diffrent Supplying plant .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do this in Sap script . I have to write this details to the footer window of my Form .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Supplying plants details are maintained in Sapscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 08:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-in-sapscript/m-p/6237077#M1381578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-22T08:41:16Z</dc:date>
    </item>
  </channel>
</rss>

