Abap equivalent for  'rownum'

Dear All,
           I want to fetch any 5 records from a table without using internal table.Basically  I want an abap equivalent for the 'rownum' keyword in oracle.
For e.g.
select * from emp where rownum <  5.
How can this be done in abap?
Yours truly,
Ratish

Hi,
you can use Select * upto 5 rows
                             from mara  into wa_mara
                    where <condition>
                    end select.
Regards,
Sarath J

Similar Messages

  • What is the equivalent for 'On Change of' Event in ABAP OBJECTS?

    What is the equivalent for 'On Change of' Event in ABAP OBJECTS?  and how to use it in LOOP control?

    hi,
    There is no such Equivalent in OO ABAP.
    You have to Raise your own Event within tha class checking the value of the field whose value is changing.
    Regards
    Sumit Agarwal

  • Is there a logic:match equivalent for JSTL?

    In a search page I execute a query which returns an array of objects (All objects are of the same object type and are cast to Object[]) and each object has many attributes. I tried using <logic:iterate>, but I was never successful in having it display any results. I believe this had something to do with the entire array being passed via session scope instead of just one record and me not specifying it properly with <logic:iterate>. I was able to successfully use <c:forEach> and it worked right away. I stuck with using that because of its "just works" ability in addition to using a lot of other JSTL code. However, one of the attributes that is being printed out needs to be parsed and is of the form "Yxxx". <logic:match> covers this very nicely, but when I specify it in the below code it is not able to find my variable in any scope.
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match parameter='${myResults}' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>I have done several google searches, but I haven't found a JSTL equivalent for <logic:match>. If there is one could someone please tell me what it is? In addition, although <logic:match> is great I still need to print out a substring of that attribute. Could someone tell me how to do that? If this is not possible could someone please tell me if its possible to use <logic:iterate> with an array of objects like I was attempting to do initially so that I could use <logic:match> at least?
    Thanks to all of you for your time.

    Yes you can use the logic:iterate tag. I think you have to specify the type of the exposed variable though. I prefer the forEach loop.
    I think you are using the wrong attribute in the logic:match tag. You should be using the "name" attribute rather than "parameter"
    Parameter attribute refers you to a request parameter, and I pretty sure you don't want that.
    So given the collection of objects in the session attribute "result"
    This should loop through them all, and see if they start with the letter 'Y'
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match name='myResults' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>As for the latter bit, are you using a JSP2 container and JSTL1.1? It would appear so seeing as you are trying to use EL expressions in the logic:match tag.
    If so, you could make use of the JSTL function library:
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
       <c:if test='${fn:startsWith(myResults.pin, "Y")}'>
          <c:out value="${fn:substring(myResults.pin, 1, -1)}"/>
        </c:if>
    </c:forEach>And I've just spotted a very cool function in there: substringAfter
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
          <c:out value='${fn:substringAfter(myResults.pin, 'Y')}'/>
    </c:forEach>Cheers,
    evnafets

  • Needs sample ABAP code for field routine

    Dear Expert,
    There is a field "Pay Scale Group" in my DSO which stores the data in the format
    AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
    InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
    I need to write a field routine on the transformation between DSO and Cube.
    Can any one please help me with the sample ABAP code for this scenario.
    Some more examples for better understanding of the requirement:-
    Data in DSO(Source)            Data in Cube(Target)
    ===================            ===================
    AA1/B1/CCC2/DD2/EEE1            EEE1
    AAA1/BB2/CC1/DDD3/EE2           EE2
    A2/BBB2/CC2/DDD3/EEE5           EEE5
    AA2/BB1/C1/DDD3/EE3             EE3
    A3/B1/CC2/DDD1/EE4              EE4
    Many thanks in advance.
    Regards,
    Prakash
    Please do not dump your code requirements in SDN
    Edited by: Pravender on May 18, 2011 11:37 AM

    Hi,
    You can use the following code :
    Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
    And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
    My assumption is that there will always be 4 '/'.
    In the field routine write the below code
    data: V1(5) type c,
              V2(5) type c,
             V3(5) type c,
              V4(5) type c,
             V5(5) type c.
    data : VAR1 TYPE /BIC/OIZPAY_SGRP.
    split VAR 1  at '/' into V1 V2 V3 V4 V5.
    result = V5.
    V5 will be having the characters after the last '/' .That is V5 = EEE1.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
    Edited by: Ashutosh Singh on May 17, 2011 4:17 PM

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • What are the pros and cons of installing java+abap stack for portal?

    Hi all,
      1.What are the pros and cons of installing java+abap stack for portal?
      2.what effect it does on the ume options to be choosen??
      3.for the purpose of integration of r3,bw and crm on portal and crm 4.0 60.2.3 business package which option of stack(java or abap or both)will be good option and which ume option while installation should be choosen?
    regards
    Rajendra

    Hi Rajendra,
    The NetWeaver Installation Master Guide offers some good scenarios on the pros and cons:
    https://websmp201.sapag.de/~sapidb/011000358700005412792005E.pdf
    In a nutshell:
    ABAP+JAVA
    Pros
    - Decrease # of servers required to administer the portal
    - Less costly
    Cons
    - Upgrades could be dependent on ABAP and Java release level
    - Additional load on the server due to ABAP stack
    - Limited scalability
    JAVA and ABAP on separate server
    Pros
    - Improved performance
    - Allows each system to be single-use purpose therefore downtime does not affect other components
    - More scalable
    Cons
    - Adds complexity to landscape
    - Additional costs
    Regards,
    Thomas Pham

  • ABAP Mapping for Error handling in Proxy to JDBC

    Hi All,
    I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
    I am following the below steps,
    step 1 - In message mapping a UDF is created to catch errors and store them in a variable using  dynamic configuration
    step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>
      <SAP:P2>001</SAP:P2/>
      <SAP:P3>Mandatory field is missing[BUKRS] </SAP:P3>
       <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I have written the following ABAP code to achieve this:
    method IF_MAPPING~EXECUTE.
      DATA l_record type mpp_dynamic.
    DATA error type String.
    getting dynamic configuration value
    filled in by any previous mapping
    CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD
      EXPORTING
        NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'
        NAME      = 'ERROR'
      RECEIVING
        RECORD    = l_record.
    error = l_record-value.
    *raising exception with our message
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '001'
        ERROR_TEXT = error .
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '003'
        ERROR_TEXT = error .
    endmethod.
    I am gettign the following message for our code:
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Could you please help in finding the solution for getting currect error message from ABAP class?
    Edited by: SwethaC on Jan 21, 2011 8:18 AM

    The error is due to RFC Call fail from PI system to your ECC Application System.
    Check your RFC Destination for ECC System type 3 in PI System.
    When you are receiving data from ECC System using Proxies & again you are going to ECC System for Validation.
    Why you are not doing this validation on ECC System only in your proxy code ?
    In your proxy code, it will be much better for performance to check your data there on same system.

  • Unknown indexes in ABAP dictionary for a BW SAP_BW 350 ?????????

    Hi all,
    can anyone help me with the procedure to handle unknown indexes in ABAP dictionary for a BW SAP_BW 350 Production system?
    The list of some of the indexes are as follows :
    /BI0/E0CCA_C11~P
    /BI0/E0FIGL_C01~P
    /BI0/E0OPA_C11~P
    /BI0/E0PS_C04~P
    /BIC/EIEFERC~P
    Thanks a lot in advance ....
    Madhavi Rane

    You should be able to delete and recreate indexes from the infocube performance tab, RSRV or DB02.   The bigger question is why these e fact table indexes are not being handled properly.  I would try searching OSS Notes to see if yo ufind one relevant for your DB;
    This older Notes provides some good background
    Note 594287 - DB6: Corrections to the primary index of fact tables

  • How To Create ABAP Code For HR Context Sensitive Structural Authorization

    Hello,
    We have created a HR Custom Program which IS NOT built off the PCH or PNP Logical Database. As a result, we need to manually create ABAP code for HR Context Sensitive Structural Authorization Check in our custom HR program. Via HR Context Sensitive Structural Authorizations, we are restricting access to personnel numbers and the underlying HRP* tables.
    Any assistance would be greatly appreciated with the identification of the SAP standard function modules (Ex. RH_STRU_AUTHORITY_CHECK, HR_CHECK_AUTHORITY_INFTY, HR_CHECK_AUTHORITY_INFTY , etc) used in HR Context Sensitive Structural Authorization Check, how they are used to control HR Structural authorization (P_ORGINCON), and some sample code.
    Thank you in advance for all your assistance,
    Ken Bowers

    Hello Ken
    You can use the interface methods IF_EX_HRPAD00AUTH_CHECK to get the same structural authorization as you can see in PA20/PA30. You need to use the methods set_org_assignment and check_authorization for this purpose. For more information you can refer to include FP50PE21 from line 237 onwards till 270.
    Regards
    Ranganath

  • Abap report for budget/actual/commitment

    Hi Guru..
    Please help me.
    Im in urgent
    I wanna write an abap program for budget/actual/commitment.
    I try to trace prgram s_alr_87013019, but only one table found.
    Please let me know which table is using for budget/actual/commitment
    report..
    Please guru..

    Hello Mohd,
    The actual,budget and commitment values are stored in the one table COSP.
    The values differentiate with field <b>VRGNG</b> - "CO Business Transaction".
    If the record has in this field text '<b>COIN</b>' it means that values are "actual".
    For example:
    OBJNR     PR00000101
    GJAHR     2005
    KSTAR   101101
    VRGNG     <b>COIN</b>
    TWEAR   USD
    WTG001     100,00
    WTG002  200,00
    It means that the element PR0000101 has the '<b>actual'</b> operations refering
    the cost element 101101, with values: 100,00 USD in january 2005 and
    200,00 USD in february 2005.
    The next row in the table COSP, clould look like this:
    OBJNR     PR00000101
    GJAHR     2005
    KSTAR   101101
    VRGNG     <b>RMBA</b>
    TWEAR   USD
    WTG001     100,00
    WTG002  0,00
    This means that there was a <b>'Purchase requisition'</b> in january 2005
    with decretation on object PR0000101.
    And the next row, could be:
    OBJNR     PR00000101
    GJAHR     2005
    KSTAR   101101
    VRGNG     <b>RMBE</b>
    TWEAR   USD
    WTG001     0,00
    WTG002  150,00
    And that means that in february 2005 there was a <b>'Purchase order'</b>
    with value 150,00 USD decretated on this object.
    I hope, that my explanation is now clear and accurate.
    - Marta

  • How to create ABAP Query for vendor open items

    HI,
    My client has requested me to create ABAP Query for vendor open items . So that it will be usefull for the users . Could anyone help me with this. I will assign you points.Thanks in advance.

    Hello,
    Use Table BSIK <Open Items of AP > & BSAK <AP Cleared items>......
    For Query you can use SQ01.
    USE BSID & BSAD for AR open/clear items...
    LFA1, LFB1 are vendor master data tables
    This is FYI
    Hope this helps.
    Rgds
    Rajendra

  • Make ABAP selection for InfoPackage

    I am making a ABAP routine for a field on my info package. The field contains a date.
    The constraint that I want to make is as follows:
    select max( /BIC/FCVERDATE ) from /BIC/AAPO_O1000 into FCVERDATE.
    But I am not sure how to make the constraint in the code:
    data: l_idx like sy-tabix.
    DATA: FCVERDATE LIKE /BIC/....
              read table l_t_range with key
                   fieldname = '/BIC/FCVERDATE'.
              l_idx = sy-tabix.
              modify l_t_range index l_idx.
              p_subrc = 0.
    Thanks in advance,
    regards,
    Torben

    Solved
    DATA: FCVERDATE LIKE /BIC/....
    select max( /BIC/FCVERDATE ) from /BIC/AAPO_O1000 into FCVERDATE.
    read table l_t_range with key
    fieldname = '/BIC/FCVERDATE'.
    l_idx = sy-tabix.
    l_t_range-option = 'BT'.
    l_t_range-low = FCVERDATE.
    l_t_range-high = FCVERDATE.
    modify l_t_range index l_idx.
    p_subrc = 0.
    I properly could have use 'EQ' instead of 'BT'.
    Regards,
    Torben

  • ABAP Mapping :: for multi files

    Dear Experts,
    We are doing an Idoc to file interface, using ABAP mapping.
    This is 1:n mapping i.e receiver message interface is 0..unbounded.
    We have achieved the mapping for 1:1. But when I test for multi, i get an error in moni saying
    Parsing error after multi mapping.Expected Message<i> instead of Item
    Item is the name of the node that has to be created multiple times.
    Has anyone done multi mapping in ABAP?? Any idea why this error....may be we are missing something.
    Any idea as to how we can progress???
    Thanks in advance
    Regards
    Shobha

    Hi,
    Surely u can use an ABAP mapping for this.
    Sounds like your problem is your not using correct output structure for multi mapping.
    As with any type of multi mapping your structure should reflect this. Your target payload must thus have the following structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <unboundedPayload/>
         </ns0:Message1>
    </ns0:Messages>
    The <unboundedPayload> element in above should of course be replaced with your actual payload - I believe 'Item' in your case, if that is in fact the root node of your actual payload.
    Regards,
    Daniel

  • ABAP-Programming for SAP BW u0096 User-Exits und BAdIs

    Hi experts,
    i am a novice und looking for informations about Badi and User-exits for BW .
    i want to learn how to programm extractors.
    Can you you help me by giving me some informations or documents or sap links where i can find informations?
    Cheers

    Dear Mr Herzog,
    Congratulations for the book: Abap Developement for SAP Netweaver BI: User exits and BadIs.
    We're trying to implement the suggestions on the chapter 5.1.1 Interface of function module EXIT_SAPLRSR0_001 (page 136), however, we're having problens with the abap sintax CALL_FUNCTION  l_d_name IF FOUND.
    The command IF FOUND is not accepted.
    It'll be very helpful to avoid issues on tranporting include zxrsru01.
    I appreciate any additional help on how to implement it.
    Best Rgs
    Eliseo Bouzan

  • Need ABAP code for the below Services requirement

    Hi,
    We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
    1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
    2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
    3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
    4.This will be the Service entry record for that PO number.
    Can any one Please suggest me to how to write the ABAP code for the above logic.
    Thanks & Regards,
    Dinakar

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

Maybe you are looking for

  • Software installer update caused macbook pro/snow leopard to not start

    I ran the recent software installer update; since then my macbook pro--running 10.6.8--won't get past the blue screen.  i tried verifying/repairing permissions and even reinstalling from the disk but it tells me simply that reinstalling from the disk

  • 100% cpu when scrolling in Adobe Reader 8.1.2

    I've installed Reader 8.1.2 on a 2003 Windows server STD Edition with SP1. Everytime I open a pdf document (regardless of what's contained in it)and I scroll using the mouse or the scroll bar the AcroRd32.exe process spikes near 100% utilization. The

  • Format email subject in ssrs

    hi  i have sql server 2008 r2 standard edition installed, and i want to show only date (not time) on my ssrs report email subscription  subject, comment. So how can i  achieve this.

  • Need patch number to Upgrade database

    I am trying to upgrade our 10.2.0.1.0 database to 10.2.0.3.0. Does anyone know the patch number? We are on Sun Solaris 10 x86 32 bit platform.

  • Buffer leak when using crypto ike

    I'm using a 851 router as an ezVPN remote and have started getting loads of small buffers which eventually lead to a system crash as they seem to be staying resident in the memory. I have not been able to work out how to fix it. Attached is the outpu