How to transter contents of itab from one class to another...

Hello experts,
I am currently having problems on how to transfer the contents of an itab or even
the value of a variable from one class to another. For example, I have 10 records
in it_spfli in class 1 and when I loop at it_spfli in the method of class 2 it has no records!
This is an example:
class lcl_one definition.
public section.
data: gt_spfli type table of spfli.
methods get_data.
endclass.
class lcl_one implementation.
method get_data.
  select * from spfli
  into table gt_spfli.
endmethod.
endclass.
class lcl_two definition inheriting from lcl_one.
public section.
  methods loop_at_itab.
endclass.
class lcl_two implementation.
method loop_at_itab.
  field-symbols: <fs_spfli> like line of gt_spfli.
  loop at gt_spfli assigning <fs_spfli>.
   write: / <fs_spfli>-carrid.
  endloop.
endmethod.
endclass.
start-of-selection.
data: one type ref to lcl_one,
      two type ref to lcl_two.
create object: one, two.
call method one->get_data.
call method two->loop_at_itab.
In the example above, the contents of gt_spfli in class lcl_two is empty
even though it has records in class lcl_one. Help would be appreciated.
Thanks a lot guys and take care!

Hi Uwe,
It is still the same. Here is my code:
REPORT zfi_ors_sms
       NO STANDARD PAGE HEADING
       LINE-SIZE 255
       LINE-COUNT 65
       MESSAGE-ID zz.
Include program/s                            *
INCLUDE zun_standard_routine.           " Standard Routines
INCLUDE zun_header.                     " Interface Header Record
INCLUDE zun_footer.                     " Interface Footer Record
INCLUDE zun_interface_control.          " Interface Control
INCLUDE zun_external_routine.           " External Routines
INCLUDE zun_globe_header.               " Report header
INCLUDE zun_bdc_routine.                " BDC Routine
Data dictionary table/s                      *
TABLES: bkpf,
        rf05a,
        sxpgcolist.
Selection screen                             *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE sxpgcolist-parameters.
SELECTION-SCREEN END OF BLOCK b1.
*/ CLASS DEFINITIONS
      CLASS lcl_main DEFINITION
CLASS lcl_main DEFINITION ABSTRACT.
  PUBLIC SECTION.
Structure/s                                  *
    TYPES: BEGIN OF t_itab,
            rec_content(100) TYPE c,
           END OF t_itab.
    TYPES: BEGIN OF t_upfile,
            record_id(2)    TYPE c,            " Record ID
            rec_date(10)    TYPE c,            " Record Date MM/DD/YYYY
            prod_line(10)   TYPE c,            " Product Line
            acc_code(40)    TYPE c,            " Acc Code
            description(50) TYPE c,            " Description
            hits(13)        TYPE c,            " Hits
            amount(15)      TYPE c,            " Amount
           END OF t_upfile.
Internal table/s                             *
    DATA: gt_bdcdata    TYPE STANDARD TABLE OF bdcdata,
          gt_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll,
          gt_itab       TYPE STANDARD TABLE OF t_itab,
          gt_header     LIKE TABLE OF interface_header,
          gt_footer     LIKE TABLE OF interface_footer,
          gt_upfile     TYPE STANDARD TABLE OF t_upfile.
Global variable/s                            *
    DATA: gv_target             TYPE rfcdisplay-rfchost,
          gv_err_flag(1)        TYPE n VALUE 0,
          gv_input_dir(100)     TYPE c
                                 VALUE '/gt/interface/FI/ORS/inbound/',
          gv_inputfile_dir(255) TYPE c,
          gv_eof_flag           TYPE c VALUE 'N',
          gv_string             TYPE string,
          gv_delimiter          TYPE x VALUE '09',
          gv_input_records(3)   TYPE n,
          gv_input_file_ctr(6)  TYPE n,
          gv_proc_tot_amt(14)   TYPE p DECIMALS 2,
          gv_prg_message        TYPE string,
          gv_gjahr              TYPE bkpf-gjahr,
          gv_monat              TYPE bsis-monat.
Work area/s                                  *
    DATA: wa_itab               LIKE LINE OF gt_itab,
          wa_upfile             LIKE LINE OF gt_upfile,
          wa_footer             LIKE LINE OF gt_footer,
          wa_header             LIKE LINE OF gt_header.
ENDCLASS.
      CLASS lcl_read_app_server_file DEFINITION
CLASS lcl_read_app_server_file DEFINITION INHERITING FROM lcl_main.
  PUBLIC SECTION.
    METHODS: read_app_server_file,
             read_input_file,
             split_header,
             process_upload_file,
             split_string,
             conv_num CHANGING value(amount) TYPE t_upfile-amount,
             split_footer,
             update_batch_control,
             process_data.
ENDCLASS.
      CLASS lcl_process_data DEFINITION
CLASS lcl_process_data DEFINITION INHERITING FROM
                                             lcl_read_app_server_file.
  PUBLIC SECTION.
    METHODS process_data REDEFINITION.
ENDCLASS.
*/ CLASS IMPLEMENTATIONS
      CLASS lcl_read_app_server_file IMPLEMENTATION
CLASS lcl_read_app_server_file IMPLEMENTATION.
*/ METHOD read_app_server_file  -  MAIN METHOD
  METHOD read_app_server_file.
    gv_target = sy-host.
    PERFORM file_copy USING 'ZPPDCP' p_file 'HP-UX'
            gv_target CHANGING gv_err_flag.
    CONCATENATE gv_input_dir p_file INTO gv_inputfile_dir.
  open application server file
    PERFORM open_file USING gv_inputfile_dir 'INPUT'
                               CHANGING gv_err_flag.
    WHILE gv_eof_flag = 'N'.
      READ DATASET gv_inputfile_dir INTO wa_itab.
      APPEND wa_itab TO gt_itab.
      IF sy-subrc <> 0.
        gv_eof_flag = 'Y'.
        EXIT.
      ENDIF.
      CALL METHOD me->read_input_file.
    ENDWHILE.
  close application file server
    PERFORM close_file USING gv_inputfile_dir.
    IF wa_footer-total_no_rec <> gv_input_file_ctr.
      MOVE 'Header Control on Number of Records is Invalid' TO
           gv_prg_message.
      PERFORM call_ws_message USING 'E' gv_prg_message 'Error'.
      gv_err_flag = 1.
    ELSEIF wa_footer-total_no_rec EQ 0 AND gv_input_file_ctr EQ 0.
      MOVE 'Input File is Empty. Batch Control will be Updated' TO
           gv_prg_message.
      PERFORM call_ws_message USING 'I' gv_prg_message 'Information'.
      CALL METHOD me->update_batch_control.
      gv_err_flag = 1.
    ENDIF.
    IF gv_err_flag <> 1.
      IF wa_footer-total_amount <> gv_proc_tot_amt.
        MOVE 'Header Control on Amount is Invalid' TO gv_prg_message.
        PERFORM call_ws_message USING 'E' gv_prg_message 'Error'.
        gv_err_flag = 1.
      ENDIF.
    ENDIF.
  ENDMETHOD.
*/ METHOD read_input_file
  METHOD read_input_file.
    CASE wa_itab-rec_content+0(2).
      WHEN '00'.
        CALL METHOD me->split_header.
      WHEN '01'.
        CALL METHOD me->process_upload_file.
        ADD 1 TO gv_input_file_ctr.
        ADD wa_upfile-amount TO gv_proc_tot_amt.
      WHEN '99'.
        CALL METHOD me->split_footer.
      WHEN OTHERS.
        gv_err_flag = 1.
    ENDCASE.
  ENDMETHOD.
*/ METHOD split_header
  METHOD split_header.
    CLEAR: wa_header,
           gv_string.
    MOVE wa_itab TO gv_string.
    SPLIT gv_string AT gv_delimiter INTO
          wa_header-record_id
          wa_header-from_system
          wa_header-to_system
          wa_header-event
          wa_header-batch_no
          wa_header-date
          wa_header-time.
    APPEND wa_header TO gt_header.
  ENDMETHOD.
*/ METHOD process_upload_file
  METHOD process_upload_file.
    CLEAR gv_string.
    ADD 1 TO gv_input_records.
    MOVE wa_itab-rec_content TO gv_string.
    CALL METHOD me->split_string.
    CALL METHOD me->conv_num CHANGING amount = wa_upfile-amount.
    APPEND wa_upfile TO gt_upfile.
  ENDMETHOD.
*/ METHOD split_string
  METHOD split_string.
    CLEAR wa_upfile.
    SPLIT gv_string AT gv_delimiter INTO
          wa_upfile-record_id
          wa_upfile-rec_date
          wa_upfile-prod_line
          wa_upfile-acc_code
          wa_upfile-description
          wa_upfile-hits
          wa_upfile-amount.
  ENDMETHOD.
*/ METHOD conv_num
  METHOD conv_num.
    DO.
      REPLACE gv_delimiter WITH ' ' INTO amount.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    ENDDO.
  ENDMETHOD.
*/ METHOD split_footer
  METHOD split_footer.
    CLEAR: wa_footer,
           gv_string.
    MOVE wa_itab TO gv_string.
    SPLIT gv_string AT gv_delimiter INTO
          wa_footer-record_id
          wa_footer-total_no_rec
          wa_footer-total_amount.
    CALL METHOD me->conv_num CHANGING amount = wa_footer-total_amount.
    APPEND wa_footer TO gt_footer.
  ENDMETHOD.
*/ METHOD update_batch_control
  METHOD update_batch_control.
    DATA: lv_sys_date      TYPE sy-datum,
          lv_sys_time      TYPE sy-uzeit,
          lv_temp_date(10) TYPE c.
    CONCATENATE wa_header-date4(4) wa_header-date2(2)
                wa_header-date+0(2)
           INTO lv_temp_date.
    MOVE lv_temp_date TO wa_header-date.
    APPEND wa_header-date TO gt_header.
  Update ZTF0001 Table
    PERFORM check_interface_header USING wa_header 'U' 'GLOB'
                                   CHANGING gv_err_flag.
  Archive files
    PERFORM archive_files USING 'ZPPDARC' gv_inputfile_dir 'HP-UX'
            gv_target CHANGING gv_err_flag.
  ENDMETHOD.
  METHOD process_data.
    SORT gt_upfile ASCENDING.
    CLEAR wa_upfile.
    READ TABLE gt_upfile INDEX 1 INTO wa_upfile.
    IF sy-subrc = 0.
      MOVE: wa_upfile-rec_date+6(4) TO gv_gjahr,
            wa_upfile-rec_date+0(2) TO gv_monat.
    ENDIF.
  ENDMETHOD.
ENDCLASS.
      CLASS lcl_process_data IMPLEMENTATION
CLASS lcl_process_data IMPLEMENTATION.
  METHOD process_data.
    CALL METHOD super->process_data.
    IF NOT gt_upfile[] IS INITIAL.
    ENDIF.
  ENDMETHOD.
ENDCLASS.
Start of selection                           *
START-OF-SELECTION.
  DATA: read TYPE REF TO lcl_read_app_server_file,
        process TYPE REF TO lcl_process_data.
  CREATE OBJECT: read, process.
  CALL METHOD read->read_app_server_file.
  CALL METHOD process->process_data.

Similar Messages

  • How to move the contents of an itab from one class to another...

    Hello Experts,
    How can I move the contents of an internal table for a given class to another class.
    I want to transfer the contents of my internal table lt_vbak to another class
    which is lcl_get_docflow. Below is my code:
    REPORT  zsd_orderstage
            NO STANDARD PAGE HEADING.
    * Data Dictionary Table/s                      *
    TABLES: vbak.
    * Global Structure/s                           *
    TYPES: BEGIN OF t_output,
            salesgroup    type vbak-vkgrp,
            salesorder    TYPE vbak-vbeln,
            custcode      TYPE vbak-kunnr,
            shipto        TYPE likp-kunnr,
            creation_date TYPE vbak-erdat,
            created_by    TYPE vbak-ernam,
            delorder      TYPE likp-vbeln,
            invnumber     TYPE vbrk-vbeln,
           END OF t_output.
    * Global Internal Table/s                      *
    DATA: gt_output TYPE STANDARD TABLE OF t_output.
    * SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_kunnr TYPE vbak-kunnr OBLIGATORY.
    SELECT-OPTIONS: s_group for vbak-vkgrp,
                    s_auart FOR vbak-auart,
                    s_erdat FOR vbak-erdat  OBLIGATORY,
                    s_ernam FOR vbak-ernam.
    SELECTION-SCREEN END OF BLOCK b1.
    *       CLASS lcl_main DEFINITION
    CLASS lcl_main DEFINITION ABSTRACT.
      PUBLIC SECTION.
        TYPES: BEGIN OF t_vbak,
              vbeln TYPE vbak-vbeln,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              auart TYPE vbak-auart,
              kunnr TYPE vbak-kunnr,
              vkgrp type vbak-vkgrp,
             END OF t_vbak.
        TYPES: BEGIN OF t_vbfa,
                vbelv   TYPE vbfa-vbelv,
                vbeln   TYPE vbfa-vbeln,
                vbtyp_n TYPE vbfa-vbtyp_n,
               END OF t_vbfa.
        TYPES: BEGIN OF t_likp,
                vbeln TYPE likp-vbeln,
                kunnr TYPE likp-kunnr,
               END OF t_likp.
        TYPES: BEGIN OF t_vbrk,
                vbeln TYPE vbrk-vbeln,
               END OF t_vbrk.
        DATA: gt_vbfa     TYPE STANDARD TABLE OF t_vbfa,
              gt_likp     TYPE HASHED TABLE OF t_likp
                          WITH UNIQUE KEY vbeln,
              gt_vbrk     TYPE HASHED TABLE OF t_vbrk
                          WITH UNIQUE KEY vbeln,
              gt_delivery TYPE STANDARD TABLE OF t_vbfa,
              gt_invoice  TYPE STANDARD TABLE OF t_vbfa.
    ENDCLASS.                    "lcl_main DEFINITION
    *       CLASS lcl_get_so DEFINITION
    CLASS lcl_get_so DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        DATA: lt_vbak TYPE STANDARD TABLE OF t_vbak.
        METHODS: get_sales_orders
                    RETURNING
                       value(re_vbak) TYPE t_vbak.
    ENDCLASS.                    "lcl_get_so DEFINITION
    *       CLASS lcl_get_so IMPLEMENTATION
    CLASS lcl_get_so IMPLEMENTATION.
      METHOD get_sales_orders.
        SELECT vbeln erdat ernam auart kunnr vkgrp
          FROM vbak
          INTO TABLE lt_vbak
         WHERE erdat IN s_erdat
           AND ernam IN s_ernam
           AND auart IN s_auart
           AND kunnr = p_kunnr.
      ENDMETHOD.                    "get_sales_orders
    ENDCLASS.                    "lcl_get_so IMPLEMENTATION
    *       CLASS lcl_get_docflow DEFINITION
    CLASS lcl_get_docflow DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        DATA: lt_vbfa TYPE STANDARD TABLE OF t_vbfa.
        METHODS: get_subsequent_docs
                    IMPORTING
                       value(im_vbak) TYPE t_vbak
                    EXPORTING
                       ex_vbfa TYPE t_vbfa.
    ENDCLASS.                    "get_docflow  INHERITING FRO
    *       CLASS lcl_get_docflow IMPLEMENTATION
    CLASS lcl_get_docflow IMPLEMENTATION.
      METHOD get_subsequent_docs.
      ENDMETHOD.                    "get_subsequent_docs
    ENDCLASS.                    "get_docflow IMPLEMENTATION
    * Global Internal Table/s                      *
    START-OF-SELECTION.
      DATA: o_get_so      TYPE REF TO lcl_get_so,
            o_get_docflow TYPE REF TO lcl_get_docflow.
      CREATE OBJECT: o_get_so,
                     o_get_docflow.
      CALL METHOD o_get_so->get_sales_orders.
    What I want is to pass the records of lt_vbak to method get_subsequent_docs. How do I do this guys?Thank you and take care!

    .

  • How do i transfer iTunes money from one account to another

    how do i transfer iTunes money from one account to another? also forgot security question answers

    You can't, an account's balance cannot be transferred to another account, nor can it be used to gift content to another account - it can only be used to buy content for the account that it's on.
    For your security questions, if you have a rescue email address (which is not the same thing as an alternate email address) on your account then you can use that to reset them : http://support.apple.com/kb/HT6170
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will have to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    If your country isn't on that page then try this form and explain and see what they reply with : https://ssl.apple.com/emea/support/itunes/contact.html
    When they've been reset, and if you don't already have a rescue email address, you can then add one for potential future use : http://support.apple.com/kb/HT5620
    Or, if it's available in your country, you could change to 2-step verification : http://support.apple.com/kb/HT5570

  • How do you transfer Apple IDs from one ipad to another iPad?  I got the new ipad and gave my ipad 2 to my wife who had the first version and now I can't get my Apple ID off so she can use her Apple ID.

    how do you transfer Apple IDs from one ipad to another iPad?  I got the new ipad and gave my ipad 2 to my wife who had the first version and now I can't get my Apple ID off so she can use her Apple ID.

    You don't transfer Apple ID's from one device to another one. You sign out in the settings, )the App Store and iTunes if necessary) and then sign in with the other ID.
    Settings>iTunes & App Stores>Apple ID>Sign out. Them sign in with the other ID. You can sign out of the app store and iTunes as well by going to the featured Atab in the App Store and the music tab in iTunes, swipe to the bottom and access the Apple ID in there.
    You should have erased the iOad before you gave it to her in Settings>General>Reset>Erase all content and settings. That way she could set up the iPad as new with her own Apple ID.
    Be aware of the fact that if you use each others ID's in order to download past purchased content to your own iPads, you will lock yourself out of your own ID as you will have associated your iPad with the other person's Apple ID.
    In other words, if you sign into your wife's ID on your iPad so that you can download an app or an album so that you don't have to pay for it again, you will lock yourself out of your Apple ID for 90 days.

  • How do I transfer a clip from one project to another?

    How do I transfer a clip from one project to another?
    [Title edited to remove personal information... Mod]
    [personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
    [This is an open forum, not Adobe support, please do not post personal information]

    Gene
    Thanks for the reply.
    For now assuming that you are using Premiere Elements 11, 12/12.1, or 13/13.1 on Windows 7, 8, or 8.1 64 bit....
    I am not sure that Left and Right channel audio editing is the answer to your DVD echo issue, but the opportunities for audio channel editing in Premiere Elements would include (before burn to)
    1. Audio Mixer - Balance.
    2. fx Effects/Audio Effects
    Please refer to https://helpx.adobe.com/premiere-elements/using/effects-reference.html#audio_effects
    for explanations of the Audio Effects.....
    Balance
    Channel Volume
    Left Fill, Right Fill
    Invert
    Swap Channels
    And, there is the free audio editor, Audacity Audacity: Free Audio Editor and Recorder for channel editing.
    Do you hear the echo before the burn to disc?
    Is any of the Timeline video content from your cell phone? If so, did you have any issues with a variable frame rate when you were preparing the video in Edit area for burn to in Publish+Share?
    What audio effects, if any, did you apply to the Timeline audio content prior to burn to?
    Please consider.
    ATR

  • How we can get the values  from one screen to another screen?

    hi guru's.
         how we can get the values  from one screen to another screen?
              we get values where cusor is placed but in my requirement i want to get to field values from one screen to another screen.
    regards.
      satheesh.

    Just think of dynpros as windows into the global memory of your program... so if you want the value of a field on dynpro 1234 to appear on dynpro 2345, then just pop the value into a global variable (i.e. one defined in your top include), and you will be able to see it in your second dynpro (assuming you make the field formats etc the same on both screens!).

  • How to EXPORT a concurrent program from one instance to another

    Hi,
    I am new to EBS.
    How to EXPORT a concurrent program from one instance to another. I dont want to use FNDLOAD.
    Is there any other way from where we can export the concurrent program to anothere instance from CLIENT connection server.
    Thanks
    Asis

    Hi;
    What is EBS version? Why you dont use FNDLOAD?
    Pelase see below thread
    Move concurrent program to prod
    Move concurrent program to prod
    Regard
    Helios

  • How do I move Contacts & Calendar from one User to another User on the same Macbook Pro?

    How do I move Contacts & Calendar from one User to another User on the same Macbook Pro? OSX 10.9.5

    is this second library in a different account on the computer?
    Look at Home Sharing.
    iTunes: How to share music and video - http://support.apple.com/kb/HT2688 - about Music Sharing and Home Sharing
    Home Sharing Support page - http://www.apple.com/support/homesharing/
    iTunes: Setting up Home Sharing on your computer - http://support.apple.com/kb/HT4620
    iTunes Home Sharing now works between users on same computer - https://discussions.apple.com/thread/3865597

  • HT4528 how do i move an icon from one screen to another on my Iphone 5?

    How do I mov an icon from one screen to another on my Iphone 5?

    Tap and hold an Icon until they begin to shake. Move the Icon towards the edge of the screen and hold for a couple seconds. The Icon will then "jump" to the next screen.

  • How do I move a contact from one group to another?

    On my device, or in iCloud on the web, how do I move a contact from one group to another.  This should be as easy as it is with calender items, but the only solution I've found is to change your default contact group, and email the contact to yourself.  Then tap the contact, and add it to your contact list.  You can then delete the original.  Is there an easier way???

    Hi rjwrjw11,
    Thanks for visiting Apple Support Communities.
    If you want a song to be listed under a different album in iTunes, you can edit the song information:
    Fixing Incorrect Song or Album Listings in iTunes
    http://support.apple.com/kb/TA24677
    Editing Track Information in iTunes
    To view and edit a song or video's info in iTunes:
    Click once on the track title to select it
    From the File menu, choose Get Info
    Click the Info tab
    Best,
    Jeremy

  • How do I move vznavigator favorites from one phone to another?

    how do I move vznavigator favorites from one phone to another?
    Wife has Pre 2 where GPS works beautiful... my old Pre Plus was always hit or miss on GPS.
    But I've developed quite a library of favorites on my Plus.  How do I move these to our new Pre 2?

    Good afternoon CWFlink.
    I am a fan of the VZ Navigator myself, and all of the great features of this application!  Is the Palm Pre 2 on the same number as the Palm Pre Plus?  If yes, you can synchronize your Favorites through our website at the following link: VZ Navigator  
    You will sign in using your My Verizon login information, and sync the Settings and Favorites to your new device.  However, if your Favorites are on a different mobile number, you will have to manually enter in the information/ settings.  I still encourage you to use the website to set everything up as you like, in case you need to change devices in the future.
    I trust this information is helpful.  
    Thank you,

  • How do i move an app from one page to another

    how do i move an app from one page to another? When I upgraded to the latest software on my 4s, the camera went to the last page rather than remaining on the home page

    What Rudegar says is true, but it's a lot easier to rearrange icons in iTunes:
    Connect your phone and open iTunes. 
    Click on the Apps tab. 
    You will see your home screen in the main window, with the other screens in a scrollable column on the right. Scroll down and click on the last page to put it in main window. 
    Now scroll the column so the home page is visible on the right.
    Click on the Camera and drag it onto the home page at the right. 
    Be careful not to accidentally insert it into another app, thereby creating a group.

  • How do I transfer my music from one PC to another?

    How do I transfer iTunes music from one PC to another?

    http://support.apple.com/kb/HT4527
    The said article above will explain how to move your itunes library to another computer.  The easiest way is to utilize an external hard drive.

  • How do I transfer my music from one PC to another PC with ipod?

    I currently have my music in one PC and just bought another PC for the home. How do I transfer my music from one PC to another without reloading all the music?

    man, oh man the money i would make if i was making commision.
    try this program:
    iPod agent
    find it at download.com
    free to try/$15USD to buy

  • How do i transfer my money from one account to another?

    How do i transfer my money from one account to another?

    Welcome to the Apple Community.
    That isn't possible.

Maybe you are looking for