Regarding explaination of ABAP code

hai
pls tell me what this code means
<b>Delete int_equipment where zpmtechid is initial.
Delete adjacent duplicates from int_equipment.</b>
Here , int_equipment is internal table with zpmtechid is column
pls tell me the code explanation
txs
rizwan

hi Rizwan,
for delete adjacent, from sap help
http://help.sap.com/saphelp_nw2004s/helpdata/en/06/aafd54fc4011d195280000e8353423/frameset.htm
Deleting Adjacent Duplicate Entries
To delete adjacent duplicate entries use the following statement:
DELETE ADJACENT DUPLICATE ENTRIES FROM itab
COMPARING f1 f2 ... .
The system deletes all adjacent duplicate entries from the internal table itab. Entries are duplicate if they fulfill one of the following compare criteria:
·        Without the COMPARINGaddition, the contents of the key fields of the table must be identical in both lines.
·        If you use the addition COMPARING f1 f2 ... the contents of the specified fields f1 f2 ... must be identical in both lines. You can also specify the fields f1 f2… dynamically using (n1) (n2) … as the contents of a field n1 n2. If n1 n2 is empty when the statement is executed, it is ignored. You can also restrict all fields f1 f2 … to subfields by specifying offset and length.
·        If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines must be identical.
You can use this statement to delete all duplicate entries from an internal table if the table is sorted by the specified compare criterion.
hope this helps.

Similar Messages

  • Regarding Customer exit - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2. I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,

    Hi Manmit,
    The following link can guide you on how to write customer exits (this has example as well)
    [http://help.sap.com/saphelp_nw70/helpdata/EN/61/579b3c494d8e15e10000000a114084/frameset.htm]
    Hope this helps.
    Cheers,
    Sumit

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,
          I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created this function in BRFPLUS and is working fine .Now I have to call it through ABAP code.Can someone kindly  provide me with the probable code for this scenario.
    E.g:
            ZT_MATNR  is the table in brfplus representing the list of MATNR values input along with other such inputs to function module Z_FM
            ZT_ATM   is the  resultant output table  of the function  which contains several fields.
    Now I have to call this BRFPLUS function with help of ABAP code.Could someone kindly help.

    Hello ,
    There should be a number of BRF+ tutorials available in SCN which discuss the FDT APIs. You can have a look at them to get an idea of the various APIs available and their uses.
    For your usecase, you should do the following.
            lo_fdt_function         TYPE REF TO if_fdt_function,
            lo_fdt_result           TYPE REF TO if_fdt_result,
    * Get function handle
          CALL METHOD lo_fdt_factory->get_function
            EXPORTING
              iv_id       = lv_function_id
            RECEIVING
              ro_function = lo_fdt_function.
    where lv_function_id is the GUID of the BRF+ function . You can either make it a constant , or you can use a FDT API to get the function GUID from the BRF+ application name and function name.
    *   Set function context
        TRY.
            CALL METHOD lo_fdt_context->set_value
              EXPORTING
                iv_id    =
                ia_value =
    This is one way to set the input context ( pass the input to the BRF+ function to process ). There are other ways to do this as well. Which one you use would depend on the kind of input you want to pass.
    * Execute BRFPLUS function
      TRY.
          CALL METHOD lo_fdt_function->process
            EXPORTING
              io_context = lo_fdt_context
            IMPORTING
              eo_result  = lo_fdt_result.
    * Get result output
      TRY.
          CALL METHOD lo_fdt_result->get_value
            IMPORTING
              ea_value =
    Another direct way of doing it would be to use the method PROCESS of the class CL_FDT_FUNCTION_PROCESS.
    I have not gone into much explaination here , but it should provide you an idea of how you can go about it.Read the SCN docs on the APIs to get a better idea , or better still if you can get hold of a copy of the BRF+ book by Carsten Ziegler , you will get an end to end explaination of all BRF+ APIs in it.
    Regards,
    Indranil.

  • REGARDING ABAP CODE IN ECATT

    HI
       HOW TO WRITE ABAP CODE IN ECATT TESTING FOR IF VENDORNO DOES NOT EXIST IT SHOULD NOT DISPLAY THE VENDOR SCREEN.
            PLZ HELP ME I WILL BE THANKFUL

    I wouldn't use ABAP for this (always remember that using inline ABAP reduces the readability of your script).
    Instead, I would use the corresponding display transaction to attempt to display the vendor and use the MESSAGE...ENDMESSAGE construction in eCATT to catch any error messages that occur. With the MESSAGE command, you can specify that certain error messages - if they occur - should not cause the script to fail.

  • What is #R2,#R3 in abap code

    Hi,
    Can any one explain what is #R2,#R3 in abap code. You can see the code snippet below.
    #R2  DATE = DEPER = I2001-BEGDA.                          "WGYS11K127228
    #R3  DEPER     = I2001-BEGDA.                             "
    #R3  DATE+4(4) = I2001-BEGDA(4).                          "
    #R3  DATE2(2) = I2001-BEGDA4(2).                        "
    #R3  DATE(2)   = I2001-BEGDA+6(2).                        "WGYS11K127228
    Regards
    Eswar

    What is the name of the standard program?
    Just run a little test, I think you are right, seems to check whether it's running on an R/2 or R/3 system. Never noticed this before.
    #R2 write 'R/2!'.
    #R3 write 'R/3!'.
    Output: R/3!
    couldn't test the R/2 case, obviously...
    Thomas

  • Setting value in a cookie using ABAP code

    Hai All,
    Using ABAP code is it possible to set some value in a cookie.
    Regards,
    H.K.Hayath Basha.

    Hai Durairaj,
    Can you explain how to do that.
    Regards,
    H.K.Hayath Basha.

  • ABAP Code + API

    Hello Friends,
    I have to write a method in ABAP equivelent to java method, here is the jave source code.
    private String constructID(String id)
        StringBuffer str = new StringBuffer("0000000000");
        str.append(id);
        return str.substring(id.length());
    (Just explain shortly what it is doing!)
    I am trying to call the BAPI (BAPI_BUPA_CENTRAL_GETDETAIL), and in oder to call this BAPI I have to export the BUSINESSPARTNER parameter. This parameter has been stored in DB with 10 char e.g 0000000001 . As I am developing web interface so the user can enter BUSINESSPARTNER No = 1, and this java code will map the user enter 1 to 0000000001.
    I want to ask, is there online API avaiable for ABAP which helps me to write this equivelent code or is there any method like append() or subString() in ABAP ( as I am very new to ABAP so please excuse me if I bothers you )
    Many thanks!
    Marek.

    If I understand correctly, you need to make "1" look like "0000000001" using ABAP code.   Try the following code.  This should work for you.
    Regards,
    Rich Heilman
    report zrich_0004 .
    data: char(10) type c value '1'.
    data: numc(10) type n.
    numc = char.
    write:/ char.
    write:/ numc.

  • How to Stop at Source System's Abap Code from BI Infopackage Trigger

    Hi Experts,
    I have enahanced 2 fields to some standard data source, that fields data is comiong fine to RSA3 in Source system.
    i am not getting 2 fields data to BI  PSA, but that 2 fields data  i am getting at in RSA3 Tcode  source system.
    i have tried all the ways to get data to BI PSA, but no luck.
    so, while running infopacke from BI i need to stop  at  Source System's Abap code where i have wriiten the code for those 2 fields.
    so, please any  one can explain, how to stop at source system's Abap Code once i  trigger infopackage from BI.
    Regards,
    Nagaraju K.

    Hi,
    which data source on your working?
    master data or transaction data
    enter the TCODE- CMOD
    choose the project
    select the funciton exit - EXIT_SAPLRSAP_001 - Transaction data
                                        EXIT_SAPLRSAP_002 - master data attr
                                        EXIT_SAPLRSAP_003 - mster data text
                                        EXIT_SAPLRSAP_004 - master data hier.
    choose the include program - ZXRSAU01.
    go to source code tab -> go to change mode -> find the code will start form here
    EX- : when " ZLIS_13_VDITM
    if not required don't put break-point .
    just comment it code.
    Thanks,
    Phani.

  • Exploiting RIA & RCA functionalities would entail changing in the ABAP code

    Dear All,
    Could someone please explain  to what extent exploiting the latest RCA & RIA functionalities available in SAP NetWeaver would lead to changing in the underlying ABAP code (SAP native & customized) of an ERP system, ABAP stack.
    Thank you in advance for your cooperation.
    Best regards.
    Reda Khalifa

    Hi,
    1st: you create a class using se24. Within your class you can define methods. Each method can have import, export and changing parameter.
    2nd: in the global part of your start routine you need to instanciate your class using:
    data: class_variable type ref to <your class>.
    create object class_variable.
    In the start routine and the infoobject routines itself you call your methods using:
    call method class_variable->method_name exporting..... importing..... changing.....
    For some more help use the F1-help on the keywords in the abap editor.
    Hope this helps!
    regards
    Siggi

  • Packaging of reusable ABAP code

    Hi ,
      We are doing a PM Implementation and almost in the live phase. To help us out
      in the later work we are planning to package the ABAP code as reusable ones,
      Is there any tool or Tcode in SAP that would make us use these reusable code,
      upload them and give it as a fully functional code with minimum adjustments.
      Basically we want to save the code in programs and exits and reuse it with
      minimum efforts during the  reloading them. Can you please suggest if there is
      any  way to do this. Thanks in advance.
    Regards,
    Prabaharan.G

    Contact your Basis team. Every transport has a Co-file and a data file associated with it. You can export the data and the co-files and import these files in the required system.
    You can try the EXPORT/IMPORT Transport functioanlity also, to Export the objects in a TR to your Local PC and then you can use the Files to be uploaded into the required system.
    The link gives the details of exporting the TR to a local file.
    http://help.sap.com/saphelp_nw04s/helpdata/en/df/c44a4278bbb56be10000000a155106/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4850d4ea-0c01-0010-8b82-d72daa95b7dd
    The Link below explains the details of the custom development that can be done for Export/import without involving the basis people
    http://wiki.ittoolbox.com/index.php/Upload/download_SAP_transport_request
    Regards,
    Abhishek
    Message was edited by:
            Abhishek Jolly

  • Compare abap code

    Hi can anyone explain me in detail how to compare  different  versions of my ABAP code?
    And how many versions can i be comparing at a time?

    Hi Shekar
    You can compare the programs in the following way:
    <b>From the ABAP editor, Utilities> Versions>Version Management--> select the versions to compare & clcik on the compare button or use F8.</b>
    Regards,
    Sree

  • UNIX command in ABAP code

    Hi All,
    I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
    Can any one help with how to used unix commands in ABAP?
    Thanks in advance.
    Regards,
    Hemendra

    The recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc.  For example:
    Command name       OS         Type             OS command                                 Parameters for operating system command 
    Z_FILE_MOVE        SunOS      Customer    mv                                                 ? ?   
    You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
    Jonathan

  • 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

  • Sample ABAP code for userexits, and calling bapi's

    Hi,
    Can someone please send me sample ABAP code
    1) to do extractor enhancement using user exit.
    2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
    3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
    Thank you very much in advance and appreciate any help.
    Regards
    Prasad

    hai ,
    check this code...
    *& Tables
    tables : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
      select single * from tstc
        where tcode eq p_tcode.
    Find Repository Objects for transaction code
      if sy-subrc eq 0.
        select single * from tadir
           where pgmid    = 'R3TR'
             and object   = 'PROG'
             and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
             where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
              where pname = tstc-pgmna.
            select single * from enlfdir
              where funcname = tfdir-funcname.
            select single * from tadir
              where pgmid    = 'R3TR'
                and object   = 'FUGR'
                and obj_name = enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
    Find SAP Modifactions
        select * from tadir
          into table jtab
          where pgmid    = 'R3TR'
            and object   = 'SMOD'
            and devclass = v_devclass.
        select single * from tstct
          where sprsl eq sy-langu
            and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            select single * from modsapt
            where sprsl = sy-langu and
            name = jtab-obj_name.
            format color col_normal intensified off.
            write:/1 sy-vline,
            2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          endloop.
          write:/(95) sy-uline.
          describe table jtab.
          skip.
          format color col_total intensified on.
          write:/ 'No of Exits:' , sy-tfill.
        else.
          format color col_negative intensified on.
          write:/(95) 'No User Exit exists'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(95) 'Transaction Code Does Not Exist'.
      endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.

  • 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

Maybe you are looking for

  • Can we load data for all levels in ASO?

    Hi All, Im creating cube in ASO can i load data for all levels in ASO we can load data for all Levels In BSO but in ASO i need confirmation???? and one more wat is the consider all levels option in ASO is used for ? wat is the purpose? Can any one he

  • How can I make button changing from one pic to another pic?

    Hi, I want to make an image as button which should show on mouse over anoher image? How it is possible? Please help. Regards.

  • VMM 2012 sp1: unable to create a logical switch on team with different nics (bug?)

    Hyper-V Host is HP Proliant G7 with 4 onboard nics and additional (different) 4-port adapter, all 1Gbit. Server 2012 with latest updates. VMM 2012 is sp1 with latest updates, server 2012 running in a vm. When I create a logical switch with teamed upl

  • Runtime error on Photoshop

    Hi, When I open Photoshop CS4 on Windows XP using a limited account, I see the error attached. Photoshop CS4 will work normally, however if I run as administrator.

  • Why is LP8 putting stuff in the trash?

    Hi, Every time I start up my Mac there are audio files in the trash with names like Dev2 followed by a long number. Some are small but one is large and a copy of a guitar track from an old logic song I loaded into LP8. Is it converting my old files a