<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROBLEM AT LOOP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483998#M560018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you are right i'm trying for that only. Yesterday i have posted regarding the same issue but i havnt got good reply so i'm asking today again &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2007 08:01:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-29T08:01:29Z</dc:date>
    <item>
      <title>PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483992#M560012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing a problem for a loop condition. Actually my requirement is to send an mail before two days to a user so for that it have to check the number of documents and it should send the data for that particular person with all document numbers&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into
corresponding fields of  int_BKPF
where bukrs = 'GSEG' and
      BELNR = INT_BSEG-BELNR.


  lv_date1 = int_bkpf-budat.
  var4 = lv_date1+(4).
  var5 = lv_date1+4(2).
  var6 = lv_date1+6(2).

concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.

endselect.

if int_bseg-belnr = int_bkpf-belnr.


read table int_bseg .

   loop at int_bseg.

   int_bseg-belnr = int_bkpf-belnr.
  it_message1 =  lv_formatdate1.

  append int_bseg.

 endloop.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;By using this code i'm getting the document number of last document but i want to get the details of all document numbers. Actually problem is the statement is not executed  i mean  after reading loop condition it is directly skipping to the next statement&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have tried all possible conditions of loop as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at int_bseg into it_message.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:47:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483992#M560012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T07:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483993#M560013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan &lt;/P&gt;&lt;P&gt;  Sorry i wan not able to understand your issue completely , could you please illustarate a bit more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more observation , why have you used the statemnt&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;read table int_bseg .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Before the loop endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:52:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483993#M560013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T07:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483994#M560014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into&lt;/P&gt;&lt;P&gt;corresponding fields of  int_BKPF&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  lv_date1 = int_bkpf-budat.&lt;/P&gt;&lt;P&gt;  var4 = lv_date1+(4).&lt;/P&gt;&lt;P&gt;  var5 = lv_date1+4(2).&lt;/P&gt;&lt;P&gt;  var6 = lv_date1+6(2).&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;append   int_BKPF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483994#M560014</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-29T07:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483995#M560015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read table int_bseg with key feilds -&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;primary keys &lt;/P&gt;&lt;P&gt;thnkx &lt;/P&gt;&lt;P&gt;bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:56:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483995#M560015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T07:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483996#M560016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R u trying for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into&lt;/P&gt;&lt;P&gt;corresponding fields of  int_BKPF&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  lv_date1 = int_bkpf-budat.&lt;/P&gt;&lt;P&gt;  var4 = lv_date1+(4).&lt;/P&gt;&lt;P&gt;  var5 = lv_date1+4(2).&lt;/P&gt;&lt;P&gt;  var6 = lv_date1+6(2).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.&lt;/P&gt;&lt;P&gt;  loop at int_bseg where belnr = int_bkpf-belnr.&lt;/P&gt;&lt;P&gt;  it_message1 =  lv_formatdate1. &lt;/P&gt;&lt;P&gt;  append int_bseg. &lt;/P&gt;&lt;P&gt;  endloop. &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483996#M560016</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-29T07:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483997#M560017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually my main problem is the loop condition is not executed. I mean it was not reading also. The system is reading upto loop condition and it is not entering into the loop.  I have used this Read statement because i thought that atleast through this statement it may read the int_bseg internal table where we are having the value of belnr( document number ) for which i have to keep loop on it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 07:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483997#M560017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T07:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483998#M560018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you are right i'm trying for that only. Yesterday i have posted regarding the same issue but i havnt got good reply so i'm asking today again &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483998#M560018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483999#M560019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now your problem is solved or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just let me know the requirement if its not solved yet, will update the code as per your need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2483999#M560019</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-29T08:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484000#M560020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No My problem is not yet solved for that only i'm seeking you ABAPers help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and coming to the coding &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; *&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTESTMAIL                                                   *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  ZMATURITY                               .

tables: bseg.


*parameters: p_email type somlreci1-receiver default
*'pavan@gujaratpetro.com'.

 Data: p_email(25) type c value 'pavan@gujaratpetro.com'.

data: it_message type standard table of solisti1 initial size 0
with header line.

data: it_message1 type standard table of solisti1 initial size 0
with header line.

data: it_attach type standard table of solisti1 initial size 0
with header line.

data: text(150).


data: t_packing_list like sopcklsti1 occurs 0 with header line,
      t_contents like solisti1 occurs 0 with header line,
      t_receivers like somlreci1 occurs 0 with header line,
      t_attachment like solisti1 occurs 0 with header line,
      t_object_header like solisti1 occurs 0 with header line,


      w_cnt type i,
      w_sent_all(1) type c,
      w_doc_data like sodocchgi1,
      gd_error type sy-subrc,
      gd_reciever type sy-subrc.



start-of-selection.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.

data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.

data: var1(4) type c,

var2(2) type c,

var3(2) type c.





data: begin of int_bseg occurs 0,
    BELNR LIKE BSEG-BELNR,
    ZUONR LIKE BSEG-ZUONR,

end of int_bseg.

data: begin of int_bkpf occurs 0,
      BELNR LIKE BKPF-BELNR,
      BUKRS LIKE BKPF-BUKRS,
      GJAHR LIKE BKPF-GJAHR,
      BUDAT  LIKE BKPF-BUDAT,

end of int_BKPF.




data: 2days_out type sy-datum.
2days_out = sy-datum + 2.


lv_date = 2days_out.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).

concatenate var3 var2 var1 into lv_formatdate separated by '.'.

data: var4(4) type c,

var5(2) type c,

var6(2) type c.





select zuonr belnr from bseg into
corresponding fields of  int_bseg
where bukrs = 'GSEG' and
      ZUONR = lv_formatdate.
endselect.

select BUDAT BELNR GJAHR BUKRS from BKPF into
corresponding fields of  int_BKPF
where bukrs = 'GSEG' and
      BELNR = INT_BSEG-BELNR.


  lv_date1 = int_bkpf-budat.
  var4 = lv_date1+(4).
  var5 = lv_date1+4(2).
  var6 = lv_date1+6(2).
append int_BKPF.

concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.

endselect.

if int_bseg-belnr = int_bkpf-belnr.


read table int_bseg .

   loop at int_bseg into it_message.

   int_bseg-belnr = int_bkpf-belnr.
  it_message1 =  lv_formatdate1.

  append int_bseg.

 endloop.
endif.


 perform populate_email_message_body.

** Send file by email as .xls speadsheet

  perform send_file_as_email_attachment
  tables it_message
  it_attach
  using p_email
  'Assignment Date after 2 days'
  'XLS'
  'filename'
  ' '
  ' '
  ' '
  changing gd_error
  gd_reciever.

* Instructs mail send program for SAPCONNECT to send email(rsconn01)
  perform initiate_mail_execute_program.



*endif.




end-of-selection.


*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form SEND_FILE_AS_EMAIL_ATTACHMENT
*&amp;amp;---------------------------------------------------------------------
*
* Send email
*----------------------------------------------------------------------
*
form send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.


  data: ld_error type sy-subrc,
  ld_reciever type sy-subrc,
  ld_mtitle like sodocchgi1-obj_descr,
  ld_email like somlreci1-receiver,
  ld_format type so_obj_tp ,
  ld_attdescription type so_obj_nam ,
  ld_attfilename type so_obj_des ,
  ld_sender_address like soextreci1-receiver,
  ld_sender_address_type like soextreci1-adr_typ,
  ld_receiver like sy-subrc.

  ld_email = p_email.
  ld_mtitle = p_mtitle.
  ld_format = p_format.
  ld_attdescription = p_attdescription.
  ld_attfilename = p_filename.
  ld_sender_address = p_sender_address.
  ld_sender_address_type = p_sender_addres_type.


* Fill the document data.
  w_doc_data-doc_size = 1.



* Populate the subject/generic message attributes
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name = 'SAPRPT'.
  w_doc_data-obj_descr = ld_mtitle .
  w_doc_data-sensitivty = 'F'.




** Fill the document data and get size of attachment
  clear w_doc_data.
  read table it_attach index w_cnt.
  w_doc_data-doc_size =
  ( w_cnt - 1 ) * 255 + strlen( it_attach ).
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name = 'SAPRPT'.
  w_doc_data-obj_descr = ld_mtitle.
  w_doc_data-sensitivty = 'F'.
  clear t_attachment.
  refresh t_attachment.
  t_attachment[] = pit_attach[].

* Describe the body of the message
  clear t_packing_list.
  refresh t_packing_list.
  t_packing_list-transf_bin = space.
  t_packing_list-head_start = 1.
  t_packing_list-head_num = 0.
  t_packing_list-body_start = 1.
  describe table it_message lines t_packing_list-body_num.
  t_packing_list-doc_type = 'RAW'.
  append t_packing_list.


* Add the recipients email address
  clear t_receivers.
  refresh t_receivers.
  t_receivers-receiver = ld_email.
  t_receivers-rec_type = 'U'.
  t_receivers-com_type = 'INT'.
  t_receivers-notif_del = 'X'.
  t_receivers-notif_ndel = 'X'.
  append t_receivers.

  call function 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = w_doc_data
      put_in_outbox              = 'X'
      sender_address             = ld_sender_address
      sender_address_type        = ld_sender_address_type
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = w_sent_all
    TABLES
      object_header              = t_object_header
      packing_list               = t_packing_list
      contents_bin               = t_attachment
      contents_txt               = it_message
      receivers                  = t_receivers
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      others                     = 8.

* Populate zerror return code
  ld_error = sy-subrc.

* Populate zreceiver return code
  loop at t_receivers.
    ld_receiver = t_receivers-retrn_code.
  endloop.
endform.                    "send_file_as_email_attachment



*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form INITIATE_MAIL_EXECUTE_PROGRAM
*&amp;amp;---------------------------------------------------------------------
*
* Instructs mail send program for SAPCONNECT to send email.
*----------------------------------------------------------------------
*

form initiate_mail_execute_program.
  wait up to 2 seconds.
  if gd_error eq 0.
    submit rsconn01 with mode = 'INT'
                  with output = 'X'
                  and return.
  endif.
endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM



*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form POPULATE_EMAIL_MESSAGE_BODY
*&amp;amp;---------------------------------------------------------------------
*
* Populate message body text
*----------------------------------------------------------------------
*
form populate_email_message_body.

  refresh it_message.
  refresh it_message1.




it_message =  int_bseg-belnr.
it_message1 =  lv_formatdate1.

* it_message = 'Assignment Date is coming After 2 Days'.



concatenate 'Doc. No :   'it_message
            'Posting Date :  '  it_message1
   'Assignment Date is coming After 2Days'  into
it_message separated by space.


 append it_message.
* append it_message1.

*  clear it_message.
*  clear it_message1.




endform. " POPULATE_EMAIL_MESSAGE_BODY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:08:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484000#M560020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484001#M560021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan , &lt;/P&gt;&lt;P&gt;  Could you plese tell me what exactly you want to acheive the piece of code you have pasted.&lt;/P&gt;&lt;P&gt;What i understand is thet it will get the last records because of select -endselect and do rest of processing with this record , all other records which match the condition mentioned in select statement will be lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:09:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484001#M560021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484002#M560022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By running this code i'm getting everything fine but the only prob is it is not selecting more number of documents it is just sending a mail of last document number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484002#M560022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484003#M560023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Arun you are right it is fetching the data of only last records but it is not fetching the whole data eventhough i applied a loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484003#M560023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484004#M560024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code instead:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select zuonr belnr from bseg into&lt;/P&gt;&lt;P&gt;corresponding fields of  table int_bseg&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      ZUONR = lv_formatdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into&lt;/P&gt;&lt;P&gt;corresponding fields of  table int_BKPF&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN int_bseg&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at int_bkpf.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  lv_date1 = int_bkpf-budat.&lt;/P&gt;&lt;P&gt;  var4 = lv_date1+(4).&lt;/P&gt;&lt;P&gt;  var5 = lv_date1+4(2).&lt;/P&gt;&lt;P&gt;  var6 = lv_date1+6(2).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484004#M560024</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-29T08:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484005#M560025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiii..,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select zuonr belnr from bseg into&lt;/P&gt;&lt;P&gt;corresponding fields of  int_bseg&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      ZUONR = lv_formatdate.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into&lt;/P&gt;&lt;P&gt;corresponding fields of  int_BKPF&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_date1 = int_bkpf-budat.&lt;/P&gt;&lt;P&gt;  var4 = lv_date1+(4).&lt;/P&gt;&lt;P&gt;  var5 = lv_date1+4(2).&lt;/P&gt;&lt;P&gt;  var6 = lv_date1+6(2).&lt;/P&gt;&lt;P&gt;append int_BKPF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   int_bseg-belnr = int_bkpf-belnr.&lt;/P&gt;&lt;P&gt;  it_message1 =  lv_formatdate1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  append int_bseg.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; perform populate_email_message_body.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sai ramesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sai ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:18:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484005#M560025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484006#M560026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sai &amp;amp; sesh &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i have tried with both of your code but its not working. Plz any more suggestions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484006#M560026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484007#M560027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan , &lt;/P&gt;&lt;P&gt;  I have made some modification in the code and commented it. But was not abel to check as the system i am working on does not have any test data .&lt;/P&gt;&lt;P&gt;please check it at your end and revert back, if it works dont forget to assign points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before pasting my code , please take a back up of you code , becuase in case it does not work , you can revert back.&lt;/P&gt;&lt;P&gt;Pelase do rememeber i ahve not been able to test it at my end so pleas do take the backup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


tables: bseg.


*parameters: p_email type somlreci1-receiver default
*'pavan@gujaratpetro.com'.

 Data: p_email(25) type c value 'pavan@gujaratpetro.com'.

data: it_message type standard table of solisti1 initial size 0
with header line.

data: it_message1 type standard table of solisti1 initial size 0
with header line.

data: it_attach type standard table of solisti1 initial size 0
with header line.

data: text(150).


data: t_packing_list like sopcklsti1 occurs 0 with header line,
      t_contents like solisti1 occurs 0 with header line,
      t_receivers like somlreci1 occurs 0 with header line,
      t_attachment like solisti1 occurs 0 with header line,
      t_object_header like solisti1 occurs 0 with header line,


      w_cnt type i,
      w_sent_all(1) type c,
      w_doc_data like sodocchgi1,
      gd_error type sy-subrc,
      gd_reciever type sy-subrc.



start-of-selection.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.

data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.

data: var1(4) type c,

var2(2) type c,

var3(2) type c.





data: begin of int_bseg occurs 0,
    BELNR LIKE BSEG-BELNR,
    ZUONR LIKE BSEG-ZUONR,

end of int_bseg.

data: begin of int_bkpf occurs 0,
      BELNR LIKE BKPF-BELNR,
      BUKRS LIKE BKPF-BUKRS,
      GJAHR LIKE BKPF-GJAHR,
      BUDAT  LIKE BKPF-BUDAT,

end of int_BKPF.




data: 2days_out type sy-datum.
2days_out = sy-datum + 2.


lv_date = 2days_out.
var1 = lv_date+0(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).

concatenate var3 var2 var1 into lv_formatdate separated by '.'.

data: var4(4) type c,

var5(2) type c,

var6(2) type c.





select zuonr belnr from bseg into      " See modification
corresponding fields of table int_bseg
where bukrs = 'GSEG' and
      ZUONR = lv_formatdate.


select BUDAT BELNR GJAHR BUKRS from BKPF into  " See modification
corresponding fields of table  int_BKPF
where bukrs = 'GSEG' and
      BELNR = INT_BSEG-BELNR.
* "Code modified
loop at int_bkpf .

   loop at int_bseg into it_message where belnr = int_bkpf-belnr.

    int_bseg-belnr = int_bkpf-belnr.
  lv_date1 = int_bkpf-budat.
  var4 = lv_date1+(4).
  var5 = lv_date1+4(2).
  var6 = lv_date1+6(2).
concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.

    it_message1 =  lv_formatdate1.
  append int_bseg.

 endloop.
endloop.
*#end of modification
 perform populate_email_message_body.

** Send file by email as .xls speadsheet

  perform send_file_as_email_attachment
  tables it_message
  it_attach
  using p_email
  'Assignment Date after 2 days'
  'XLS'
  'filename'
  ' '
  ' '
  ' '
  changing gd_error
  gd_reciever.

* Instructs mail send program for SAPCONNECT to send email(rsconn01)
  perform initiate_mail_execute_program.



*endif.




end-of-selection.


*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form SEND_FILE_AS_EMAIL_ATTACHMENT
*&amp;amp;---------------------------------------------------------------------
*
* Send email
*----------------------------------------------------------------------
*
form send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.


  data: ld_error type sy-subrc,
  ld_reciever type sy-subrc,
  ld_mtitle like sodocchgi1-obj_descr,
  ld_email like somlreci1-receiver,
  ld_format type so_obj_tp ,
  ld_attdescription type so_obj_nam ,
  ld_attfilename type so_obj_des ,
  ld_sender_address like soextreci1-receiver,
  ld_sender_address_type like soextreci1-adr_typ,
  ld_receiver like sy-subrc.

  ld_email = p_email.
  ld_mtitle = p_mtitle.
  ld_format = p_format.
  ld_attdescription = p_attdescription.
  ld_attfilename = p_filename.
  ld_sender_address = p_sender_address.
  ld_sender_address_type = p_sender_addres_type.


* Fill the document data.
  w_doc_data-doc_size = 1.



* Populate the subject/generic message attributes
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name = 'SAPRPT'.
  w_doc_data-obj_descr = ld_mtitle .
  w_doc_data-sensitivty = 'F'.




** Fill the document data and get size of attachment
  clear w_doc_data.
  read table it_attach index w_cnt.
  w_doc_data-doc_size =
  ( w_cnt - 1 ) * 255 + strlen( it_attach ).
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name = 'SAPRPT'.
  w_doc_data-obj_descr = ld_mtitle.
  w_doc_data-sensitivty = 'F'.
  clear t_attachment.
  refresh t_attachment.
  t_attachment[] = pit_attach[].

* Describe the body of the message
  clear t_packing_list.
  refresh t_packing_list.
  t_packing_list-transf_bin = space.
  t_packing_list-head_start = 1.
  t_packing_list-head_num = 0.
  t_packing_list-body_start = 1.
  describe table it_message lines t_packing_list-body_num.
  t_packing_list-doc_type = 'RAW'.
  append t_packing_list.


* Add the recipients email address
  clear t_receivers.
  refresh t_receivers.
  t_receivers-receiver = ld_email.
  t_receivers-rec_type = 'U'.
  t_receivers-com_type = 'INT'.
  t_receivers-notif_del = 'X'.
  t_receivers-notif_ndel = 'X'.
  append t_receivers.

  call function 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = w_doc_data
      put_in_outbox              = 'X'
      sender_address             = ld_sender_address
      sender_address_type        = ld_sender_address_type
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = w_sent_all
    TABLES
      object_header              = t_object_header
      packing_list               = t_packing_list
      contents_bin               = t_attachment
      contents_txt               = it_message
      receivers                  = t_receivers
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      others                     = 8.

* Populate zerror return code
  ld_error = sy-subrc.

* Populate zreceiver return code
  loop at t_receivers.
    ld_receiver = t_receivers-retrn_code.
  endloop.
endform.                    "send_file_as_email_attachment



*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form INITIATE_MAIL_EXECUTE_PROGRAM
*&amp;amp;---------------------------------------------------------------------
*
* Instructs mail send program for SAPCONNECT to send email.
*----------------------------------------------------------------------
*

form initiate_mail_execute_program.
  wait up to 2 seconds.
  if gd_error eq 0.
    submit rsconn01 with mode = 'INT'
                  with output = 'X'
                  and return.
  endif.
endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM



*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp; Form POPULATE_EMAIL_MESSAGE_BODY
*&amp;amp;---------------------------------------------------------------------
*
* Populate message body text
*----------------------------------------------------------------------
*
form populate_email_message_body.

  refresh it_message.
  refresh it_message1.




it_message =  int_bseg-belnr.
it_message1 =  lv_formatdate1.

* it_message = 'Assignment Date is coming After 2 Days'.



concatenate 'Doc. No :   'it_message
            'Posting Date :  '  it_message1
   'Assignment Date is coming After 2Days'  into
it_message separated by space.


 append it_message.
* append it_message1.

*  clear it_message.
*  clear it_message1.




endform. " POPULATE_EMAIL_MESSAGE_BODY


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagrds,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484007#M560027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484008#M560028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun &amp;amp; Sai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By performing your code i have got the following error message&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Cannot be sent: Assignment Date after 2 days  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Status received for this document:&lt;/P&gt;&lt;P&gt;     Assignment Date after 2 days&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent by:&lt;/P&gt;&lt;P&gt;     GSPCABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Status for Recipient pavan@gujaratpetro.com:&lt;/P&gt;&lt;P&gt;     Internal error: CL_SMTP_RESPONSE ESMTP error code is not known. 554 554 Mail from GSPCABAP@gujaratpetronet.com rejecte&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:38:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484008#M560028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484009#M560029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI..,&lt;/P&gt;&lt;P&gt;Try this.............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select zuonr belnr from bseg into&lt;/P&gt;&lt;P&gt;corresponding fields of int_bseg&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ZUONR = lv_date.   "&amp;lt;&amp;lt;===== Here it should be in the internal format.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into&lt;/P&gt;&lt;P&gt;corresponding fields of int_BKPF&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_date1 = int_bkpf-budat.&lt;/P&gt;&lt;P&gt;var4 = lv_date1+(4).&lt;/P&gt;&lt;P&gt;var5 = lv_date1+4(2).&lt;/P&gt;&lt;P&gt;var6 = lv_date1+6(2).&lt;/P&gt;&lt;P&gt;append int_BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int_bseg-belnr = int_bkpf-belnr.&lt;/P&gt;&lt;P&gt;it_message1 = lv_formatdate1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append int_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform populate_email_message_body.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:47:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484009#M560029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484010#M560030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi pavan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is there in  ur select stmts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. select zuonr belnr from bseg into&lt;/P&gt;&lt;P&gt;    corresponding fields of  int_bseg &lt;/P&gt;&lt;P&gt;     where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      ZUONR = lv_formatdate.&lt;/P&gt;&lt;P&gt;     endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of above write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select zuonr belnr from bseg into&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;corresponding fields of table  int_bseg&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      ZUONR = lv_formatdate. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2. select BUDAT BELNR GJAHR BUKRS from BKPF into &lt;/P&gt;&lt;P&gt;    corresponding fields of  int_BKPF&lt;/P&gt;&lt;P&gt;      where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of above write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUDAT BELNR GJAHR BUKRS from BKPF into &lt;/P&gt;&lt;P&gt;corresponding fields of  table int_BKPF&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FOR ALL ENTRIES IN  int_bseg&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;where bukrs = 'GSEG' and&lt;/P&gt;&lt;P&gt;      BELNR = INT_BSEG-BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Preethi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 08:58:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484010#M560030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T08:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM AT LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484011#M560031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   loop at int_bseg.&lt;/P&gt;&lt;P&gt;     read table int_bseg .&lt;/P&gt;&lt;P&gt;     if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;       int_bseg-belnr = int_bkpf-belnr.&lt;/P&gt;&lt;P&gt;       it_message1 =  lv_formatdate1.&lt;/P&gt;&lt;P&gt;     endif.&lt;/P&gt;&lt;P&gt;     append int_bseg.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Shivakumar Kanti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 09:06:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-at-loop/m-p/2484011#M560031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T09:06:26Z</dc:date>
    </item>
  </channel>
</rss>

