Read statment

Hi,
Is it possible to read from internal table by comparing special characters like '*'.
  For example I have one string xxxx* ,
My internal table contains following entries.
xxxxzzz
xxxxyyy.
How to retrieve this using read statment.
Regards,
Satya

You can't do that using the READ statement...You should LOOP the internal table and compare each field...
LOOP AT ITAB ASSIGNING <FS_TAB>.
IF <FS_TAB>-FIELD CP 'XXXX*'.
  WRITE: <FS_TAB>-FIELD.
ENDIF.
ENDLOOP.
Greetings,
Blag.

Similar Messages

  • How to give two values of same field in read Statment

    Hi,
    Please Tell me how to give the two values of same field in read statements Condition.
    i.e
      Read table it_tab with key matnr = '1' or matnr = '2'.
    With Regards
    Kesavaperumal

    Hi Kesavaperumal,
    <li>You can not use OR operator with READ TABLE statement.
    <li>You have to use different fields of the internal table in where condition.
    <li>If you want to compare with two values, you need to use LOOP statement.
    LOOP AT it_mara WHERE matnr = '1' or matnr = '2'.
    "Write code
    ENDLOOP.
    Thanks
    Venkat.O

  • Need help in read statment

    Hi,
    i have a internal table with following records,
    BDZEI     PDATU     PLNMG
    1083     20071029     4
    <b>1083     20071029     44</b>
    1096     20071029     44
    1096     20071029     100
    <b>1096     20071029     62</b>
    1089     20071029     32
    <b>1089     20071029     40</b>
    i want to fetch the plnmg values from this table it will check the each and every BDZEI values to collect the last bdzei value and its qty.for example in my internal table contains bdzei values 1083 1083 i need the second value,  for 1096 in need the 3rd values, for 1089 i need 2 values.
    how to do plz give some idea. point will be sure.
    Mohana

    Hi Mohan,
    Loop through itab1.
    at end of BDZEI.
    move entries to itab2.
    endat.
    display itab2.
    <b>Reward points if it helps,</b>
    Satish

  • Doubt in loop.......endloop  and Read..........

    Hi,
          the current syntax  we are using for looping a internal table is
    1. loop at itab
      assigning <fs_itab>.
    if <fs_itab> is assigned.
    endif.
    endloop. 
    My TL suggested me that if the field symbol is not  assigned then it will not move into the loop. So there is no need for checking if the field symbol is assiged or not. I am not sure please suggest.
    2. One more question current read syntax we are using
        read itab assigning <fs_itab>............
             if <fs_itab> is assigned.
             endif.
    instead of checking if the field symbol is assigned can check the sy-subrc.
    will there be any case in which even if the field symbol is not assigned there is chance of sy-subrc eq 0. Please suggest

    Hi,
    For ur first question field symbol check is not required as the field symbol will get assigned only if the itab contains the data.
    But for ur second question, it is better to check with SY-SUBRC as the field symbol always contains the data of the internal table for every iteration. It could be a problem if  u r reading the data with some where clause as the the field symbol will not get refreshed and contains the previous record data irrelevent to the success of the READ statement.
    U need to perform some operation only if the read statement is successfull. If u r using READ statment then it is always better to use SY-SUBRC instead of checking with destination one.
    Reward points if this is helpful for u.
    Chandrasekhar K

  • Read statement in abap

    Hello Experts,
    Can I use both index and key addition in READ statment like
    Read table itab from index i with key id = 'XYZ'.
    Actually I am using that but the read statement is not following both the addition.Is there any other way out in which I can do that.I dont want to use LOOP...ENDLOOP

    Hi *priya singh *.
    You are not able to use index and with key parley in read statement. you should use LOOP..END LOOP only..
    See following...
    I think in your requirement you want i th record which is satisfied id = 'XYZ'.
    use following code...
    loop at itab into wa where id = 'XYZ'.
      if sy-index eq = i.
         " Assign/take values here
       EXIT.      " -->  Immediately exit the loop after satisfied your condition
      exit.
    endloop.
    Regards,
    Mahi.

  • About Read stmt

    Hi Friends,
    can anyone .. Explain this below READ statement.
    LOOP AT it_hrp1000.
        READ TABLE it_hrp1000 WITH KEY plvar = p_plvar
                                   and otype = p_otype
                                   and endda = p_endda2
                                   BINARY SEARCH.
    MY QUESTION IS,
    WHY WE ARE USING THE ABOVE READ STMT WITH CONDITIONS IN PRG.. I MEAN WHICH WHICH SCENARIO..(SITUATION).
    PLS.EXPLAIN ANY ONE.

    Read statement is basically used to capture one particular record instead of looping over the whole table. With the read statment you can just get one particular row of the table , put it in a work area and process it as per your requirement.
    please go through the following links to understand the fucntionality of read statement and how can we read lines of tables;
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
    Problem with read table with binary search
    Please reward the helpful entries.
    Regards,
    Raman.

  • How to make use of a global internal table in SAP BW during transfer rules

    HI friends,
    I am ABAP consultant working on some APO info cubes. I have an issue during the upload of planning area data into APO info cube.
    Please help.
    I am using a transfer routine to find the TECHWEEK from a data base table ZGC_CALWEEK based on the on the calender month and calender week.
    Code I am writing is like below.
    *       FORM COMPUTE_/BIC/ZCALWEEK
    * Compute value of InfoObject ZCALWEEK
    * in communication structure /BIC/CSZT6DPPA
    * Technical properties:
    *     field name      = /BIC/ZCALWEEK
    *     data element    = /BIC/OIZCALWEEK
    *     data type       = NUMC
    *     length          = 000006
    *     decimals        = 000000
    *     ABAP type       = N
    *     ABAP length     = 000006
    *     reference field =
    * Parameters:
    *  -->  RECORD_NO       Record number
    *  -->  TRAN_STRUCTURE  Transfer structure
    *  <--  RESULT          Return value of InfoObject
    *  <->  G_T_ERRORLOG    Error log
    *  <--  RETURNCODE      Return code (to skip one record)
    *  <--  ABORT           Abort code (to skip whole data package)
    FORM COMPUTE_/BIC/ZCALWEEK
      USING    RECORD_NO LIKE SY-TABIX
               TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
               G_S_MINFO TYPE RSSM_S_MINFO
      CHANGING RESULT TYPE /BIC/OIZCALWEEK
               G_T_ERRORLOG TYPE rssm_t_errorlog_int
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
    *$*$ begin of routine - insert your code only below this line        *-*
    * DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
    DATA: LV_WEEK         TYPE ZGC_CALWEEK-APOWEEK,
            LV_MONTH        TYPE ZGC_CALWEEK-APOMONTH,
            LV_TECH_WEEK    TYPE ZGC_CALWEEK-TECHWEEK.
      LV_WEEK   = TRAN_STRUCTURE-CALWEEK.
      LV_MONTH  = TRAN_STRUCTURE-CALMONTH.
      SELECT SINGLE TECHWEEK INTO LV_TECH_WEEK
        FROM ZGC_CALWEEK CLIENT SPECIFIED
        WHERE  MANDT = SY-MANDT
        AND  APOWEEK  = LV_WEEK
        AND   APOMONTH = LV_MONTH.
      IF SY-SUBRC IS INITIAL.
        RESULT = LV_TECH_WEEK.
      ELSE.
        RETURNCODE = 1.
        ENDIF.
    *$*$ end of routine - insert your code only before this line         *-*
    ENDFORM.
    There are more than 50-80 million records that wil be transferred from planning area to info cube. The select statment is giving pathetic performance as this has to run 50-80 million times.
    After adding the select statment to find the TECHWEEK it is taking 4 times the time that used to take before writing the select statment.
    Is there a way that I can first fetch the data from ZGC_CALWEEK to one internal table and that internal table can be used using read statment during the transfer routine instead of writing select statement here.
    Please help in this case?

    Hi Ashutosh,
    Thanks for the reply,
    The structure of the ZGC_CALWEEK is as below. I have already created a secondary index on the table for this table for the fields APO WEEK and APO MONTH. This didn't help much on the performance.
    I am also planning to keep the ZGC_CALWEEK database table to be fully buffered and this may definitely improve the performance but I need to reduce the data base hits as less as possible.
    MANDT                           MANDT                           CLNT     3     0     Client
    TECHWEEK                           ZTECHWEEK                           NUMC     6     0     Technical Week
    FROMDATE_TECH     DATUM                           DATS     8     0     Date
    TODATE_TECH     DATUM                           DATS     8     0     Date
    APOWEEK                           /BI0/OICALWEEK     NUMC     6     0     Calendar year / week
    FROMDATE_APO     DATUM                            DATS     8     0     Date
    TODATE_APO     DATUM                            DATS     8     0     Date
    APOMONTH                           /BI0/OICALMONTH     NUMC     6     0     Calendar year/month
    The table ZGC_CALWEEK is in APO system, where the transfer rules are being executed.
    As you mentioned START ROUTINE, In the start routine Can I create an internal table let's say GT_CALWEEK with structure ZGC_CALWEEK and pull all the records (I have a max of 2000 records in this table) from ZGC_CALWEEK to GT_CALWEEK and Can I used the same internal table GT_CALWEEK in the transfer routine to read the TECHWEEK from internal table.
    Thank you very much again for you reply. Any help regarding this would be greatly appreciated.
    Best regards,
    Siva

  • Performance problem in ABAP programming

    Hi!
    Please review the following program,
    LOOP AT TG_PRICE INTO WA_PRICE.
        CLEAR WA_VBELN.
        READ TABLE TG_VBELN INTO WA_VBELN WITH KEY KNUMV = WA_PRICE-KNUMV
                                                   POSNR = WA_PRICE-KPOSN.
        IF SY-SUBRC = 0.
          WA_PRICE-VKORG = WA_VBELN-VKORG.
          WA_PRICE-VBELN = WA_VBELN-VBELN.
          WA_PRICE-POSNR = WA_VBELN-POSNR.
          WA_PRICE-MATNR = WA_VBELN-MATNR.
          WA_PRICE-MAKTX = WA_VBELN-MAKTX.
          WA_PRICE-ERNAM = WA_VBELN-ERNAM.
          WA_PRICE-ERDAT = WA_VBELN-ERDAT.
          MODIFY TG_PRICE FROM WA_PRICE.
          DELETE TABLE TG_VBELN FROM WA_VBELN.
        ELSE.
          DELETE TABLE TG_PRICE FROM WA_PRICE.
        ENDIF.
      ENDLOOP.
    comments: internal table TG_PRICE has about 20,000 records and TG_VBELN has about 70,000.
    this segment run spent too much time.
    Comparing the following program, the speed is more faster.
      LOOP AT TG_PRICE INTO WA_PRICE.
        CLEAR WA_KONP.
        SELECT SINGLE KNUMH
                      KBETR
                      KONWA
                      KPEIN
                      KMEIN
                      INTO WA_KONP
        FROM KONP
        WHERE KNUMH = WA_PRICE-KNUMH.
        IF SY-SUBRC = 0.
          WA_PRICE-KBETR_FROM = WA_KONP-KBETR_FROM.
          WA_PRICE-KONWA_FROM = WA_KONP-KONWA_FROM.
          WA_PRICE-KPEIN_FROM = WA_KONP-KPEIN_FROM.
          WA_PRICE-KMEIN_FROM = WA_KONP-KMEIN_FROM.
          VL_AMOUNT = WA_PRICE-KBETR_FROM.
          CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
            EXPORTING
              CURRENCY              = WA_PRICE-KONWA_FROM
              AMOUNT_INTERNAL       = VL_AMOUNT
            IMPORTING
              AMOUNT_DISPLAY        = VL_RATE
            EXCEPTIONS
              INTERNAL_ERROR        = 1
              OTHERS                = 2 .
          IF SY-SUBRC = 0.
            WA_PRICE-PRICE_FROM = VL_RATE.
          ENDIF.
          MODIFY TG_PRICE FROM WA_PRICE.
        ELSE.
          DELETE TABLE TG_PRICE FROM WA_PRICE.
        ENDIF.
      ENDLOOP.
    commmets: internal table TG_PRICE has also 20,000 records. Within the Loop, there is system table selection clause. it should be slower than the previous program. But why the previous is more slower, is there something wrong with the READ clasue or any others?
    Many thanks,
    Aries

    Hi Suresh,
    The complete READ statment is as follows:
    READ TABLE TG_VBELN INTO WA_VBELN
         WITH KEY KNUMV = WA_PRICE-KNUMV
                  POSNR = WA_PRICE-KPOSN.
    Hi Andreas,
    The two internal tables have already been sorted as follows:
      SORT TG_PRICE BY KNUMV KPOSN.
      SORT TG_VBELN BY KNUMV POSNR.
    And these two internal table are defined as follows:
    Price
    TYPES:BEGIN OF YS_PRICE,
             KNUMV      TYPE KNUMV,     "Number of the document condition
             KPOSN      TYPE KPOSN,     "Condition item number
             KNUMH      TYPE KNUMH,     "Condition record number
             VKORG      TYPE VKORG,     "Sales orgnazation
             VBELN      TYPE VBELN_VA,  "Order Number
             POSNR      TYPE POSNR_VA,  "Item number
             MATNR      TYPE MATNR,     "Material Number
             MAKTX      TYPE MAKTX,     "Material Description
             KBETR_FROM TYPE KBETR_KOND,"Changed From Price
             KONWA_FROM TYPE KONWA,     "Price Unit
             KPEIN_FROM TYPE KPEIN,     "Per
             KMEIN_FROM TYPE KMEIN,     "Per
             KBETR_TO   TYPE KBETR_KOND,"Changed to Price
             KONWA_TO   TYPE KONWA,     "Price Unit
             KPEIN_TO   TYPE KPEIN,     "Per
             KMEIN_TO   TYPE KVMEI,     "Per
             ERNAM      TYPE ERNAM,     "Created by
             ERDAT      TYPE ERDAT,     "Date Created
             PRICE_FROM TYPE P  DECIMALS 2,
             PRICE_TO   TYPE P  DECIMALS 2,
          END OF YS_PRICE.
    Sales order
    TYPES: BEGIN OF YS_VBELN,
             KNUMV      LIKE VBAK-KNUMV,"Number of the document condition
             VKORG      TYPE VKORG,     "Sales orgnazation
             VBELN      TYPE VBELN_VA,  "Order Number
             POSNR      TYPE POSNR_VA,  "Item number
             MATNR      TYPE MATNR,     "Material Number
             MAKTX      TYPE MAKTX,     "Material Description
             ERNAM      TYPE ERNAM,     "Created by
             ERDAT      TYPE ERDAT,     "Date Created
           END OF YS_VBELN.
    DATA: TG_PRICE  TYPE YS_PRICE  OCCURS 0,
          TG_VBELN  TYPE YS_VBELN  OCCURS 0.
    Do you have any ideas?
    Many thanks,
    Aries

  • Linking tables 'mara' , 'marc ' with 'konv'

    hi, I have to link tables mara and marc to table konv.
    i want to get the field kschl from konv and
    i know the following fields : mara-werks, mara-matnr,mara-matkl, marc-ekgrp.
    We can use the following tables for linking:
    eina, a018,konh, konp,a005.
    Pls. help
    Rgds,
    Ravindra

    Hi Ravindra,
    In order to retrieve KNUMH field, you can use table A018.
    Based on the fields you have mara-werks, mara-matnr,mara-matkl, marc-ekgrp etc, fetch all relevant A018 records in an internal table and pick the record which has the latest validity end date(Field DATBI). you can use Read statment wth index 1 after sorting as per latest valid record and pick up the Condition record number(Field KNUMH).
    Now you can use this condition record # to retrieve field KSCHL from Table KONH.
    Cheers,
    Vikram
    Please reward for helpful replies!!

  • When I go online to my bank my statments are unable to read as they get overlapped by the questions on the right, If I log in from Internet explorer the full page is shown, This is the same for the Daily Mail Rewards club.

    I use Windows XP professional, When I use Firefox to go to my Barclay bank statements, they are unreadable as the page with the amounts on is partly covered by the Questions on the right of the page, I also have this problem with the Daily Mail rewards club, If I login to my account from Internet Explorer it works fine for both, this is without making any changes to my setup.

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • If statment in sap script

    hi,
    IF ( &STAX3& = '4.00' OR &STAX3& = '12.50' )
    XXXXXX,,  ,,&text3& &STAX1&%   ,,,,  &TOT_STAX1(C.0)&
    XXXXXX,,  ,,&text3& &STAX2&%   ,,,,  &TOT_STAX2(C.0)&
    ,,,,&text51&,,,,&tot_tcost&
    ,,,,,,,,&TOT_FINAL(C.0)&
    ELSE
    XXXXXX,,  ,,&text3& &STAX&%   ,,,,  &TOT_STAX(C.0)&
    ,,,,&text51&,,,,&tot_tcost&
    ,,,,,,,,&TOT_FINAL(C.0)&
    ENDIF
    i am using this code.
    i have one doubt in if statment we can use this syntax
    IF ( &STAX3& = '4.00' OR &STAX3& = '12.50' )
    this is correct or not.
    if i use this code if statment is not excuting.
    pls clarify my doubt.

    Hi Venkat,
    Usually we'll write all the logical ABAP statements in Subroutine pool, instead of writing them in the script form directly.
    Use PERFORM statement in the script form as shown below & write the code u want in that....
    /:   PERFORM GET_MERCANTIL IN PROGRAM cust_invoice
    /:   USING &RKWA-BUKRS&
    /:   USING &RKWA-LIFNR&
    /:   USING &BKPF-GJAHR&
    /:   CHANGING &V_MERCANTIL&
    /:   ENDPERFORM
    GT   Insc.Reg.Mercantil    &V_MERCANTIL&
    GT is the paragraph format.
    Go to SE38 & create the program,cust_invoice ( called as Subroutine pool ) & write the FORMs in that....
    U can use the normal ABAP coding in that....
    Hope this will work.
    Try this out & let me know if there are any issues.
    Reward points, if useful.
    Pavan.

  • Primary key index not working in a select  statment

    Hi ,
    I'm doing a :
    select *
    from my_table
    where B = v1 and
    A = v2 ;
    where A and B are the primary key of the table, in that table the primary key index is there and the order of the primary key definition is A first and then B.
    While testing this statment in my database the Explain Plan shows that it is using the index ok but when
    runninng in client database it is not using it becasue of the order (i think), is this something configurable that I need to ask to my DBA ?
    The solution I found was to do the select with a hint wich fix the problem , but I'm curious about why is working in my dadabase and not in the client database
    thanks in advance .
    oracle version 11g

    This is the forum for SQL Developer (Not for general SQL/PLSQL questions). Your question would be better asked in the SQL and PL/SQL forum.
    Short answer: The execution plan used will depend on optimizer settings and table/index statistics. For example if the table has very few rows it may not bother using the index.

  • Performace problem in a select statment how to imporve the performance

    fist select statment
    SELECT    a~extno
              a~guid_lclic       " for next select
              e~ctsim
              e~ctsex
    *revised spec 3rd
              f~guid_pobj
              f~amnt_flt
              f~amcur
              f~guid_mobj
              e~srvll     "pk
              e~ctsty     "PK
              e~lgreg  "PK
      INTO TABLE gt_sagmeld
      FROM /SAPSLL/LCLIC  as a
      INNER JOIN /sapsll/tlegsv as e on elgreg = algreg
    * revised spec 3rd
      inner join /sapsll/legcon as f on fguid_lclic = aguid_lclic   " for ccngn1 selection
      inner join /sapsll/corcts as g on gguid_pobj = fguid_pobj
                               where   a~extno in s_extno.
      sort gt_sagmeld by guid_lclic guid_pobj.
    lgreg ctsty srvll
      delete adjacent duplicates from gt_sagmeld comparing guid_lclic guid_pobj.
    it selects about 20 lakh records
    belos select statment whichs is taking time as it is based on the entreis of gt_sagmeld
    select /sapsll/corpar~guid_mobj
                /sapsll/corpar~PAFCT
                but000~bpext
                but000~partner
                /sapsll/corpar~parno
                into table gt_but001
        from    /sapsll/corpar
        INNER join but000  on  but000partner = /sapsll/corparparno
        for all entries in gt_sagmeld
        where  /sapsll/corpar~guid_mobj = gt_sagmeld-guid_mobj
        and    /sapsll/corpar~PAFCT = 'SH'.
       SELECT /sapsll/cuit~guid_cuit         " PK
              /sapsll/cuit~QUANT_FLT         " to be displayed
              /sapsll/cuit~QUAUM             " to be displayed
              /sapsll/cuit~RPTDT             " to be displayed
             /sapsll/cuhd~guid_cuhd         " next select
              /sapsll/cuit~guid_pr           " next select
      INTO table gt_sapsllcuit
      FROM  /sapsll/cuit
    inner join /sapsll/cuhd on /sapsll/cuitguid_cuhd = /sapsll/cuhdguid_cuhd
      FOR all entries in gt_sagmeld
      WHERE /sapsll/cuit~guid_cuit = gt_sagmeld-guid_pobj.
      Delete adjacent duplicates from gt_sapsllcuit[].
           if not gt_sapsllcuit[] is initial.

    hi navenet
    that didnt worked
    we need to try ur range options
    but not sure what you told in the last mail as not clear with range can u pls eloboragte more i am pasting the full code here
    SELECT     a~extno
               a~guid_lclic       " for next select but000
               e~ctsim
               e~ctsex
               e~srvll
               e~ctsty
               e~lgreg
      INTO TABLE gt_sagmeld
      FROM /SAPSLL/LCLIC  as a
      INNER JOIN /sapsll/tlegsv as e on elgreg = algreg
                               where   a~extno in s_extno.
    sort gt_sagmeld by guid_lclic.
    delete adjacent duplicates from gt_sagmeld comparing all fields.
      IF not gt_sagmeld[] is initial.
      SELECT  /sapsll/legcon~guid_lclic
              /sapsll/legcon~guid_pobj
              /sapsll/legcon~amnt_flt
              /sapsll/legcon~amcur
               but000~bpext
               *revised spec
               /sapsll/corpar~PAFCT
              /sapsll/legcon~guid_mobj
             /sapsll/cuit~guid_cuit
      INTO TABLE gt_but000
      FROM /SAPSLL/LEGCON
      for all entries in gt_sagmeld
      where /SAPSLL/legcon~guid_lclic = gt_sagmeld-guid_lclic.
            IF NOT GT_BUT000[] IS INITIAL.
           sort gt_but000 by guid_mobj.
           delete adjacent duplicates from gt_but000 comparing guid_mobj.
         select /sapsll/corpar~guid_mobj
                /sapsll/corpar~PAFCT
                /sapsll/corpar~parno
                into table gt_but001
        from    /sapsll/corpar
        for all entries in gt_but000
        where  /sapsll/corpar~guid_mobj = gt_but000-guid_mobj.
       and    /sapsll/corpar~PAFCT = 'SH'.
    DELETE gt_but001 where PAFCT <> 'SH'.
    *sort gt_corpar by parno.
    *delete adjacent duplicates from gt_corpar comparing parno.
    *select gd000~partner
          gd000~bpext
         from gd000 into table gt_but001
    for all entries in gt_corpar
    where  gd000~partner = gt_corpar-parno.
    my ultimat aim is to select bpext from gd000
    can u please explain how to use ranges here and what is the singnificance and how ill i read the data from the final  table if we use ranges
    regards
    Nishant

  • READING AND WRITING FROM A FILE(WRITTEN IN ANOTHER LANGUAGE)

    # Comment
    INTEGER Declares integer type variable
    STRING Declares string type variable
    LET Assigns a variable
    CALCULATE Performs an arithmetic calculation
    PRINT Writes data to the console
    PRINTLN As print, but followed by a new line
    END Terminates the program
    Each line of the program must begin with one of these words, and the language should not be case sensitive.
    Tim Brailsford, 2007
    G64ICP
    COMMENT
    Any line beginning with the # character is completely ignored.
    Example:
    # ignore this line!
    INTEGER
    The INTEGER reserved word declares an Integer variable, and assigns a default value of 0 to it.
    Example:
    INTEGER myInt
    This example is equivalent to the Java statment "int myInt=0;"
    STRING
    The STRING reserved word declares a String variable, and assigns an empty string to it.
    Example:
    STRING myString
    This is equivalent to the Java statement "String myString;"
    LET
    This assigns values to variables (either integers, or strings enclosed
    in double quotes).
    Examples:
    LET myInt=42
    LET myString="Hello World!"
    CALCULATE
    This performs numeric calculations upon values or variables, and assigns the result to a variable (which must have
    been declared earlier). Four operators are supported: + *
    and / (for addition, subtraction multiplication and
    integer division respectively).
    Examples:
    CALCULATE myInt=2*2
    CALCULATE myInt=myInt+24
    CALCULATE myInt=intA/intB
    PRINT and PRINTLN
    These words both print to the console the
    only difference being that PRINTLN appends a new line (as does
    System.out.println in Java). These can print either text provided as an argument, or variables (string or integer).
    Examples:
    PRINTLN "Hello World!"
    PRINT myString
    PRINTLN myInt
    END
    This terminates the program, and prints a message to that effect.
    TPL Example
    To the left is an example TPL input file , to
    calculate the factorial of 5. This should produce
    an output similar to that shown overleaf (except
    that calculates the factorial of 10).
    # A TPL Program to calculate the factorial of 5
    INTEGER myInt
    INTEGER factorial
    STRING myString
    LET mystring="Factorial Program"
    LET myInt=5
    CALCULATE factorial=myInt*4
    CALCULATE factorial=factorial*3
    CALCULATE factorial=factorial*2
    Tim Brailsford, 2007
    G64ICP
    PRINTLN mystring
    PRINTLN
    PRINT "The factorial of "
    PRINT myInt
    PRINT " is "
    PRINTLN factorial
    END
    Documentation
    Document your code by writing instructions explaining how to run it, listing all of the files you have submitted,
    and specifying any limitations (eg you might want to say what platforms you would expect it to run on, and what
    platforms you have tested it on). This document should be written as a plain text file (ie ASCII � MS Word binary
    files are not acceptable) � and this file should be called README.TXT. This file should constitute the user
    manual of your program, and should explain exactly how to use your program.
    The README file should be the user manual for your language as implemented.
    NB:
    I want it to read values from the file as given above and execute the answer in the command prompt( as intented in the file above)
    Thanks
    Alam Ikenna

    Hai I have one doubt in doing other peoples homework for them. Why bother?

  • REJECT statment to break GET event is Obsolete in ECC 6.0 - Alternative?

    Hi Developers,
    REJECT statment is used to break from GET event (say GET PERNR event in Logical Database) used to process for an Employee.
    This REJECT statement is Obsolete . Is there any alternative for this ?
    If so, please reply at the earliest as it is very Urgent.
    Regards,

    Hi Suma,
    The REJECT statement was specially developed for leaving GET event blocks. Unlike CHECK and EXIT, REJECT always refers to the current GET event block. If CHECK and EXIT occur in a loop, they refer to the loop, and in a subroutine, they always refer to the subroutine. The REJECT statement, on the other hand, allows you to exit a GET event block directly from a loop or a called subroutine.
    The statement
    REJECT [dbtab].
    always terminates the processing of the current line of the node of the logical database. Without the optional dbtabspecification, the logical database automatically reads the next line of the same node, and the next GET event at the same hierarchy level is triggered. If you use the optional dbtab specification, the logical database reads the next line of the node dbtab. The node dbtab  must occur above the current node in the logical database hierarchy.
    Example
    The following executable program is connected to the logical database F1S.
    REPORT EVENT_DEMO.
    NODES: SPFLI, SFLIGHT, SBOOK.
    GET SFLIGHT.
      SKIP.
      WRITE: / 'Carrid:', SFLIGHT-CARRID,
               'Connid:', SFLIGHT-CONNID,
               'Fldate:', SFLIGHT-FLDATE.
      ULINE.
    GET SBOOK.
      PERFORM SUB.
    FORM SUB.
      WRITE: / 'Bookid:', SBOOK-BOOKID.
      REJECT 'SFLIGHT'.
    ENDFORM.
    This program reads and displays only the first booking for each flight, since the logical database reads the next line of SFLIGHT after the REJECT statement.

Maybe you are looking for

  • Safari crashes every  time I open it - 10.7.4

    Lion 10.7.4.   Safari Crash on open.  Does not even open.   I tried a re-install of Lion withtout re-format, disk verified ok. Reminds of the days when Microsoft explorer would crash constantly.    Wonder what is going on at Apple, Process:     Safar

  • Apple tv (3rd gen) set up

    I have a strange problem. I had an apple TV in the past which had to be sent back for a replacement because we continually got an error code (can't remember the number now). Until then, it worked well and I had it hooked up to the same TV we currentl

  • Problems to delete Rows

    Hi, i want to delete all rows in a table which will be automaticlly updatet in a thread. the problem is that i get somtimes the message 9>=9 or 8>=3. did somebody know what that means ?!?

  • Io exception: SO Exception was generated

    Your assumptions if you choose to respond... This is my first installation of a DB. I'm taking a class that requires db 10g, and I'm trying to load it on my home computer. Windows XP pro. Everything seemed to be going well, until the point where it i

  • Mifi4510L, Windows XP and a Dell Inspiron 8600

    Good evening everybody. My sisters co-worker has a Mifi4510L and a Dell  Inspiron 8600, he has been using this unit for a while without issue until recently. The computer seems to lose connection to his hotpoint and he has to repair the laptops wirel