<?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: changes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620352#M277569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Please make highlighted changes. This is to avoid writing to the file incase of failure to open file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form writefile.
data: msg(100).
data: todir like rsmrgstr-path value '/apps/MQBridge/idocproc/'.
data: tofile like edi_path-pthnam.
clear msg.
concatenate todir 'amkor4b2' sy-datum sy-uzeit w_seqno '.xml' into tofile.
open dataset tofile for output in text mode encoding default message msg.
if sy-subrc ne 0.
   message e168(j4) with tofile.
else.
&amp;lt;b&amp;gt;   loop at wlines.
   transfer wlines to tofile.
   endloop.
   
   close dataset tofile.&amp;lt;/b&amp;gt;

   write:/ 'File transferred:', tofile.
endif.
endform. "WriteFile&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Oct 2006 06:15:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-15T06:15:48Z</dc:date>
    <item>
      <title>changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620351#M277568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;can anyone check changes to done in the following code?&lt;/P&gt;&lt;P&gt;here i am writing file in apps.&lt;/P&gt;&lt;P&gt;form writefile.&lt;/P&gt;&lt;P&gt;  data: msg(100).&lt;/P&gt;&lt;P&gt;  data: todir like rsmrgstr-path value '/apps/MQBridge/idocproc/'.&lt;/P&gt;&lt;P&gt;  data: tofile like edi_path-pthnam.&lt;/P&gt;&lt;P&gt;  clear msg.&lt;/P&gt;&lt;P&gt;  concatenate todir 'amkor4b2' sy-datum sy-uzeit w_seqno '.xml'&lt;/P&gt;&lt;P&gt;  into tofile.&lt;/P&gt;&lt;P&gt;  open dataset tofile for output in text mode encoding default&lt;/P&gt;&lt;P&gt;       message msg.&lt;/P&gt;&lt;P&gt;  if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;    message e168(j4) with tofile.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write:/ 'File transferred:', tofile.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at wlines.&lt;/P&gt;&lt;P&gt;    transfer wlines to tofile.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  close dataset tofile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    "WriteFile&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Oct 2006 02:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620351#M277568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-15T02:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620352#M277569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Please make highlighted changes. This is to avoid writing to the file incase of failure to open file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form writefile.
data: msg(100).
data: todir like rsmrgstr-path value '/apps/MQBridge/idocproc/'.
data: tofile like edi_path-pthnam.
clear msg.
concatenate todir 'amkor4b2' sy-datum sy-uzeit w_seqno '.xml' into tofile.
open dataset tofile for output in text mode encoding default message msg.
if sy-subrc ne 0.
   message e168(j4) with tofile.
else.
&amp;lt;b&amp;gt;   loop at wlines.
   transfer wlines to tofile.
   endloop.
   
   close dataset tofile.&amp;lt;/b&amp;gt;

   write:/ 'File transferred:', tofile.
endif.
endform. "WriteFile&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Oct 2006 06:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620352#M277569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-15T06:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620353#M277570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eswar,&lt;/P&gt;&lt;P&gt;thanks for the suggestion. and also can u check the following code too for any changes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form getdata.&lt;/P&gt;&lt;P&gt;  data: wrecord type i.&lt;/P&gt;&lt;P&gt;  data: wtime   type t.&lt;/P&gt;&lt;P&gt;  data: wtoday  type d.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  move sy-datum to wtoday.&lt;/P&gt;&lt;P&gt;  move sy-uzeit to wtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if wtime eq '000000'. &lt;/P&gt;&lt;P&gt;  wtoday = wtoday - 1. &lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  status = 1.&lt;/P&gt;&lt;P&gt;if sy-batch = 'X'.&lt;/P&gt;&lt;P&gt;select mblnr mjahr bldat cputm from mkpf into table mkpftbl where bldat eq wtoday and tcode2 eq ctcode2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;select mblnr mjahr bldat cputm from mkpf into table mkpftbl where mblnr in mblnr and mjahr in mjahr and tcode2 eq ctcode2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;describe table mkpftbl lines wrecord.&lt;/P&gt;&lt;P&gt;if wrecord &amp;gt; 0.&lt;/P&gt;&lt;P&gt; loop at mkpftbl.&lt;/P&gt;&lt;P&gt;      select zeile matnr werks charg menge from mseg&lt;/P&gt;&lt;P&gt;into corresponding fields of table msegtbl&lt;/P&gt;&lt;P&gt;for all entries in mkpftbl&lt;/P&gt;&lt;P&gt;where mblnr eq mkpftbl-wmblnr and mjahr eq mkpftbl-wmjahr and&lt;/P&gt;&lt;P&gt;bwart eq cbwart and werks eq splant.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;    status = 0.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    "GetData&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Oct 2006 06:42:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620353#M277570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-15T06:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620354#M277571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Nihi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Please check this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form getdata.
data: wrecord type i.
data: wtime type t.
data: wtoday type d.

move sy-datum to wtoday.
move sy-uzeit to wtime.

if wtime eq '000000'. 
wtoday = wtoday - 1. 
endif.

status = 1.
if sy-batch = 'X'.
   select mblnr mjahr bldat cputm 
          from mkpf 
          into table mkpftbl 
          where bldat eq wtoday 
          and   tcode2 eq ctcode2.
else.
   select mblnr mjahr bldat cputm 
          from mkpf 
          into table mkpftbl 
          where mblnr in mblnr 
          and   mjahr in mjahr 
          and   tcode2 eq ctcode2.
endif.

&amp;lt;b&amp;gt;if not mkpftbl[] is initial.
   select zeile matnr werks charg menge 
          from mseg
          into corresponding fields of table msegtbl
          for all entries in mkpftbl
          where mblnr eq mkpftbl-wmblnr
          and   mjahr eq mkpftbl-wmjahr
          and   bwart eq cbwart
          and   werks eq spalnt.
    status = 0.
endif.&amp;lt;/b&amp;gt;

&amp;lt;b&amp;gt;*describe table mkpftbl lines wrecord.
*if wrecord &amp;gt; 0.
*loop at mkpftbl.
*select zeile matnr werks charg menge from mseg
*into corresponding fields of table msegtbl
*for all entries in mkpftbl
*where mblnr eq mkpftbl-wmblnr and mjahr eq mkpftbl-wmjahr and
*bwart eq cbwart and werks eq splant.
*endloop.
*status = 0.
*endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;/b&amp;gt;endform. "GetData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try to avoid using CORRESPONDING FIELDS of table MSEGTBL, if the structure is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Oct 2006 07:43:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changes/m-p/1620354#M277571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-15T07:43:31Z</dc:date>
    </item>
  </channel>
</rss>

