Import , Export problem in Internal table

Hi all,
I am using ver 4.6C.
I have 2 programs  namely X an Y.
X is main program  and Y is having some Internal table with data. I want to use Y internal table in X program.
In X program.
I used SUBmit to call Y program . After Submit  I used Import as follows.
Import Itab from memory id 'ABC'.
In y program  used Export as follows
Export itab from memory id 'ABC'.
When I put break-point and check ITAB in X program it is empty.
Anyone help me or send code will be appreciated.
Thanks
Rathnam

Hi Stalin,
i did it the following way:
CONSTANTS: memid_zfo0consu_upl(13) TYPE c VALUE 'ZFO0CONSU_UPL'.
TYPES: BEGIN OF t_zfo0consu_upl,
         zfo0consu type /bic/oizfo0consu.
TYPES: END OF t_zfo0consu_upl.
DATA: it_zfo0consu_upl     TYPE STANDARD TABLE OF t_zfo0consu_upl
                                               WITH DEFAULT KEY.
*&...Gesellschaft exportieren
        EXPORT zfo0consu_upl = it_zfo0consu_upl TO MEMORY ID
                                              memid_zfo0consu_upl.
and then the import.
  CONSTANTS: memid_zfo0consu_upl(13) TYPE c VALUE 'ZFO0CONSU_UPL'.
  DATA: BEGIN OF it_zfo0consu_upl OCCURS 0,
           zfo0consu_upl TYPE /bic/oizfo0consu.
  DATA: END   OF it_zfo0consu_upl.
*&...Import der Upzuloadenden Gesellschaft
  IMPORT zfo0consu_upl = it_zfo0consu_upl
                          FROM MEMORY ID memid_zfo0consu_upl.
<b>Reward if useful.</b>
Kind regards
Henner

Similar Messages

  • ABAP for Super Dumps: Import- & Export-Parameter for a Table in a FM

    Hello ABAP Profs,
    sorry I am BW.
    <b>Import- & Export-Parameter for a Table in and out of an Function Modul.</b>
    I want to import a table into a Function Module, change it and export it again.
    How do I have to define the Import- and Export- Parameters in the FM ?
    The table looks looks this:
    DATA: zvpshub_tab TYPE SORTED TABLE OF /bic/pzvpshub WITH UNIQUE KEY
    /bic/zvpshub objvers /bic/zvpsoursy INITIAL SIZE 0.
    Thanks a lot
    Martin Sautter

    Hi Clemens,
    <u>in SE11</u> I defined a datatype of Type Structure: ZVPSHUB_ROW.
    <u>in SE11</u> I defiend a datatype of Type Tabletype: ZVPSHUB_TAB,
    bases on Rowtype ZVPSHUB_ROW.
    <u>in SE 80</u> I creates an FM with a CHANGEING Parameter referencing ZVPSHUB_TAB:
    FUNCTION ZVP_SHUB_TAB_LOAD.
    ""Lokale Schnittstelle:
    *"  CHANGING
    *"     VALUE(SHUB_TAB) TYPE  ZVPSHUB_TAB
    <u>in RSA1</u> in BW in the Startroutine of the Upload Rules in defined the table:
    DATA:shub_tab          TYPE zvpshub_tab.
    <u>in RSA1</u> in BW in the Startroutine of the Upload Rules in defined the table:
    DATA:shub_tab          TYPE zvpshub_tab.
    <u>in RSA1</u> in BW in the Startroutine i called the FM
    CALL FUNCTION 'ZVP_SHUB_TAB_LOAD'
        CHANGING
          shub_tab = shub_tab.
    and it works ..
    Thank You
    Martin Sautter

  • 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

  • How can we use IMPORT-EXPORT as structure and TABLES parameters?

    Hello Sir,
    I have used SAPRFC with single IMPORT and EXPORT parameter.
    Could anybody give me an example in I can use IMPORT/EXPORT as structure and TABLE parameter as input?
    of course from/to PHP.
    Regards,
    RH

    Thanks

  • Import from database an internal table with generic Type : Web Dynpro ABAP

    Hi everyone,
    i have a requirement in which i'm asked to transfer data flow between two frameworks, from WD Component to another. The problem is that i have to transfer internal tables with generic types. i used the import/ export from database approache but in that way i get an error message saying "Object references and data references not yet supported".
    Here is my code to extract a generic internal table from memory.
        DATA l_table_f4 TYPE TABLE OF REF TO data.
      FIELD-SYMBOLS: <l_table_f4> TYPE STANDARD TABLE.
      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
      DATA: ls_indx TYPE indx.
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->fire_vh_search_action_evt( ).
      ASSIGN l_table_f4 TO <l_table_f4>.
    *-- Import table for Help F4
      IMPORT l_table_f4 TO <l_table_f4> FROM DATABASE indx(v1) TO ls_indx ID 'table_help_f4_ID'.
    The error message is desplayed when last instruction is executed " IMPORT l_table_f4...".
    I saw another post facing the same problem but never solved "Generic Type for import Database".
    Please can anyone help ?
    Thanks & Kind regards.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • EXPORT STATEMENT fro INTERNAL TABLE VALUES

    Hi,
    From one program I am calling my program using SUBMIT statement.
    In the subprogram, I will be doing som process.If I get any error message I am storing in an internal table.
    This internal table has to come to the main program.
    So that I will create an Idoc in main program for all the error messages.
    For this I am using EXPORT IMPORT statements.
      wa_idoc_msg-type = text-003.
      wa_idoc_msg-id =  'ZLES'.
      wa_idoc_msg-number = '477'.
      append wa_idoc_msg to t_idoc_msg.
      clear wa_idoc_msg.
      exit.
      export (T_IDOC_MSG) to memory id 'T_IDOC_MSG'.
    Now In this export line, I am getting error as ZLES not able to recognize.
    Help required for this issue.

    Hi,
    Check the below link
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    Regards,
    nagaraj

  • 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.

  • Problem with internal table declaration in function gui_upload

    hi friends,
    can u tell me how should i define internal table when i use this function?
    i get error that in oo my declaration not good.
    thanks,
    dana.

    see this example:-
    DATA: BEGIN OF itab OCCURS 0,
            tdname   TYPE mara-matnr,
            tdline1  TYPE tline-tdline,
            tdline2  TYPE tline-tdline,
            tdline3  TYPE tline-tdline,
            tdline4  TYPE tline-tdline,
            tdline5  TYPE tline-tdline,
                  END OF itab.
    DATA: BEGIN OF itab_error OCCURS 0,
            tdname  TYPE mara-matnr,
            error   TYPE string,
          END OF itab_error.
    DATA: lines    TYPE STANDARD TABLE OF tline WITH HEADER LINE.
    DATA: temp     TYPE string.
    DATA: tdspras  TYPE thead-tdspras.
    DATA: tdname   TYPE thead-tdname.
    DATA: tdobject TYPE thead-tdobject.
    DATA: tdid     TYPE thead-tdid.
    DATA :flag     TYPE c.
    At Selection Screen Event
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p1.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p1.
    At Start of Selection Event
    START-OF-SELECTION.
      PERFORM upload_data.
      PERFORM upload_text.
    *&      Form  upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM upload_data .
      temp = p1.
    **& Upload Data from Excel
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = temp
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab.
    ENDFORM.                    " upload_data
    *&      Form  upload_text
          text
    -->  p1        text
    <--  p2        text
    FORM upload_text .
      tdspras  = 'EN'.
      tdid = 'BEST'.
      tdobject = 'MATERIAL'.
      LOOP AT itab.
        REFRESH lines.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = itab-tdname
          IMPORTING
            output = itab-tdname.
        TRANSLATE itab-tdname TO UPPER CASE.
        tdname = itab-tdname.
        PERFORM check_material.
        lines-tdline = itab-tdline1.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline2.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline3.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline4.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline5.
        APPEND lines.
        CLEAR lines.
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid       = tdid
            flanguage = tdspras
            fname     = tdname
            fobject   = tdobject
          TABLES
            flines    = lines.
      ENDLOOP.
      IF itab_error[] IS NOT INITIAL.
        WRITE : / 'PO Text For Following Material is not Uploaded'.
        WRITE : / .
        WRITE : / 'Material', '              Error'.
        LOOP AT itab_error.
          WRITE : / itab_error-tdname, '   ',  itab_error-error.
        ENDLOOP.
      ELSE.
        MESSAGE s001(38) WITH 'Data Uploaded Succcesfully'.
      ENDIF.
    ENDFORM.                    " upload_text
    *&      Form  check_material
          text
    -->  p1        text
    <--  p2        text
    FORM check_material .
      DATA : w_matnr TYPE mara-matnr.
      SELECT SINGLE matnr
      INTO w_matnr
      FROM mara
      WHERE matnr = itab-tdname.
      IF sy-subrc = 0.
        flag = 'X'.
      ELSE.
        MOVE-CORRESPONDING itab TO itab_error.
        itab_error-error = 'Material does not exist'.
        APPEND itab_error.
      ENDIF.
    ENDFORM.                    " check_material

  • Exporting An message Internal table to Standard program Internal Table

    Hi,
      In T-code VOFM, We have Goods issue routine 113, Now in Custmizing 913 is Configured. we are Checking the status of each handling unit of the Delivery. So I am getting the status Incomeplete Message for Multipe HU's. hence AM storing into One internal Table and Now I want To Export That Internal Table to Standard Program Internal Table 'WAT'.
    If I raise

    Elaborate your questions Please.

  • IMPORT/EXPORT problem.

    Hi,
    I am using a import export statement in my program.
    REPORT  ZKATEST.
    data : w_test type c value '1'.
    data : w_test1 type c.
    export w_test to memory id 'ZKAPIL'.
    import w_test1 from memory id 'ZKAPIL'.
    write : w_test1.
    Here the value gets exported to memory, but while importing its not getting populated (w_test1 is blank).
    Please suggest the solution.
    Thanks
    Kapil

    Hi kapil,
    1.  This kind of problems happen
        because the variable name,
        for export
        and import are different.
    2.  While exporting,
        Under memory id ZKAPIL,
        Value of W_TEST is stored with the name W_TEST.
    3. From the syntax,
        <b>import w_test1 from memory id 'ZKAPIL'</b>
       while importing,  from memory id ZKAPIL,
        the sysetm will , by default,
        try to search the value stored under name W_TEST1.
    (But it won't be found, because the orignal value is stored
      under the name W_TEST and not W_TEST1)
    <b>4. So just modify the syntax with this, and it will work fine.</b>
    <b>import W_TEST = w_test1 from memory id 'ZKAPIL'.</b>
    regards,
    amit m.

  • Problem with internal table initialisation in EBP system

    Hi
    I work in EBP system, and i made a specific work in LBBP_POCF0o program. It is in the displaying items of a purchase order.
    This is what i done:
    LOOP AT t_screen_items WHERE del_ind NE 'X'.
            w_old_total = w_old_total + t_screen_items-value.
            CLEAR:t_screen_items.
    ENDLOOP.
    loop at gt_item where del_ind ne 'X'.
          w_new_total = w_new_total +
              ( gt_item-GROSS_PRICE * gt_item-quantity ).
          clear: gt_item.
    endloop.
        if w_new_total GT w_old_total.   
           MESSAGE I001(ZBBP_PO) WITH
             'elle possède un montant supérieur'
             ' à celui déterminé intialement.'
             'Veuillez modifier la commande.'.
           MOVE 'X' TO w_checksum_flag.
        endif.
    My problem is that if i use the elevator at the screen, the system is looping only at the first element visible on the screen, so the "LOOP AT t_screen_items" is wrong. i don't understand why the sytem doesn't count all the elements of the internal table t_screen_items...
    Thank you for your help.

    Well, i will try to be more clearly...
    My problem is very suprising..In the purchase order screen, if there's more than 10 items, there's an elevator (or ascencor) to permit displaying the items which are hidden. And so, when i use the elevator, and when i want to see the details of the item, the "loop at t_item_screens" only begins at the first item visible. For exemple, if i have 13 items, i want to see the 11th item, i have to use the elevator, and then in the "loop at t_item_screens", the loop will do only 3 times the loop, it will begin only from the 11th item... The loop won't begin at the first element.... I really don't understand.
    Sorry if i'm not clearly... Anyway, thank you for your help.

  • Data fetching problem in internal table

    Hi All,
    I have two internal table which are of type as shown below.
    itab1 is of following type:
    regno(255) type c,
    uid type c
    itab2 is of following type
    regno type regno,
    uid type userid,
    address type add,
    phno type phn.
    Datas in itab2 are as follows:
    100       01       india              3454534
    200       01       china             34553543
    300       02       us                  6464654
    400       02       uk                   45654
    Itab1 is populated using the uid field as key as shown below.
    regno                          uid
    100 200                           01
    300 400                           02
    100 200 are values in field regno
    01  is uid.
    What we have done is collected all the regno which belong to the same uid for sending a single mail to the uid person with both the regno. We are able to achieve this. For this finally we loop into itab1 and fetch the uid and send mail to him.
    Now an extra requirement is to send the details of a regno (address and phno) along with the mail. The prob is in our final internal table we have a character field which will have all the regno for a uid (may be upto 20). Each regno will be of length 3.
    I have to loop into tab1 and read tab2 to achieve this using uid as key. But regno will for a uid will be combined. I have fetch each regno say 100 first and get the details and then 200 and then get the details and send a mail to uid 01. Then 300 and 400 details and then a mail to uid 02.
    Please explain how to get individual regno when i loop into tab1 and read tab2 so that i can fetch the details.
    Any suggestion will be very helpful

    Hi Aslam,
    As per my understanding...
    In itab1, instead of maintaining all the reg no in the same field(like 100 200 300 ....) againist uid 01
    maintain multiple records like
    regno  udi
    100      01
    200      01
    300      01 etc
    (in this case the combination of regno & uid becomes the key.)
    now while ur sending mail to the people, just loop the recors of itab1
    in the same loop u can just write a read statement to get the remainig details(address, phone no etc..) of that regno from itab2.
    Hope this helps you, revert back if still u hav any problm.

  • Problem in Internal table Record Splitting

    Hi All,
    Plz look into my below requirement and me know your Suggestions.
    My Internal tables :
    1.*Internal table for Infotype 2002 (Attendances)
    DATA : BEGIN OF T_PA2002 OCCURS 0,
           PERNR LIKE PA2002-PERNR,
           BEGDA LIKE PA2002-BEGDA,
           ENDDA LIKE PA2002-ENDDA,
           BEGUZ LIKE PA2002-BEGUZ,
           ENDUZ LIKE PA2002-ENDUZ,
           SUBTY LIKE PA2002-SUBTY,
           END OF T_PA2002.
    1.*Internal table for Infotype 9003 (Custom Attendances)
    DATA : BEGIN OF T_PA9003HRABS OCCURS 0,
           PERNR LIKE PA9003-PERNR,
           BEGDA LIKE PA9003-BEGDA,
           ENDDA LIKE PA9003-ENDDA,
           SHIFT LIKE PA9003-SHIFT,
           OTHOURS LIKE PA9003-OTHOURS,
           BEGUZ LIKE PA2002-BEGUZ,
           ENDUZ LIKE PA2002-ENDUZ,
           NSA LIKE PA9003-NSA,     
           MA  LIKE PA9003-MA,     
           CA  LIKE PA9003-CA,
           END OF T_PA9003HRABS.
    Requirement :
    1.  Internal table T_PA2002
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ
         5          27.12.2006     27.12.2006     10:00:00     14:30:00
    2.  Internal table T_PA9003HRABS
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ          HRABS     OTHOURS     MA     CA     WA
         5          27.12.2006     27.12.2006     08:00:00     14:30:00     2     2     
    Iam doing comparision between T_PA2002 and T_PA9003HRABS.
    Iam doing some caluculation to get Hourly absence,OT Hours and else ( Fields)
    So my Hourly absence on 27.12.2006 was 2Hours.
    So i need to split my Final table as below how to do that....( It is like In infotypes COPY option i.e 1 record to 3 Record )
    I need the Output like this...
    3.  Final Internal table T_PA9003HRABS
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ          HRABS     OTHOURS     MA     CA     WA
         5          25.12.2006     26.12.2006     08:00:00     14:30:00     0     0     
         5          27.12.2006     27.12.2006     08:00:00     14:30:00     2     2     
         5          25.12.2006     26.12.2006     08:00:00     14:30:00     0     0     
    Points will be rewarded.
    Thanks,
    Suresh.U

    you could:
    sort T_PA2002 by pernr.
    sort T_PA9003HRABS by pernr.
    loop at T_PA2002
    read table T_PA9003HRABS with key
    pernr = T_PA2002-pernr
    begda = T_PA2002-begda
    binary search.
    ***here you can specify how you calculate
    ***your absences and apply them to your
    ***final internal table.
    endloop.
    hope this helps.
    Warren

  • Memory problems in internal table

    Hi,
    I am facing an issue with the internal table memory.
    I am selecting something from the database and putting it in internal table but the load is so much that it is giving me memory errors as the data may go into millions.
    So what we have decided is to cut down the data in the internal table. we have defined a variable which will contain suppose 30000 data.
    so what i mean to do is to take the records from the databas based on the value in the variable. By that way i will be taking only 30000 data each time.
    But the issue is that first time it will take 1 to 30000 records if i give upto 30000 rows in the select query.. but then how will i take 30001 to 60000 the next time.. by that i mean how will i keep incrementing in the select query.
    Thanks in advance.
    Amit Kurup

    Hi
    I've never used these stataments but perhaps they are usefull for you:
    See the help for OPEN/CLOSE/FETCH CURSOR
    DATA: C TYPE CURSOR,
          WA TYPE <TABLE>.
    DATA: ITAB LIKE STANDARD TABLE OF <TABLE>.
    OPEN CURSOR C FOR
      SELECT * FROM <TABLE> WHERE .......
    DO.
    FETCH NEXT CURSOR C TO WA.
    IF SY-SUBRC <> 0.
      CLOSE CURSOR C.
      EXIT.
    ENDIF.
    APPEND WA TO ITAB.
    IF COUNT = 30000.
    DO SOMETHING
    COUNT = 0.
    REFRESH ITAB.
    ENDIF.
    COUNT = COUNT + 1.
    ENDDO. 
    Max

  • Problem in internal table calculation

    i have internal table values as follows ( for eg.)
    person          month                  amount1                amount2
    A                   jan                     rs.500(1)                       rs.1000 (3)
    A                  feb                       rs.500   (2)                   rs.1000
    B                  jan                       rs.1000(1)                 rs.2000(4)
    B                  feb                       rs.1500(2)                 rs.2000
    B                  mar                       rs.1000(3)                rs.1000
    i need to total the values - total = 123+4 and populate to another table as
    person          amount
    A                   123 so the value will be 2000
    B                   123+4 the value will be 5500.
    i have written the code using AT NEW AND AT END OF... but i need to work it with IF condition... so plz help me in this regard...
    <removed_by_moderator>
    thank you
    Edited by: Julius Bussche on Sep 5, 2008 7:55 PM

    Hi,
    Use the logic.
    person month amount1 amount2
    A jan rs.500(1) rs.1000 (3)
    A feb rs.500 (2) rs.1000
    B jan rs.1000(1) rs.2000(4)
    B feb rs.1500(2) rs.2000
    B mar rs.1000(3) rs.1000
    Sort it on person.
    take temporary variables for Person.
    g_1 and g_2.
    g_var is for the amount.
    loop on itab.
    MOve itab-peson to g_1.
    g_index  = sY-tabix + 1.
    read itab into wa index g_index.
    if sy-subrc eq 0 and wa-person = itab-person.
      g_var = amount 1 + amount2 + g_var.
    elseif sy-subrc eq 0 and wa-person NE itab-person.
      append a new record.
    clear: g_var.
    else.
      append a new record with the data
    clear: g_var.
    endif.
    endloop.
    Regards,
    Venkatesh

Maybe you are looking for