What is the syntax for a CASE statement in Crystal XI

I'm having difficulty locating documentation for the use of CASE statements in Crystal syntax. My database administrator does not allow me to write SQL expressions so I need to covert the SQL below to Crystal Syntax. Can anyone help me? Thank you very much!!
Select
   CASE
         WHEN projects.ProjType like 'S%' then 'Shopping Center'
         WHEN projects.ProjType like 'I%' then 'Industrial'
         WHEN projects.ProjType like 'O%' then 'Office Building'
         ELSE 'Other'
   END
from projects

Let's assume column XYZ has both numbers (1), and letters (any alphabet).
I have a case statement on SQL to turn any value that's not 1 into 0, then I am getting a sum of that column.
I am also grouping by Row A, B etc to get aggregated sum of column XYZ for those group.
Now on Crystal Reports function, I need to sum up values under column XYZ for all the groups.
If I try using sum function like below, I get an error stating:
"A number field or currency amount field is required here"
(sum({Command.XYZ}))
So I thought if I can use a case statement to change the non-numbers to 0 prior to sum that will probably resolve it. But I could not get the below case statement to work either (Error: A string is required). 
SELECT {Command.XYZ}
   Case 1:
      1 
   Default:
      0;

Similar Messages

  • What is the condition for First write statement in reports?

    What is the condition for First write statement in reports?

    In
    TOP-OF-PAGE & START-OF-SELECTION.
    U have to write what ever u want to dispaly.
    Top-of-page will trigger first and write the statements.
    SAmple report program for reference.
    REPORT ztemplate
              NO STANDARD PAGE HEADING
              LINE-SIZE 130
              LINE-COUNT 65
              MESSAGE-ID zm.
    * The Data Declarations
    TABLES:    mara." General Material Data.
    * Type Declarations:
    TYPES : BEGIN OF ty_mara,
              cb(1),
              matnr LIKE mara-matnr,
              mtart LIKE mara-mtart,
              matkl LIKE mara-matkl,
             END OF ty_mara.
    * Internal Tables:
    * The following structure type must be defined in the data dictionary
    DATA :  i_output TYPE ty_mara OCCURS 0 WITH HEADER LINE.
    DATA: lines TYPE i, free TYPE i.
    * The Selection Screen Definition
    SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-b01.
    *SELECTION-SCREEN skip.
    SELECT-OPTIONS: s_matnr FOR  mara-matnr.                  "Material No
    *PARAMETERS:     P_XXXXX like XXXX-XXXXX.                   "Description
    *PARAMETERS:     CB_XXXX as checkbox.                       "Description
    *PARAMETERS:     RB_XXXY radiobutton group XXX default 'X'. "Description
    *PARAMETERS:     RB_XXXZ radiobutton group XXX.             "Description
    *SELECTION-SCREEN COMMENT fmt name.
    SELECTION-SCREEN END OF BLOCK b_main.
    *SELECTION-SCREEN ULINE.
    *eject
    * INITIALIZATION
    INITIALIZATION.
    * AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    *Validate material no details
    IF NOT s_matnr[] IS INITIAL.
    LOOP AT s_matnr.
    IF NOT s_matnr-low  IS INITIAL.
      SELECT SINGLE matnr INTO v_matnr
             FROM mara
             WHERE matnr = s_matnr-low.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
      ENDIF.
    IF NOT s_matnr-high IS INITIAL.
      SELECT SINGLE matnr INTO v_matnr
             FROM mara
             WHERE matnr = s_matnr-high.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
      ENDIF.
    ENDLOOP.
    ENDIF.
    * START-OF-SELECTION
    START-OF-SELECTION.
       REFRESH: i_output.
      CLEAR  : i_output.
      SELECT matnr
             mtart
             matkl
             INTO TABLE i_output
             FROM mara
             WHERE mara~matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i000 WITH text-002.
        " No records found for selected criteria
            leave list-processing.
      ENDIF.
      IF NOT i_output[] IS INITIAL.
        LOOP AT i_output INTO wa_output.
          WRITE:/001 wa_output-cb AS checkbox,
                 003 wa_output-matnr,
                 015 wa_output-mtart,
                 024 wa_output-matkl.
          CLEAR wa_output.
        ENDLOOP.
      ENDIF.
    * END-OF-SELECTION
    END-OF-SELECTION.
      lines = sy-linno - 1.
    SET PF-STATUS 'ZSTATUS'.
    AT USER-COMMAND.
          wa_output-cb = space.
          SET PF-STATUS 'ZSTATUS' EXCLUDING 'SAVE'.
          DO lines TIMES.
            READ LINE sy-index FIELD VALUE wa_output-cb.
              IF wa_output-cb = 'X'.
            MODIFY i_output  FROM wa_output INDEX sy-tabix TRANSPORTING cb.
            ENDIF.
          ENDDO.
    CASE sy-ucomm.
    WHEN 'SAVE'.
          DELETE i_output WHERE cb = 'X'.
    WHEN 'BACK'.
    LEAVE SCREEN.
    ENDCASE.
    * TOP-OF-PAGE.
    TOP-OF-PAGE.
      ULINE.
      FORMAT INTENSIFIED OFF.
      FORMAT COLOR COL_HEADING.
      WRITE:/001 'CB' ,
             003 'Material No',
             015 'Mat type',
             024 'Mat group'.
      FORMAT COLOR OFF.
      FORMAT INTENSIFIED ON.
      ULINE.

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • What is the syntax for the mdx offset in universe designer?

    Hi everybody!!!
    I wish someone could help me with my mdx syntax. I made an universe with Universe designer (BOEdge 3.1) from a BW query and I'm trying to create in this universe an object with an offset.
    My new object has to be the result of the [0CALYEAR].[LEVEL01] with "- 1" offset, is it possible???
    I tried to put the code in the select or in the where fields of the object but without results. When I try to make a query in webi rich client this "new object" doesn't work...
    Please help me...
    Dario

    Hi Ingo,
    thank you for the reply.
    I tried to use that document...the problem is when I put the code in the object (inside univ des) and I analyse the code using the button, the syntax is every time without errors. When I try to make the query in webi rich client , if I use that object the software shows a window with error.
    I used these code in the "where" field:
    1. <EXPRESSION>@SELECT([0CALYEAR].[LEVEL01])-1</EXPRESSION>
    2. <EXPRESSION>@SELECT(Anno calendario\L01 Anno calendario)-1</EXPRESSION>
    the problem is to find the right syntax for what I want...the -1 offset for the new object from the OCALYEAR. I need that if in webi I select from the object filter [0CALYEAR].[LEVEL01] the value 2010 - in the new object will be 2009 etc...
    Dario

  • What is the SYNTAX for the user and group filters??? Is the HTML Ampersand token Amper A m p semicolon required in the filter

    There seems to be quite a bit of confusion over the actual syntax for the user and group filters on the Forms Based Authentication  Ldap Role and membership providers.. MSFT isn't really clear and there is a universal confusion in the blogsphere.
    I the filters should the prefix be the ACTUAL Ampersand or the HTML token for an AMPERSAND.. I realize the in many cases the blogger might have inadvertently specified the html token when the bare naked ampersand was intended..   The question
    therefore is : can a filter be taken directly from and ADSIEdit query and used as a filter or must the filter be made HTML safe by swapping out the AMERSAND with the HTML Token for AMERSAND before putting it into the configuration
    for the LDAPRole/membership provider...
    All science is either physics or stamp collecting

    Hi GUYO,
    I am not quite sure how we implement this on sharepoint side, as I did research and sharepoint may not have this feature to do this.
    most of the LDAP for sharepoint may need to follow these steps in this article:
    http://technet.microsoft.com/en-us/library/ee806890(v=office.15).aspx
    http://blogs.msdn.com/b/sridhara/archive/2010/01/07/setting-up-fba-claims-in-sharepoint-2010-with-active-directory-membership-provider.aspxhttp://blogs.msdn.com/b/kaevans/archive/2013/01/31/configuring-ldap-for-fba-in-sharepoint-2010-or-sharepoint-2013-with-powershell.aspx
    here is an example :
    http://blogs.msdn.com/b/sharepoint__cloud/archive/2011/12/20/achieving-fba-with-adlds-amp-sharepoint-2010.aspx
    if should this questions was at the ADSIEdit part, perhaps you can help us by opening a new thread at the AD foum
    https://social.technet.microsoft.com/Forums/en-US/home?category=windowsserver
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • What is the syntax for this?

    Hi,
    I'm new to CF and am trying to create a security layer for a
    page that has some links where users can download a program.
    I am trying to say, "If you're not logged in and you request
    "myapplication.cfm", abort and go back to the index page. What is
    the correct syntax for this? Also, could you please spell it out
    since, as I said, I'm new to CF and to programming. Thank
    you!

    AmyEverAfter wrote:
    > I was putting it in the Application.cfc file.
    >
    > The OnRequestStart function doesn't seem to work for
    what I'm doing.
    OnRequestStart has always worked for me for this type of
    function. But
    as I have no clue to what you are doing, I can't say why it
    is different
    for you then for me.
    Have you reviewed the example in the documentation?
    http://livedocs.adobe.com/coldfusion/8/htmldocs/appSecurity_14.html
    http://livedocs.adobe.com/coldfusion/8/htmldocs/appSecurity_15.html
    http://livedocs.adobe.com/coldfusion/8/htmldocs/appSecurity_16.html
    http://livedocs.adobe.com/coldfusion/8/htmldocs/appSecurity_17.html
    And the entire section on Securing Applications in the
    ColdFusion
    Developer's Guide?
    http://livedocs.adobe.com/coldfusion/8/htmldocs/appSecurity_01.html
    If you have and are still having trouble, we need to know
    what the
    actual problem(s) is|are, how you have tried to solve them
    (i.e. code)
    and what the results where as well as any error messages
    generated.

  • What's the syntax for Insert statement in Servlet?

    I'm trying to insert record into table using servlet. Can you please show me the statement and syntax of how to use it?

    hi
    we can insert in 2 types
    1) to all column insert
    insert into <tablename> values  ( 1,2,3,4...n);
    2) particular column insert
    insert into <tablename> ( col1,col2,col3...n)  values  ( value1 for col1, 2 , 3...n);
    ex:
              PreparedStatement ps = con.prepareStatement ( "insert into billtable (grandtotal,userid,creditno)values( ?,?,? )" );
              //bill table
              ps.setDouble ( 1, 10.50);  //replace this double value with double variable
              ps.setString ( 2, "vijay");
              ps.setLong      ( 3, 1111111111);  
              ps.executeUpdate ();
              ps.clearParameters ();
              ps.close ();More Details refer java with Jdbc concepts

  • What is the syntax for searching Firefox History?

    I remember reading an article about war a few days ago. When I search my extensive Firefox history for "war" (without the quotes) I get results for "warm", "warning", etc. I have searched Firefox/Mozilla support to no avail. Except for similar requests that resulted in suggested addins that no longer work on Firefox 24+.
    Does anyone know of Firefox History search syntax information I can use?
    Also, it would be nice if the Mozilla Support search allowed something like +History +search. Typing "history search" in Firefox support shows me everything about either history or search.
    Thank you for your help

    You would need to use a Google site search to do an AND search.
    *http://www.google.com/search?q=site:support.mozilla.org {search terms}

  • What is the syntax for set-key RSA-PUB in JCOP Shell?

    I am trying to perform Put Key for the RSA DAP Verification Key using JCOP Shell.
    I have tried variations of the following:
    set-key 115/1/RSA-PUB/[128 byte public key modulus]
    set-key 115/1/RSA-PUB/A001[1 byte public key exponent]A18180[128 byte public key modulus]
    set-key 115/1/RSA-PUB/A001[1 byte public key exponent]A180[128 byte public key modulus]
    But when I send the following command on a SSD with DAP Verification privilege after mutual authentication
    put-key -m add 115/1
    I get jcshell: Unknown exception: java.lang.ArrayIndexOutOfBoundsException: 161 (or 172)
    Thanks,
    Ming

    The format for RSA-PUB is:
    <pubexp length><pubexp><mod length><mod>
    For example:
    115/1/RSA-PUB/0301000180xxxxxx....

  • What is the syntax for If x contains ...

    I've tried
    KF Debit Memo
    'KF Debit Memo'
    "KF Debit Memo"
    ... but it is not getting caught?

    OK - I found the answer in a piece by Steve Rumsby ...
    "  ....Because the Personas script IF only tests values in screen fields, I have a hidden field into which I paste a value that can be tested....."
    These leaves a issue when you don't know what screen you're going to be on.
    In DP91 RRB - attempting to create a Debit Memo Request can either take you to a flavour of DP91 or VA02 therefore you need to paste the task bar value into an on screen field on VA02 or DP91 .... how to I know which one to past to?
    Any logic brain boxes out there?

  • WHAT  ARE THE SYNTAXES FOR CALLTRANSACTION AND SESSION METHODS

    hi
    experts
    can u help me plzzzzzzzzzzzzzzzzzzzzzz
    for this

    Check oout this sample program ...
    REPORT  ztest_report
    NO STANDARD PAGE HEADING
                            LINE-SIZE 255
                            MESSAGE-ID ZRASH.
    *                 Internal Table Declarations                          *
    *--Internal Table for Data Uploading.
    DATA : BEGIN OF IT_FFCUST OCCURS 0,
             KUNNR(10),
             BUKRS(4),
             KTOKD(4),
             ANRED(15),
             NAME1(35),
             SORTL(10),
             STRAS(35),
             ORT01(35),
             PSTLZ(10),
             LAND1(3),
             SPRAS(2),
             AKONT(10),
           END OF IT_FFCUST.
    *--Internal Table to Store Error Records.
    DATA : BEGIN OF IT_ERRCUST OCCURS 0,
             KUNNR(10),
             EMSG(255),
           END OF IT_ERRCUST.
    *--Internal Table to Store Successful Records.
    DATA : BEGIN OF IT_SUCCUST OCCURS 0,
             KUNNR(10),
             SMSG(255),
           END OF IT_SUCCUST.
    *--Internal Table for Storing the BDC data.
    DATA : IT_CUSTBDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *--Internal Table for storing the messages.
    DATA : IT_CUSTMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : V_FLAG1(1) VALUE ' ',
    "Flag used for opening session.
           V_TLINES LIKE SY-TABIX,
           "For storing total records processed.
           V_ELINES LIKE SY-TABIX,
           "For storing the no of error records.
           V_SLINES LIKE SY-TABIX.
           "For storing the no of success records.
    *          Selection screen                                            *
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    PARAMETERS : V_FNAME LIKE RLGRAP-FILENAME,
                 V_SESNAM  LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK B1.
    *          Start-of-selection                                          *
    START-OF-SELECTION.
    *-- Form to upload flatfile data into the internal table.
      PERFORM FORM_UPLOADFF.
    *        TOP-OF-PAGE                                                   *
    TOP-OF-PAGE.
      WRITE:/ 'Details of the error and success records for the transaction'
      ULINE.
      SKIP.
    *          End of Selection                                            *
    END-OF-SELECTION.
    *-- Form to Generate a BDC from the Uploaded Internal table
      PERFORM FORM_BDCGENERATE.
    *--To write the totals and the session name.
      PERFORM FORM_WRITEOP.
    *&      Form  form_uploadff
    *     Form to upload flatfile data into the internal table.
    FORM FORM_UPLOADFF .
    *--Variable to change the type of the parameter file name.
      DATA : LV_FILE TYPE STRING.
      LV_FILE = V_FNAME.
    *--Function to upload the flat file to the internal table.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      =  LV_FILE
    *     FILETYPE                      = 'ASC'
          HAS_FIELD_SEPARATOR           = 'X'
    *     HEADER_LENGTH                 = 0
    *     READ_BY_LINE                  = 'X'
    *     DAT_MODE                      = ' '
    *   IMPORTING
    *     FILELENGTH                    =
    *     HEADER                        =
        TABLES
          DATA_TAB                      = IT_FFCUST
        EXCEPTIONS
          FILE_OPEN_ERROR               = 1
          FILE_READ_ERROR               = 2
          NO_BATCH                      = 3
          GUI_REFUSE_FILETRANSFER       = 4
          INVALID_TYPE                  = 5
          NO_AUTHORITY                  = 6
          UNKNOWN_ERROR                 = 7
          BAD_DATA_FORMAT               = 8
          HEADER_NOT_ALLOWED            = 9
          SEPARATOR_NOT_ALLOWED         = 10
          HEADER_TOO_LONG               = 11
          UNKNOWN_DP_ERROR              = 12
          ACCESS_DENIED                 = 13
          DP_OUT_OF_MEMORY              = 14
          DISK_FULL                     = 15
          DP_TIMEOUT                    = 16
          OTHERS                        = 17
      IF SY-SUBRC = 0.
    *--Deleting the headings from the internal table.
        DELETE IT_FFCUST INDEX 1.
    *--Getting the total number of records uploaded.
        DESCRIBE TABLE IT_FFCUST LINES V_TLINES.
      ENDIF.
    ENDFORM.                    " form_uploadff
    *&      Form  Form_bdcgenerate
    *     Form to Generate a BDC from the Uploaded Internal table
    FORM FORM_BDCGENERATE .
    *--Generating the BDC table for the fields of the internal table.
      LOOP AT IT_FFCUST.
        PERFORM POPULATEBDC USING :
                                    'X' 'SAPMF02D' '0105',
                                    ' ' 'BDC_OKCODE'  '/00' ,
                                    ' ' 'RF02D-KUNNR' IT_FFCUST-KUNNR,
                                    ' ' 'RF02D-BUKRS' IT_FFCUST-BUKRS,
                                    ' ' 'RF02D-KTOKD' IT_FFCUST-KTOKD,
                                    'X' 'SAPMF02D' '0110' ,
                                    ' ' 'BDC_OKCODE'  '/00',
                                    ' ' 'KNA1-ANRED'  IT_FFCUST-ANRED,
                                    ' ' 'KNA1-NAME1' IT_FFCUST-NAME1,
                                    ' ' 'KNA1-SORTL'  IT_FFCUST-SORTL,
                                    ' ' 'KNA1-STRAS' IT_FFCUST-STRAS,
                                    ' ' 'KNA1-ORT01' IT_FFCUST-ORT01,
                                    ' ' 'KNA1-PSTLZ' IT_FFCUST-PSTLZ,
                                    ' ' 'KNA1-LAND1' IT_FFCUST-LAND1,
                                    ' ' 'KNA1-SPRAS' IT_FFCUST-SPRAS,
                                    'X' 'SAPMFO2D' '0120',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0125',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0130',     
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0340',     
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0360',
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0210',     
                                    ' ' 'KNB1-AKONT'  IT_FFCUST-AKONT,
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0215',
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0220',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0230',     
                                    ' ' 'BDC_OKCODE'  '=UPDA'.
    *--Calling the transaction 'fd01'.
        CALL TRANSACTION 'FD01' USING IT_CUSTBDC MODE 'N' UPDATE 'S'
        MESSAGES INTO IT_CUSTMSG.
        IF SY-SUBRC <> 0.
    *--Populating the error records internal table.
          IT_ERRCUST-KUNNR = IT_FFCUST-KUNNR.
          APPEND IT_ERRCUST.
          CLEAR IT_ERRCUST.
    *--Opening a session if there is an error record.
          IF V_FLAG1 = ' '.
            PERFORM FORM_OPENSESSION.
            V_FLAG1 = 'X'.
          ENDIF.
    *--Inserting the error records into already open session.
          IF V_FLAG1 = 'X'.
            PERFORM FORM_INSERT.
          ENDIF.
    *--Populating the Success records internal table.
        ELSE.
          IT_SUCCUST-KUNNR = IT_FFCUST-KUNNR.
          APPEND IT_SUCCUST.
          CLEAR IT_SUCCUST.
        ENDIF.
    *--Displaying the messages.
        IF NOT IT_CUSTMSG[] IS INITIAL.
          PERFORM FORM_FORMATMSG.
        ENDIF.
    *--Clearing the message and bdc tables.
        CLEAR : IT_CUSTBDC[],IT_CUSTMSG[].
      ENDLOOP.
    *--Getting the total no of error records.
      DESCRIBE TABLE IT_ERRCUST LINES V_ELINES.
    *--Getting the total no of successful records.
      DESCRIBE TABLE IT_SUCCUST LINES V_SLINES.
    *--Closing the session only if it is open.
      IF V_FLAG1 = 'X'.
        PERFORM FORM_CLOSESESS.
      ENDIF.
    ENDFORM.                    " Form_bdcgenerate
    *&      Form  populatebdc
    *       FOrm to Populate the BDC table.
    FORM POPULATEBDC  USING    VALUE(P_0178)
                               VALUE(P_0179)
                               VALUE(P_0180).
      IF P_0178 = 'X'.
        IT_CUSTBDC-PROGRAM = P_0179.
        IT_CUSTBDC-DYNPRO = P_0180.
        IT_CUSTBDC-DYNBEGIN = 'X'.
      ELSE.
        IT_CUSTBDC-FNAM = P_0179.
        IT_CUSTBDC-FVAL = P_0180.
      ENDIF.
      APPEND IT_CUSTBDC.
      CLEAR IT_CUSTBDC.
    ENDFORM.                    " populatebdc
    *&      Form  FORM_OPENSESSION
    *       Form to Open a session.
    FORM FORM_OPENSESSION .
    *--Variable to convert the given session name into reqd type.
      DATA : LV_SESNAM(12).
      LV_SESNAM = V_SESNAM.
    *--Opening a session.
      CALL FUNCTION 'BDC_OPEN_GROUP'
       EXPORTING
         CLIENT                    = SY-MANDT
         GROUP                     = LV_SESNAM
         HOLDDATE                  = '20040805'
         KEEP                      = 'X'
         USER                      = SY-UNAME
         PROG                      = SY-CPROG
    *  IMPORTING
    *    QID                       =
       EXCEPTIONS
         CLIENT_INVALID            = 1
         DESTINATION_INVALID       = 2
         GROUP_INVALID             = 3
         GROUP_IS_LOCKED           = 4
         HOLDDATE_INVALID          = 5
         INTERNAL_ERROR            = 6
         QUEUE_ERROR               = 7
         RUNNING                   = 8
         SYSTEM_LOCK_ERROR         = 9
         USER_INVALID              = 10
         OTHERS                    = 11
      IF SY-SUBRC <> 0.
        WRITE :/ 'Session not open'.
      ENDIF.
    ENDFORM.                    " FORM_OPENSESSION
    *&      Form  FORM_INSERT
    *       fORM TO INSERT ERROR RECOED INTO A SESSION.
    FORM FORM_INSERT .
    *--Inserting the record into session.
      CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          TCODE                  = 'FD01'
    *     POST_LOCAL             = NOVBLOCAL
    *     PRINTING               = NOPRINT
    *     SIMUBATCH              = ' '
    *     CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = IT_CUSTBDC
        EXCEPTIONS
          INTERNAL_ERROR         = 1
          NOT_OPEN               = 2
          QUEUE_ERROR            = 3
          TCODE_INVALID          = 4
          PRINTING_INVALID       = 5
          POSTING_INVALID        = 6
          OTHERS                 = 7
      IF SY-SUBRC <> 0.
        WRITE :/ 'Unable to insert the record'.
      ENDIF.
    ENDFORM.                    " FORM_INSERT
    *&      Form  FORM_CLOSESESS
    *       Form to Close the Open Session.
    FORM FORM_CLOSESESS .
      CALL FUNCTION 'BDC_CLOSE_GROUP'
        EXCEPTIONS
          NOT_OPEN    = 1
          QUEUE_ERROR = 2
          OTHERS      = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " FORM_CLOSESESS
    *&      Form  FORM_FORMATMSG
    *       Form to format messages.
    FORM FORM_FORMATMSG .
    *--Var to store the formatted msg.
      DATA : LV_MSG(255).
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          ID        = SY-MSGID
          LANG      = SY-LANGU
          NO        = SY-MSGNO
          V1        = SY-MSGV1
          V2        = SY-MSGV2
          V3        = SY-MSGV3
          V4        = SY-MSGV4
        IMPORTING
          MSG       = LV_MSG
        EXCEPTIONS
          NOT_FOUND = 1
          OTHERS    = 2.
      IF SY-SUBRC = 0.
        WRITE :/ LV_MSG.
      ENDIF.
      ULINE.
    ENDFORM.                    " FORM_FORMATMSG
    *&      Form  form_writeop
    *       To write the totals and the session name.
    FORM FORM_WRITEOP .
      WRITE :/ 'Total Records Uploaded :',V_TLINES,
               / 'No of Error Records :',V_ELINES,
               / 'No of Success Records :',V_SLINES,
               / 'Name of the Session :',V_SESNAM.
      ULINE.
    ENDFORM.                    " form_writeop

  • What is the syntax for creating global temporary table using a select query

    hii
    I'm creating a global temporary table using a select query ..how to mention 'on commit preserve rows' that?
    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;
    but this is invalid syntax,so how to mention on commit preserve rows in this???if i dont mention it ,by default its considering as on commit delete rows.
    Please help me out of this problem.

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • What's the price for a MacBook Pro Retina Display Top Case with battery in the US?

    I'd like to know what´s the price for a MacBook Pro Retina Display Top Case with battery in the US.

    Here you go.

  • What would the syntax be for type "select"?

    This onload function works great for type "text" - what would the syntax be for type "select"? or is there an example?
    (Vikas' example pg 227)
    window.onload=function () {
    var text=document.getElementsByTagName('input');
    for (var j=0;j<text.length;j++) {
    var ip=text[j];
    if (ip.type=="text") {
    ip.onchange=function () {
         var td=html_CascadeUpTill(this,'TD');
         var tr=html_CascadeUpTill(this,'TR');
         // Getting the value of the PK
         var pk=tr.lastChild.getElementsByTagName('input')[1].value;
         alert(pk);
         var l_cellindex=td.cellIndex;
         var l_column=g_headers[l_cellindex].id;
         var app=html_GetElement('pFlowId').value;
         var pg=html_GetElement('pFlowStepId').value;
         var get=new htmldb_Get(null,app,'APPLICATION_PROCESS=session_auto_update',pg);
         get.add('G_ITEM1',l_column);
         get.add('G_ITEM2',this.value);
         get.add('G_ITEM3',pk);
         alert('column='+l_column+',value='+this.value+',pk='+pk);
         gReturn=get.get();
         if (gReturn) { alert(gReturn); this.focus();}
         get=null;
    </script>

    Here it is... Do I need any adjustments?
    var selectlist=document.getElementsByTagName('select');
    for (var k=0;k<selectlist.length;k++) {
    var select_ip=selectlist[k];
    //alert(select_ip.type);
    if (select_ip.type=="select-one") {
    //alert(select_ip.type);
    select_ip.onchange=function () {
    var td=html_CascadeUpTill(this,'TD');
    var tr=html_CascadeUpTill(this,'TR');
    // Getting the value of the PK
    var pk=tr.lastChild.getElementsByTagName('input')[1].value;
    //alert('PK='+pk);
    var l_cellindex=td.cellIndex;
    var l_column=g_headers[l_cellindex].id;
    var app=html_GetElement('pFlowId').value;
    var pg=html_GetElement('pFlowStepId').value;
    var get=new htmldb_Get(null,app,'APPLICATION_PROCESS=session_auto_update',pg);
    get.add('G_ITEM1',l_column);
    get.add('G_ITEM2',this[this.selectedIndex].value);
    get.add('G_ITEM3',pk);
    //alert('COLUMN='+l_column+',VALUE='+ this[this.selectedIndex].value+',PK='+pk);
    gReturn=get.get();
    if (gReturn) { alert(gReturn); this.focus();}
    get=null;
    }

  • What is the use of at new statement?

    What is the use of at new statement?

    Hi,
    AT - itab
    Syntax
    LOOP AT itab result ...
      [AT FIRST.
       ENDAT.]
        [AT NEW comp1.
         ENDAT.
           [AT NEW comp2.
           ENDAT.
           AT END OF comp2.
           ENDAT.]
         AT END OF comp1.
         ENDAT.]
      [AT LAST.
      ENDAT.]
    ENDLOOP.
    Extras:
    1. ...  FIRST
    2. ... |{END OF} compi
    3. ...  LAST
    Effect
    The statement block of a LOOP loop can contain control structures for control level processing. The respective control statement is AT. The statements AT and ENDAT define statement blocks that are executed at control breaks, that is, when the control structure is changed. The additions to the AT statements determine the control break at which their statement blocks are executed. Within these statement blocks, the statement SUM can be specified to add together the numeric components of a control level. For the output behavior result, the same applies as for LOOP AT.
    The prerequisite for control level processing is that the internal table is sorted in exactly the same sequence as the component of its line type - that is, first in accordance with the first component, then in accordance with the second component, and so on. The line structure and the corresponding sorting sequence gives a group structure of the content of the internal table, whose levels can be evaluated using AT statements. The AT- ENDAT control structures must be aligned one after the other, in accordance with the group structure.
    The statement blocks within the AT- ENDAT control structures are listed if an appropriate control break is made in the current table line. Statements in the LOOP- ENDLOOP control structure that are not executed within an AT- ENDAT control structure are executed in each pass of the loop.
    In order that control level processing is carried out properly, the following rules must be observed:
    After LOOP, a restricting condition cond can only be specified if this selects a consecutive line block of the internal table. Otherwise, the behavior of control level processing is undefined.
    The internal table cannot be modified within the LOOP loop.
    A work area wa specified in the LOOP statement after the addition INTO must be compatible with the line type of the table.
    The content of a work area wa specified after the addition INTO in the LOOP statement must not be modified.
    If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
    The components of the current control key remain unchanged.
    All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
    All the other components to the right of the current control key are set to their initial value.
    When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa.
    Addition 1
    ... FIRST
    Effect
    The control level is defined by the first line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT FIRST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Addition 2
    ... |{END OF} compi/>
    Effect
    : Control levels are defined by the beginning or end of a group of lines with the same content in the component compi (where i = 1, 2, and so on) and in the components to the left of compi. The control breaks take place when the content of the component compi or another component to the left of compi changes.
    The compi components can be specified as described in Specification of Components, with the limitation that access to object attributes is not possible here.
    Note
    If the INTO or ASSIGNING additions are used in the LOOP statement, a field symbol can be entered after AT |{END OF} outside classes, to which the corresponding component of the work area wa or the field symbol <fs> is assigned. This form of dynamic component specification is obsolete and has been replaced by specification in the format (name).
    Addition 3
    ... LAST
    Effect
    : The control level is defined by the last line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT LAST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Regards,
    Prashant

Maybe you are looking for

  • Scripting preferences

    I'm working on a script that sets various preferences for InDesign and InCopy. My goal is to be able to set every preference that appears on every tab of the Preferences dialog in either application. I've got most of them, but there are a few I can't

  • SG500 or 3560x for 375 poe ports (117 of which are poe+ 25w needed)

    Hi there, new to the boards but looking for some assistance since it's been awhile since I've worked with the Cisco products. I'm working on a configuration that will involve roughly 400 gig ports and looking to provide 25w of poe+ to 117 ports and t

  • NCS failing to gather current clients from APs

    We're running NCS 1.1.0.58. Since updating to this release from the 1.0 release, the 'Autonomous AP Client Status' and 'Lightweight Client Status' background tasks have been failing with message 'java.lang.NullPointerException'.  I believe as a resul

  • IMAQ vs NI Vision

    Hi...  First a question about IMAQ...  I've seen a lot of LabVIEW examples that include IMAQ VI's...  What does one have to own or buy to get access to these IMAQ vi's???  Second, what is IMAQ versus NI Vision???  Is NI Vision a newer name for what u

  • My ipad mini required a restore but appears to crash on the firmware

    i have just purchased an ipad mini and on connecting it to itunes it stated that I needed to restore to factory settings. I have tried doing this, howeverit appears to freeze on the restoring of ipad firmware.