<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5714096731928945714</id><updated>2024-09-06T06:55:48.821+01:00</updated><category term="ABAP"/><category term="program"/><category term="report"/><category term="Object"/><category term="Class"/><category term="SAP"/><category term="source"/><category term="OLE"/><category term="Operation"/><category term="Transport"/><category term="automation"/><category term="copy"/><category term="order"/><category term="request"/><category term="scan"/><category term="text"/><category term="ALV"/><category term="Batch"/><category term="COMM"/><category term="Calculation"/><category term="Delete"/><category term="Desktop"/><category term="Download"/><category term="Email"/><category term="Excel"/><category term="File"/><category term="Input"/><category term="Move"/><category term="Port"/><category term="Presentation"/><category term="SAPI"/><category term="SAPScript"/><category term="Serial"/><category term="Server"/><category term="Upload"/><category term="Voice"/><category term="Week"/><category term="background"/><category term="generate"/><category term="log"/><category term="logoff"/><category term="logout"/><category term="off"/><category term="out"/><category term="release"/><category term="session"/><category term="shutdown"/><title type='text'>World of ABAP</title><subtitle type='html'>Experiments, Information and Tips and Tricks for ABAP</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Luis Queirós</name><uri>http://www.blogger.com/profile/10488421597941590684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-6381517333977511253</id><published>2013-11-06T13:55:00.000+00:00</published><updated>2013-11-06T17:24:39.784+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="log"/><category scheme="http://www.blogger.com/atom/ns#" term="logoff"/><category scheme="http://www.blogger.com/atom/ns#" term="logout"/><category scheme="http://www.blogger.com/atom/ns#" term="off"/><category scheme="http://www.blogger.com/atom/ns#" term="out"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="session"/><category scheme="http://www.blogger.com/atom/ns#" term="shutdown"/><category scheme="http://www.blogger.com/atom/ns#" term="source"/><title type='text'>Logoff SAP session without warning</title><content type='html'>As a measure of control or simpy to release resources, we can force, with abap code, the shutdown of all instances of the current logon session. Here is a small program to show how to do that.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea style=&quot;height: 310px; margin: 2px; width: 580px;&quot;&gt;data: begin of l_data,
        rlmbp  type rlmbp,
        trprp  type lmbpt_trprp,
        actual type lmbpt_it_actual,
        do     type lmbpt_it_do,
        step   type lmbpt_it_scrstack,
        move   type lmbpt_it_move,
      end of l_data.

  clear: l_data. free: l_data.
  call function &#39;LMBP_RESOURCE_LOGOFF&#39;
       changing cs_rlmbp  = l_data-rlmbp
                cs_trprp  = l_data-trprp
                ct_actual = l_data-actual
                ct_do     = l_data-do
                ct_step   = l_data-step
                ct_move   = l_data-move.
  clear: l_data. free: l_data.
&lt;/textarea&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/6381517333977511253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/logoff-sap-session-without-warning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/6381517333977511253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/6381517333977511253'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/logoff-sap-session-without-warning.html' title='Logoff SAP session without warning'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-8838720232489922869</id><published>2013-11-04T11:24:00.002+00:00</published><updated>2013-11-06T17:35:20.029+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Class"/><category scheme="http://www.blogger.com/atom/ns#" term="COMM"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><category scheme="http://www.blogger.com/atom/ns#" term="OLE"/><category scheme="http://www.blogger.com/atom/ns#" term="Port"/><category scheme="http://www.blogger.com/atom/ns#" term="Serial"/><title type='text'>ABAP communication with COMM Ports ( Serial Ports )</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;One need that sometimes arise, is to allow the system to communicate with scales, printers or other devices. As far as I know, there isn&#39;t a simple and straigth forward way to do that.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In this post I&#39;ll present a class to make this possible. This class uses OLE to allow the desktop PC to communicate using a serial port. In a future post, I&#39;ll show how to create a webservice, running in a given PC, that can be accessed by a SAP Server in order to allow the communication in background and/or allow any pc to read a remote serial port.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For now, this only works in the running PC and there is the need to create and register the MSCOMM32.OCX (I&#39;ll show how to create a script to do this for 32 and 64 windows)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 - Download MSCOMM32.OCX ( for instance, you can download it from here : &lt;a href=&quot;http://www.ocxdump.com/ocxfiles/M/MSCOMM32.OCX&quot; target=&quot;_blank&quot;&gt;Link&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 - Create a text file named comm.reg with the following content:&lt;/span&gt;&lt;br /&gt;
&lt;textarea style=&quot;height: 74px; margin: 2px; width: 542px;&quot;&gt;Windows Registry Editor version 5.00

[HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]
&quot;VALUE&quot;=&quot;REG_SZ=kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun&quot;
&lt;/textarea&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 - Create a batch file comm.bat with the following content:&lt;/span&gt;&lt;/div&gt;
&lt;textarea style=&quot;height: 118px; margin: 2px; width: 581px;&quot;&gt;copy MSCOMM32.ocx %SYSTEMROOT%\SysWOW64\
if not exist %SYSTEMROOT%\SysWOW64\mscomm32.ocx (copy MSCOMM32.ocx %SYSTEMROOT%\system32\)
if exist %SYSTEMROOT%\SysWOW64\mscomm32.ocx (regsvr32 /s MSCOMM32.OCX)
if exist %SYSTEMROOT%\SysWOW64\mscomm32.ocx (regedit /s comm.reg)
if exist %SYSTEMROOT%\system32\mscomm32.ocx (regsvr32 /s MSCOMM32.OCX)
if exist %SYSTEMROOT%\system32\mscomm32.ocx (regedit /s comm.reg)
&lt;/textarea&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;4 - Place all three files in the same location and run, with administrator privileges, the comm.bat file).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;5 - Now, the ABAP Class. Create the following class:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-sG9bzQCUQkc/UneDfBQLt7I/AAAAAAAAG1A/YBwlSQAqZ24/s1600/screenshot.1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;232&quot; src=&quot;http://3.bp.blogspot.com/-sG9bzQCUQkc/UneDfBQLt7I/AAAAAAAAG1A/YBwlSQAqZ24/s400/screenshot.1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;6 - Create these class attributes:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-TCisUzhpvYs/UneDfOygSmI/AAAAAAAAG1I/RDJ3YmJVxKo/s1600/screenshot.2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;52&quot; src=&quot;http://4.bp.blogspot.com/-TCisUzhpvYs/UneDfOygSmI/AAAAAAAAG1I/RDJ3YmJVxKo/s400/screenshot.2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;7 - Create these methods:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-Lx9YeNlswOY/UneDfBv48eI/AAAAAAAAG1o/PD-eWa9FS8E/s1600/screenshot.3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;141&quot; src=&quot;http://2.bp.blogspot.com/-Lx9YeNlswOY/UneDfBv48eI/AAAAAAAAG1o/PD-eWa9FS8E/s400/screenshot.3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;8 - Give these parameters to the created methods:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-tPuVfiRthqU/UneDfVdN5WI/AAAAAAAAG1Q/2_jpvkkOZ3A/s1600/screenshot.4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;63&quot; src=&quot;http://4.bp.blogspot.com/-tPuVfiRthqU/UneDfVdN5WI/AAAAAAAAG1Q/2_jpvkkOZ3A/s400/screenshot.4.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-8sDKueazi2Y/UneDfoqqtPI/AAAAAAAAG1g/lExmOaMKoHM/s1600/screenshot.5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;65&quot; src=&quot;http://1.bp.blogspot.com/-8sDKueazi2Y/UneDfoqqtPI/AAAAAAAAG1g/lExmOaMKoHM/s400/screenshot.5.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-4mJhAG_ASdE/UneDf9luQOI/AAAAAAAAG1c/05_CFgphfNg/s1600/screenshot.6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;67&quot; src=&quot;http://1.bp.blogspot.com/-4mJhAG_ASdE/UneDf9luQOI/AAAAAAAAG1c/05_CFgphfNg/s400/screenshot.6.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;9 - Insert the appropriate code bellow in each of the corresponding methods:&lt;/span&gt;&lt;/div&gt;
&lt;textarea style=&quot;height: 600px; margin: 2px; width: 580px;&quot;&gt;method CLOSE.

  set property of w_connection &#39;PortOpen&#39; = 0.

endmethod.
method CONSTRUCTOR.

  initialization( exceptions no_authorization   = 1
                             object_not_created = 2
                             others             = 3 ).
  case sy-subrc.
    when 0.
      if i_com_port is supplied.
        w_com_port = i_com_port.
      endif.
      if i_settings is supplied.
        w_settings = i_settings.
      endif.
    when 1. raise NO_AUTHORIZATION.
    when 2. raise OBJECT_NOT_CREATED.
    when others.
  endcase.

endmethod.
method INITIALIZATION.

  call function &#39;AUTHORITY_CHECK_OLE&#39;
    exporting
      program          = sy-repid
      activity         = sabc_act_call
      application      = &#39;MSCOMMLIB.MSCOMM.1&#39;
    exceptions
      no_authority     = 1
      activity_unknown = 2
      others           = 3.
  if not sy-subrc is initial.
    raise NO_AUTHORIZATION.
  endif.
  create object w_connection &#39;MSCOMMLib.MSComm.1&#39;.
  if not sy-subrc is initial.
    raise OBJECT_NOT_CREATED.
  endif.

endmethod.
method OPEN.

  set property of w_connection &#39;CommPort&#39; = w_com_port.
  set property of w_connection &#39;Settings&#39; = w_settings.
  set property of w_connection &#39;InputLen&#39; = 0.
  set property of w_connection &#39;PortOpen&#39; = 1.

endmethod.
method READ.

data: l_buffer type i.


  clear: l_buffer, e_input.
  do 10 times.
    get property of w_connection &#39;InBufferCount&#39; = l_buffer.
    if l_buffer &gt; 0.
      get property of w_connection &#39;Input&#39; = e_input.
      exit.
    endif.
  enddo.
  clear: l_buffer. free: l_buffer.

endmethod.
method WRITE.

  set property of w_connection &#39;Output&#39; = i_output.
  set property of w_connection &#39;Output&#39; = cl_abap_char_utilities=&gt;cr_lf.

endmethod.
&lt;/textarea&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10 - Enjoy :)&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/8838720232489922869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/abap-communication-with-comm-ports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8838720232489922869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8838720232489922869'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/abap-communication-with-comm-ports.html' title='ABAP communication with COMM Ports ( Serial Ports )'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-sG9bzQCUQkc/UneDfBQLt7I/AAAAAAAAG1A/YBwlSQAqZ24/s72-c/screenshot.1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-8047305441731092842</id><published>2013-11-04T02:03:00.001+00:00</published><updated>2013-11-04T12:33:56.620+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Class"/><category scheme="http://www.blogger.com/atom/ns#" term="copy"/><category scheme="http://www.blogger.com/atom/ns#" term="Delete"/><category scheme="http://www.blogger.com/atom/ns#" term="Desktop"/><category scheme="http://www.blogger.com/atom/ns#" term="Download"/><category scheme="http://www.blogger.com/atom/ns#" term="File"/><category scheme="http://www.blogger.com/atom/ns#" term="Move"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><category scheme="http://www.blogger.com/atom/ns#" term="Operation"/><category scheme="http://www.blogger.com/atom/ns#" term="Presentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Upload"/><title type='text'>ABAP File Operations : Desktop and Server</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sometimes, we need to get a file from the presentation server or the application server. Usually, we need to fork the code in order to be able to use one or the other. Here, I&#39;ll show a simple class to make this task a lot easier. All the usual file/directory operations, are called the same way. The only distinction is a flag to indicate that the file should be considered in the desktop or in the server.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The class only has static methods, to use it, you just need to call any of the public methods.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This is the beggining, in the future I&#39;ll try to allow FTP, network shares, among others and consider to create a instanciable class to deal with connection, autentication, etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 - Create the following Class&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-u5VKKtT5r2w/Unb3yg6mo9I/AAAAAAAAGw0/Yo0hatQgBlY/s1600/screenshot.1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://4.bp.blogspot.com/-u5VKKtT5r2w/Unb3yg6mo9I/AAAAAAAAGw0/Yo0hatQgBlY/s400/screenshot.1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 - Create the following Methods:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-TXhdtVB3cYo/Unb4ZK4e04I/AAAAAAAAGw8/2hLkJXtZMas/s1600/screenshot.2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;http://3.bp.blogspot.com/-TXhdtVB3cYo/Unb4ZK4e04I/AAAAAAAAGw8/2hLkJXtZMas/s400/screenshot.2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-WZ5Xf-ESeJo/Unb4ZWtvsHI/AAAAAAAAGxI/PHeb7n8TisU/s1600/screenshot.4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;56&quot; src=&quot;http://3.bp.blogspot.com/-WZ5Xf-ESeJo/Unb4ZWtvsHI/AAAAAAAAGxI/PHeb7n8TisU/s400/screenshot.4.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 - Use the following parameters for each method:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-tI8QG6S_VF8/Unb-2L8Pm6I/AAAAAAAAGyM/DSxeAd0kn2I/s1600/screenshot.1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;65&quot; src=&quot;http://4.bp.blogspot.com/-tI8QG6S_VF8/Unb-2L8Pm6I/AAAAAAAAGyM/DSxeAd0kn2I/s400/screenshot.1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-Z2Cmd5Yg1o0/Unb-8WMwO0I/AAAAAAAAG0M/gGwmTvn6xWg/s1600/screenshot.22.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://4.bp.blogspot.com/-Z2Cmd5Yg1o0/Unb-8WMwO0I/AAAAAAAAG0M/gGwmTvn6xWg/s400/screenshot.22.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-BnyuQ0BLcIs/Unb-3PygmfI/AAAAAAAAGyo/ZoVaNhqjVcc/s1600/screenshot.2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;73&quot; src=&quot;http://4.bp.blogspot.com/-BnyuQ0BLcIs/Unb-3PygmfI/AAAAAAAAGyo/ZoVaNhqjVcc/s400/screenshot.2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-8FIgl-KwmrA/Unb-5_J51WI/AAAAAAAAGzg/43JYfOME-EQ/s1600/screenshot.3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;76&quot; src=&quot;http://3.bp.blogspot.com/-8FIgl-KwmrA/Unb-5_J51WI/AAAAAAAAGzg/43JYfOME-EQ/s400/screenshot.3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-iq8t-KABtrs/Unb-59pXWHI/AAAAAAAAGzc/omnicZp33c8/s1600/screenshot.5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;73&quot; src=&quot;http://3.bp.blogspot.com/-iq8t-KABtrs/Unb-59pXWHI/AAAAAAAAGzc/omnicZp33c8/s400/screenshot.5.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-qtRq-b3Cct4/Unb-6mqzevI/AAAAAAAAGzo/_Lc-qHQ25IM/s1600/screenshot.6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;http://4.bp.blogspot.com/-qtRq-b3Cct4/Unb-6mqzevI/AAAAAAAAGzo/_Lc-qHQ25IM/s400/screenshot.6.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-L3CJlCEKGl4/Unb-64lukXI/AAAAAAAAGzw/w-kiJPfdEf4/s1600/screenshot.7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;52&quot; src=&quot;http://3.bp.blogspot.com/-L3CJlCEKGl4/Unb-64lukXI/AAAAAAAAGzw/w-kiJPfdEf4/s400/screenshot.7.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-7QNzgOmpvI0/Unb-7BcQ8ZI/AAAAAAAAGz4/VoS16UBEwfo/s1600/screenshot.8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;75&quot; src=&quot;http://1.bp.blogspot.com/-7QNzgOmpvI0/Unb-7BcQ8ZI/AAAAAAAAGz4/VoS16UBEwfo/s400/screenshot.8.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-el9KKOBVhJU/Unb-7sOhSAI/AAAAAAAAG0A/tZQDQdl2r1E/s1600/screenshot.9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;85&quot; src=&quot;http://3.bp.blogspot.com/-el9KKOBVhJU/Unb-7sOhSAI/AAAAAAAAG0A/tZQDQdl2r1E/s400/screenshot.9.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-Y4oKLW_Z5U4/Unb-zp0PNkI/AAAAAAAAGxU/YcuQ0FB2Loc/s1600/screenshot.10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;http://4.bp.blogspot.com/-Y4oKLW_Z5U4/Unb-zp0PNkI/AAAAAAAAGxU/YcuQ0FB2Loc/s400/screenshot.10.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-nxVH5igLEbg/Unb-zma8XiI/AAAAAAAAGxY/tFeS86dZFFM/s1600/screenshot.11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;52&quot; src=&quot;http://3.bp.blogspot.com/-nxVH5igLEbg/Unb-zma8XiI/AAAAAAAAGxY/tFeS86dZFFM/s400/screenshot.11.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-X2vd7k6gG_4/Unb-0FVaUDI/AAAAAAAAGxg/iVPO9A865pk/s1600/screenshot.12.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://4.bp.blogspot.com/-X2vd7k6gG_4/Unb-0FVaUDI/AAAAAAAAGxg/iVPO9A865pk/s400/screenshot.12.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-exPywCOT7v8/Unb-0b4pVdI/AAAAAAAAGxo/LtVu3en5Yzo/s1600/screenshot.13.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://2.bp.blogspot.com/-exPywCOT7v8/Unb-0b4pVdI/AAAAAAAAGxo/LtVu3en5Yzo/s400/screenshot.13.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-GZB9jJL9buI/Unb-0i17z1I/AAAAAAAAGxw/mYbIxD2jjPQ/s1600/screenshot.14.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;73&quot; src=&quot;http://3.bp.blogspot.com/-GZB9jJL9buI/Unb-0i17z1I/AAAAAAAAGxw/mYbIxD2jjPQ/s400/screenshot.14.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-WB3vQRNjxe0/Unb-02AStGI/AAAAAAAAGyA/1s-y5iN1d38/s1600/screenshot.15.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;75&quot; src=&quot;http://1.bp.blogspot.com/-WB3vQRNjxe0/Unb-02AStGI/AAAAAAAAGyA/1s-y5iN1d38/s400/screenshot.15.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-kabGbzdC0YA/Unb-1VB-rOI/AAAAAAAAGx8/oELJVdQT_R4/s1600/screenshot.16.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://4.bp.blogspot.com/-kabGbzdC0YA/Unb-1VB-rOI/AAAAAAAAGx8/oELJVdQT_R4/s400/screenshot.16.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-uE2xii6_T7w/Unb-5AkyrsI/AAAAAAAAGzI/Y_Nrd6qDeUU/s1600/screenshot.17.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;75&quot; src=&quot;http://4.bp.blogspot.com/-uE2xii6_T7w/Unb-5AkyrsI/AAAAAAAAGzI/Y_Nrd6qDeUU/s400/screenshot.17.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-e-_x2UeWBLI/Unb-2G3SyeI/AAAAAAAAGyQ/RZqDgIGRE38/s1600/screenshot.18.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://4.bp.blogspot.com/-e-_x2UeWBLI/Unb-2G3SyeI/AAAAAAAAGyQ/RZqDgIGRE38/s400/screenshot.18.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-TKGUaWtjCqs/Unb-2yVADjI/AAAAAAAAGyY/EjfyljzRZ7w/s1600/screenshot.19.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;63&quot; src=&quot;http://2.bp.blogspot.com/-TKGUaWtjCqs/Unb-2yVADjI/AAAAAAAAGyY/EjfyljzRZ7w/s400/screenshot.19.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-6XeBVdkAhLI/Unb-3fF2epI/AAAAAAAAGyk/xiCdT2lrmt0/s1600/screenshot.20.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;42&quot; src=&quot;http://1.bp.blogspot.com/-6XeBVdkAhLI/Unb-3fF2epI/AAAAAAAAGyk/xiCdT2lrmt0/s400/screenshot.20.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-v1QEq59aktA/Unb-37mX0PI/AAAAAAAAGyw/Awaq0u7Yk20/s1600/screenshot.21.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;42&quot; src=&quot;http://2.bp.blogspot.com/-v1QEq59aktA/Unb-37mX0PI/AAAAAAAAGyw/Awaq0u7Yk20/s400/screenshot.21.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-SFbE_RwclQI/Unb-4QjQP9I/AAAAAAAAGy4/0uO8Fa6IAgc/s1600/screenshot.23.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;http://3.bp.blogspot.com/-SFbE_RwclQI/Unb-4QjQP9I/AAAAAAAAGy4/0uO8Fa6IAgc/s400/screenshot.23.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-HIc1tsueS5M/Unb-4zcvciI/AAAAAAAAGzE/j-9dti5GwYQ/s1600/screenshot.24.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;73&quot; src=&quot;http://4.bp.blogspot.com/-HIc1tsueS5M/Unb-4zcvciI/AAAAAAAAGzE/j-9dti5GwYQ/s400/screenshot.24.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-8gB3t75lMuo/Unb-5vakMTI/AAAAAAAAGzM/ulqPE1e7Y14/s1600/screenshot.25.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;72&quot; src=&quot;http://4.bp.blogspot.com/-8gB3t75lMuo/Unb-5vakMTI/AAAAAAAAGzM/ulqPE1e7Y14/s400/screenshot.25.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;4 - Insert the appropriate code in each method:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;textarea style=&quot;height: 800px; margin: 2px; width: 580px;&quot;&gt;method COPY_FILE.

data: l_file_from type string,
      l_path_from type string,
      l_file_to   type string,
      l_path_to   type string.


  l_file_from = i_file_from.
  l_path_from = i_path_from.
  if i_file_to is initial.
    l_file_to = i_file_from.
  endif.
  if i_path_to is initial.
    l_path_to = i_path_from.
  endif.
  if not l_file_from = l_file_to and not l_path_from = l_path_to.
    if i_desktop = &#39;X&#39;.
      copy_file_desktop( exporting  i_file_from = l_file_from
                                    i_file_to   = l_file_to
                                    i_path_from = l_path_from
                                    i_path_to   = l_path_to
                         exceptions error       = 1
                                    others      = 2 ).
    else.
      copy_file_server( exporting  i_file_from = l_file_from
                                   i_file_to   = l_file_to
                                   i_path_from = l_path_from
                                   i_path_to   = l_path_to
                        exceptions error       = 1
                                   others      = 2 ).
    endif.
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method COPY_FILE_DESKTOP.

data: l_file_from type string,
      l_file_to   type string.


  free: l_file_from, l_file_to.
  concatenate i_path_from i_file_from into l_file_from.
  concatenate i_path_to   i_file_to   into l_file_to.
  cl_gui_frontend_services=&gt;file_copy( exporting  source                = l_file_from
                                                  destination           = l_file_to
                                                  overwrite             = &#39;X&#39;
                                       exceptions cntl_error           = 1
                                                  error_no_gui         = 2
                                                  wrong_parameter      = 3
                                                  disk_full            = 4
                                                  access_denied        = 5
                                                  file_not_found       = 6
                                                  destination_exists   = 7
                                                  unknown_error        = 8
                                                  path_not_found       = 9
                                                  disk_write_protect   = 10
                                                  drive_not_ready      = 11
                                                  not_supported_by_gui = 12
                                                  others               = 13 ).
  if not sy-subrc is initial.
    raise error.
  endif.
  clear: l_file_from, l_file_to.
  free:  l_file_from, l_file_to.

endmethod.
method COPY_FILE_SERVER.

data: l_file_from   type string,
      l_file_to     type string,
      l_file_line   type dxrawdata,
      l_line_length type i.


  clear: l_file_from, l_file_to, l_file_line, l_line_length.
  concatenate i_path_from i_file_from into l_file_from.
  concatenate i_path_to   i_file_to   into l_file_to.
  open dataset l_file_from for input in binary mode.
  if sy-subrc is initial.
    open dataset l_file_to for output in binary mode.
    if sy-subrc is initial.
      read dataset l_file_from into l_file_line actual length l_line_length.
      if sy-subrc is initial.
        transfer l_file_line to l_file_to length l_line_length.
      else.
        close dataset l_file_from.
        close dataset l_file_to.
      endif.
    else.
      close dataset l_file_from.
      raise error.
    endif.
  else.
    raise error.
  endif.
  clear: l_file_from, l_file_to, l_file_line, l_line_length.
  free:  l_file_from, l_file_to, l_file_line, l_line_length.

endmethod.
method DELETE_FILE.

  if i_desktop = &#39;X&#39;.
    delete_file_desktop( exporting  i_file = i_file
                                    i_path = i_path
                         exceptions error  = 1
                                    others = 2 ).
  else.
    delete_file_server( exporting  i_file = i_file
                                   i_path = i_path
                        exceptions error  = 1
                                   others = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method DELETE_FILE_DESKTOP.

data: l_file type string,
      l_rc   type i.


  clear: l_file, l_rc.

  concatenate i_file i_path into l_file.
  cl_gui_frontend_services=&gt;file_delete( exporting  filename             = l_file
                                         changing   rc                   = l_rc
                                         exceptions file_delete_failed   = 1
                                                    cntl_error           = 2
                                                    error_no_gui         = 3
                                                    file_not_found       = 4
                                                    access_denied        = 5
                                                    unknown_error        = 6
                                                    not_supported_by_gui = 7
                                                    wrong_parameter      = 8
                                                    others               = 9 ).
  if not sy-subrc is initial.
    raise error.
  endif.
  clear: l_file, l_rc.
  free:  l_file, l_rc.

endmethod.
method DELETE_FILE_SERVER.

data: l_file type string.

  clear: l_file.

  concatenate i_path i_file into l_file.
  call function &#39;ISH_N2_DELETE_FILE_APP_SERVER&#39;
    exporting
      ss_file = l_file
    exceptions
      error   = 1
      others  = 2.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

  clear: l_file. free: l_file.

endmethod.
method DOWNLOAD.

  if i_desktop = &#39;X&#39;.
    download_desktop( exporting  i_file   = i_file
                                 i_path   = i_path
                      importing  et_table = et_table
                      exceptions error    = 1
                                 others   = 2 ).
  else.
    download_server( exporting  i_file   = i_file
                                i_path   = i_path
                     importing  et_table = et_table
                     exceptions error    = 1
                                others   = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method DOWNLOAD_DESKTOP.

data: l_file type string,
      l_type(10).


  clear: l_file, l_type.

  cl_gui_frontend_services=&gt;gui_download( exporting  filename                = l_file
                                                     filetype                = l_type
                                          changing   data_tab                = et_table
                                          exceptions file_write_error        = 1
                                                     no_batch                = 2
                                                     gui_refuse_filetransfer = 3
                                                     invalid_type            = 4
                                                     no_authority            = 5
                                                     unknown_error           = 6
                                                     header_not_allowed      = 7
                                                     separator_not_allowed   = 8
                                                     filesize_not_allowed    = 9
                                                     header_too_long         = 10
                                                     dp_error_create         = 11
                                                     dp_error_send           = 12
                                                     dp_error_write          = 13
                                                     unknown_dp_error        = 14
                                                     access_denied           = 15
                                                     dp_out_of_memory        = 16
                                                     disk_full               = 17
                                                     dp_timeout              = 18
                                                     file_not_found          = 19
                                                     dataprovider_exception  = 20
                                                     control_flush_error     = 21
                                                     not_supported_by_gui    = 22
                                                     error_no_gui            = 23
                                                     others                  = 24 ).
  if not sy-subrc is initial.
    raise ERROR.
  endif.

  clear: l_file, l_type.
  free:  l_file, l_type.

endmethod.
method DOWNLOAD_SERVER.

data: l_file type string.

field-symbols: &lt;lt_table&gt;     type standard table,
               &lt;l_table_line&gt; type any.


  clear: l_file.

  assign et_table to &lt;lt_table&gt;.
  concatenate i_path i_file into l_file.
  if i_type = &#39;BIN&#39;.
    open dataset l_file for output in binary mode.
  else.
    open dataset l_file for output in text mode encoding default.
  endif.

  if sy-subrc is initial.
    loop at &lt;lt_table&gt; assigning &lt;l_table_line&gt;.
      transfer &lt;l_table_line&gt; to l_file.
      if not sy-subrc is initial.
        close dataset l_file.
        exit.
      endif.
    endloop.
  else.
    raise ERROR.
  endif.

  clear: l_file. free: l_file.

endmethod.
method MOVE_FILE.

  if i_desktop = &#39;X&#39;.
    move_file_desktop( exporting  i_file      = i_file
                                  i_path_from = i_path_from
                                  i_path_to   = i_path_to
                       exceptions error       = 1
                                  others      = 2 ).
  else.
    move_file_server( exporting  i_file      = i_file
                                 i_path_from = i_path_from
                                 i_path_to   = i_path_to
                      exceptions error       = 1
                                 others      = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method MOVE_FILE_DESKTOP.

  copy_file_desktop( exporting  i_file_from = i_file
                                i_path_from = i_path_from
                                i_file_to   = i_file
                                i_path_to   = i_path_to
                     exceptions error       = 1
                                others      = 2 ).
  if sy-subrc is initial.
    delete_file_desktop( exporting  i_file = i_file
                                    i_path = i_path_from
                         exceptions error  = 1
                                    others = 2 ).
    if not sy-subrc is initial.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.
endmethod.
method MOVE_FILE_SERVER.

  copy_file_server( exporting  i_file_from = i_file
                               i_path_from = i_path_from
                               i_file_to   = i_file
                               i_path_to   = i_path_to
                    exceptions error       = 1
                               others      = 2 ).
  if sy-subrc is initial.
    delete_file_server( exporting  i_file = i_file
                                   i_path = i_path_from
                        exceptions error  = 1
                                   others = 2 ).
    if not sy-subrc is initial.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.

endmethod.
method SELECT_FILE.

  if i_desktop = &#39;X&#39;.
    select_file_desktop( exporting  i_mask  = i_mask
                         changing   ch_file = ch_file
                                    ch_path = ch_path
                         exceptions error   = 1
                                    others  = 2 ).
  else.
    select_file_server( exporting  i_mask  = i_mask
                        changing   ch_file = ch_file
                                   ch_path = ch_path
                        exceptions error   = 1
                                   others  = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method SELECT_FILE_DESKTOP.

data: lt_file_table     type filetable,
      l_file_table_line like line of lt_file_table,
      l_file            type string,
      l_rc              type i.


  cl_gui_frontend_services=&gt;file_open_dialog( exporting  window_title            = &#39;&#39;
                                                         default_filename        = ch_file
                                                         initial_directory       = ch_path
                                                         multiselection          = &#39; &#39;
                                              changing   file_table              = lt_file_table
                                                         rc                      = l_rc
                                              exceptions file_open_dialog_failed = 1
                                                         cntl_error              = 2
                                                         error_no_gui            = 3
                                                         not_supported_by_gui    = 4
                                                         others                  = 5 ).
  if sy-subrc is initial.
    read table lt_file_table index 1 into l_file_table_line.
    if sy-subrc is initial.
      l_file = l_file_table_line.
      split_path_desktop( exporting  i_file = l_file
                          importing  e_file = ch_file
                                     e_path = ch_path
                          exceptions error  = 1
                                     others = 2 ).
      if not sy-subrc is initial.
        raise ERROR.
      endif.
    else.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.

endmethod.
method SELECT_FILE_SERVER.

data: l_file type string.


  clear: l_file.

  call function &#39;/SAPDMC/LSM_F4_SERVER_FILE&#39;
    exporting
      directory        = ch_path
*     filemask         = &#39; &#39;
    importing
      serverfile       = l_file
    exceptions
      canceled_by_user = 1
      others           = 2.
  if sy-subrc is initial.
    split_path_server( exporting  i_file = l_file
                       importing  e_file = ch_file
                                  e_path = ch_path
                       exceptions error  = 1
                                  others = 2 ).
    if not sy-subrc is initial.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.
  clear: l_file.
  free:  l_file.

endmethod.
method SELECT_PATH.

  if i_desktop = &#39;X&#39;.
    select_path_desktop( changing   ch_path = ch_path
                         exceptions error   = 1
                                    others  = 2 ).
  else.
    select_path_server( changing   ch_path = ch_path
                        exceptions error   = 1
                                   others  = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method SELECT_PATH_DESKTOP.

  cl_gui_frontend_services=&gt;directory_browse( exporting  window_title         = &#39;&#39;
                                                         initial_folder       = ch_path
                                              changing   selected_folder      = ch_path
                                              exceptions cntl_error           = 1
                                                         error_no_gui         = 2
                                                         not_supported_by_gui = 3
                                                         others               = 4 ).
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method SELECT_PATH_SERVER.

data: l_file type string.

  clear: l_file.
  select_file_server( changing   ch_file = l_file
                                 ch_path = ch_path
                      exceptions error   = 1
                                 others  = 2 ).
  if not sy-subrc is initial.
    raise ERROR.
  endif.
  clear: l_file. free: l_file.

endmethod.
method SPLIT_PATH.

  if i_desktop = &#39;X&#39;.
    split_path_desktop( exporting  i_file = i_file
                        importing  e_file = e_file
                                   e_path = e_path
                        exceptions error  = 1
                                   others = 2 ).
  else.
    split_path_server( exporting  i_file = i_file
                       importing  e_file = e_file
                                  e_path = e_path
                       exceptions error  = 1
                                  others = 2 ).

  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method SPLIT_PATH_DESKTOP.

data: lt_path type table of string,
      l_path  like line of lt_path,
      l_lines type i,
      l_separator.

  clear: l_lines, l_separator, l_path, lt_path, lt_path[].

  cl_gui_frontend_services=&gt;get_file_separator( changing   file_separator       = l_separator
                                                exceptions cntl_error           = 1
                                                           error_no_gui         = 2
                                                           not_supported_by_gui = 3
                                                           others               = 4 ).
  if sy-subrc is initial.
    split i_file at l_separator into table lt_path.
    describe table lt_path lines l_lines.
    read table lt_path into l_path index l_lines.
    if sy-subrc is initial.
      e_file = l_path.
      delete lt_path index l_lines.
      loop at lt_path into l_path.
        if sy-tabix = 1.
          concatenate l_path l_separator into e_path.
        else.
          concatenate e_path l_path l_separator into e_path.
        endif.
      endloop.
    else.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.

  clear: l_lines, l_separator, l_path, lt_path, lt_path[].
  free:  l_lines, l_separator, l_path, lt_path, lt_path[].

endmethod.
method SPLIT_PATH_SERVER.

data: lt_path type table of string,
      l_path  like line of lt_path,
      l_lines type i,
      l_separator.


  clear: l_lines, l_separator, l_path, lt_path, lt_path[].

  call function &#39;WSAF_BUILD_SEPARATOR&#39;
    importing
      separator                  = l_separator
    exceptions
      separator_not_maintained   = 1
      wrong_call                 = 2
      wsaf_config_not_maintained = 3
      others                     = 4.
  if sy-subrc is initial.
    split i_file at l_separator into table lt_path.
    describe table lt_path lines l_lines.
    read table lt_path into l_path index l_lines.
    if sy-subrc is initial.
      e_file = l_path.
      delete lt_path index l_lines.
      loop at lt_path into l_path.
        if sy-tabix = 1.
          concatenate l_path l_separator into e_path.
        else.
          concatenate e_path l_path l_separator into e_path.
        endif.
      endloop.
    else.
      raise ERROR.
    endif.
  else.
    raise ERROR.
  endif.

  clear: l_lines, l_separator, l_path, lt_path, lt_path[].
  free:  l_lines, l_separator, l_path, lt_path, lt_path[].

endmethod.
method UPLOAD.

  if i_desktop = &#39;X&#39;.
    upload_desktop( exporting  i_type   = i_type
                               i_path   = i_path
                               i_file   = i_file
                    importing  et_table = et_table
                    exceptions error    = 1
                               others   = 2 ).
  else.
    upload_server( exporting  i_type   = i_type
                              i_path   = i_path
                              i_file   = i_file
                   importing  et_table = et_table
                   exceptions error    = 1
                              others   = 2 ).
  endif.
  if not sy-subrc is initial.
    raise ERROR.
  endif.

endmethod.
method UPLOAD_DESKTOP.

data: l_file type string,
      l_type(10).


  clear: l_file, l_type.

  concatenate i_path i_file into l_file.
  case i_type.
    when &#39;ASC&#39;. l_type = &#39;ASC&#39;.
    when &#39;BIN&#39;. l_type = &#39;BIN&#39;.
  endcase.
  cl_gui_frontend_services=&gt;gui_upload( exporting  filename                = l_file
                                                   filetype                = l_type
                                        changing   data_tab                = et_table
                                        exceptions file_open_error         = 1
                                                   file_read_error         = 2
                                                   no_batch                = 3
                                                   gui_refuse_filetransfer = 4
                                                   invalid_type            = 5
                                                   no_authority            = 6
                                                   unknown_error           = 7
                                                   bad_data_format         = 8
                                                   header_not_allowed      = 9
                                                   separator_not_allowed   = 10
                                                   header_too_long         = 11
                                                   unknown_dp_error        = 12
                                                   access_denied           = 13
                                                   dp_out_of_memory        = 14
                                                   disk_full               = 15
                                                   dp_timeout              = 16
                                                   not_supported_by_gui    = 17
                                                   error_no_gui            = 18
                                                   others                  = 19 ).
  if not sy-subrc is initial.
    raise ERROR.
  endif.
  clear: l_file, l_type.
  free:  l_file, l_type.

endmethod.
method UPLOAD_SERVER.

data: l_file       type string,
      l_file_line  type dxrawdata,
      l_table_line type ref to data.

field-symbols: &lt;lt_table&gt;     type standard table,
               &lt;l_table_line&gt; type any.


  clear: l_file, l_file_line, l_table_line.

  assign et_table to &lt;lt_table&gt;.
  create data l_table_line like line of &lt;lt_table&gt;.
  assign l_table_line to &lt;l_table_line&gt;.
  concatenate i_path i_file into l_file.
  if i_type = &#39;BIN&#39;.
    open dataset l_file for input in binary mode.
  else.
    open dataset l_file for input in text mode encoding default.
  endif.

  if sy-subrc is initial.
    read dataset l_file into l_file_line.
    if sy-subrc is initial.
      &lt;l_table_line&gt; = l_file_line.
      append &lt;l_table_line&gt; to &lt;lt_table&gt;.
    else.
      close dataset l_file.
    endif.
  else.
    raise ERROR.
  endif.

  clear: l_file, l_file_line, l_table_line.
  free:  l_file, l_file_line, l_table_line.

endmethod.
&lt;/textarea&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/8047305441731092842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/abap-file-operations-desktop-and-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8047305441731092842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8047305441731092842'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/abap-file-operations-desktop-and-server.html' title='ABAP File Operations : Desktop and Server'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-u5VKKtT5r2w/Unb3yg6mo9I/AAAAAAAAGw0/Yo0hatQgBlY/s72-c/screenshot.1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-331835779606889119</id><published>2013-11-01T00:57:00.004+00:00</published><updated>2013-11-04T14:16:10.710+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Calculation"/><category scheme="http://www.blogger.com/atom/ns#" term="Class"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><category scheme="http://www.blogger.com/atom/ns#" term="Operation"/><category scheme="http://www.blogger.com/atom/ns#" term="SAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Week"/><title type='text'>ABAP Week Operations</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Some SAP objects must deal with week periods. Here I&#39;ll show a small class to deal with some of the needs that arise when making calculations with week periods. This class makes simplier to use only one object to provide the needed calculations with weeks. As usual, there is allways room for improvement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 - Create the Class:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-eFIVQDy4dV4/UnL7XIskFOI/AAAAAAAAGuo/qcOt4VK4D3s/s1600/screenshot.1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; src=&quot;http://4.bp.blogspot.com/-eFIVQDy4dV4/UnL7XIskFOI/AAAAAAAAGuo/qcOt4VK4D3s/s400/screenshot.1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 - Create the Methods:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-gtcd3yQ-fno/UnL7XLCfR6I/AAAAAAAAGu4/dOFwliMdcvI/s1600/screenshot.2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;88&quot; src=&quot;http://3.bp.blogspot.com/-gtcd3yQ-fno/UnL7XLCfR6I/AAAAAAAAGu4/dOFwliMdcvI/s400/screenshot.2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 - Define Methods Parameters&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-t-0mxcsgBgM/UnL7XLCKftI/AAAAAAAAGu0/PpXy9VDCXlg/s1600/screenshot.3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-t-0mxcsgBgM/UnL7XLCKftI/AAAAAAAAGu0/PpXy9VDCXlg/s1600/screenshot.3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-oly4_Q3XKC0/UnL7a04XF6I/AAAAAAAAGvU/foywwMNNQtA/s1600/screenshot.4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-oly4_Q3XKC0/UnL7a04XF6I/AAAAAAAAGvU/foywwMNNQtA/s1600/screenshot.4.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-CnpC5gvLIo0/UnL7a4ZLi1I/AAAAAAAAGvM/FYI0BW70TFU/s1600/screenshot.5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-CnpC5gvLIo0/UnL7a4ZLi1I/AAAAAAAAGvM/FYI0BW70TFU/s1600/screenshot.5.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-0V-qpiwJJYQ/UnL7YJp8eXI/AAAAAAAAGvA/dSSVSDS32EA/s1600/screenshot.6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-0V-qpiwJJYQ/UnL7YJp8eXI/AAAAAAAAGvA/dSSVSDS32EA/s1600/screenshot.6.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-tNGXa3kFtHA/UnL7cnvnz3I/AAAAAAAAGvg/N27W9W6YL7s/s1600/screenshot.7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-tNGXa3kFtHA/UnL7cnvnz3I/AAAAAAAAGvg/N27W9W6YL7s/s1600/screenshot.7.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/--LlV6_6Lg_Q/UnL7bQlVBSI/AAAAAAAAGvY/y7WPF27FR5w/s1600/screenshot.8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/--LlV6_6Lg_Q/UnL7bQlVBSI/AAAAAAAAGvY/y7WPF27FR5w/s1600/screenshot.8.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;4 - Insert the code in the appropriate methods:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;ADD_NUMBER&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;:&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;type&amp;nbsp;&lt;/span&gt;dats&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;do&amp;nbsp;&lt;/span&gt;im_numb&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;times&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;get_first_day&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;ch_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;L0S32&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ch_week&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;get_from_day&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;enddo&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;DIFFERENCE&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;if&amp;nbsp;&lt;/span&gt;im_week2&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;im_week1&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;re_no_weeks&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;im_week1+4&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S70&quot;&gt;-&amp;nbsp;&lt;/span&gt;im_week2+4&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;elseif&amp;nbsp;&lt;/span&gt;im_week1&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;&amp;gt;&amp;nbsp;im_week2&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;re_no_weeks&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_week1&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S70&quot;&gt;-&amp;nbsp;&lt;/span&gt;im_week2&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;*&amp;nbsp;&lt;span class=&quot;L0S32&quot;&gt;52&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;+&amp;nbsp;im_week1+4&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S70&quot;&gt;-&amp;nbsp;&lt;/span&gt;im_week2+4&lt;span class=&quot;L0S55&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;clear&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;:&amp;nbsp;&lt;/span&gt;re_no_weeks&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;endif&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;L0S55&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;
&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;GET_FIRST_DAY&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;call&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S52&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S33&quot;&gt;&#39;WEEK_GET_FIRST_DAY&#39;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;exporting&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;week&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;im_week&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;importing&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;re_day&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;exceptions&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;week_invalid&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;others&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;
&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;GET_FROM_DAY&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;call&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S52&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S33&quot;&gt;&#39;DATE_GET_WEEK&#39;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;exporting&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;im_day&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;importing&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;week&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;re_week&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;exceptions&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;date_invalid&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;others&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;
&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;GET_LAST_DAY&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;re_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;get_first_day&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;im_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;)&amp;nbsp;&lt;/span&gt;+&amp;nbsp;&lt;span class=&quot;L0S32&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span class=&quot;L0S55&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;
&lt;span class=&quot;L0S52&quot;&gt;method&amp;nbsp;&lt;/span&gt;SUBTRACT_NUMBER&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;:&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;type&amp;nbsp;&lt;/span&gt;dats&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;do&amp;nbsp;&lt;/span&gt;im_numb&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;times&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;get_first_day&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;ch_week&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;&lt;span class=&quot;L0S70&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;L0S32&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ch_week&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;get_from_day&lt;span class=&quot;L0S55&quot;&gt;(&amp;nbsp;&lt;/span&gt;im_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;=&amp;nbsp;&lt;/span&gt;l_first_day&amp;nbsp;&lt;span class=&quot;L0S55&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;L0S52&quot;&gt;enddo&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;L0S52&quot;&gt;endmethod&lt;/span&gt;&lt;span class=&quot;L0S55&quot;&gt;.&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/331835779606889119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/week-calculations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/331835779606889119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/331835779606889119'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/11/week-calculations.html' title='ABAP Week Operations'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-eFIVQDy4dV4/UnL7XIskFOI/AAAAAAAAGuo/qcOt4VK4D3s/s72-c/screenshot.1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-8104834318519205743</id><published>2013-10-31T01:12:00.001+00:00</published><updated>2013-11-02T00:40:32.918+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="ALV"/><category scheme="http://www.blogger.com/atom/ns#" term="Email"/><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><title type='text'>Convert ALV to Excel and send it by email</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;One of the most requested abilities for an report is the possibility to run it as a job and send the output to a given user. However, the spool output of most ALV reports is unusable as is. To solve this problem, I&#39;ll show a simple class that takes an internal table, a fieldcatalog and a user email to create a xml excel file from the field catalog with the contents of the internal table and forward it to the email supplied.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I should warn that the excel output isn&#39;t something fancy. It&#39;s just a simple table. The class can be greatly enhanced.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 - Create a class:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Arial, Helvetica, sans-serif; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;http://3.bp.blogspot.com/-8HXWoelghxY/UnGr4umEChI/AAAAAAAAGtU/BRYAF_OGfNg/s400/screenshot.23.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 - Create the class atributes:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Arial, Helvetica, sans-serif; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;27&quot; src=&quot;http://3.bp.blogspot.com/-RzfZ13Edu5M/UnGr7N52niI/AAAAAAAAGtc/VTstJ8n4Xsg/s400/screenshot.24.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 - Create the class methods:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-SM8vHjqN7fs/UnGr7HbMLqI/AAAAAAAAGtg/73Z_JO9Ev1k/s1600/screenshot.25.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;190&quot; src=&quot;http://2.bp.blogspot.com/-SM8vHjqN7fs/UnGr7HbMLqI/AAAAAAAAGtg/73Z_JO9Ev1k/s400/screenshot.25.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;4 - Create the method parameters:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-5z4ojg4At30/UnGtEQeC8qI/AAAAAAAAGtw/LamObD7ZQkc/s1600/screenshot.26.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;http://1.bp.blogspot.com/-5z4ojg4At30/UnGtEQeC8qI/AAAAAAAAGtw/LamObD7ZQkc/s400/screenshot.26.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-izaPcuYNimo/UnGtEdKlprI/AAAAAAAAGuM/JmeoEGmMsMM/s1600/screenshot.27.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;122&quot; src=&quot;http://1.bp.blogspot.com/-izaPcuYNimo/UnGtEdKlprI/AAAAAAAAGuM/JmeoEGmMsMM/s400/screenshot.27.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-03q5agvs8-I/UnGtEVQyJFI/AAAAAAAAGts/qeu2JZXZoRY/s1600/screenshot.28.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;58&quot; src=&quot;http://2.bp.blogspot.com/-03q5agvs8-I/UnGtEVQyJFI/AAAAAAAAGts/qeu2JZXZoRY/s400/screenshot.28.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-wXRNOM7nM2w/UnGtE_SHYFI/AAAAAAAAGt0/Z_4-pwouFWI/s1600/screenshot.29.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;64&quot; src=&quot;http://2.bp.blogspot.com/-wXRNOM7nM2w/UnGtE_SHYFI/AAAAAAAAGt0/Z_4-pwouFWI/s400/screenshot.29.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-K9pBy3wlgwU/UnGtFF-ERYI/AAAAAAAAGuI/bsrv04uN9Cg/s1600/screenshot.30.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;61&quot; src=&quot;http://3.bp.blogspot.com/-K9pBy3wlgwU/UnGtFF-ERYI/AAAAAAAAGuI/bsrv04uN9Cg/s400/screenshot.30.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-FTzlBi8gk3w/UnGtFHI6-OI/AAAAAAAAGuE/XDPmC5sKewM/s1600/screenshot.31.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;60&quot; src=&quot;http://4.bp.blogspot.com/-FTzlBi8gk3w/UnGtFHI6-OI/AAAAAAAAGuE/XDPmC5sKewM/s400/screenshot.31.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;5 - Insert the appropriate code in each method:&lt;/span&gt;&lt;br /&gt;
&lt;textarea style=&quot;height: 705px; margin: 2px; width: 500px;&quot;&gt;method CLOSE.

data: l_xml_line like line of wt_xml.


  clear: l_xml_line.

  l_xml_line = im_element.
  append l_xml_line to wt_xml.

  clear: l_xml_line. free: l_xml_line.

endmethod.
method CLOSE_ROW.

  close( im_element = &#39;&lt;/Row&gt;&#39; ).

endmethod.
method CLOSE_TABLE.

  close( im_element = &#39;&lt;/Table&gt;&#39; ).

endmethod.
method CLOSE_WORKSHEET.

  close( im_element = &#39;&lt;/Worksheet&gt;&#39; ).

endmethod.
method CLOSE_XML_HEADER.

  close( im_element = &#39;&lt;/Workbook&gt;&#39; ).

endmethod.
method CONVERT_TABLE_TO_EXCEL_XML.

* Excel XML file created according to: http://wiki.sdn.sap.com/wiki/display/Snippets/XML+TAGS+simplifies+Excel+Download

data: l_formated_value(255),
      l_num_columns type i,
      l_comp_idx    type sy-tabix.

field-symbols: &lt;l_data_line&gt;    type any,
               &lt;l_value&gt;        type any,
               &lt;l_fieldcatalog&gt; type any,
               &lt;l_fieldname&gt;    type any,
               &lt;l_table_name&gt;   type any,
               &lt;l_field_name&gt;   type any,
               &lt;l_xml_line&gt;     type any,
               &lt;l_xml&gt;          like line of wt_xml.


  clear: l_num_columns, l_formated_value, l_comp_idx, wt_xml, wt_xml[].

  describe table it_fieldcatalog lines l_num_columns.
  open_xml_header( ).
    open_worksheet( im_name = &#39;PO Report&#39; ).
      open_table( ).
        loop at it_data assigning &lt;l_data_line&gt;.
          if sy-tabix = 1.
            open_row( ).
              loop at it_fieldcatalog assigning &lt;l_fieldcatalog&gt;.
                assign component &#39;SELTEXT_M&#39; of structure &lt;l_fieldcatalog&gt; to &lt;l_value&gt;.
                if not sy-subrc is initial.
                  assign component &#39;SCRTEXT_M&#39; of structure &lt;l_fieldcatalog&gt; to &lt;l_value&gt;.
                endif.
                if &lt;l_value&gt; is assigned.
                  if &lt;l_value&gt; is initial.
                    assign component &#39;REF_TABNAME&#39;   of structure &lt;l_fieldcatalog&gt; to &lt;l_table_name&gt;.
                    if &lt;l_table_name&gt; is assigned.
                      assign component &#39;REF_FIELDNAME&#39; of structure &lt;l_fieldcatalog&gt; to &lt;l_field_name&gt;.
                      if &lt;l_field_name&gt; is assigned.
                        select single scrtext_m into &lt;l_value&gt; from dd03m
                                where tabname    = &lt;l_table_name&gt;
                                  and fieldname  = &lt;l_field_name&gt;
                                  and ddlanguage = sy-langu.
                      endif.
                    endif.
                  endif.
                  insert_cell( exporting im_value = &lt;l_value&gt; ).
                endif.
              endloop.
            close_row( ).
          endif.
          open_row( ).
            if it_fieldcatalog[] is initial.
              clear: l_comp_idx.
              do.
                add 1 to l_comp_idx.
                assign component l_comp_idx of structure &lt;l_data_line&gt; to &lt;l_value&gt;.
                if sy-subrc is initial.
                  write: &lt;l_value&gt; to l_formated_value.
                  shift l_formated_value left deleting leading space.
                  if &lt;l_value&gt; is initial.
                    clear: l_formated_value.
                  endif.
                  insert_cell( exporting im_value = l_formated_value ).
                else.
                  exit.
                endif.
              enddo.
            else.
              loop at it_fieldcatalog assigning &lt;l_fieldcatalog&gt;.
                assign component &#39;FIELDNAME&#39; of structure &lt;l_fieldcatalog&gt; to &lt;l_fieldname&gt;.
                if sy-subrc is initial.
                  assign component &lt;l_fieldname&gt; of structure &lt;l_data_line&gt; to &lt;l_value&gt;.
                  if sy-subrc is initial.
                    write: &lt;l_value&gt; to l_formated_value.
                    shift l_formated_value left deleting leading space.
                    if &lt;l_value&gt; is initial.
                      clear: l_formated_value.
                    endif.
                    insert_cell( exporting im_value = l_formated_value ).
                  endif.
                endif.
              endloop.
            endif.
          close_row( ).
        endloop.
      close_table( ).
    close_worksheet( ).
  close_xml_header( ).


data: l_xml_line type ref to data.
  create data l_xml_line like line of et_xml.
  assign l_xml_line-&gt;* to &lt;l_xml_line&gt;.
  if sy-subrc is initial.
    loop at wt_xml assigning &lt;l_xml&gt;.
      &lt;l_xml_line&gt; = &lt;l_xml&gt;.
      insert &lt;l_xml_line&gt; into table et_xml.
      clear: &lt;l_xml_line&gt;.
    endloop.
  endif.

  clear: l_num_columns, l_formated_value, l_comp_idx, wt_xml, wt_xml[].
  free:  l_num_columns, l_formated_value, l_comp_idx, wt_xml, wt_xml[].

endmethod.
method INSERT_CELL.

data: l_data(128).


  clear: l_data.

  open( im_element = &#39;&lt;cell&gt;&#39;).
    concatenate &#39;&lt;data ss:Type=&quot;String&quot;&gt;&#39; im_value into l_data.
    open( im_element = l_data ).
    close( im_element = &#39;&lt;/Data&gt;&#39; ).
  close( im_element = &#39;&lt;/Cell&gt;&#39; ).

  clear: l_data. free: l_data.

endmethod.
method OPEN.

data: l_xml_line like line of wt_xml.


  clear: l_xml_line.

  l_xml_line = im_element.
  append l_xml_line to wt_xml.

  clear: l_xml_line. free: l_xml_line.

endmethod.
method OPEN_ROW.

  open( im_element = &#39;&lt;row&gt;&#39; ).

endmethod.
method OPEN_TABLE.

  open( im_element = &#39;&lt;table&gt;&#39; ).

endmethod.
method OPEN_WORKSHEET.

data: l_data(128).


  clear: l_data.

  l_data = &#39;&lt;worksheet ss:Name=&quot;&amp;&quot;&gt;&#39;.
  replace &#39;&amp;&#39; with im_name into l_data.
  open( im_element = l_data ).

  clear: l_data. free: l_data.

endmethod.
method OPEN_XML_HEADER.

data: l_xml_line like line of wt_xml.


  clear: l_xml_line.

  l_xml_line = &#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;&lt;?mso-application progid=&quot;Excel.Sheet&quot;?&gt;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;&lt;workbook xmlns=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;xmlns:ss=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&#39;.
  append l_xml_line to wt_xml.
  l_xml_line = &#39;xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot;&gt;&#39;.
  append l_xml_line to wt_xml.

  clear: l_xml_line. free: l_xml_line.

endmethod.
method SEND_TABLE_AS_EXCEL_BY_EMAIL.

* mail sent as described here: http://forums.sdn.sap.com/thread.jspa?threadID=227475&amp;start=30&amp;tstart=0

data: lt_binary_content type solix_tab,
      lt_text           type bcsy_text,
      lt_xml            type srm_t_solisti1,
      l_sender          type ref to if_sender_bcs,
      l_recipient       type ref to if_recipient_bcs,
      l_send_request    type ref to cl_bcs,
      l_document        type ref to cl_document_bcs,
      l_xml_string      type string,
      l_xl_content      type xstring,
      l_subject         type so_obj_des,
      l_len             type sood-objlen,
      l_length          type i,
      l_atta_sub        type sood-objdes,
      begin of l_mail_address,
        ad_smtpadr type ad_smtpadr,
      end of l_mail_address.

field-symbols: &lt;l_xml&gt; like line of lt_xml.


  clear: lt_binary_content, lt_binary_content[], lt_text,  lt_text[],   lt_xml,     lt_xml[],
         l_send_request,    l_xl_content,        l_sender, l_recipient, l_document, l_xml_string,
         l_subject, l_len,  l_mail_address,      l_length, l_atta_sub.

  if im_filename is initial.
    raise NO_FILENAME.
  endif.
  if im_subject is initial.
    raise NO_SUBJECT.
  endif.
  if it_mail_addresses[] is initial.
    raise NO_RECEIVERS.
  endif.

  zcl_excel=&gt;convert_table_to_excel_xml( exporting it_data         = it_data
                                                   it_fieldcatalog = it_fieldcatalog
                                         importing et_xml          = lt_xml ).
  if not sy-subrc is initial.
    raise ERROR_GENERATING_XML.
  else.
    if lt_xml[] is initial.
      raise NO_XML.
    endif.

    loop at lt_xml assigning &lt;l_xml&gt;.
      if sy-tabix = 1.
        l_xml_string = &lt;l_xml&gt;.
      else.
        concatenate l_xml_string &lt;l_xml&gt; into l_xml_string separated by cl_abap_char_utilities=&gt;cr_lf.
      endif.
    endloop.
    call function &#39;SCMS_STRING_TO_XSTRING&#39;
      exporting
        text     = l_xml_string
        mimetype = &#39;text/xml; charset=utf-8&#39;
      importing
        buffer   = l_xl_content.
    concatenate cl_abap_char_utilities=&gt;byte_order_mark_utf8 l_xl_content into l_xl_content in byte mode.
    call function &#39;SCMS_XSTRING_TO_BINARY&#39;
      exporting
        buffer        = l_xl_content
      importing
        output_length = l_length
      tables
        binary_tab    = lt_binary_content.
    move: l_length to l_len .
    try.
      clear: l_send_request. free: l_send_request.

      l_send_request = cl_bcs=&gt;create_persistent( ).
      clear l_document .
      append &#39;Description&#39; TO lt_text.
      l_subject = im_subject.
      l_document = cl_document_bcs=&gt;create_document( i_type = &#39;HTM&#39; i_text = lt_text i_subject = l_subject ).
      l_atta_sub = im_filename.
      l_document-&gt;add_attachment( exporting  i_attachment_type    = &#39;xls&#39;
                                             i_attachment_subject = l_atta_sub
                                             i_attachment_size    = l_len
                                             i_att_content_hex    = lt_binary_content ).
      l_send_request-&gt;set_document( l_document ).

      CLEAR l_sender .
      l_sender = cl_cam_address_bcs=&gt;create_internet_address( &#39;po_report@sap.colepccl&#39; ).
      l_send_request-&gt;set_sender( exporting i_sender = l_sender ).
      loop at it_mail_addresses into l_mail_address.
        l_recipient = cl_cam_address_bcs=&gt;create_internet_address( l_mail_address-ad_smtpadr ).
        l_send_request-&gt;add_recipient( exporting i_recipient = l_recipient
                                                 i_express   = &#39;X&#39; ).
      endloop.
      l_send_request-&gt;set_status_attributes( exporting i_requested_status = &#39;E&#39;
                                                       i_status_mail      = &#39;E&#39; ).
      l_send_request-&gt;set_send_immediately( &#39;X&#39; ).
      if l_send_request-&gt;send( i_with_error_screen = &#39; &#39; ) = &#39;X&#39;.
        commit work.
      endif.
      catch cx_bcs.
        raise ERROR_SENDING_MAIL.
        exit.
    endtry.
  endif.

  clear: lt_binary_content, lt_binary_content[], lt_text,  lt_text[],   lt_xml,     lt_xml[],
         l_send_request,    l_xl_content,        l_sender, l_recipient, l_document, l_xml_string,
         l_subject, l_len,  l_mail_address,      l_length, l_atta_sub.
  free:  lt_binary_content, lt_binary_content[], lt_text,  lt_text[],   lt_xml,     lt_xml[],
         l_send_request,    l_xl_content,        l_sender, l_recipient, l_document, l_xml_string,
         l_subject, l_len,  l_mail_address,      l_length, l_atta_sub.

endmethod.
&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/8104834318519205743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/10/convert-alv-to-excel-and-send-it-by-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8104834318519205743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/8104834318519205743'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/10/convert-alv-to-excel-and-send-it-by-mail.html' title='Convert ALV to Excel and send it by email'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-8HXWoelghxY/UnGr4umEChI/AAAAAAAAGtU/BRYAF_OGfNg/s72-c/screenshot.23.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-4231345413546715360</id><published>2013-10-25T12:07:00.002+01:00</published><updated>2013-11-06T17:35:04.004+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><category scheme="http://www.blogger.com/atom/ns#" term="OLE"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="SAPI"/><category scheme="http://www.blogger.com/atom/ns#" term="Voice"/><title type='text'>Talking ABAP</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Just for fun, you can make sap talk to the user or, for more serious work, you can give hearing aids to alert the users for some event or to help them be more aware of what is happening.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;textarea style=&quot;height: 380px; margin: 2px; width: 580px;&quot;&gt;report ytest_lq00.

class lcl_speech definition.

  public section.

  methods: constructor,
           speak importing i_text type string.


  private section.

    data: w_voice type ole2_object.

endclass.
class lcl_speech implementation.

  method constructor.

    data: begin of l_data,
            ole   type ole2_object,
            voice type ole2_object,
          end of l_data.


      clear: w_voice. free: w_voice..
      create object w_voice &#39;SAPI.SpVoice&#39;.

  endmethod.

  method speak.

    data: l_ole type ole2_object.

    clear: l_ole. free: l_ole.
    if not w_voice is initial.
      call method of w_voice &#39;Speak&#39; = l_ole exporting #1 = i_text.
      free object l_ole.
    endif.
    clear: l_ole. free: l_ole.

  endmethod.

endclass.

start-of-selection.

data: l_speech type ref to lcl_speech.


  clear: l_speech. free: l_speech.
  if not l_speech is bound.
    create object l_speech.
  endif.
  if l_speech is bound.
    l_speech-&gt;speak( &#39;Hello!&#39; ).
    l_speech-&gt;speak( &#39;Let&#39;&#39;&#39;&#39;s speak a little bit.&#39; ).
    l_speech-&gt;speak( &#39;Goodbye!&#39; ).
    clear: l_speech. free: l_speech.
  endif.
&lt;/textarea&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As a final thought, I should say that, this is a simple example. As most of the times, you have plenty of room to improve.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Don&#39;t forget that this is an instanciation of a windows object. It will only work with SAP Gui for windows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Remark: depending on the security settings of your SAP GUI configuration, a popup can appear asking for authorization to instanciate a windows object.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/4231345413546715360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2013/10/talking-abap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/4231345413546715360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/4231345413546715360'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/10/talking-abap.html' title='Talking ABAP'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-4296746626529530754</id><published>2013-10-24T13:08:00.002+01:00</published><updated>2013-11-02T00:49:22.692+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Batch"/><category scheme="http://www.blogger.com/atom/ns#" term="generate"/><category scheme="http://www.blogger.com/atom/ns#" term="Input"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><title type='text'>Batch Input with Objects</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Some times, we get such a requirement that forces us to use batch input for creation/changing of some SAP object/document.
Usually, the resulting code isn&#39;t that elegant.
In this post, I&#39;ll show how to use a ABAP Class to process call transaction and allow to future improvements that afects every program that uses it, without the need to change those same programs.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Those improvements could be:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create Batch input in DB for latter processing&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create Enhanced Logs&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Start Workflows&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Etc&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 - Create an ABAP Class in transaction SE24, select an apropriate package:
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-8Mcz7NFS6BI/UmkKIH5hInI/AAAAAAAAGqI/PYExaswNRJM/s1600/screenshot.9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;247&quot; src=&quot;http://2.bp.blogspot.com/-8Mcz7NFS6BI/UmkKIH5hInI/AAAAAAAAGqI/PYExaswNRJM/s400/screenshot.9.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 - Create the following attributes:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-IQumsnC1HDM/UmkK5heMs-I/AAAAAAAAGqQ/g6NVIXXOSr4/s1600/screenshot.10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;http://2.bp.blogspot.com/-IQumsnC1HDM/UmkK5heMs-I/AAAAAAAAGqQ/g6NVIXXOSr4/s400/screenshot.10.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 - Create these methods:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-PIe_GjIrE8E/UmkLJMHMiRI/AAAAAAAAGqY/fDtPaT4_TaY/s1600/screenshot.11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;149&quot; src=&quot;http://3.bp.blogspot.com/-PIe_GjIrE8E/UmkLJMHMiRI/AAAAAAAAGqY/fDtPaT4_TaY/s400/screenshot.11.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-VB6j59SBZdc/UmkMPWOaqdI/AAAAAAAAGqk/MQtJFsQ_DUE/s1600/screenshot.13.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;49&quot; src=&quot;http://2.bp.blogspot.com/-VB6j59SBZdc/UmkMPWOaqdI/AAAAAAAAGqk/MQtJFsQ_DUE/s400/screenshot.13.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-rVFetCLLS2g/UmkMPbV9HfI/AAAAAAAAGqg/JXHu1GHaFbw/s1600/screenshot.14.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;65&quot; src=&quot;http://3.bp.blogspot.com/-rVFetCLLS2g/UmkMPbV9HfI/AAAAAAAAGqg/JXHu1GHaFbw/s400/screenshot.14.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-5PJcAiF1oYg/UmkMPXdmmfI/AAAAAAAAGq8/nz3heJsYUcs/s1600/screenshot.15.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;http://1.bp.blogspot.com/-5PJcAiF1oYg/UmkMPXdmmfI/AAAAAAAAGq8/nz3heJsYUcs/s400/screenshot.15.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-f2fQVhSh0kg/UmkMQBLaGWI/AAAAAAAAGqs/GbZWjCPtWjs/s1600/screenshot.17.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;67&quot; src=&quot;http://1.bp.blogspot.com/-f2fQVhSh0kg/UmkMQBLaGWI/AAAAAAAAGqs/GbZWjCPtWjs/s400/screenshot.17.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-UrtORyb7eKQ/UmkMP969ITI/AAAAAAAAGq4/hKYvmN4eJ3s/s1600/screenshot.16.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;50&quot; src=&quot;http://4.bp.blogspot.com/-UrtORyb7eKQ/UmkMP969ITI/AAAAAAAAGq4/hKYvmN4eJ3s/s400/screenshot.16.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;4 - Pick the relevant code for the each method:&lt;/span&gt;&lt;/div&gt;
&lt;textarea style=&quot;height: 484px; margin: 2px; width: 580px;&quot;&gt;method CONSTRUCTOR.

  clear: w_options, w_transaction, wt_bdcdata, wt_bdcdata[], wt_messages, wt_messages[].
  w_options-dismode  = im_dismode.
  w_options-updmode  = im_updmode.
  w_options-defsize  = im_defsize.
  w_options-racommit = im_racommit.
  w_transaction      = im_tcode.

endmethod.
method SET_CURSOR.

data: l_bdcdata like line of wt_bdcdata.


  clear: l_bdcdata.
  l_bdcdata-fnam = &#39;BDC_CURSOR&#39;.
  l_bdcdata-fval = im_field.
  append l_bdcdata to wt_bdcdata.
  clear: l_bdcdata.

endmethod.
method SET_FIELD.

data: l_bdcdata like line of wt_bdcdata.


  clear: l_bdcdata.
  l_bdcdata-fnam = im_field.
  l_bdcdata-fval = im_value.
  append l_bdcdata to wt_bdcdata.
  clear: l_bdcdata.

endmethod.
method SET_OKCODE.

data: l_bdcdata like line of wt_bdcdata.


  clear: l_bdcdata.
  l_bdcdata-fnam = &#39;BDC_OKCODE&#39;.
  l_bdcdata-fval = im_okcode.
  append l_bdcdata to wt_bdcdata.
  clear: l_bdcdata.

endmethod.
method SET_SCREEN.

data: l_bdcdata like line of wt_bdcdata.


  clear: l_bdcdata.
  l_bdcdata-program  = im_program.
  l_bdcdata-dynpro   = im_screen.
  l_bdcdata-dynbegin = &#39;X&#39;.
  append l_bdcdata to wt_bdcdata.
  clear: l_bdcdata.

endmethod.
method START.

field-symbols: &lt;l_message&gt; like line of wt_messages.


  call transaction w_transaction using wt_bdcdata options from w_options messages into wt_messages.
  if sy-subrc is initial.
    loop at wt_messages assigning &lt;l_message&gt; where msgtyp ca &#39;AXE&#39;.
      exit.
    endloop.
    if sy-subrc is initial.
      re_success = &#39; &#39;.
    else.
      re_success = &#39;X&#39;.
    endif.
  else.
    re_success = &#39; &#39;.
  endif.

endmethod.&lt;/textarea&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;5 - Save and activate the class.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;6 - To help generate the code, the following program can be used:&lt;/span&gt;&lt;br /&gt;
&lt;textarea style=&quot;height: 494px; margin: 2px; width: 580px;&quot;&gt;*&amp;---------------------------------------------------------------------*
*&amp; Report  Y_CREATE_BATCH_INPUT
*&amp;---------------------------------------------------------------------*
report zds_create_batch_input.

constants: c_data(132)    value &#39;data: &amp; type ref to zdsbc_batch_input.&#39;,
           c_clear(132)   value &#39;  clear: &amp;.&#39;,
           c_free(132)    value &#39;  free: &amp;.&#39;,
           c_create1(132) value &#39;  create object &amp;1 exporting im_tcode    = &#39;&#39;&amp;2&#39;&#39;.&#39;,
           c_create2(132) value &#39;*                            im_dismode  = &#39;&#39;N&#39;&#39;&#39;,
           c_create3(132) value &#39;*                            im_updmode  = &#39;&#39;S&#39;&#39;&#39;,
           c_create4(132) value &#39;*                            im_defsize  = &#39;&#39;X&#39;&#39;&#39;,
           c_create5(132) value &#39;*                            im_racommit = &#39;&#39;X&#39;&#39;&#39;,
           c_screen(132)  value &#39;  &amp;1-&gt;set_screen( exporting im_program = &#39;&#39;&amp;2&#39;&#39; im_screen = &#39;&#39;&amp;3&#39;&#39; ).&#39;,
           c_okcode(132)  value &#39;  &amp;1-&gt;set_okcode( exporting im_okcode  = &#39;&#39;&amp;2&#39;&#39; ).&#39;,
           c_cursor(132)  value &#39;  &amp;1-&gt;set_cursor( exporting im_field   = &#39;&#39;&amp;2&#39;&#39; ).&#39;,
           c_field(132)   value &#39;  &amp;1-&gt;set_field(  exporting im_field   = &#39;&#39;&amp;2&#39;&#39; im_value = &#39;&#39;&amp;3&#39;&#39; ).&#39;,
           c_run1(132)    value &#39;  if &amp;-&gt;start( ) = &#39;&#39;X&#39;&#39;.&#39;,
           c_run2(132)    value &#39;*   Success!!!&#39;,
           c_run3(132)    value &#39;  else.&#39;,
           c_run4(132)    value &#39;*   Error!!!&#39;,
           c_run5(132)    value &#39;  endif.&#39;,
           c_info(132)    value &#39;* messages in &amp;-&gt;wt_messages[].&#39;.


data: begin of wt_data occurs 0,
        line(132),
      end of wt_data.

data: wt_bdcdata type table of bdcdata.


parameters: p_record type apqi-groupid obligatory,
            p_object type char30       obligatory lower case.


start-of-selection.

data: l_qid    type apqi-qid,
      l_value  like line of wt_data,
      l_length type i.

field-symbols: &lt;l_bdcdata&gt; like line of wt_bdcdata.


  select single qid into l_qid from apqi where datatyp = &#39;%BDC&#39;
                                           and mandant = sy-mandt
                                           and groupid = p_record.
  if sy-subrc is initial.
    call function &#39;BDC_OBJECT_READ&#39;
      exporting
        queue_id         = l_qid
      tables
        dynprotab        = wt_bdcdata
      exceptions
        not_found        = 1
        system_failure   = 2
        invalid_datatype = 3
        others           = 4.
    if sy-subrc is initial.
      l_length = strlen( p_object ). l_value = c_data.  replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      clear: l_value. append l_value to wt_data.
      l_length = strlen( p_object ). l_value = c_clear. replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      l_length = strlen( p_object ). l_value = c_free.  replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      clear: l_value. append l_value to wt_data.
      loop at wt_bdcdata assigning &lt;l_bdcdata&gt;.
        if &lt;l_bdcdata&gt;-dynbegin = &#39;T&#39;.
          l_value = c_create1.
          l_length = strlen( p_object ). replace &#39;&amp;1&#39; with p_object(l_length)         into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-fnam ). replace &#39;&amp;2&#39; with &lt;l_bdcdata&gt;-fnam(l_length) into l_value.
          append l_value to wt_data.
          l_value = c_create2. append l_value to wt_data.
          l_value = c_create3. append l_value to wt_data.
          l_value = c_create4. append l_value to wt_data.
          l_value = c_create5. append l_value to wt_data.
        elseif &lt;l_bdcdata&gt;-dynbegin = &#39;X&#39;.
          l_value = c_screen.
          l_length = strlen( p_object ). replace &#39;&amp;1&#39; with p_object(l_length)            into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-program ). replace &#39;&amp;2&#39; with &lt;l_bdcdata&gt;-program(l_length) into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-dynpro ). replace &#39;&amp;3&#39; with &lt;l_bdcdata&gt;-dynpro(l_length)  into l_value.
          append l_value to wt_data.
        elseif &lt;l_bdcdata&gt;-fnam = &#39;BDC_OKCODE&#39;.
          l_value = c_okcode.
          l_length = strlen( p_object ). replace &#39;&amp;1&#39; with p_object(l_length)            into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-fval ). replace &#39;&amp;2&#39; with &lt;l_bdcdata&gt;-fval(l_length)    into l_value.
          append l_value to wt_data.
        elseif &lt;l_bdcdata&gt;-fnam = &#39;BDC_CURSOR&#39;.
          l_value = c_cursor.
          l_length = strlen( p_object ). replace &#39;&amp;1&#39; with p_object(l_length)            into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-fval ). replace &#39;&amp;2&#39; with &lt;l_bdcdata&gt;-fval(l_length)    into l_value.
          append l_value to wt_data.
        elseif &lt;l_bdcdata&gt;-fnam &lt;&gt; &#39;BDC_SUBSCR&#39;.
          shift &lt;l_bdcdata&gt;-fval left deleting leading space.
          l_value = c_field.
          l_length = strlen( p_object ). replace &#39;&amp;1&#39; with p_object(l_length)            into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-fnam ). replace &#39;&amp;2&#39; with &lt;l_bdcdata&gt;-fnam(l_length)    into l_value.
          l_length = strlen( &lt;l_bdcdata&gt;-fval ). replace &#39;&amp;3&#39; with &lt;l_bdcdata&gt;-fval(l_length)    into l_value.
          append l_value to wt_data.
        endif.
      endloop.
      l_value = c_run1.
      l_length = strlen( p_object ). replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      l_value = c_run2. append l_value to wt_data.
      l_value = c_run3. append l_value to wt_data.
      l_value = c_run4. append l_value to wt_data.
      l_value = c_run5. append l_value to wt_data.
      l_value = c_info.
      l_length = strlen( p_object ). replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      clear: l_value. append l_value to wt_data.
      l_length = strlen( p_object ). l_value = c_clear. replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      l_length = strlen( p_object ). l_value = c_free.  replace &#39;&amp;&#39; with p_object(l_length) into l_value. append l_value to wt_data.
      editor-call for wt_data display-mode.
    endif.
  else.

  endif.&lt;/textarea&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The input for this program is the SHDB record and the program variable name.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;7 - Example:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SHDB Record:&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-IKJakuwlUPU/UmkbUj8m1WI/AAAAAAAAGro/FefLDikauBw/s1600/screenshot.18.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;http://3.bp.blogspot.com/-IKJakuwlUPU/UmkbUj8m1WI/AAAAAAAAGro/FefLDikauBw/s400/screenshot.18.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: right;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;8 - Program Input&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-NFIzCmGgKFg/UmkbwHMToJI/AAAAAAAAGrw/8z6k07tg1b0/s1600/screenshot.19.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;http://1.bp.blogspot.com/-NFIzCmGgKFg/UmkbwHMToJI/AAAAAAAAGrw/8z6k07tg1b0/s400/screenshot.19.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;9 - Generated Code:&lt;/span&gt;&lt;br /&gt;
&lt;textarea style=&quot;height: 389px; margin: 2px; width: 580px;&quot;&gt;data: l_batch_input type ref to zdsbc_batch_input.

  clear: l_batch_input.
  free: l_batch_input.

  create object l_batch_input exporting im_tcode    = &#39;VL_COMPLETE&#39;.
*                            im_dismode  = &#39;N&#39;
*                            im_updmode  = &#39;S&#39;
*                            im_defsize  = &#39;X&#39;
*                            im_racommit = &#39;X&#39;
  l_batch_input-&gt;set_screen( exporting im_program = &#39;SHP_DELIVERY_COMPLETE&#39; im_screen = &#39;1000&#39; ).
  l_batch_input-&gt;set_cursor( exporting im_field   = &#39;S_ERDAT-HIGH&#39; ).
  l_batch_input-&gt;set_okcode( exporting im_okcode  = &#39;=ONLI&#39; ).
  l_batch_input-&gt;set_field(  exporting im_field   = &#39;S_VBELN-LOW&#39; im_value = &#39;2102001998&#39; ).
  l_batch_input-&gt;set_field(  exporting im_field   = &#39;S_ERDAT-LOW&#39; im_value = &#39;01.07.2013&#39; ).
  l_batch_input-&gt;set_field(  exporting im_field   = &#39;S_ERDAT-HIGH&#39; im_value = &#39;31.07.2013&#39; ).
  l_batch_input-&gt;set_field(  exporting im_field   = &#39;P_AEDAT&#39; im_value = &#39;X&#39; ).
  l_batch_input-&gt;set_screen( exporting im_program = &#39;SAPMSSY0&#39; im_screen = &#39;0120&#39; ).
  l_batch_input-&gt;set_cursor( exporting im_field   = &#39;04/03&#39; ).
  l_batch_input-&gt;set_okcode( exporting im_okcode  = &#39;=&amp;ALL&#39; ).
  l_batch_input-&gt;set_screen( exporting im_program = &#39;SAPMSSY0&#39; im_screen = &#39;0120&#39; ).
  l_batch_input-&gt;set_cursor( exporting im_field   = &#39;04/03&#39; ).
  l_batch_input-&gt;set_okcode( exporting im_okcode  = &#39;=COMP&#39; ).
  l_batch_input-&gt;set_screen( exporting im_program = &#39;SAPLSPO1&#39; im_screen = &#39;0500&#39; ).
  l_batch_input-&gt;set_okcode( exporting im_okcode  = &#39;=OPT1&#39; ).
  if l_batch_input-&gt;start( ) = &#39;X&#39;.
*   Success!!!
  else.
*   Error!!!
  endif.
* messages in l_batch_input-&gt;wt_messages[].

  clear: l_batch_input.
  free: l_batch_input.
&lt;/textarea&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Final remarks:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As you can see, the code is more understable and simplier to use.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The SHDB record name, must be unique, since it is selected by name.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;With the generated code, you must add the coding for variable selection and remove unecessary inputs. The program only creates code for the relevant batch input lines.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/4296746626529530754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/4296746626529530754'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2013/10/batch-input-with-objects.html' title='Batch Input with Objects'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-8Mcz7NFS6BI/UmkKIH5hInI/AAAAAAAAGqI/PYExaswNRJM/s72-c/screenshot.9.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-7860393262584673293</id><published>2010-12-31T14:49:00.001+00:00</published><updated>2013-11-01T22:48:05.419+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="background"/><category scheme="http://www.blogger.com/atom/ns#" term="order"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="release"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="request"/><category scheme="http://www.blogger.com/atom/ns#" term="Transport"/><title type='text'>Release transport orders in background</title><content type='html'>It&#39;s a very simple task. Just run the RSWBO011 report.</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/7860393262584673293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2010/12/release-transport-orders-in-background.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/7860393262584673293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/7860393262584673293'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/12/release-transport-orders-in-background.html' title='Release transport orders in background'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-2616535853353521327</id><published>2010-04-06T12:00:00.001+01:00</published><updated>2013-11-01T22:47:25.341+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="copy"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="SAP"/><category scheme="http://www.blogger.com/atom/ns#" term="text"/><title type='text'>SAP Texts Copy</title><content type='html'>RSTXTCPY - This program is very useful to copy texts between SAP clients.</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/2616535853353521327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2010/04/sap-texts-copy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/2616535853353521327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/2616535853353521327'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/04/sap-texts-copy.html' title='SAP Texts Copy'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-6798462207430864408</id><published>2010-03-11T15:49:00.002+00:00</published><updated>2013-11-01T22:47:07.729+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="order"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="request"/><category scheme="http://www.blogger.com/atom/ns#" term="SAP"/><category scheme="http://www.blogger.com/atom/ns#" term="text"/><category scheme="http://www.blogger.com/atom/ns#" term="Transport"/><title type='text'>SAP Texts Transport</title><content type='html'>&lt;p&gt;An simple way of transport SAP texts is to use the program RSTXTRAN.&lt;/p&gt;&lt;p&gt;First, you must create a transport order, check if the task is of development/correction type.&lt;/p&gt;&lt;p&gt;After that, take not of the task number (not the request), and introduce it in the program, together with the text name, type and language.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/6798462207430864408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2010/03/sap-texts-transport.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/6798462207430864408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/6798462207430864408'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/03/sap-texts-transport.html' title='SAP Texts Transport'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-2044862262439721008</id><published>2010-02-24T18:21:00.001+00:00</published><updated>2010-02-24T18:23:59.380+00:00</updated><title type='text'>Hello world!</title><content type='html'>One of the simpliest programs that you can create in abap, is the famous Hello World.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;report y_hello_world.&lt;br /&gt;&lt;br /&gt;write:/ &#39;Hello World!&#39;.</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/2044862262439721008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2010/02/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/2044862262439721008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/2044862262439721008'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/02/hello-world.html' title='Hello world!'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-3819452141905485139</id><published>2010-02-18T14:49:00.003+00:00</published><updated>2013-11-01T22:46:52.974+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="scan"/><category scheme="http://www.blogger.com/atom/ns#" term="source"/><title type='text'>Scan string in ABAP programs</title><content type='html'>As with sapscript, sometimes we need to find certain strings present in abap source code. For this, sap provides us with an interesting program: RPR_ABAP_SOURCE_SCAN</content><link rel='replies' type='application/atom+xml' href='http://world-of-abap.blogspot.com/feeds/3819452141905485139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://world-of-abap.blogspot.com/2010/02/scan-string-in-abap-programs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/3819452141905485139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/3819452141905485139'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/02/scan-string-in-abap-programs.html' title='Scan string in ABAP programs'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5714096731928945714.post-3151664583188725164</id><published>2010-02-18T13:55:00.006+00:00</published><updated>2013-11-01T22:47:41.407+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ABAP"/><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="SAPScript"/><category scheme="http://www.blogger.com/atom/ns#" term="scan"/><category scheme="http://www.blogger.com/atom/ns#" term="source"/><title type='text'>Scan string in SAPScript Sources</title><content type='html'>Every now and then, there is the need to find an particular string in multiple layouts/languages. This could be done by displaying the form info and search there. However, this is painfully slow and boring. For that need, I&#39;ve created a small and simple program that can show if an form has that string. Below is the source code for it. Just create an empty program and copy &amp;amp; paste. Enjoy.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea style=&quot;height: 600px; margin: 2px; width: 700px;&quot;&gt;*&amp;---------------------------------------------------------------------*
*&amp; Report  Y_SEARCH_SAPSCRIPT_SOURCE                                   *
*&amp;---------------------------------------------------------------------*
report y_search_sapscript_source line-size 255.


tables: stxh, phtmlb_fli.


type-pools: sscr.


data: begin of wt_forms occurs 0,
        tdform  like stxh-tdform,
        tdspras like stxh-tdspras,
        found,
      end of wt_forms,
      begin of wt_final occurs 0,
        form    like stxh-tdform,
        lang    like stxh-tdspras,
        line_no like sy-tabix,
        format  type tdformat,
        line    type tline,
        string  type char30,
      end of wt_final,
      wt_lines type table of tline with header line,
      l_tabix  type sy-tabix.


field-symbols: &lt;w_form&gt;  like line of wt_forms,
               &lt;w_line&gt;  like line of wt_lines,
               &lt;w_final&gt; like line of wt_final.


selection-screen: begin of block b1 with frame.
  select-options: s_form for stxh-tdform,
                  s_lang for stxh-tdspras.
selection-screen: end of block b1.
selection-screen: skip.
selection-screen: begin of block b2 with frame.
  select-options: s_string for phtmlb_fli-fli_id lower case obligatory no intervals.
selection-screen: end of block b2.
selection-screen: skip.
selection-screen: begin of block b3 with frame.
  parameters: p_com as checkbox default &#39; &#39;,
              p_par as checkbox default &#39; &#39;,
              p_ins as checkbox default &#39; &#39;,
              p_ele as checkbox default &#39; &#39;,
              p_win as checkbox default &#39; &#39;.
selection-screen: end of block b3.


initialization.

data: l_restriction type sscr_restrict,
      l_opt         type sscr_opt_list,
      l_assign      type sscr_ass.

  clear: l_restriction, l_opt, l_assign.
  free:  l_restriction, l_opt, l_assign.
  l_opt-name       = &#39;ONE&#39;.
  l_opt-options-eq = &#39;X&#39;.
  l_assign-kind    = &#39;S&#39;.
  l_assign-name    = &#39;S_STRING&#39;.
  l_assign-sg_main = &#39;I&#39;.
  l_assign-op_main = &#39;ONE&#39;.
  append l_opt    to l_restriction-opt_list_tab.
  append l_assign to l_restriction-ass_tab.
  call function &#39;SELECT_OPTIONS_RESTRICT&#39;
    exporting
      restriction            = l_restriction
    exceptions
      too_late               = 1
      repeated               = 2
      selopt_without_options = 3
      selopt_without_signs   = 4
      invalid_sign           = 5
      empty_option_list      = 6
      invalid_kind           = 7
      repeated_kind_a        = 8
      others                 = 9.
  clear: l_restriction, l_opt, l_assign.
  free:  l_restriction, l_opt, l_assign.

start-of-selection.


  clear: wt_forms, wt_forms[], wt_lines, wt_lines[], wt_final, wt_final[].
  select tdform tdspras into corresponding fields of table wt_forms
         from stxh where tdobject =  &#39;FORM&#39;
                     and tdname   in s_form
                     and tdid     =  &#39;TXT&#39;
                     and tdspras  in s_lang.
  if sy-subrc is initial.
    clear: wt_lines.
    loop at wt_forms assigning &lt;w_form&gt;.
      clear: &lt;w_form&gt;-found, wt_lines,
             wt_lines[].
      free:  wt_lines, wt_lines[].
      call function &#39;READ_FORM&#39;
        exporting
          form       = &lt;w_form&gt;-tdform
          language   = &lt;w_form&gt;-tdspras
        importing
          found      = &lt;w_form&gt;-found
        tables
          form_lines = wt_lines.
      if not &lt;w_form&gt;-found is initial and not wt_lines[] is initial.
        loop at wt_lines assigning &lt;w_line&gt;.
          if ( p_com = &#39;X&#39; and &lt;w_line&gt;-tdformat    =  &#39;/*&#39; ) or
             ( p_par = &#39;X&#39; and &lt;w_line&gt;-tdformat(1) &lt;&gt; &#39;/&#39;
                           and &lt;w_line&gt;-tdformat(1) &lt;&gt; &#39;&gt;&#39;  ) or
             ( p_ins = &#39;X&#39; and &lt;w_line&gt;-tdformat    =  &#39;/:&#39; ) or
             ( p_ele = &#39;X&#39; and &lt;w_line&gt;-tdformat    =  &#39;/E&#39; ) or
             ( p_win = &#39;X&#39; and &lt;w_line&gt;-tdformat    =  &#39;/W&#39; ) or
                               &lt;w_line&gt;-tdformat(1) =  &#39;&gt;&#39;.
            continue.
          endif.
          l_tabix = sy-tabix.
          loop at s_string.
            if &lt;w_line&gt;-tdline cs s_string-low.
              wt_final-form    = &lt;w_form&gt;-tdform.
              wt_final-lang    = &lt;w_form&gt;-tdspras.
              wt_final-line_no = l_tabix.
              wt_final-format  = &lt;w_line&gt;-tdformat.
              wt_final-line    = &lt;w_line&gt;-tdline.
              wt_final-string  = s_string-low.
              append wt_final. clear wt_final.
            endif.
          endloop.
        endloop.
      endif.
    endloop.
    if not wt_final[] is initial.
      write:/ &#39;FORM            &#39;, &#39;;&#39;, &#39;LG&#39;, &#39;;&#39;, &#39;LINE No    &#39;, &#39;;&#39;, &#39;STRING                        &#39;, &#39;;&#39;, &#39;  &#39;, &#39;;&#39;, &#39;LINE&#39;.
      loop at wt_final assigning &lt;w_final&gt;.
        write:/ &lt;w_final&gt;-form, &#39;;&#39;, &lt;w_final&gt;-lang, &#39;;&#39;, &lt;w_final&gt;-line_no, &#39;;&#39;, &lt;w_final&gt;-string, &#39;;&#39;, &lt;w_final&gt;-format, &#39;;&#39;, &lt;w_final&gt;-line.
      endloop.
    else.
      write:/ &#39;Not Found!&#39;.
    endif.
  else.
      write:/ &#39;Not Found!&#39;.
  endif.
&lt;/textarea&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 78%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/3151664583188725164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5714096731928945714/posts/default/3151664583188725164'/><link rel='alternate' type='text/html' href='http://world-of-abap.blogspot.com/2010/02/scan-string-in-sapscript-sources.html' title='Scan string in SAPScript Sources'/><author><name>..:: lm ::..</name><uri>http://www.blogger.com/profile/04167520526720131308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>