Finding duplicates:Minus set operator in dealing with internal tables

Dear experts,
I am newbie to ABAP developement,i have been given an assignment to find the duplicate list of vendors in lfa table.
Now duplicate list doesnot means that text tokens will be just exact to conclude them as duplicate ,it could also be like
1111 Vendor ABC
1222 ABC Vendor
If anybody has clue ,how to work on such a problem ,plz come forward.
Right now i just tried initially how to find exact duplicates,i found  on change command,it do works.
Then i am trying a new way which should just do the same thing.
I did as per this algorithm
1.Compute wholesome list in one internal table itab1
2.Used delete adjacent duplicates in itab2.
3.I feel itab3=itab1-itab2 will contain all duplicates in itab3.
Can anyone give me a hint.How can i do A-B ?.

Hi Arul,
There is no special aided SET operations upon internal tables in ABAP. Concerning your particular task I would say that you can try INSERT statement for each record in your internal table without preliminary comparing them with DB table. If there is a record in DB table with the same key then sy-subrc after INSERT will be non zero (actually 4) and no real insert would occur. So, only those records would be inserted which have no counterpart in DB table.
Best regards, Sergei

Similar Messages

  • Does EDQ support MINUS set operation

    Hi
    I would like to implement a MINUS set operation using EDQ - is this possible in EDQ?
    For example, I have duplicate records in my input set and I can use the group and merge processor to generate the unique records (btw, it selects the lowest id of the duplicate records) but I want to output all the other duplicated records (that were eliminated as part of group and merge processor) as part of separate output list so some cleanup action  can be taken on those records.
    For eg for following input set:
    id  code
    1   code1
    2   code 1
    3   code 2
    The output of group and merge (merge is done by code) is
    id code
    1  code1
    What I want is to store the following output (that was discarded by group and merge) for cleanup actions later - how I can achieve this using EDQ?
    id code
    2 code1
    Thank you for your time.
    Thanks,
    Priya

    Thanks Mike. Good to know about other configurable options under Merge BUT I'm still not sure how can I get a list of "other" duplicated values - other than the one that is the output of Group and Merge processor.
    Once again, my input data set is something like
    <id>  <code>
    1       code1
    2       code 1
    3       code 2
    The output of group and merge (merge is done by code and it uses the default to select the lowest id or first one available) is
    <id> <code>
    1      code1
    (The above default behavior for the Group and merge is fine for our example.
    BUT, What I want is to store the following output (that was discarded by group and merge) for cleanup actions later - how I can achieve this using EDQ?
    <id> <code>
    2      code1
    (As you notice, code1 is duplicated twice in the input data set and I want to write to the output the other record - meaning id=2 in the above example)
    Thanks,
    Priya

  • Can ui:table deal with large table?

    I have found h:dataTable can do pagination because it's data source is just a DataModel. But ui:table's datasouce is a data provider which looks some complex and confused.
    I have a large table and I want to load the data on-demand . So I try to implement a provider. But soon I found that the ui:table may be load all data from provider always.
    In TableRowGroup.java, there are many code such as:
    provider.getRowKeys(rowCount, null);
    null will let provider load all data.
    So ui:table can NOT deal with large table!?
    thx.
    fan

    But ui:table just uses TableDataProvider interface.TableData provider is a wrapper for the CachedRowSet
    There are two layers between the UI:Table comonent and the database table: the RowSet layer and the Data Provider layer. The RowSet layer makes the connection to the database, executes the queries, and manages the result set. The Data Provider layer provides a common interface for accessing many types of data, from rowsets, to Array objects, to Enterprise JavaBeans objects.
    Typically, the only time that you work with the RowSet object is when you need to set query parameters. In most other cases, you should use the Data Provider to access and manipulate the data.
    What can a CachedRowSet (or CachedRowSetprovider?)
    do?Check out the API that I pointed you to to see what you can do with a CachedRowSet
    Does the Table cache the data itself?
    Maybe this way is convenient for filter and order?
    Thx.I do not know the answers to these questions.

  • Best way to deal with Mutating table exception with Row Level Triggers

    Hello,
    It seems to be that the best way to deal with Mutating Table exception(s) is to have to put all the trigger code in a package & use it in conjunction with a Statement level trigger .
    This sounds quite cumbersome to me . I wonder is there any alternative to dealing with Mutating table exceptions ?
    With Regards

    AskTom has a good article about this,
    http://asktom.oracle.com/tkyte/Mutate/index.html

  • I am getting problem with internal table & work area declaration.

    I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this
    TYPES : BEGIN OF ty_makt,
             matnr TYPE makt-matnr,
             spras TYPE makt-spras,
             maktx TYPE makt-maktx,
             maktg TYPE makt-maktg,
             celltab TYPE lvc_t_styl,
           END OF ty_makt.
    DATA : i_makt TYPE TABLE OF ty_makt.
    DATA : wa_makt TYPE ty_makt .
        But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.
    i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.

    Hi Nagasankar,
    TYPES : BEGIN OF TY_MATNR,
                  MATNR TYPE MAKT-MATNR,
                  SPRAS TYPE MAKT-SPRAS,
                  MAKTX TYPE MAKT-MAKTX,
                  MAKTX TYPE MAKT-MAKTG,
                  CELLTAB TYPE LVC_T_STYL,  " Its Working perfectly fine..
                 END OF TY_MAKT.
    DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
              WA_MAKT TYPE TY_MAKT.
    Its working perfectly fine. if still you are facing any issue post your complete code.
    Thanks,
    Sandeep

  • Change a MINUS set operation to JOINS?

    Hi guys,
    I have a question about an SQL statement that I have to do. The complexity is big (lots of tables), but the problem can be resumed to this. Imagine I have the following query:
    SELECT t.x
      FROM the_table t
    WHERE t.y = 'a'
    MINUS
    SELECT t.x
      FROM the_table t
    WHERE t.y = 'b'In my original statement, I don't have only one table but many. But the issue is the same. I select a set of data and I minus the same statement with another criteria. I tried with some OR combination but never had the same result...
    Does anyone have an idea?
    Thanks,

    Please post a realistic example that demonstrates your problem. As Nikolay stated your MINUS isn't even needed making what you posted useless in trying to understand what you need to do.
    So for starters post the following:
    1. What Oracle version you are using for each server.
    2. How many servers are involved.
    3. Is this a new process or a current process that has performance or other issues? If a current process how is it being done now? What are the issues?
    4. A statement of exactly what you are trying to do; not how you think it ought to be done but what the goal is.
    5. A realistic example with actual tables, columns and queries
    6. How many columns are there in the result set?
    A sample set of source data and the set of result data you want to produce from that source.

  • Dealing with DB table-entries in ABAP OO

    Hi everybody,
    in ABAP-Reports (normally) we have deal a lot with DB table entries.
    Is there a "state of the art" for doing this with ABAP OO?
    An easy example:
    Asuming I want to select table  entries into an
    internal table from BUT000.And than I want to write: the entries.
    How would this look like in ABAP OO?
    show the internal ZTable be my object?
    or should every BUT000-Table-record be my object?
    Regards Mario
    null
    Message was edited by:
            Mario Müller

    Hello Mario,
    A very good question. This is what is called as modeling.
    I shall give you an approach into this. There is no right and wrong way of doing it. Probably, only a more desriable or better way !!
    How you model it depends on what your object is.
    If you have an internal table of sales orders, still in real world the services or methods are on a single sales order. So the object here is a single sales order.
    => I would model the class to deal with one sales order. (this more or less answers your question)
    2. Just to take this a little further.
    What I would do is have 3 different layers of abstraction.
    A UI class, a business layer class and a DB class.
    UI class can only talk to business class, business can talk to DB class. And the DB class is a static class.
    The UI class is only responsbile to do the display job.
    The UI will display multiple sales orders for eg, so u have an internal table of instances to the business layer.
    The business layer itself does validation, processing for each sales order.
    The business layer can also have soem static methods (or class methods) to select multiple records from Database. This is static, as it is not acting on one sales order, but you are returning multiple. This method should simply call a method of the DB layer.
    The DB layer is meant only to read from DB and write to DB.
    Hope this helps. Remember to reward points, if it does.
    For more highlights into this, refer to some material on design approach or design pattern.
    Best Rgds,
    Prashanth.
    SAP.

  • Dealing with Denormalized Tables - jdev 11.1.2.3 redhat 5.8

    Hello:
    In a Legacy oracle system, we have many tables that are not in 3rd normal form. i.e. they are denormalized.
    Example: A student has many teachers and a teacher has many students... a classic many-to-many. The normal solution would be to create an association table to hold the intersection.
    However in a legacy system, we have the student table that has columns of teacher1, teacher2, teacher 3, teacher4, teacher5, teacher6, teacher7 and no association table.
    Without modifying the table structures, what is the best way to deal with this in a ADF application. My guess would be to create 7 view links and write code to implement
    any logical rules.
    Does anyone have other ways around this problem?
    Thanks for the help.

    Hi,
    how about using a database view
    e.g.
    select student_id, teacher1 from your_table
    UNION
    select student_id, teacher2 from your_table
    UNION
    select student_id, teacher3 from your_table
    Create an entity and view object based on the database view. If you need teachers to be updateable, create stored procedures and override the entity object doDML method for insert/update/delete
    Frank

  • Date operations with internal table

    Dear friends
               would you like to tell me. how i determine the most recent date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...
    here the scenario is.
    id       idnumber  chdate      chtime
    1        123456    20060606    135312
    2        123456    20060606    135900
    3        123456    20060606    132300
    4        123457    20060606    140000
    5        123457    20060606    142500
    in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:
    the record should be fetched this way
    id       idnumber  chdate      chtime
    3        123456    20060606    132300
    5        123457    20060606    142500
    because here the id 3 is the most recently changed in the idnumber 123456
    where id 5 is the most recently changed in the idnumber 123457
    please help me to determin how i am supposed to carry out this task  any suggestion, code will be great help of mine.
    regards
    Naim

    Hi Naim,
      For example if ur select statement is like this..
       select id idnumber chdate chtime from xtable into table itab  where ...<condn>..
        sort itab by  idnumber chdate chtime  descending.
         delete adjacent duplicates from itab comparing idnumber .
         Code like above statement..
       You can get result...
    id idnumber chdate chtime
    3 123456 20060606 132300
    5 123457 20060606 142500
      Reward the points if it helps.

  • XSU: Dealing with large tables / large XML files

    Hi,
    I'm trying to generate a XML file from a "large" table (about 7 million lines, 512Mbytes of storage) by means of XSU. I get into "java.lang.OutOfMemoryError" even after raising the heap size up to 1 Gbyte (option -Xmx1024m of the java cmd line).
    For the moment, I'm involved in an evaluation process. But in a near future, our applications are likely to deal with large amount of XML data, (typically hundreds of Mbytes of storage, which means possibly Gbytes of XML code), both in updating/inserting data and producing XML streams from existing data in relationnal DB.
    Any ideas about memory issues regarding XSU? Should we consider to use XMLType instead of "classical" relational tables loaded/unloaded by means of XSU?
    Any hint appreciated.
    Regards,
    /Hervi QUENIVET
    P.S. our environment is Linux red hat 7.3 and Oracle 9.2.0.1 server

    Hi,
    I'm trying to generate a XML file from a "large" table (about 7 million lines, 512Mbytes of storage) by means of XSU. I get into "java.lang.OutOfMemoryError" even after raising the heap size up to 1 Gbyte (option -Xmx1024m of the java cmd line).
    For the moment, I'm involved in an evaluation process. But in a near future, our applications are likely to deal with large amount of XML data, (typically hundreds of Mbytes of storage, which means possibly Gbytes of XML code), both in updating/inserting data and producing XML streams from existing data in relationnal DB.
    Any ideas about memory issues regarding XSU? Should we consider to use XMLType instead of "classical" relational tables loaded/unloaded by means of XSU?
    Any hint appreciated.
    Regards,
    /Hervi QUENIVET
    P.S. our environment is Linux red hat 7.3 and Oracle 9.2.0.1 server Try to split the XML before you process it. You can take look into XMLDocumentSplitter explained in Building Oracle XML Applications Book By Steven Meunch.
    The other alternative is write your own SAX handler and send the chuncks of XML for insert

  • Issue with internal table in object oriented ABAP.

    Hello Gurus,
    I am having trouble defining internal table in Object oriented ABAP. for following:
    DATA: BEGIN OF IT_TAB OCCURS 0.
            INCLUDE STRUCTURE ZCUSTOM.
    DATA    tot_sum   TYPE char40.
    DATA END OF IT_TAB.
    Can someone help ?
    Regards,
    Jainam.
    Edited by: Jainam Shah on Feb 5, 2010 8:33 PM
    Edited by: Jainam Shah on Feb 5, 2010 8:33 PM
    Moderator message - Please post in the correct forum. You can easily find out for yourself by looking at SAP help for internal tables using OOP - thread locked
    Edited by: Rob Burbank on Feb 5, 2010 2:49 PM

    No, you can not declare internal table with header line in OO context. You have to declare the work are/header line separately
    Example:
    TYPES: BEGIN OF ty_it_tab.
            INCLUDE STRUCTURE mara.
    TYPES:  tot_sum TYPE char40.
    TYPES: END OF ty_it_tab.
    DATA: it_tab TYPE STANDARD TABLE  OF ty_it_tab.
    DATA: wk_tab TYPE ty_it_tab.
    LOOP AT it_tab INTO wk_tab.
    ENDLOOP.
    Edited by: Dean Q on Feb 5, 2010 8:50 PM

  • Problem with Internal table

    HI,
    I need to DMBE2 value as with respective of Month, Year and Inception date.
    I need the output to be like
    HKONT  BLART PRCTR DMBE2(Month) DMBE2 (Year) DMBE3 (Year)
    Below is my code
    DATA : BEGIN OF gt_lkorr OCCURS 0,
              hkont LIKE bsis-hkont,
              prctr LIKE bsis-prctr,
              bewar LIKE bsis-bewar,
              dmbe2 LIKE bsis-dmbe2,
              belnr LIKE bsis-belnr,
              budat LIKE bsis-budat,
              monat LIKE bsis-monat,
              gjahr LIKE bsis-gjahr,
              blart LIKE bsis-blart,
              shkzg like bsis-shkzg,
           END OF gt_lkorr.
    *DATA : wa_lkorr LIKE gt_lkorr OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF wa_lkorr OCCURS 0,
              hkont LIKE bsis-hkont,
              prctr LIKE bsis-prctr,
              bewar LIKE bsis-bewar,
              dmbe2 LIKE bsis-dmbe2,
              belnr LIKE bsis-belnr,
              budat LIKE bsis-budat,
              monat LIKE bsis-monat,
              gjahr LIKE bsis-gjahr,
              blart LIKE bsis-blart,
             dmbe2_2 LIKE bsis-dmbe2,
             dmbe2_3 LIKE bsis-dmbe2,
           END OF wa_lkorr.
    DATA : gt_final_lkorr LIKE wa_lkorr OCCURS 0 WITH HEADER LINE.
    FORM f_get_t030hb_tr.
      SELECT hkont lkorr FROM t030hb INTO CORRESPONDING FIELDS OF
                          TABLE gt_tr_t030hb
                          WHERE ktopl = 'KCOA'
                          AND   bwber = 'TR'
                          AND hkont IN so_hkont.
      IF gp_pprct IS INITIAL.
        SELECT hkont prctr bewar dmbe2 belnr budat monat gjahr blart
                           FROM bsis INTO CORRESPONDING
                           FIELDS OF TABLE gt_lkorr FOR ALL ENTRIES
                           IN gt_tr_t030hb
                           WHERE bukrs IN so_bukrs
                           AND gjahr IN so_gjahr
                           AND prctr IN so_prctr
                           AND hkont = gt_tr_t030hb-lkorr
                           AND vbund IN so_vbund.
      ELSE.
        LOOP AT gt_prctr.
          SELECT hkont prctr bewar dmbe2 belnr budat monat gjahr blart
                             FROM bsis INTO CORRESPONDING
                             FIELDS OF TABLE gt_lkorr FOR ALL ENTRIES
                             IN gt_tr_t030hb
                             WHERE bukrs IN so_bukrs
                             AND gjahr   IN so_gjahr
                             AND prctr = gt_prctr-prctr
                             AND hkont = gt_tr_t030hb-lkorr
                             AND vbund IN so_vbund.
        ENDLOOP.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM gt_lkorr COMPARING ALL FIELDS.
    ENDFORM.                    "f_get_t030hb_tr
    *&      Form  f_get_yearwise_data
          text
    FORM f_get_yearwise_data.
      DATA : lv_period LIKE t009b-poper.
      DATA : lv_year LIKE bsis-gjahr,
             lv_dmbe2 LIKE bsis-dmbe2.
      LOOP AT gt_lkorr.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date               = sy-datum
             I_MONMIT             = 00
            i_periv              = 'K4'
         IMPORTING
           e_buper              = lv_period
             E_GJAHR              =
        EXCEPTIONS
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          OTHERS               = 4
        IF gt_lkorr-monat EQ lv_period.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
        endif.
    ENDLOOP.
          LOOP AT wa_lkorr INTO gt_final_lkorr.
            write  : / gt_final_lkorr-hkont,
                     gt_final_lkorr-prctr,
                     gt_final_lkorr-bewar,
                     gt_final_lkorr-dmbe2,
                     gt_final_lkorr-blart.
          ENDLOOP.
    write : ' Inception to date'.
      LOOP AT gt_lkorr.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date               = sy-datum
             I_MONMIT             = 00
            i_periv              = 'K4'
         IMPORTING
          e_buper              = lv_period
              e_gjahr              = lv_year
        EXCEPTIONS
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          OTHERS               = 4
        IF gt_lkorr-gjahr EQ lv_year.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
        endif.
    ENDLOOP.
          LOOP AT wa_lkorr into gt_final_lkorr.
            WRITE : / gt_final_lkorr-hkont,
                      gt_final_lkorr-prctr,
                      gt_final_lkorr-bewar,
                      gt_final_lkorr-dmbe2,
                      gt_final_lkorr-blart.
             move : wa_lkorr-dmbe2_2 to gt_final_lkorr-dmbe2_2.
             modify gt_final_lkorr.
             clear gt_final_lkorr.
          ENDLOOP.
    loop at gt_lkorr.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
    ENDLOOP.
          LOOP AT wa_lkorr into gt_final_lkorr.
            WRITE : / gt_final_lkorr-hkont,
                      gt_final_lkorr-prctr,
                      gt_final_lkorr-bewar,
                      gt_final_lkorr-dmbe2,
                      gt_final_lkorr-blart.
          ENDLOOP.
    Please let me know how to do it?
    Thanks,
    Pavan.

    I think you need to insert a field in your wa_lkorr internal table for key which you should populate as M for month data, Y2 for Year data and Y3 for dmbe3 data.
    So when you want to display they are three different records.

  • Function Module Extractor with Internal Table

    Hi All,
    I have a need to extract records from a complex SQL Statements, so I will be using different SQL Statements and merging the results in to a single internal table. In the function modules what will happen if I do not use cursor WITH HOLD option, (I know it maintains the cursor position) and what if I directly load into E_T_DATA  from my internal table. How this will affect the datapackage size?
    In the future I will have records beyond 1 million and I am concerned to send all the 1 million record in one package rather than multiple packages during extraction.
    Please give a solution if you have come acroos this kind of situation with your development.
    Thanks,
    Alex.

    Alex,
    I do not see why the complexity of ABAP statements should make you change the data processing logic proposed by SAP by way of the sample Function module.  
    It appears to me that you are changing something knowing fully well its implications and then trying to find a solution for it.
    Good Luck!
    Mathew.

  • SAP script linking with internal table

    Hi all,
    This is my program to print invoices
    REPORT  z_g_test.
    TABLES: sbook.
    DATA sflights_wa TYPE sflights.
    DATA: itcpo LIKE itcpo.
    DATA itcpp LIKE itcpp.
    DATA sflights_itab TYPE TABLE OF sflights WITH HEADER LINE.
    DATA sbook_itab TYPE TABLE OF sbook WITH HEADER LINE.
    *SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
    *SELECT-OPTIONS: s_carrid FOR sflights-carrid,
    *                s_fldate FOR sflights-fldate.
    *SELECTION-SCREEN END OF BLOCK 1.
    SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN COMMENT 1(79) text-004.
    SELECT-OPTIONS: s_custid FOR sbook-customid,
                    s_bookid FOR sbook-bookid.
    SELECTION-SCREEN END OF BLOCK 2.
    INITIALIZATION.
      s_custid-low = 00001721.
      APPEND s_custid.
    START-OF-SELECTION.
      SELECT * FROM sbook INTO sbook_itab WHERE customid IN s_custid.
    *    APPEND sbook TO sbook_itab.
        APPEND sbook_itab.
      ENDSELECT.
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
         device                            = 'PRINTER'
         dialog                            = 'X'
         form                              = 'ZG_SCRIPT'
         language                          = sy-langu
         OPTIONS                           = itcpo
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    *   SPONUMIV                          =
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
       EXCEPTIONS
         canceled                          = 1
         device                            = 2
         form                              = 3
         OPTIONS                           = 4
         unclosed                          = 5
         mail_options                      = 6
         archive_error                     = 7
         invalid_fax_number                = 8
         more_params_needed_in_batch       = 9
         spool_error              e         = 10
         codepage                          = 11
         OTHERS                            = 12
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         element                        = 'MY_ELEMENT'
         function                       = 'SET'
         type                           = 'BODY'
         window                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
       EXCEPTIONS
         element                        = 1
         function                       = 2
         type                           = 3
         unopened                       = 4
         unstarted                      = 5
         window                         = 6
         bad_pageformat_for_print       = 7
         spool_error                    = 8
         codepage                       = 9
         OTHERS                         = 10
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
         RESULT                         = itcpp
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
       EXCEPTIONS
         unopened                       = 1
         bad_pageformat_for_print       = 2
         send_error                     = 3
         spool_error                    = 4
         codepage                       = 5
         OTHERS                         = 6
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    My question is! i am not passing the internal table any where. Now i am trying to print the values which is already existed in internal table,so iam not getting the out put. Now what shall i do in order to get output.
    Regards,
    Lisa

    Hi all,
    the modified code is like this.
    REPORT  z_g_test.
    TABLES: sbook.
    DATA sflights_wa TYPE sflights.
    DATA: itcpo LIKE itcpo.
    DATA itcpp LIKE itcpp.
    DATA sflights_itab TYPE TABLE OF sflights WITH HEADER LINE.
    DATA sbook_itab TYPE TABLE OF sbook WITH HEADER LINE.
    *SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
    *SELECT-OPTIONS: s_carrid FOR sflights-carrid,
    *                s_fldate FOR sflights-fldate.
    *SELECTION-SCREEN END OF BLOCK 1.
    SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN COMMENT 1(79) text-004.
    SELECT-OPTIONS: s_custid FOR sbook-customid,
                    s_bookid FOR sbook-bookid.
    SELECTION-SCREEN END OF BLOCK 2.
    INITIALIZATION.
      s_custid-low = 00001721.
      APPEND s_custid.
    START-OF-SELECTION.
      SELECT * FROM sbook INTO sbook_itab WHERE customid IN s_custid.
    *    APPEND sbook TO sbook_itab.
        APPEND sbook_itab.
      ENDSELECT.
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
         device                            = 'PRINTER'
         dialog                            = 'X'
         form                              = 'ZG_SCRIPT'
         language                          = sy-langu
         OPTIONS                           = itcpo
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    *   SPONUMIV                          =
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
       EXCEPTIONS
         canceled                          = 1
         device                            = 2
         form                              = 3
         OPTIONS                           = 4
         unclosed                          = 5
         mail_options                      = 6
         archive_error                     = 7
         invalid_fax_number                = 8
         more_params_needed_in_batch       = 9
         spool_error              e         = 10
         codepage                          = 11
         OTHERS                            = 12
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT sbook_itab.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           element                        = 'MY_ELEMENT'
           function                       = 'SET'
           type                           = 'BODY'
           window                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
         EXCEPTIONS
           element                        = 1
           function                       = 2
           type                           = 3
           unopened                       = 4
           unstarted                      = 5
           window                         = 6
           bad_pageformat_for_print       = 7
           spool_error                    = 8
           codepage                       = 9
           OTHERS                         = 10
      ENDLOOP.
      CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
         RESULT                         = itcpp
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
       EXCEPTIONS
         unopened                       = 1
         bad_pageformat_for_print       = 2
         send_error                     = 3
         spool_error                    = 4
         codepage                       = 5
         OTHERS                         = 6
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    even though i am not getting the output.
    The question is with out passing the internal table how we will get the output from it?.

  • Performance with internal tables

    Hi everybody,
    I'm having trouble with the performance of a report.
    The reports selects data out of many different tables and merges them together in one extraction file. (I would really like it to be executable in dialog task, because I don't want to write the file on the application sever)
    I've done what I could using runtime analysis to improve performance of the db accesses. Now 97% of runtime is consumed by abap.
    I'm using several internal tables which will have many entries, and at the moment I'm using nested loops to gather the information out of the internal tables into one extraction file. (Reading the internal tables with key is not always possible, I do this whenever possible)
    I've tried to use loop... assigning <fs> instead of loop... into, but it doesn't really help too much.
    Any other suggestions?
    Thank you for your help, regards, Kathrin!

    Hi,
    Some of these might be able to help for improving the performance.
    1. Read table with key using binary search.
    2. While comparing two internal tables, user Kernal
       method. Eg: If I_TAB1[] = I_TAB2[]. Enfif.
    3. Instead of appending records within loop/endloop,
       use 'Append lines of'.
    4. When populate different internal tables, try to create
       with key field which will make a big difference while
       accessing the data.
    5. Sort the internal tables.
    6. Use Case/Endcase in place of If/Endif.
    7. While making values negative, use 0 - <field>, in
       place of <field> * -1.
    8. If the field structures are similar in two internal
       tables, for appending records use I_TAB2[] = I_TAB1[].
    9. After the complete usage of internal tables, release
       the resources using FREE/FREFRESH <internal table>.
    10. For data extraction, use field by field selection
        from database.
    11. Try to avoid using 'ALL ENTRIES'. If using and make
        sure that the ref.internal table have entries.
    12. Try using Inner Join using Foriegn key fields.
    13. To get sum or count use Aggregate functions.
    14. Try to use Views if need appropriately.
    Hope this helps.
    Gopakumar

Maybe you are looking for

  • Getting Error while integrating Crystal reports with Java

    Hi All, I am getting below error while integrating crystal report with java [java] os.arch = x86 [java] java.lang.NoSuchMethodError: com.crystaldecisions.Utilities.d.<init> (Ljava/awt/Image;I)V [java] at com.crystaldecisions.Utilities.af.try(Unknown

  • HT204053 how to use same id for different stores

    How can i use the same apple id to access apps on different apple stores (in different regions)?

  • Cross tab on quarter (date) parameter

    Post Author: tomahawk CA Forum: Charts and Graphs I need to design a cross tab report where the column is a certain date field (say date1). However, the report is a quarterly report, so the columns should be for each quarter (date1 falling in a parti

  • ITunes crashes when Bonjour is disabled

    To use the companies VPN I have to disable Bonjour. When I disable Bonjour, iTunes launches, then stops working. Windows 7 machine Anyone have any thoughts? Thanks

  • PIR not created durning mass processing (MC8G) job

    We are transfering data from S076 to inactive PIR version for use in LTP using a job created in MC8G.  We have a few materials that are not transfering quantities.  One in particular, has 2 plants, and only 1 transfers.   The one that transfers is in