Doubt in AT END OF...ENDAT statement...

Hi,
I am retrieving the data from E071 table into an internal table "it_e071" ; and sorting it according to obj_name and trkorr fields.
Now, the sorted data in it_e071 table is of the format:
TRKORR   AS4POS     PGMID  OBJECT OBJ_NAME
X1            -                   -           -             ZOBJ1
X2            -                   -           -             ZOBJ1
X3            -                   -           -             ZOBJ1
Y1            -                   -           -             ZOBJ2
Y2            -                   -           -             ZOBJ2
Y3            -                   -           -             ZOBJ2
Y4            -                   -           -             ZOBJ2
Z1            -                   -           -             ZOBJ3
Z2            -                   -           -             ZOBJ3
Now, I want only the last record for each OBJ_NAME to be populated in another internal table "it_sfdet". So, for the above example "it_sfdet" should be:
TRKORR   AS4POS     PGMID  OBJECT OBJ_NAME
X3            -                   -           -             ZOBJ1
Y4            -                   -           -             ZOBJ2
Z2            -                   -           -             ZOBJ3
For this, I am using 'AT END OF' statement as in the following code:
    SORT it_e071 BY obj_name trkorr.
    LOOP AT it_e071 INTO wa_e071.
      AT END OF obj_name.
        wa_sfdet-trkorr = wa_e071-trkorr.
        wa_sfdet-sfname = wa_e071-obj_name.
        APPEND wa_sfdet TO it_sfdet.
      ENDAT.
    ENDLOOP.
However, at the end, the internal table "it_sfdet" is getting all the values of "it_e071" table. I want only the last record for each OBJ_NAME. The table E071 has TRKORR and AS4POS as the primary keys. Could you please tell me what exactly is wrong with the above code or suggest me any other way of achieving this.
Thanks,
Vishal.

Hi, Vishal Saxena
Please test the following Sample Code and don't use AT END OF ... ENDAT if you don't want OBJ_NAME Field as First Field of your Internal Table.
TYPES:  BEGIN OF ty_test_sdn,
  f1(3),
  f2(3),
  f3(3),
  END OF ty_test_sdn.
DATA: it_test_sdn TYPE STANDARD TABLE OF ty_test_sdn WITH HEADER LINE,
      wa_test_sdn LIKE LINE OF it_test_sdn,
      count TYPE i.
it_test_sdn-f1 = 'AAA'. it_test_sdn-f2 = 'AAA'. it_test_sdn-f3 = 'AAA'. APPEND it_test_sdn.
it_test_sdn-f1 = 'BBB'. it_test_sdn-f2 = 'DDD'. it_test_sdn-f3 = 'ZZZ'. APPEND it_test_sdn.
it_test_sdn-f1 = 'CCC'. it_test_sdn-f2 = 'BBB'. it_test_sdn-f3 = 'BBB'. APPEND it_test_sdn.
it_test_sdn-f1 = 'BBB'. it_test_sdn-f2 = 'AAA'. it_test_sdn-f3 = 'AAA'. APPEND it_test_sdn.
it_test_sdn-f1 = 'DDD'. it_test_sdn-f2 = 'SSS'. it_test_sdn-f3 = 'AAA'. APPEND it_test_sdn.
SORT it_test_sdn BY f3.
LOOP AT it_test_sdn.
  IF sy-tabix <> 1 AND it_test_sdn-f3 <> wa_test_sdn-f3.
    WRITE: / 'End of ', wa_test_sdn-f3, ' Number of Records were = ', count.
    CLEAR: count.
  ENDIF.
  ADD 1 TO count.
  MOVE-CORRESPONDING it_test_sdn TO wa_test_sdn.
ENDLOOP.
  WRITE: / 'End of ', wa_test_sdn-f3, ' Number of Records were = ', count.
Hope above Code will help you to solve out your Problem,
Please Reply if any Issue,
Best Regards,
Faisal

Similar Messages

  • I'm trying to edit a talking head video and want to find an straightforward way to mark a spot at the end of a statement and then cut the clip at that point. Can you help? thanks.

    I'm trying to edit a talking head video and want to find an straightforward way to mark a spot at the end of a statement made by the subject and then cut the clip at that point. Can you help? Thanks.

    I don't know how to mark a clip the way you want without adding an audio clip and putting in markers and then splitting the clip. You would think that hitting M would be the logical way to do things, but...
    But, one can just click before the place one wants to edit, hit the spacebar and hit it again when the exact place is reached. Then go to the clip menu and click split clip. That works, but one really needs to keep the cursor out of both the timeline and the event browser, or the place in the timeline gets changed..
    Are you really still using iMovie 08? That drove me nuts...a year later iMovie 09 came out with some needed improvements, and iMovie 11 with its audio adjustments is even better.
    Personally, I edit iMovie with kind of a meat axe. I grab whole chunks of video and put it into the project, then edit the ends to get the frame I want. I got too frustrated otherwise.
    Hugh

  • Missing semicolon (;) at end of SQL statement

    I'm getting this error on a form in which I'm trying to upload multiple files as well as populate a database with information about them all in one query. In addition, not every file field will be used every time the form is submitted, so I have some <cfif> tags to prevent errors in the event the fields are empty. I was able to get the form to work with only two file fields (leaving the second one blank to check that there would be no errors with blank fields), but when I expanded it to the full 15 (and all I did is copy and paste the code and update the field numbers), I get this error:
    Error Executing Database Query.
    Missing semicolon (;) at end of SQL statement.
    The error occurred in C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 477
    Called from C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 14
    Called from C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 1
    Called from C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 477
    Called from C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 14
    Called from C:\ColdFusion9\wwwroot\CrimsonTideBand\admin\upload.cfm: line 1
    475:  </cfif>)
    476:  </cfif>
    477:  <cfif IsDefined("FORM.File15") AND #FORM.File15# NEQ "">,
    478:  (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
    479:  <cfqueryparam value="#FORM.Ensemble# cfsqltype="cf_sql_clob" maxlength="255">
    Here is my full SQL for this query. Any help would be greatly appreciated. Also, if there's a more streamlined way to handle this sort of situation, that would be great as well. (Sorry, it's pretty long, but most of it is repetitive):
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "upload">
      <cfquery datasource="ctband">
        INSERT INTO Files (Ensemble, Category, Selection, Part, File_Name, Uploaded_By)
        VALUES (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part1") AND #FORM.Part1# NEQ "">
        <cfqueryparam value="#FORM.Part1#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File1") AND #FORM.File_Name1# NEQ "">
        <cfqueryparam value="#FORM.File_Name1#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File1" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        <cfif IsDefined("FORM.File2") AND #FORM.File2# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part2") AND #FORM.Part2# NEQ "">
        <cfqueryparam value="#FORM.Part2#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File2") AND #FORM.File_Name2# NEQ "">
        <cfqueryparam value="#FORM.File_Name2#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File2" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File3") AND #FORM.File3# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part3") AND #FORM.Part3# NEQ "">
        <cfqueryparam value="#FORM.Part3#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File3") AND #FORM.File_Name3# NEQ "">
        <cfqueryparam value="#FORM.File_Name3#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File3" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File4") AND #FORM.File4# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part4") AND #FORM.Part4# NEQ "">
        <cfqueryparam value="#FORM.Part4#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File4") AND #FORM.File_Name4# NEQ "">
        <cfqueryparam value="#FORM.File_Name4#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File4" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File5") AND #FORM.File5# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part5") AND #FORM.Part5# NEQ "">
        <cfqueryparam value="#FORM.Part5#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File5") AND #FORM.File_Name5# NEQ "">
        <cfqueryparam value="#FORM.File_Name5#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File5" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File6") AND #FORM.File6# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part6") AND #FORM.Part6# NEQ "">
        <cfqueryparam value="#FORM.Part6#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File6") AND #FORM.File_Name6# NEQ "">
        <cfqueryparam value="#FORM.File_Name6#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File6" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File7") AND #FORM.File7# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part7") AND #FORM.Part7# NEQ "">
        <cfqueryparam value="#FORM.Part7#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File7") AND #FORM.File_Name7# NEQ "">
        <cfqueryparam value="#FORM.File_Name7#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File7" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File8") AND #FORM.File8# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part8") AND #FORM.Part8# NEQ "">
        <cfqueryparam value="#FORM.Part8#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File8") AND #FORM.File_Name8# NEQ "">
        <cfqueryparam value="#FORM.File_Name8#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File8" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File9") AND #FORM.File9# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part9") AND #FORM.Part9# NEQ "">
        <cfqueryparam value="#FORM.Part9#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File9") AND #FORM.File_Name9# NEQ "">
        <cfqueryparam value="#FORM.File_Name9#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File9" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File10") AND #FORM.File10# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part10") AND #FORM.Part10# NEQ "">
        <cfqueryparam value="#FORM.Part10#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File10") AND #FORM.File_Name10# NEQ "">
        <cfqueryparam value="#FORM.File_Name10#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File10" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File11") AND #FORM.File11# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part11") AND #FORM.Part11# NEQ "">
        <cfqueryparam value="#FORM.Part11#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File11") AND #FORM.File_Name11# NEQ "">
        <cfqueryparam value="#FORM.File_Name11#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File11" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File12") AND #FORM.File12# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part12") AND #FORM.Part12# NEQ "">
        <cfqueryparam value="#FORM.Part12#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File12") AND #FORM.File_Name12# NEQ "">
        <cfqueryparam value="#FORM.File_Name12#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File12" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File13") AND #FORM.File13# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part13") AND #FORM.Part13# NEQ "">
        <cfqueryparam value="#FORM.Part13#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File13") AND #FORM.File_Name13# NEQ "">
        <cfqueryparam value="#FORM.File_Name13#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File13" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File14") AND #FORM.File14# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part14") AND #FORM.Part14# NEQ "">
        <cfqueryparam value="#FORM.Part14#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File14") AND #FORM.File_Name14# NEQ "">
        <cfqueryparam value="#FORM.File_Name14#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File14" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
        <cfif IsDefined("FORM.File15") AND #FORM.File15# NEQ "">,
        (<cfif IsDefined("FORM.Ensemble") AND #FORM.Ensemble# NEQ "">
        <cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
        <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Selection") AND #FORM.Selection# NEQ "">
        <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.Part15") AND #FORM.Part15# NEQ "">
        <cfqueryparam value="#FORM.Part15#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>
        , <cfif IsDefined("FORM.File15") AND #FORM.File_Name15# NEQ "">
        <cfqueryparam value="#FORM.File_Name15#" cfsqltype="cf_sql_clob" maxlength="255">
        <cffile action="upload" filefield="File15" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
        <cfelse>
        </cfif>
        , <cfif IsDefined("SESSION.MM_Username") AND #SESSION.MM_Username# NEQ "">
        <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_clob" maxlength="255">
        <cfelse>
        </cfif>)
        </cfif>
      </cfquery>
      <cflocation url="/admin/upload_confirm.cfm">
    </cfif>

    Okay, I've rewritten the page and sql using loops. The problem I have is that if I don't use all the file fields, I get the error message:
    The form field File2 did not contain a file.
    (substitute whatever file field is the first empty one).
    What I tried to do was insert <cfif> tags to overlook the blank entries. Here's my new SQL:
    <cfif IsDefined ("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "upload">
      <cfloop from="1" to="15" index="counter">
        <cfset CurrentPart="FORM.Part#counter#">
        <cfif #CurrentPart# NEQ "">
          <cffile action="upload" filefield="File#counter#" destination="C:\Coldfusion9\wwwroot\CrimsonTideBand\#FORM.Ensemble#\member_files" nameconflict="overwrite">
          <cfquery datasource="ctband">
            INSERT INTO Files (Ensemble, Category, Selection, File_Name, Part, Uploaded_By)
            VALUES (<cfqueryparam value="#FORM.Ensemble#" cfsqltype="cf_sql_varchar">,
                    <cfqueryparam value="#FORM.Category#" cfsqltype="cf_sql_varchar">,
                    <cfqueryparam value="#FORM.Selection#" cfsqltype="cf_sql_varchar">,
                    "#CFFILE.serverFile#",
                    <cfqueryparam value="#CurrentPart#" cfsqltype="cf_sql_varchar">,
                    <cfqueryparam value="#SESSION.MM_Username#" cfsqltype="cf_sql_varchar">)
          </cfquery>
        </cfif>
      </cfloop>
    </cfif>
    Any thoughts on how to get it to overlook the unused file fields, or stop the loop at the last populated field?
    Thanks for your help!

  • Netscape SuiteSpot Server 3.5 for AlphaNT End of Life statement

    Netscape SuiteSpot for WindowsNT (Alpha) End of Life statement
    <P>
    Netscape has discontinued development and support for the Netscape
    SuiteSpot 3.5 product line on the Alpha platform of WindowsNT.
    <P>
    For details, please see the Netscape SuiteSpot v3.5 for
    WindowsNT Alpha platform End of Life Statement located at:
    <P>
    http://help.netscape.com/products/eol/server/es-alpha-eol.htm
    <P>

    Hello, my name is Steve from Iplanet Support Services. Regarding your
    inquiry below,.....
    A. End of Version Start Date: November 29, 2001
    B. Last Order Date: March 1, 2002
    C. Last Ship Date: May 29, 2002
    D. End of Support Life: August 29, 2002
    thanks
    Steve
    Is there an official announcement about the end-of-life for iPlanet Web
    Server
    4.x?
    - steven.russell.vcf

  • Doubt with WHERE clause on OCIStmtPrepare statement

    I'm trying to run something like:
    select offc_ipbase
    from nexqoffice, connection_type
    where offc_type = coty_type and offc_lastsincro > to_date('2006/11/3:00:00:00', '>yyyy/mm/dd:hh24:mi:ss')
    order by offc_id
    where 'to_date...' is a variable. How Can I do this. I've been testing several (wrong) ways but all of them sends me an error. The code of my last test is:
    string sSQL = "select offc_ipbase from nexqoffice, connection_type where offc_type = >coty_type and offc_lastsincro >:dSQLDate order by offc_id";
    //Prepare statement
    checkerr(p_err,     OCIStmtPrepare(sqlStatement,p_err,(unsigned char *)
    const_cast<const char *>(sSQL.c_str()),
    strlen(sSQL.c_str()),OCI_NTV_SYNTAX,OCI_DEFAULT));
    //Define Output Variables
    OCIDefine * defnp = (OCIDefine *) 0;
    short name_length=15;
    char name[15];
    checkerr(p_err,     OCIDefineByPos(sqlStatement, &defnp, p_err, 1, (dvoid *) name,
    name_length+1, SQLT_STR, (dvoid *) 0, (ub2 *) 0, (ub2 *) 0,
    OCI_DEFAULT));
    // dSQLDate
    char dSQLDate[80]; //to_date('2006/11/3:00:00:00', 'yyyy/mm/dd:hh24:mi:ss')
    OCIBind *p_dSQLDate = NULL; // client and server Ips
    checkerr(p_err,OCIBindByPos(sqlStatement, &p_dSQLDate , p_err, 1, dSQLDate, 80,
    SQLT_CHR, 0, 0, 0, 0, 0, OCI_DEFAULT));
    Then I make the execute statement. I guess the problem is in the dSQLDate variable, but I do not know which is it.
    The error that OCI returns me is:ORA-01858: a non-numeric character was found where a numeric was expected.
    Thank you very much.

    The statement needs to be:
    select offc_ipbase from nexqoffice, connection_type
    where offc_type = >coty_type
    and offc_lastsincro >to_date(:p1, 'yyyy/mm/dd:hh24:mi:ss')
    order by offc_id
    And then you bind only the actual value (without the to_date function itself):
    snprintf(dSQLDate, sizeof(dSQLDate), "2006/11/3:00:00:00");
    OCIBindByPos(sqlStatement, &p_dSQLDate , p_err, 1, dSQLDate, sizeof(dSQLDate), SQLT_CHR, 0, 0, 0, 0, 0, OCI_DEFAULT))

  • Doubts reg try block and return statements

    hi
    public int test()
              try
                   System.out.println("hi");
                   return 1;
              catch(Exception e)
              System.out.println("err");
              return 2;
              finally
                   System.out.println("final");
                   return 3;
              //System.out.println("after");
              //return 4;
    when i call this function, it will printing 3... why ??
    and also compilation error is coming when i put return statement after final block.. why is it so??

    but if commented the return statements in catcch and finally then it iam not getting any compilation error.
    public int test()
              try
                   System.out.println("hi");
                   return 1;
              catch(Exception e)
              System.out.println("err");
              // return 2;
              finally
                   System.out.println("final");
              //     return 3;
              System.out.println("after");
              return 4;
    and iam just learning ..... regarding return and try block

  • Why is the clause marked red giving error - unexpected end of sql statement

    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
         SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),                         (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B')
                        FROM ape_summary_a a ;

    I believe you are missing a parenthesis from the last select statement
    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
    SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'), (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B') )
    FROM ape_summary_a a ;
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • Is Firefox 4 in End Of Life state?

    Is Firefox 4 declared End of Life?

    Is there an official news letter released by Mozilla on this. Can I have the link?

  • Need help to sum up total amount in at end of.....endat!!! Please help

    Hi,
    There is one program need to calculat the SUB-TOTAL AMOUNT FOR SAME DOCUMENT NUMBER.
    Means: Need to sumup betrg for the same belnr.
    QUESTION:
    How can I write the sorce cord In AT END OF...ENDAT.
    TO SUMUP THE AMOUNT FOR SAME DOCUMENT NUMBER.
    Please help!!
    Thanks.
    Here is the sourc code.
    DATA: BEGIN OF t OCCURS 0,
            bukrs   LIKE knb1-bukrs,
    *<<<<< CR01
            zuonr   Like bsid-zuonr,                        "sort key  "CR01
    *>>>>> CR01
            belnr   LIKE bsid-belnr,
            kunnr   LIKE kna1-kunnr,
            bldat   LIKE bsid-bldat,
            budat   LIKE bsid-budat,
            netdt   LIKE bsega-netdt,
            waers   LIKE bsid-waers,
            wrbtr   LIKE bsid-wrbtr,
            shkzg   LIKE bsid-shkzg,
            xblnr   LIKE bsid-xblnr,                            "WD041005a
            sgtxt   LIKE bsid-sgtxt,
            dmbtr   LIKE bsid-dmbtr,
          END OF t.
    Description of Interface-record RECON
    DATA: BEGIN OF s,
            belnr(10),                     " document number
    *<<<< CR01 STRAT ADD ZUONR
            zuonr(10),                     "sort key  " CR01
    *>>>> CR01 END ADD ZUONR
            filler1(1),
          KUNNR(5),                      " customer no."WD290705a
            kunnr LIKE kna1-kunnr,         " customer no."WD290705a
            filler2(1),
            bldat(10),                     " date
            filler3(1),
            budat(10),
            filler4(1),
            netdt(10),                     " due date for payment
            filler5(1),
            betrg(14),                     " amount
            filler6(1),
            waers(3),                      " currency
            filler7(1),                    " document field - blank
            compcode(4),                   " company-code         "fw070905
            filler8(1),                    " comment - blank
            sgtxt(50),                     " Text             "INS MG020207
            filler9(1),
            kmmnt(30),
            filler10(1),
            vbeln(12) ,
            filler11(1),
            xblnr(16),                     "WD041005a hier Referenznr rein
            filler12(1),
            lifn2(11),
            filler13(1),                   " remark - blank
            dmbtr(14),
            filler14(1),
            twaer(3),
          END OF s.
    DATA: BEGIN OF outtab OCCURS 1000,
                s LIKE s,
          END OF outtab.
    *<<<<< INS MG020207
    TYPES: BEGIN OF ty_outalv,
             belnr(10),                     " document number
    *<<<< CR01 START ADD ZUONR
             zuonr,                         " sort key  " CR01
    *>>>>CR01 END ADD AUONR
             kunnr LIKE kna1-kunnr,         " customer no."WD290705a
             bldat(10),                     " date
             budat(10),                     " posting date
             netdt(10),                     " due date for payment
             betrg(14),                     " amount
             waers(3),                      " currency
             compcode(4),                   " company-code         "fw070905
             sgtxt(30),                     " comment
             kmmnt(30),                     " comment
             vbeln(12),                     " delivery number
             xblnr(16),                     "WD041005a hier Referenznr rein
             lifn2(11),                     " customer number
             dmbtr(14),
             twaer(3),                     " currency company code
           END OF ty_outalv.
    DATA: gt_outalv TYPE STANDARD TABLE OF ty_outalv.
    DATA: gs_outalv TYPE ty_outalv.
    *>>>>> INS MG020207
    DATA: l_date TYPE sy-datum.
    DATA: g_date TYPE sy-datum.
    DATA: g_budat TYPE bsik-budat.
    *<<<< CR01 START   ADD DATA STATEMENT
    DATA: wk_belnr LIKE bsid-zuonr,
          wk_x_belnr LIKE bsid-zuonr,
          ZUONR LIKE BSID-ZUONR,
          WRBTR LIKE BSID-WRBTR,
          WK_ZUONR LIKE BSID-ZUONR,
          WK_WRBTR LIKE BSID-WRBTR.
    *>>>> CR01 END  ADD DATA STATEMENT
    DATA: l_it_bsik TYPE STANDARD TABLE OF bsik.               "INS MG050706
    DATA: l_wa_bsik TYPE bsik.                                 "INS MG050706
    TYPE-POOLS: slis.                                          "INS MG020207
    DATA:                                                      "INS MG020207
    gt_fieldcat TYPE slis_t_fieldcat_alv,                     "INS MG020207
    gs_layout   TYPE slis_layout_alv,                         "INS MG020207
    gs_fieldcat TYPE slis_fieldcat_alv.                       "INS MG020207
    END-OF-SELECTION.
      SORT t.
      LOOP AT t.
        AT NEW bukrs.
          CLEAR anz_dl.
          CLEAR htext-anzahl.
          CLEAR htext-datei.
          htext-text1 = ' records writen in file '.
          CLEAR p_pfad.
          CONCATENATE
              i_pfad
              'CU_CC'
              t-bukrs
              sy-datum+6(2)
              sy-datum+4(2)
              sy-datum(4)
              sy-uzeit
              '.txt'
         INTO p_pfad.
          CLEAR outtab.
          REFRESH outtab.
          REFRESH: gt_outalv.                                  "INS MG020207
        ENDAT.
       IF t-shkzg = 'H'.
         h_betrg  = t-wrbtr * -1.
       ELSE.
        h_betrg  = t-wrbtr.
        h_dmbtr  = t-dmbtr.
       ENDIF.
        s-filler1 = s-filler2 = s-filler3 = s-filler4 = s-filler5 = ';'.
        s-filler6 = s-filler7 = s-filler8 = ';'.
        s-filler9 = s-filler10 = s-filler11 = s-filler12 = s-filler13 = ';'.
        s-filler14 = ';'.
        s-belnr = t-belnr.
        IF t-xblnr NE space.                                    "WD041005a
          s-xblnr      = t-xblnr.                               "WD041005a
        ELSE.                                                   "WD041005a
          s-xblnr      = t-belnr.                               "WD041005a
        ENDIF.                                                  "WD041005a
        WHILE s-xblnr(1) EQ '0'.                            "INS MG130606
          SHIFT s-xblnr LEFT.                               "INS MG130606
        ENDWHILE.                                            "INS MG130606
        WRITE t-kunnr TO s-kunnr NO-ZERO.
        s-lifn2 = s-kunnr.
        shift s-lifn2 RIGHT.
        s-lifn2(1) = 'R'.
      S-KUNNR = T-KUNNR+5(5).
        s-bldat+2(1) = '/'.
        s-bldat+5(1) = '/'.
        s-bldat0(2) = t-bldat4(2).
        s-bldat3(2) = t-bldat6(2).
        s-bldat6(4) = t-bldat0(4).
        s-budat+2(1) = '/'.
        s-budat+5(1) = '/'.
        s-budat0(2) = t-budat4(2).
        s-budat3(2) = t-budat6(2).
        s-budat6(4) = t-budat0(4).
        s-netdt+2(1) = '/'.
        s-netdt+5(1) = '/'.
        s-netdt0(2) = t-netdt4(2).
        s-netdt3(2) = t-netdt6(2).
        s-netdt6(4) = t-netdt0(4).
        s-waers      = t-waers.
        s-dmbtr      = t-dmbtr.
        s-sgtxt      = t-sgtxt.
        CLEAR s-twaer.
        SELECT SINGLE waers INTO s-twaer
                            FROM t001
                            WHERE bukrs = t-bukrs.
        IF h_betrg < 0.
          hs_betrg+0(1) = '-'.
        ELSE.
          hs_betrg+0(1) = ' '.
        ENDIF.
        WRITE h_betrg CURRENCY t-waers TO hs_betrg+1 NO-GROUPING
                                                        NO-SIGN
                                                        LEFT-JUSTIFIED.
        REPLACE ',' WITH '.' INTO hs_betrg.
        WRITE hs_betrg TO s-betrg.
        IF h_dmbtr < 0.
          hs_betrg+0(1) = '-'.
        ELSE.
          hs_betrg+0(1) = ' '.
        ENDIF.
        WRITE h_dmbtr CURRENCY t-waers TO hs_betrg+1 NO-GROUPING
                                                        NO-SIGN
                                                        LEFT-JUSTIFIED.
        REPLACE ',' WITH '.' INTO hs_betrg.
        WRITE hs_betrg TO s-dmbtr.
        s-compcode   = t-bukrs.                                 "fw070905
        IF p_downl = 'X'.
          MOVE s TO outtab-s.
          APPEND outtab.
          ADD 1 TO anz_dl.
        ENDIF.
        gs_outalv-belnr = s-belnr.                             "INS MG020207
    *<<<< CR01 START ADD as_outalv-zuonr
        gs_outalv-zuonr = s-zuonr.                             "CR01
    *>>>> CR01 EDD   ADD as_outalv-zuonr
        gs_outalv-kunnr = s-kunnr.                             "INS MG020207
        gs_outalv-bldat = s-bldat.                             "INS MG020207
        gs_outalv-netdt = s-netdt.                             "INS MG020207
        gs_outalv-betrg = s-betrg.                             "INS MG020207
        gs_outalv-waers = s-waers.                             "INS MG020207
        gs_outalv-compcode = s-compcode.                       "INS MG020207
        gs_outalv-budat = s-budat.                             "INS MG020207
        gs_outalv-sgtxt = s-sgtxt.
        gs_outalv-kmmnt = s-kmmnt.
        gs_outalv-vbeln = s-vbeln.
        gs_outalv-xblnr = s-xblnr.
        gs_outalv-lifn2 = s-lifn2.
        gs_outalv-dmbtr = s-dmbtr.
        gs_outalv-twaer = s-twaer.
        APPEND gs_outalv TO gt_outalv.                         "INS MG020207
        AT END OF bukrs.
          WRITE anz_dl  TO htext-anzahl.
          WRITE p_pfad  TO htext-datei.
          CONDENSE htext.
          IF p_downl = 'X'.
            SKIP 2.
            WRITE: / htext.
            CALL FUNCTION 'GUI_DOWNLOAD'
              EXPORTING
                filename                = p_pfad
                filetype                = 'ASC'
              TABLES
                data_tab                = outtab
              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
                OTHERS                  = 22.
            IF sy-subrc <> 0.
             write: / 'Error creating File:', P_Pfad, sy-subrc.
              MESSAGE e405 WITH text-002 p_pfad.
            ENDIF.
          ENDIF.
    *<<<<< INS MG020207
          IF p_alvd EQ 'X'.
            PERFORM build_layout_data.
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
              EXPORTING
                i_callback_program     = sy-repid
                i_structure_name       = 'GT_OUTALV'
                is_layout              = gs_layout
                it_fieldcat            = gt_fieldcat[]
                i_callback_top_of_page = 'TOP-OF-PAGE'
              TABLES
                t_outtab               = gt_outalv.
          ENDIF.
    *>>>>> INS MG020207
    ENDAT.
      ENDLOOP.

    HI
    Have alook at below program
    *& Report  ZINTERNALTABLE
    REPORT  zinternaltable.
    TYPES:BEGIN OF itab,
          num TYPE i,
          name(10) TYPE c,
          amt type i,
          END OF itab.
    DATA : wa_itab TYPE itab,
           it_itab TYPE STANDARD TABLE OF itab.
    DATA : v_lines TYPE i.
    wa_itab-num = 1.
    wa_itab-name = 'nag'.
    wa_itab-amt = 1000.
    append wa_itab TO it_itab.
    wa_itab-num = 1.
    wa_itab-name = 'nag'.
    wa_itab-amt = 2000.
    append wa_itab TO it_itab.
    wa_itab-num = 1.
    wa_itab-name = 'nag'.
    wa_itab-amt = 1500.
    append wa_itab TO it_itab.
    wa_itab-num = 2.
    wa_itab-name = 'sri'.
    wa_itab-amt = 500.
    append wa_itab tO it_itab.
    wa_itab-num = 2.
    wa_itab-name = 'sri'.
    wa_itab-amt = 600.
    append wa_itab TO it_itab.
    wa_itab-num = 2.
    wa_itab-name = 'sri'.
    wa_itab-amt = 700.
    append wa_itab TO it_itab.
    wa_itab-num = 3.
    wa_itab-name = 'ganesh'.
    wa_itab-amt = 1200.
    append wa_itab TO it_itab.
    wa_itab-num = 3.
    wa_itab-name = 'ganesh'.
    wa_itab-amt = 1300.
    append wa_itab TO it_itab.
    wa_itab-num = 3.
    wa_itab-name = 'ganesh'.
    wa_itab-amt = 1400.
    append wa_itab TO it_itab.
    wa_itab-num = 4.
    wa_itab-name = 'suresh'.
    wa_itab-amt = 900.
    append wa_itab TO it_itab.
    wa_itab-num = 4.
    wa_itab-name = 'suresh'.
    wa_itab-amt = 300.
    append wa_itab TO it_itab.
    sort it_itab.
    LOOP AT it_itab INTO wa_itab.
    at first.
    write :/ 'details of sales order:'.
    uline.
    endat.
    at new num.
    write :/ 'serial num:', wa_itab-num.
    uline.
    endat.
    WRITE :/ wa_itab-num , wa_itab-name , wa_itab-amt.
    at end of num.
    uline.
    sum.
    write :/ 'total amount:',wa_itab-amt.
    uline.
    endat.
    at last.
    sum.
    uline.
    write:/ 'grand total:',wa_itab-amt.
    endat.
    ENDLOOP.
    describe table it_itab lines  v_lines.
    WRITE:/'no of records :', v_lines.
    Regards
    Nagesh.Paruchuri

  • Doubt in control break statement

    Hi All,
    Is there any way to trigger control break statements at new & at end of for non primary key fields.
    i want to trigger both control break statements for my requirement , not at change of, because i want to trigger at end of also. Please let me know if any possibility. Thanks
    regards
    vishal

    hi vishal,
    Variants:
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    Effect
    In a LOOP which processes an internal table, you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT. The sequence of statements which lies between them is then executed if a control break occurs.
    You can use these key words for control break processing with internal tables only if a loop is actively processing an internal table and reference is to the innermost currently active loop.
    The control level structure with internal tables is static. It corresponds exactly to the sequence of columns in the internal table (from left to right). In this context, the criteria according to which you sort the internal table are unimportant.
    At the start of a new control level (i.e. immediately after AT), the following occurs in the output area of the current LOOP statement:
    All character type fields (on the right) are filled with "*" after the current control level key.
    All other fields (on the right) are set to their initial values after the current control level key.
    Between AT and ENDAT, you can use SUM to insert the appropriate control totals in the numeric fields (see also ABAP Number Types) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level (AT FIRST, AT NEW f) and also the end of a control level (AT END OF f, AT LAST).
    At the end of the control level processing (i.e. after ENDAT), the old contents of the LOOP output area are restored.
    Notes
    When calculating totals, you must ensure that the totals are inserted into the same sub-fields of the LOOP output area as those where the single values otherwise occur. If there is an overflow, processing terminates with a runtime error.
    If an internal table is processed only in a restricted form (using the additions FROM, TO and/or WHERE with the LOOP statement), you should not use the control structures for control level processing because the interaction of a restricted LOOP with the AT statement is currenly not properly defined.
    With LOOPs on extracts, there are also special control break control structures you can use.
    Note
    Non-Catchable Exceptions:
    SUM_OVERFLOW: Overflow when calculating totals with SUM.
    Variant 1
    AT NEW f.
    Variant 2
    AT END OF f.
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.See Compatible Work Area with Control Level Processing and Field Symbols Not Allowed as Control Level Criterion.
    Effect
    f is a sub-field of an internal table processed with LOOP. The sequence of statements which follow it is executed if the sub-field f or a sub-field in the current LOOP line defined (on the left) before fhas a different value than in the preceding (AT NEW) or subsequent (AT END OF) table line.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
      AT NEW NAME.
        NEW-PAGE.
        WRITE / WA_COMPANIES-NAME.
      ENDAT.
      WRITE: / WA_COMPANIES-PRODUCT, WA_COMPANIES-SALES.
      AT END OF NAME.
        SUM.
        WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-SALES.
      ENDAT.
    ENDLOOP.
    The AT statements refer to the field COMPANIES-NAME.
    Notes
    If a control break criterion is not known until runtime, you can use AT NEW (name) or AT END OF (name) to specify it dynamically as the contents of the field name. If name is blank at runtime, the control break criterion is ignored and the sequence of statements is not executed. If name contains an invalid component name, a runtime error occurs.
    By defining an offset and/or length, you can further restrict control break criteria - regardless of whether they are specified statically or dynamically.
    A field symbol pointing to the LOOP output area can also be used as a dynamic control break criterion. If the field symbol does not point to the LOOP output area, a runtime error occurs.
    If you use AT within a LOOP with an explicitly-specified output area, the area must be compatible with the line type of the internal table so that it can be initialized properly (as described above) at the start of a new control level.
    You can restrict control break criteria further, regardless of whether they were defined statically or dynamically, by specifying offset and/or length.
    Variant 3
    AT FIRST.
    Variant 4
    AT LAST.
    Effect
    Executes the appropriate sequence of statements once during the first (AT FIRST) or last (AT LAST) loop pass.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
    AT FIRST.
    SUM.
    WRITE: 'Sum of all SALES:',
    55 WA_COMPANIES-SALES.
    ENDAT.
    WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-PRODUCT,
    55 WA_COMPANIES-SALES.
    ENDLOOP.

  • Doubt in case statement

    in my rpd i got two columns a and b
    both have the below mentioned logic
    cloumn A : PREIOD <= 20 THEN 'No' ELSE 'Yes' END
    column B: PREIOD >20 THEN ‘Yes’ ELSE ‘No’ END
    what is the diffrence between these two logic can any one help me with a small example please

    no diffrence as such.Both will populate same values.what is your requirement?
    cloumn A : PREIOD <= 20 THEN 'No' ELSE 'Yes' END It simply states that when value of column period is <=20 then 'No' will be populated for column A and for rest of the values 'Yes' will be populated for column A
    column B: PREIOD >20 THEN ‘Yes’ ELSE ‘No’ ENDIt simply states that when value of column period is >20 then 'Yes' will be populated in column B and for rest of the values 'No' will be populated for column B
    For further help see the help file.Go to functions Answres and see the case when decription.
    Regards,
    Sandeep
    Edited by: Sandeep Saini on 25-Nov-2010 00:46

  • Doubt about UPDATE STAT COLUMN

    Hi,
    I have a doubt of when to execute update stat:
    i create this SQL to generate an SQL script to generate update stat for all my tables:
    select 'UPDATE STAT ' || schemaname || '.' || tablename || ' ESTIMATE SAMPLE 20 PERCENT' from tables where schemaname = 'DBUSER' and not tablename like 'JDBC%' AND type = 'TABLE'
    and created this SQL to generate an SQL script for update stat for all columns.
    select 'UPDATE STAT COLUMN(*) FOR ' || schemaname || '.' || tablename || ' ESTIMATE SAMPLE 20 PERCENT' from tables where schemaname = 'DBUSER' and not tablename like 'JDBC%' AND type = 'TABLE'
    my doubt is i really need run that second script? or the UPDATE STAT for table dont UPDATE STAT for all columns?
    thanks for any insight
    Clóvis

    > my doubt is i really need run that second script? or the UPDATE STAT for table dont UPDATE STAT for all columns?
    Hi Clovis,
    hmm... good question.
    There are a few things to know about the UPDATE STAT command here.
    1) It will always generate statistics for key or indexed columns.
    2) The optimizer won't be able to generate a better plan when there are column statistics for non-indexed columns present.
    3) The command will also collect column statistics for all columns that already have statistics.
    The direct effect of 3) is that by running your second command just once - all column statistics will always be collected.
    Since you can easily change the default sample size for your tables via
    ALTER TABLE SAMPLE SIZE 20 PERCENT
    I would say: drop your script and just use
    UPDATE STAT DBUSER.* ESTIMATE
    This single command would lead to the same statistics as your script does.
    And if you really, really want to leave out the JDBC tables - then just set their default sample size to 0 and they will be ignored by the UPDATE STAT command.
    regards,
    Lars

  • Module pool Program Doubt

    Hi Xperts,
    I am Working an object on module pool.I have a small doubt regarding that.
    tables:lfa1.
    data:begin of itab occurs 0,
    lifnr like lfa1-lifnr,
    land1 like lfa1-land1,
    name1 like lfa1-name1,
    end of itab.
    case sy-ucomm.
    when 'disp'.
    select lifnr land1 name1 from lfa1 into itab where lifnr = lfa1-lifnr.
    append itab.
    endselect.
    when 'exit'.
    leave program.
    endcase.
    Here comes the doubt.Why do we use the statement underneath and why is this always under PBO.As lfa1 is an SAP standard table how can we move anything into that.
    Move-corresponding itab to lfa1.
    Query#2: Suppose a Z table was used.We pulled the fields onto the layout.For only retrieving of database values, do i need to declare an internal table like the way i defined here.
    Thanks in advance.Hope i get my queries resolved.
    --Ranjith.T.

    Hi,
    The declaration "tables:lfa1" means you are declaring a work area of type lfa1. Anything you change in this workarea does not change the filed in the actual database table.
    PBO means Process before output. It contains declarations and some initializations.
    Yes you need an internal table and use that internal table to populate your values.
    Regards,
    Subramanian

  • Control statements

    When using control statements like AT FIRST...ENDAT.AT NEW (field).... ENDAT.
    Is it necessary to define the field (thru which we r going to group the records) as a first field in internal table?

    Hi,
         Control break statements are used to stop the control at a particular point.
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    Effect
    In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs.
    You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset.
    The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted .
    At the start of a new control level (i.e. immediately after AT ), the following occurs in the output area of the current LOOP statement:
    All default key fields (on the right) are filled with "*" after the current control level key.
    All other fields (on the right) are set to their initial values after the current control level key.
    Between AT and ENDAT , you can use SUM to insert the appropriate control totals in the number fields (see also ABAP/4 number types ) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level ( AT FIRST , AT NEW f ) and also the end of a control level ( AT END OF f , AT LAST ).
    At the end of the control level processing (i.e. after ENDAT ), the old contents of the LOOP output area are restored
    use control break on any fields
    chk this sample program
    REPORT YCHATEST LINE-SIZE 350.
    TABLES MARA.
    DATA : BEGIN OF ITAB OCCURS 0,
             MATNR LIKE MARA-MATNR,
             AMOUNT TYPE P DECIMALS 2,
           END OF ITAB.
    ITAB-MATNR = '12345'.
    ITAB-AMOUNT = '100.20'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-MATNR = '12345'.
    ITAB-AMOUNT = '100.20'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-MATNR = '3456'.
    ITAB-AMOUNT = '100.20'.
    APPEND ITAB.
    CLEAR ITAB.
    sort itab by matnr amount.
    LOOP AT ITAB.
      AT END OF AMOUNT. 
        WRITE : / ITAB-MATNR , ITAB-AMOUNT.
      ENDAT.
    ENDLOOP.
    Regards

  • SUM STATEMENT

    HI GURU'S,
    Please can anybody explains me
    what is significance of using SUM statement inside the AT AND ENDAT statement.
    what i understood about sum is: The statement SUM calculates the component total with the numeric data type (i, p, f)
    of all rows in the current control level and assigns these to the components of the work area wa. In the control levels
    FIRST, LAST, and outside of an AT-ENDAT control structure, the system calculates the sum of numeric components
    of all rows in the internal table.
    but in below program which i did, its not doing that</b>
    TYPES: BEGIN OF companies_type,
            name(30),
            product(20),
            sales TYPE i,
            SALES1 TYPE I,
          END   OF companies_type.
    DATA: companies TYPE STANDARD TABLE OF companies_type WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          wa_companies TYPE companies_type.
    wa_companies-name = 'XYZ'.
    wa_companies-product = 'SAP'.
    wa_companies-sales = '1'.
    wa_companies-sales1 = '1'.
    APPEND wa_companies TO companies.
    wa_companies-name = 'ABC'.
    wa_companies-product = 'ABAP'.
    wa_companies-sales = '4'.
    wa_companies-sales1 = '4'.
    APPEND wa_companies TO companies.
    wa_companies-name = 'PQR'.
    wa_companies-product = 'HR'.
    wa_companies-sales = '3'.
    wa_companies-sales1 = '3'.
    APPEND wa_companies TO companies.
    LOOP AT companies INTO wa_companies.
      AT NEW name.
      sum.
        NEW-PAGE.
        WRITE / wa_companies-name.
      ENDAT.
      WRITE: / wa_companies-product, wa_companies-sales,wa_companies-sales1.
      AT END OF NAME.
        SUM.
        WRITE: / wa_companies-name, wa_companies-sales,wa_companies-sales1 .
      ENDAT.
    ENDLOOP.
    Thanks
    Priya

    Hi,
      The control statements should be used inside a loop, the internal table should be sorted before using the control statements.
    loop...
    At new name.
    sum.
    endat.
    endloop....
    Sum of the numeric values will be calculated when the name changes. At new  is triggered at the begining itself.
    loop...
    At end of name.
    sum.
    endat.
    endloop....
      Sum of the numeric values will be calculated when the name changes .
    Just a simple example:
    ID no    Name    Salary.
    100       Ram     5000
    100       Ravi      6000
    200       Prajn    7000
    In this case.
    loop at itab.
      At new idno.
         sum
      write:/ itab-idno , itab-name, itab-salaty.
    Endat.
    endloop.
    O/p will be :
          100  Ram 11000
    The sum will trigger when the number idno is changing .
    Similarly AT end  also works.
    Regards,
    Vani

Maybe you are looking for

  • Why does my Macbook Pro take so long to go to sleep?

    I have a mid 2012 15' Macbook Pro with retina display and I'm having problems with it going to sleep mode. This laptop was used for a few months by my brother before me and he had no problems with this, and neither did I have it until a few days ago.

  • Error In The Installaion SAP NW PI 7.1

    Hi All, We are installing SAP NW PI7.1 with EHP1 on RHEL5 and MAXDB. It's getting error at the last but one phse (installation of software units). I am pasting the java.log   : [1106630976] 13:30:14 ***ERROR (os_linux.cpp:2916): os::create_event: sem

  • How to reduce image's file size in Preview?

    I am in Preview Version 5.0.3 (504.1).  I have a PDF file that is 3.7 meg. in size.  That is a big large for what I want to do with it.  I would like to reduce its size to something a bit more manageable.   The Preview Help gives these instructions:

  • Adding an icon to a custom panel

    Hi, I have created some WindowSWF panels, and want to add an icon to them, so that when they are minimised I can tell what they are. I've googled and checked the 'Extending Flash' docs but can find no reference on how to do this. Anyone have any idea

  • Failed to execute query

    HI Genius, I have designed on MDX Query. That Query is working in Crystal Report. I have successfully exported universe from this query. Now I want to use this universe in Query As A Web Service. I found universe of this query in QaawS. I am able to