Save Internal table to disk!?

Hi,
I have an Internal table in my program that I want to save to disk in some way...
Is there any FM or something for this ?
//Martin

try this:
     call function 'WS_DOWNLOAD'
       exporting
            filename                = cpath
                                      "c:tempoutput.txt
            filetype                = 'DAT' "tab-delimited
       tables
            data_tab                = itab
       exceptions
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            others                  = 10.
ryan.

Similar Messages

  • How to save internal table data to file on local disk from smartforms?

    Hi there,
    I'm trying to save internal table data into .csv file on presentation server from within smartforms using GUI_DOWNLOAD function.
    This function works fine from abap program, but when I call it from smartforms it does nothing. Form prints ok and there is no file created on local dick.
    Is there a way to save smartforms internal table data to local disk?
    Thanks in advance,
    Baske

    Hi Jey,
    Thanks for your prompt replay.
    Unfortunately, Iu2019ve tried both your suggestions without success. Smartforms behaves just like in case of GUI_DOWNLOAD. There is no file saved on disk.
    Do you have any other idea?
    BR,
    Baske

  • How to save Internal table as a local file?

    Hi,
    How to save Interanl table as a local file ?
    I had some data which i had selected in Interanl table and would like to send this as an attachment by attaching internal table contents as a local file--

    Hi friend,
    See sample code for GUI_DOWNLOAD.
    *Types
    TYPES: BEGIN OF g_r_mara,
           matnr LIKE mara-matnr,
           ersda LIKE mara-ersda,
           laeda LIKE mara-laeda,
           mtart LIKE mara-mtart,
           mbrsh LIKE mara-mbrsh,
           END OF g_r_mara.
    *Data
    DATA: g_t_mara TYPE TABLE OF g_r_mara,
          filename TYPE string.
    *Tables
    TABLES: mara, sscrfields.
    *Selection Screen
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 10(20) text-001 FOR FIELD p1.
    SELECTION-SCREEN PUSHBUTTON 12(20) word USER-COMMAND uc.
    SELECTION-SCREEN END OF LINE.
    *Initilizing data.
    INITIALIZATION.
      word = 'word'.
      filename = 'C:\Testing.doc'.   <------- File name and location
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
        WHEN 'UC'.
    *Data retrival
          SELECT matnr ersda laeda mtart mbrsh
            INTO  CORRESPONDING FIELDS OF TABLE g_t_mara
            FROM mara
            WHERE matnr IN s_matnr.
    *Downloading data from internal table to excel
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename              = filename
              filetype              = 'ASC'
              write_field_separator = 'X'
            TABLES
              data_tab              = g_t_mara.
      ENDCASE.
    (Note: Downloaded file is in C:\Testing.doc)
    You can change the file format by changing the extension in filename.
    Might helpful for u.
    Thanks..

  • Save Internal table to memory - problem

    Hi everybody ,
    I need to extract one Internal table to memory , every 1st in the Month .
    Then every day I will be reading this table for my report ( in order to avoid running every day same and same database selections) .
    My originall idea wos with EXPORT TO MEMORY ID , AND IMPORT
    but it does'nt work next day ... With Export data is cept only untill tthe end of the transaction ...
    Is there any way except of storing data in one Z_ database table ???
    Thanks in advance

    Hi,
    You can use the following code to export to memory
    *data variable required for background processing
    data: wa_indx type indx.
    *EXPORT Internal Table TO MEMORY ID 'XYZ'.
    *part for background processing
      export tab = <your table> to database indx(xy) from wa_indx client
      sy-mandt id 'XYZ'.
    the following code will import from Memory and clear memory
    *data variable required for background processing
    data: wa_indx type indx.
    imports from database the list sent by the calling program
    IMPORT tab = <your table> FROM DATABASE indx(xy) TO wa_indx CLIENT sy-mandt
    ID 'XYZ'.
    deletes the data to save wastage of memory
    DELETE FROM DATABASE indx(xy)
      CLIENT sy-mandt
      ID 'XYZ'.
    Regards,
    Samson Rodrigues.

  • How to save Internal table into Excel Sheet in App. Sever in Background

    How can i save my file int excel in application server in background.
    i am able to do in fronend but not in back ground.

    HI
    see this example code where i had write EXCEL to INTERNAL TABLE and then TO APPLICATION SERVER
    assign this program to background thats all
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    *   PROGRAM_NAME        = SYST-REPID
    *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
       STATIC              = 'X'
    *   MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    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 it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • How to save Internal table inside Personnel Change Request after JSPcode ??

    HI ,
         I have built up Som Org management Data while running PCR . But when it goes to JSP for form display
    and comes back to SAP. The internal table that I have saved in SAP MEMORY / ABAP MEMORY is getting washed off..
    I m building the table in the INIT method of the BADI ( qisr1) .
    Can any body suggest a way for saving the DATA when control is back from JSP.
    is it posible thr saving in som class private data ??

    SAP and ABAP Memory belong to a user session, in a new session you wont have access to the ABAP/SAP Memory of another session. Seems like you are using a stateless JSP.
    Instead you could use the Shared Memory, check this link: http://help.sap.com/saphelp_nw04s/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm or you use a Server-Side cookie, http://help.sap.com/saphelp_nw70/helpdata/EN/bd/4cd23a09313b37e10000000a11405a/frameset.htm
    regards,
    Markus

  • Save report painter output into internal table

    Hi,
      i have created a report painter for vendor aging report. got output in drill down format.
    i need to show the data in smartform as well. so need to save the report painter output into an internal table. can anyone please help me resolving this.
    regards,
    sudha.m

    Hi Sudha
    You can use sample below:
    DATA: list_tab TYPE TABLE OF ABAPLIST.
    SUBMIT NROWS EXPORTING LIST TO MEMORY
                  AND RETURN VIA SELECTION-SCREEN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Best regards

  • How to save value in struture into internal table?

    good day to everyone,
    i have a prb with my coding below. i am trying to save the value tvbdpr-uecha into wa_zmas-uecha by using modify as shown below.
    however, the value uecha is not successfully being transported/saved into it_zmas.
    could anyone guide me?
    tvbdpr - is a structure table
    it_zmas - is an internal table
      LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
              wa_zmas-uecha = tvbdpr-uecha.
              MODIFY TABLE it_zmas FROM wa_zmas TRANSPORTING uecha.
    thank you
    regards,
    sw

    Hi,
    If the internal table is already having contents and u need to modify it for the field uecha, you can try the following
    LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
    wa_zmas-uecha = tvbdpr-uecha.
    READ TABLE it_zmas with KEY posnr = wa_zmas-posnr matnr = wa_zmas-matnr.
    if sy-subrc = 0.
    it_zmas-uecha = wa_zmas-uecha.
    MODIFY it_zmas index sy-index.
    clear it_zmas-uecha.
    endif.
    ENDLOOP.
    Else if the internal table is empty and you are populating the field uecha, use append
    LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
    wa_zmas-uecha = tvbdpr-uecha.
    it_zmas-uecha = wa_zmas-uecha.
    append it_zmas.
    clear it_zmas.
    ENDLOOP.
    Regards,
    Vik

  • How to save message into internal table?

    Hi,everyone!
    I have a problem when I'm coding.I want to store messages into a internal table.Can you help me?
    Thanks!

    Hello Feng
    If you are already working on SAP basis release >= 6.20 I would recommend the most versatile message handler of all: interface <b>IF_RECA_MESSAGE_LIST</b>
    Perhaps you will find the following sample report ZUS_SDN_APOLLO_13
    (see also: <a href="https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack">Message Handling - Finding the Needle in the Haystack</a>) useful.
    *& Report  ZUS_SDN_APOLLO_13
    REPORT  zus_sdn_apollo_13
      LINE-SIZE 200.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    TYPES:   status     TYPE exception.
    INCLUDE TYPE bapiret2  AS msg.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                        WITH DEFAULT KEY.
    DATA:
      gs_layout         TYPE lvc_s_layo,
      gt_outtab         TYPE ty_t_outtab.
    DATA:
      gd_title          TYPE lvc_title,
      gd_msgv           TYPE symsgv,
      gd_msg            TYPE bapi_msg,
      gs_msg            TYPE recamsg,
      gs_return         TYPE bapiret2,
      gt_return         TYPE bapirettab,
      go_msglist        TYPE REF TO if_reca_message_list,
      go_random         TYPE REF TO cl_random_number,
      gif_random        TYPE REF TO if_random_number.
    PARAMETERS:
      p_opt1  RADIOBUTTON GROUP radi  DEFAULT 'X',
      p_opt2  RADIOBUTTON GROUP radi,
      p_opt3  RADIOBUTTON GROUP radi.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
      p_opt4  RADIOBUTTON GROUP radi,
      p_opt5  RADIOBUTTON GROUP radi,
      p_opt6  RADIOBUTTON GROUP radi.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
      p_count    TYPE numc3     DEFAULT '4',
      p_level    TYPE ballevel  DEFAULT '7'.
    DEFINE mac_build_msg.
      clear: gs_msg.
      gs_msg-msgty = &5.
      gs_msg-msgid = '00'.
      gs_msg-msgno = '398'.
      gs_msg-msgv1 = &1.
      gs_msg-msgv2 = &2.
      gs_msg-msgv3 = &3.
      gs_msg-msgv4 = &4.
      gs_msg-detlevel = &6.
    END-OF-DEFINITION.
    *  msgty
    *  msgid
    *  msgno
    *  msgv1
    *  msgv2
    *  msgv3
    *  msgv4
    *  msgv1_src
    *  msgv2_src
    *  msgv3_src
    *  msgv4_src
    *  detlevel
    *  probclass
    *  alsort
    *  time_stmp
    *  msg_count
    *  context
    *  params
    START-OF-SELECTION.
      " Create message handler
      go_msglist = cf_reca_message_list=>create( ).
      " Create random number instance
      CREATE OBJECT go_random TYPE cl_random_number.
      gif_random ?= go_random.
      gif_random->init( ).
      PERFORM message_handling_1.
      PERFORM message_handling_2.
      PERFORM message_handling_3.
      PERFORM message_handling_4.
    END-OF-SELECTION.
    *&      Form  MESSAGE_HANDLING_1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_1 .
      CHECK ( p_opt1 = abap_true ).
      gd_title = 'Information System 1 (IS1)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      WRITE: / 'Apollo 13 Mission'.
      WRITE: / syst-uline.
      WRITE: / 'Take-Off             -> ok'.
      WRITE: / 'Leaving Orbit        -> ok'.
      WRITE: / 'Trajectory           -> ok'.
      WRITE: /.
      FORMAT COLOR COL_NEGATIVE.
      WRITE: / 'Explosion happened   -> not ok'.
      WRITE: / 'Command and Service module (CSM) -> damaged'.
      FORMAT RESET.
      WRITE: / 'Lunar module (LM)    -> not affected, ok'.
      MESSAGE text-hou TYPE 'S'.
    ENDFORM.                    " MESSAGE_HANDLING_1
    *&      Form  message_handling_2
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_2 .
    * define local data
      DATA:
        ld_success(6)  TYPE n,
        ld_warning(6)  TYPE n,
        ld_failure(6)  TYPE n,
        ld_total(6)    TYPE n.
      CHECK ( p_opt2 = abap_true ).
      gd_title = 'Information System 2 (IS2)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      PERFORM generate_messages.  " simulation of messages
      CALL METHOD go_msglist->get_list_as_bapiret
        IMPORTING
          et_list = gt_return.
      " Calculate message types and total
      ld_total   = 0.
      ld_success = 0.
      ld_warning = 0.
      ld_failure = 0.
    " Print messages as WRITE list
      LOOP AT gt_return INTO gs_return.
        IF ( gs_return-type = 'E' ).
          ADD 1 TO ld_failure.
        ELSEIF ( gs_return-type = 'W' ).
          ADD 1 TO ld_warning.
        ELSE.
          ADD 1 TO ld_success.
        ENDIF.
      ENDLOOP.
      ld_total = ld_success + ld_warning + ld_failure.
      WRITE: / 'Total Message =', ld_total.
      WRITE: / 'Failures      =', ld_failure.
      WRITE: / 'Warnings      =', ld_warning.
      WRITE: / 'Successes     =', ld_success.
      WRITE: / syst-uline.
      SKIP.
    " Colouring depending on message type
      LOOP AT gt_return INTO gs_return.
        IF ( gs_return-type = 'E' ).
          FORMAT COLOR COL_NEGATIVE.
        ELSEIF ( gs_return-type = 'W' ).
          FORMAT COLOR COL_TOTAL.
        ELSE.
          FORMAT RESET.
        ENDIF.
        WRITE: / gs_return-type, gs_return-message+0(100).
      ENDLOOP.
    ENDFORM.                    " message_handling_2
    *&      Form  message_handling_3
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_3 .
    * define local data
      DATA:
        ls_outtab    TYPE ty_s_outtab.
      DATA:
        ld_success(6)  TYPE n,
        ld_warning(6)  TYPE n,
        ld_failure(6)  TYPE n,
        ld_total(6)    TYPE n.
      CHECK ( p_opt3 = abap_true ).
      gd_title = 'Information System 3 (IS3)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      PERFORM generate_messages.  " simulation of messages
      CALL METHOD go_msglist->get_list_as_bapiret
        IMPORTING
          et_list = gt_return.
      REFRESH: gt_outtab.
      " Calculate message types and total
      ld_total   = 0.
      ld_success = 0.
      ld_warning = 0.
      ld_failure = 0.
    " Define the logic for setting exception status (LED)
      LOOP AT gt_return INTO gs_return.
        CLEAR: ls_outtab.
        ls_outtab-msg = gs_return.
        IF ( gs_return-type = 'E' ).
          ls_outtab-status = '1'.  " red
          ADD 1 TO ld_failure.
        ELSEIF ( gs_return-type = 'W' ).
          ls_outtab-status = '2'.  " yellow
          ADD 1 TO ld_warning.
        ELSE.
          ls_outtab-status = '3'.  " green
          ADD 1 TO ld_success.
        ENDIF.
        APPEND ls_outtab TO gt_outtab.
      ENDLOOP.
      ld_total = ld_failure + ld_warning + ld_success.
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
      gs_layout-excp_fname = 'STATUS'.
      gs_layout-excp_led   = abap_true.
      gs_layout-smalltitle = abap_true.
      CONCATENATE 'T(' ld_total   ')  '
                  'E(' ld_failure ')  '
                  'W(' ld_warning ')  '
                  'S(' ld_success ')  '
        INTO gd_title SEPARATED BY space.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'BAPIRET2'
          i_grid_title     = gd_title
          is_layout_lvc    = gs_layout
        TABLES
          t_outtab         = gt_outtab
        EXCEPTIONS
          OTHERS           = 1.
    ENDFORM.                    " message_handling_3
    *&      Form  message_handling_4
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_4 .
    * define local data
      CHECK ( p_opt4 = abap_true   OR
              p_opt5 = abap_true   OR
              p_opt6 = abap_true ).
      IF ( p_opt4 = abap_true ).
        gd_title = 'Information System 4 (IS4)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ELSEIF ( p_opt5 = abap_true ).
        gd_title = 'Information System 5 (IS5)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ELSE.
        gd_title = 'Information System 6 (IS6)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ENDIF.
      PERFORM generate_messages.  " simulation of messages
      PERFORM display_log.
    ENDFORM.                    " message_handling_4
    *&      Form  GENERATE_MESSAGES
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM generate_messages .
    * define local data
      mac_build_msg 'Apollo 13 Mission: Spacecraft'
                     space space space 'I' '1'.
    **  DEFINE mac_build_msg.
    **    clear: gs_msg.
    **    gs_msg-msgty = &5.
    **    gs_msg-msgid = '00'.
    **    gs_msg-msgno = '398'.
    **    gs_msg-msgv1 = &1.
    **    gs_msg-msgv2 = &2.
    **    gs_msg-msgv3 = &3.
    **    gs_msg-msgv4 = &4.
    **    gs_msg-detlevel = &6.
    **  END-OF-DEFINITION.
      go_msglist->add( is_message = gs_msg ).
      DO 6 TIMES.
        CASE syst-index.
          WHEN '1'.
            mac_build_msg 'Command and Service Module (CSM)'
               space space space 'I' '2'.
          WHEN '2'.
            mac_build_msg 'Lunar Module (LM)' space space space 'I' '2'.
          WHEN '3'.
            mac_build_msg 'Additional Module (M-1)'
              space space space 'I' '2'.
          WHEN '4'.
            mac_build_msg 'Additional Module (M-2)'
              space space space 'I' '2'.
          WHEN '5'.
            mac_build_msg 'Additional Module (M-3)'
              space space space 'I' '2'.
          WHEN '6'.
            mac_build_msg 'Additional Module (M-4)'
              space space space 'I' '2'.
          WHEN OTHERS.
            EXIT.
        ENDCASE.
        go_msglist->add( is_message = gs_msg ).
    "   recursive call of routine
        PERFORM generate_messages_1 USING syst-index 'Modul' '3'.
      ENDDO.
    ENDFORM.                    " GENERATE_MESSAGES
    *&      Form  GENERATE_MESSAGES_1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM generate_messages_1
                         USING
                            value(ud_index)     TYPE i
                            value(ud_msgv)      TYPE symsgv
                            value(ud_detlevel)  TYPE ballevel.
    * define local data
      DATA:
        ld_integer         TYPE i,
        ld_msgty           TYPE symsgty,
        ld_msgv            TYPE symsgv,
        ld_detlevel        TYPE ballevel.
      DO p_count TIMES.
        WRITE syst-index TO ld_msgv NO-ZERO LEFT-JUSTIFIED.
        IF ( ud_detlevel = '3' ).
          CONCATENATE ud_msgv ld_msgv INTO ld_msgv
            SEPARATED BY space.
        ELSE.
          CONCATENATE ud_msgv ld_msgv INTO ld_msgv
            SEPARATED BY '.'.
        ENDIF.
        CONDENSE ld_msgv.
        gd_msgv = ld_msgv.
        IF ( ud_index = 1 ).
          ld_integer = gif_random->get_random_int( 300 ).
          IF ( ld_integer = 1 ).
            ld_msgty = 'E'.
            CONCATENATE gd_msgv 'failed' INTO gd_msgv SEPARATED BY ' -> '.
          ELSEIF ( ld_integer BETWEEN 1 AND 10 ).
            ld_msgty = 'W'.
            CONCATENATE gd_msgv 'check(?)' INTO gd_msgv SEPARATED BY ' -> '.
          ELSE.
            ld_msgty = 'S'.
            CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
          ENDIF.
        ELSE.
          ld_msgty = 'S'.
          CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
        ENDIF.
        mac_build_msg gd_msgv space space space ld_msgty ud_detlevel.
        go_msglist->add( is_message = gs_msg ).
        IF ( ud_detlevel < p_level ).
          ld_detlevel = ud_detlevel + 1.
          PERFORM generate_messages_1 USING ud_index ld_msgv ld_detlevel.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GENERATE_MESSAGES_1
    *&      Form  DISPLAY_LOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_log .
    * define local data
      DATA:
        ld_handle           TYPE balloghndl,
        lt_log_handles      TYPE bal_t_logh,
        ls_profile          TYPE bal_s_prof.
    " Get log handle of collected message list
      ld_handle = go_msglist->get_handle( ).
      APPEND ld_handle TO lt_log_handles.
      IF ( p_opt4 = 'X' ).
    *   get a display profile which describes how to display messages
        CALL FUNCTION 'BAL_DSP_PROFILE_DETLEVEL_GET'
          IMPORTING
            e_s_display_profile = ls_profile.  " tree & ALV list
      ELSEIF ( p_opt5 = 'X' ).
    *   get standard profile to display one log
        CALL FUNCTION 'BAL_DSP_PROFILE_SINGLE_LOG_GET'
          IMPORTING
            e_s_display_profile = ls_profile.
      ELSE.
        CALL FUNCTION 'BAL_DSP_PROFILE_NO_TREE_GET'
          IMPORTING
            e_s_display_profile = ls_profile.
      ENDIF.
    * set report to allow saving of variants
      ls_profile-disvariant-report = sy-repid.
    *   when you use also other ALV lists in your report,
    *   please specify a handle to distinguish between the display
    *   variants of these different lists, e.g:
      ls_profile-disvariant-handle = 'LOG'.
      CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
        EXPORTING
          i_s_display_profile          = ls_profile
          i_t_log_handle               = lt_log_handles
        EXCEPTIONS
          profile_inconsistent         = 1
          internal_error               = 2
          no_data_available            = 3
          no_authority                 = 4
          OTHERS                       = 5.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_LOG
    Regards
      Uwe

  • Std Internal Tables

    Hi, what are Standard Internal Tables and Standard reports, and can I have names of some 'Standard Internal Tables' and  'Standard Reports' plz ?
    Thnx.

    these are some of the standard reports\
    REKH0004
       SAP demo program that shows how to do  2d        3D, and 4D graphics.
    RGUGBR00 
    Substitution/Validation utility
    RHGEN00
         Regen PD and PA inconsistencies
    RHGRENZ0  
       Delimit IT1000 and related 1001s. Program                     will            delete any 1001 infotypes whose start date is after the delimit date.
    RHGRENZ1
    Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
    RHGRENZ2
    Delimit IT1001 only.
    RKCTSEAR
    Search source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.
    RPDTRA00
    List all HR transactions.
    RPR_ABAP_SOURCE_SCAN
    Search ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.
    RPUAUD00
    HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.
    RPUAUDDL
    HR Report to delete audit data from the PCL4 Audit Cluster.
    RPUDELPN
    Delete all info for an employee number, including cluster data and infotypes
    RPUP1D00/10
    View/Delete data from PCL1 Cluster
    RPUP2D00/10
    View/Delete data from PCL2 Cluster
    RPUP3D00/10
    View/Delete data from PCL3 Cluster
    RPUP4D00/10
    View/Delete data from PCL4 Cluster
    RSABAPIV
    Mass print/display of ABAP/4 help text
    RSAVGL00
    Table adjustment across clients
    RSBDCBTC
    Submit a BDC job with an internal batch number and wait for the end of the batch input session.
    RSBDCDRU
    Prints the contents of a Batch Input session. No options for error transactions only.
    RSBDCOS0
    Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0
    RSBDCSUB
    Release batch input sessions automatically
    RSBTCDEL
    Clean the old background job records
    RSSDOCTB
    R/3 Table Manual - prints a list of all fields in the selected tables with the field name and the field documentation.
    RSCLTCOP
    Copy tables across clients
    RSDBCREO
    Clean batch input session log
    RSINCL00
    Extended program list
    RSNASTED
    Process message control output for entries in the NAST table
    RSORAREL
    Get the Oracle Release
    RSPARAM
    Display all instance parameters
    RSPO0041
    Removing old spooling objects
    RSRSCAN1
    Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
    RSSNAPDL
    Clean the old ABAP error dumps
    RSTBSERV
    Compare a contents of a table between clients
    RSTXFCON
    Converts SAPScript page formats
    RSTXSCRP
    Save a SAPScript layout set to disk, and load it back into SAP.
    RSTXSCRP
    Transport SAPscript files across systems
    RSTXSCRP
    Upload and download SAPScript layout sets
    RSTXTPDF4
    Pass the spool number of a report's output to this program to have the output converted to PDF format.
    RSTXTRAN
    Add standard texts to a transport so they can be moved between systems.
    RSUSR003
    Check the passwords of users SAP* and DDIC in all clients
    RSUSR006
    List users last login
    RSWBO052
    Change development class of a sapscript (provided by Alan Cecchini)
    RSWBO060
    put objects into a request and transport it to any other system
    inernal tables
    INTERNAL TABLES IN ABAP:
    There are two ways of accessing the records in an internal table:
    By copying individual records into a work area. The work area must be compatible with the line type of the internal table.
    You can access the work area in any way, as long as the component you are trying to access is not itself an internal table. If one of the components is an internal table, you must use a further work area, whose line type is compatible with that of the nested table.
    When you change the internal table, the contents of the work area are either written back to the table or added as a new record.
    By assigning the individual data records to an appropriate field symbol. Once the system has read an entry, you can address its components directly via its address. There is no copying to and from the work area. This method is particularly appropriate for accessing large or complex tables.
    If you want to read more than one record, you must use a LOOP... ENDLOOP structure. You can then change or delete the line that has just been read, and the system applies the change to the table body. You can also change or delete lines using a logical condition.
    When you use the above statements with sorted tables, you must ensure that the sort sequence is maintained.
    Within a loop, the INSERT statement adds the data record before the current record in the table. If you want to insert a set of lines from an internal table into another index table, you should use the INSERT LINES OF variant instead.
    When you read single data records, you can use two further additions:
    In the COMPARING addition, the system compares the field contents of a data record with those in the work area for equality.
    In the TRANSPORTING addition, you can restrict the data transport to selected fields.
    Other statements for standard tables
    SORT [ASCENDING|DESCENDING]
    [BY [ASCENDING|DESCENDING] ..
    [ASCENDING|DESCENDING]][AS TEXT] [STABLE].
    These statements sort the table by the table key or the specified field sequence. If you do not use an addition, the system sorts ascending. If you use the AS TEXT addition, character fields are sorted in culture-specific sequence. The relative order of the data records with identical sort keys only remain constant if you use the STABLE addition.
    APPEND INTO SORTED BY .
    This statement appends the work area to the ranked list in descending order. The ranked list may not be longer than the specified INITIAL SIZE, and the work area must satisfy the sort order of the table.
    The statements listed here can be used freely with both standard and sorted tables.
    When you change a single line, you can specify the fields that you want to change using the TRANSPORTING addition. Within a loop, MODIFY changes the current data record.
    If you want to delete a set of lines from an index table, use the variant DELETE FROM... TO.. or WHERE... instead of a loop. You can program almost any logical expression after WHERE.
    The only restriction is that the first field in each comparison must be a component of the line structure (see the corresponding Open SQL statements). You can pass component names dynamically.
    If you want to delete the entire internal table , use the statement CLEAR .
    In the LOOP AT... ENDLOOP structure, the statements within the loop are applied to each data record in turn. The INTO addition copies entries one at a time into the work area.
    The system places the index of the current loop pass in the system field sy-tabix. When the loop has finished, sy-tabix has the same value that it had before the loop started.
    Inserting and deleting lines within a loop affects the following loop passes.
    Access to a hashed table is imple mented using a hash algorithm. Simplified, this means that the data records are distributed randomly but evenly over a particular memory area.. The addresses are stored in a special table called the hashing table .
    There is a hash function, which determines the address at which the pointer to a data record with a certain key can be found. The function is not injective, that is, there can be several data records stored at a single address. This is implemented internally as a chained list. Therefore, although the system still has to search sequentially within these areas, it only has to read a few data records (usually no more than three). The graphic illustrates the simplest case, that is, in which there is only one data record stored at each address.
    Using a hash technique means that the access time no longer depends on the total number of entries in the table. On the contrary, it is always very fast. Hash tables are therefore particularly useful for large tables with which you use predominantly read access.
    Data records are not inserted into the table in a sorted order. As with standard tables, you can sort hashed tables using the SORT statement:
    SORT [ASCENDING|DESCENDING]
    [BY [ASCENDING|DESCENDING] ..
    [ASCENDING|DESCENDING]][AS TEXT].
    Sorting the table can be useful if you later want to use a loop to access the table.
    You can use the statements listed here with tables of all three types. Apart from a few special cases, you can recognize the statements from the extra keyword TABLE. The technical implementation of the statements varies slightly according to the table type.
    As a rule, index access to an internal table is quickest. However, it sometimes makes more sense to access data using key values. A unique key is only possible with sorted and hashed tables. If you use the syntax displayed here, your program coding is independent of the table type (generic type specification, easier maintenance).
    With a standard table, inserting an entry has the same effect as appending. With sorted tables with a non-unique key, the entry is inserted before the first (if any) entry with the same key.
    To read individual data records using the first variant, all fields of that are key fields of must be filled. and can be identical. If you use the WITH TABLE KEY addition in the second variant, you must also specify the key fully. Otherwise, the system searches according to the sequence of fields that you have specified, using a binary search where possible. You can force the system to use a binary search with a standard table using the BINARY SEARCH addition.
    In this case, you must sort the table by the corresponding fields first. The system returns the first entry that meets the selection criteria.
    Similarly to when you read entries, when you change and delete entries using the key and a work area, you must specify all of the key fields.
    You can prevent fields from being transported into the work area during loop processing by using the TRANSPORTING NO FIELDS addition in the WHERE condition. (You can use this to count the number of a particular kind of entry.)
    Other statements for all table types
    DELETE ADJACENT DUPLICATES FROM
    [COMPARING .. | A L L F I E L }|ALL FIELDS}].
    The system deletes all adjacent entries with the same key field contents apart from the first entry. You can prevent the system from only comparing the key field using the COMPARING addition. If you sort the table by the required fields beforehand, you can be sure that only unique entries will remain in the table after the DELETE ADJACENT DUPLICATES statement.
    Searches all lines of the table for the string . If the search is successful, the system sets the fields sy-tabix and sy-fdpos.
    FREE .
    Unlike CLEAR, which only deletes the contents of the table, FREE releases the memory occupied by it as well.
    If you want to access your data using the index and do not need your table to be kept in sorted order or to have a unique key, that is, when the sequence of the entries is the most important thing, not sorting by key or having unique entries, you should use standard tables. (If you decide you need to sort the table or access it using the key or a binary search, you can always program these functions by hand.)
    This example is written to manage a waiting list.
    Typical functions are:
    Adding a single entry,
    Deleting individual entries according to certain criteria,
    Displaying and then deleting the first entry from the list,
    Displaying someone's position in the list.
    For simplicity, the example does not encapsulate the functions in procedures.
    The first thing we do in the example is to declare line and table type, from which we can then declare a work area and our internal table. We also require an elementary field for passing explicit index values.
    This example omits the user dialogs and data transport, assuming that you understand the principles involved. We really only want to concentrate on the table access:
    Adding new entries
    The data record for a waiting customer is only added to the table if it does not already exist in it. If the table had a unique key, you would not have had to have programmed this check yourself.
    Deleting single entries according to various criteria
    The criterion is the key field. However, other criteria would be possible - for example, deleting data records older than a certain insertion date reg_date.
    Displaying and deleting the first entry from the list
    Once a customer comes to the top of the waiting list, you can delete his or her entry. If the waiting list is empty, such an action has no effect. Consequently, you do not have to check whether there are entries in the list before attempting the deletion.
    Displaying the position of a customer in the waiting list
    As above, you do not need to place any data in the work area. We are only interested in the values of sy-subrc and sy-tabix. If the entry is not in the table, sy-tabix is set to zero.
    At this stage, let us return to the special case of the restricted ranked list:
    DATA {TYPE|LIKE} STANDARD TABLE OF ... INITIAL SIZE . ... APPEND INTO SORTED BY .
    When you choose to use a sorted table, it will normally be because you want to define a unique key.
    The mere fact that the table is kept in sorted order is not that significant, since you can sort any kind of internal table. However, with sorted tables (unlike hashed tables), new data records are inserted in the correct sort order. If you have a table with few entries but lots of accesses that change the contents, a sorted table may be more efficient than a hashed table in terms of runtime.
    The aim of the example here is to modify the contents of a database table. The most efficient way of doing this is to create a local copy of the table in the program, make the changes to the copy, and then write all of its data back to the database table. When you are dealing with large amounts of data, this method both saves runtime and reduces the load on the database server. Since the internal table represents a database table in this case, you should ensure that its records have unique keys.
    This is assured by the key definition. Automatic sorting can also bring further advantages.
    When you change a group of data records, only the fields price and currency are copied from the work area.
    This means that, with larger tables, the access time is reduced significantly in comparison with a binary search. In a loop, however, the hashed table has to search the entire table (full table scan). Since the table entries are stored unsorted, it would be better to use a sorted table if you needed to run a loop through a left-justified portion of the key.
    It can also be worth using a hashed table but sorting it. A typical use for hashed tables is to buffer detailed information that you need repeatedly and can identify using a unique key. You should bear in mind that you can also set up table buffering for a table in the ABAP Dictionary to cover exactly the same case. However, whether the tables are buffered on the application table depends on the size of the database table.
    Buffering in the program using hashed tables also allows you to restrict the dataset according to your own needs, or to buffer additional data as required.
    In this example, we want to allow the user to enter the name of a city, and the system to display its geographical coordinates.
    First, we fill our "buffer table" city_list with values from the database table sgeocity. Then, we read an entry from the hashed table, specifying the full key.
    The details are displayed as a simple list. At this point, it is worth repeating that you should only use this buffering technique if you want to keep large amounts of data locally in the program. You must ensure that you design your hashed table so that it is possible to specify the full key when you access it from your program.
    You can define internal tables either with (WITH HEADER LINE addition) or without header lines. An internal table with header line consists of a work area (header line) and the actual table body. You address both objects using the same name. The way in which the system interprets the name depends on the context. For example, the MOVE statement applies to the header line, but the SEARCH statement applies to the body of the table.
    To avoid confusion, you are recommended to use internal tables without header lines. This is particularly important when you use nested tables. However, internal tables with header line do offer a shorter syntax in several statements (APPEND, INSERT, MODIFY, COLLECT, DELETE, READ, LOOP).
    hope this is helpful
    do reward

  • Loop Internal Table Performance

    Hi I am from BW and not much familiar with ABAP. I have written the following code in BW. I have around 1.5 million records coming into BW and the code I have written needs to go through 1.5 million times. Hence the data load is taking long time. I would like someone to please go through the code below and suggest if any for performance improvement.
    data: i_datapackage like DATA_PACKAGE occurs 0 with header line,
          i_index like sy-tabix,
          j_index like sy-tabix,
          i_employee like /bi0/memployee occurs 0 with header line,
          i_begda like /bi0/memployee occurs 0 with header line.
          prev_job like i_employee-job,
          prev_position like i_employee-hrposition,
          curr_job like i_employee-job,
          curr_position like i_employee-hrposition,
          job_datefrom like i_employee-datefrom,
          position_datefrom like i_employee-datefrom,
          prejob_datefrom like i_employee-datefrom,
          prepos_datefrom like i_employee-datefrom,
          prejob_dateto like i_employee-datefrom,
          prepos_dateto like i_employee-datefrom.
    i_datapackage[] = DATA_PACKAGE[].
    sort i_datapackage by employee calmonth ascending.
    select * from /bi0/memployee into table i_employee.
    sort i_employee by employee dateto descending.
    i_begda[] = i_employee[].
    sort i_begda by employee datefrom ascending.
    delete adjacent duplicates from i_employee comparing employee.
    loop at i_datapackage.
    *collecting current job,position, previous job, position
        read table i_employee with key employee = i_datapackage-employee
        dateto ='99991231'.
        if sy-subrc = 0.
          curr_job = i_employee-job.
          curr_position = i_employee-hrposition.
        endif.
       read table i_begda with key employee = i_datapackage-employee.
       if sy-subrc = 0.
         prev_job = i_begda-/bic/zhr_pjob.
         prev_position = i_begda-/bic/zhr_ppost.
       endif.
    *end of collecting current job and position
    sort i_begda by employee datefrom descending.
    read table i_begda with key employee = i_datapackage-employee
    binary search.
    if sy-subrc = 0.
      i_index = sy-tabix.
    endif.
    read table i_begda index i_index.
    if i_begda-employee ne i_datapackage-employee.
      exit.
    endif.
    code for populating service award tenure
    if i_begda-/bic/zhr_srvdt is not initial.
    i_datapackage-/bic/zhr_hrtnr = sy-datum+0(4) -
    i_begda-/BIC/ZHR_SRVDt+0(4).
    if sy-datum4(4) lt i_begda-/bic/zhr_srvdt4(4).
       i_datapackage-/bic/zhr_hrtnr = i_datapackage-/bic/zhr_hrtnr - 1.
    endif.
    endif.
    code for current hire tenure
    if i_begda-/bic/zhr_curdt is not initial.
    i_datapackage-/bic/zhr_crtnr = sy-datum+0(4) -
    i_begda-/BIC/ZHR_CURDT+0(4).
    if sy-datum4(4) lt i_begda-/BIC/ZHR_CURDT4(4).
       i_datapackage-/BIC/ZHR_CRTNR = i_datapackage-/bic/zhr_crtnr - 1.
    endif.
    endif.
    code for current supervisor tenure
    if i_begda-/bic/zhr_csbdt is not initial.
    i_datapackage-/bic/ZHR_CSTNR = sy-datum+0(4) -
    i_begda-/BIC/ZHR_CSBDT+0(4).
    if sy-datum4(4) lt i_begda-/BIC/ZHR_CSBDT4(4).
       i_datapackage-/bic/ZHR_CSTNR = i_datapackage-/bic/ZHR_CSTNR - 1.
    endif.
    endif.
    code for previous supervisor tenure
    if i_begda-/bic/zhr_psbdt is not initial.
    i_datapackage-/bic/ZHR_PSTNR = sy-datum+0(4) -
    i_begda-/BIC/ZHR_PSBDT+0(4).
    if sy-datum4(4) lt i_begda-/BIC/ZHR_PSBDT4(4).
       i_datapackage-/bic/ZHR_PSTNR = i_datapackage-/bic/ZHR_PSTNR - 1.
    endif.
    endif.
    Code for populating Years in current job
    and current position
      sort i_begda by employee datefrom ascending.
        clear j_index.
        read table i_begda with key employee = i_datapackage-employee.
        if sy-subrc = 0.
          j_index = sy-tabix.
        endif.
        loop at i_begda from j_index.
          if i_begda-employee ne i_datapackage-employee.
            exit.
          elseif ( i_begda-job eq curr_job ) and
          ( curr_job is not initial ).
            job_datefrom = i_begda-datefrom.
            prejob_dateto = i_begda-datefrom - 1.
            exit.
          endif.
        endloop.
        loop at i_begda from j_index.
          if i_begda-employee ne i_datapackage-employee.
            exit.
          elseif ( i_begda-hrposition eq curr_position ) and
              ( curr_position is not initial ).
              position_datefrom = i_begda-datefrom.
              prepos_dateto = i_begda-datefrom - 1.
              exit.
          endif.
        endloop.
        loop at i_begda from j_index.
          if i_begda-employee ne i_datapackage-employee.
            exit.
          elseif ( i_begda-job eq prev_job ) and
             ( prev_job is not initial ) and
             ( i_begda-datefrom ne '10000101').
              prejob_datefrom = i_begda-datefrom.
              exit.
          endif.
        endloop.
        loop at i_begda from j_index.
          if i_begda-employee ne i_datapackage-employee.
            exit.
          elseif ( i_begda-hrposition eq prev_position ) and
             ( prev_position is not initial ) and
             ( i_begda-datefrom ne '10000101').
              prepos_datefrom = i_begda-datefrom.
              exit.
          endif.
        endloop.
    i_datapackage-/bic/zhr_cjtnr = sy-datum+0(4) -
    job_datefrom+0(4).
    if sy-datum4(4) lt job_datefrom4(4).
       i_datapackage-/bic/zhr_cjtnr = i_datapackage-/bic/zhr_cjtnr - 1.
    endif.
    if position_datefrom+0(4) is not initial.
    i_datapackage-/bic/zhr_cptnr = sy-datum+0(4) -
    position_datefrom+0(4).
    if sy-datum4(4) lt position_datefrom4(4).
       i_datapackage-/bic/zhr_cptnr = i_datapackage-/bic/zhr_cptnr - 1.
    endif.
    endif.
    if prejob_datefrom is not initial.
    i_datapackage-/bic/zhr_pjtnr = prejob_dateto+0(4) -
    prejob_datefrom+0(4).
    if prejob_dateto4(4) lt prejob_datefrom4(4).
       i_datapackage-/bic/zhr_pjtnr = i_datapackage-/bic/zhr_pjtnr - 1.
    endif.
    endif.
    if prepos_datefrom is not initial.
    i_datapackage-/bic/zhr_pptnr = prepos_dateto+0(4) -
    prepos_datefrom+0(4).
    if prepos_dateto4(4) lt prepos_datefrom4(4).
       i_datapackage-/bic/zhr_pptnr = i_datapackage-/bic/zhr_pptnr - 1.
    endif.
    endif.
    modify i_datapackage transporting /bic/zhr_hrtnr /bic/zhr_crtnr
    /bic/zhr_cstnr /bic/ZHR_PSTNR /bic/zhr_cjtnr /bic/zhr_cptnr
    /bic/zhr_pjtnr /bic/zhr_pptnr.
    endloop.
    DATA_PACKAGE[] = i_datapackage[].
    Thanks.

    i_datapackage[] = DATA_PACKAGE[].
    i_begda[] = i_employee[].
    How larger are these internal tables ?
    If large, then
    > sort i_begda by employee datefrom descending.
    > read table i_begda with key employee = i_datapackage-employee binary search.
    the resorting and
    the nested loops
    => will kill your performance
    Please reconsider the whole logic, I have only some hints
    + Binary search does not help anything if you have to sort everytime you use it.
    + Never use a sort of a larger table inside a larger loop, it is always avoidable!
    + Check whether you can break down the big piece into smaller one, try to
       do the break down in the database already to save memory
    =>  Please provide your code in better layout, and explain what you actually want
          to do.
    Siegfried

  • How to check  if all values from a dataset  has come to  an internal table

    How to check  if all values from a dataset  has come to  an internal table ?

    Hi,
    After OPEN DATASET statement check if sy-subrc = 0 if its success then proceed with split statement and save the dataset values into a internal table and while debugging the internal table you will find that whether all values get into internal table.
    Checking sy-subrc after OPEN DATASET statement is must to fill up the values in the internal table.
    For e.g.
    OPEN DATASET p_inpfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        WRITE :/ 'No such input file' .
        EXIT.
      ELSE.
    READ DATASET p_inpfile INTO loc_string.
          IF sy-subrc NE 0.
            EXIT.
          ELSE.
            CLEAR loc2.
    *Spliting fields in the file-
            REPLACE ALL OCCURRENCES OF '#' IN wa_string WITH ' '.
           SPLIT wa_string AT const INTO loc2-pernr
                                           loc2-werks
                                           loc2-persk 
                                           loc2-vdsk1.
    Hope you get some idea.
    Thanks,
    Sakthi C

  • Get data in editable ALV back to internal table without data_changed ev?

    Hi,
       I have an editable ALV using classes to whch I have users the option to edit directly on the screen or upload data from an excel. The event data_changed gets triggered when users edit the table on the screen.
    However when EXCEL is uploaded, I refresh the table display. So, I need a way to get the data from the ALV into a internal table to check which rows were update using the excel and save them into the db table.
    Prakash

    Hi!
    For more information, inspect programs suiting the mask "BCALVEDIT*" and the thread with header "How to make a row of ALV editable " (I know this is some more steps further from your demand but it may be useful) at URL " How to make a row of ALV editable " .
    If you want to study more BC412 "EnjoySAP Controls" may help you.
    *--Serdar

  • Importing internal table from one program to another program

    Hi everybody,
    i have one small doubt.
    i am using submit statement and passing the values from this program to another program selection screen. in that program logic is written.In that program one internal table values are being exported to the memory id of that program. now i have to import that internal table values into my program by using import statement. i am using the following syntax
    import itab from menory id 'program name'.
    but i am getting an error saying program name is unknown.
    what is the exat syntax for this .
    thanking you,
    giri.

    hi,
    check these statements.
    IMPORT - Get data
    Variants:
    1. IMPORT obj1 ... objn FROM DATA BUFFER f.
    2. IMPORT obj1 ... objn FROM INTERNAL TABLE itab.
    2. IMPORT obj1 ... objn FROM MEMORY.
    3. IMPORT obj1 ... objn FROM SHARED MEMORY itab(ar) ID key.
    4. IMPORT obj1 ... objn FROM SHARED BUFFER itab(ar) ID key.
    5. IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.
    6. IMPORT obj1 ... objn FROM DATASET dsn(ar) ID key.
    7. IMPORT obj1 ... objn FROM LOGFILE ID key.
    8. IMPORT DIRECTORY INTO itab FROM DATABASE dbtab(ar) ID key.
    9. IMPORT (itab) FROM ... .
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. For more details, see Storing Cluster Tables.
    Variant 1
    IMPORT obj1 ... objn FROM DATA BUFFER f.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... ACCEPTING PADDING
    4. ... ACCEPTING TRUNCATION
    5. ... IGNORING STRUCTURE BOUNDARIES
    6. ... IGNORING CONVERSION ERRORS
    7. ... REPLACEMENT CHARACTER c
    8. ... IN CHAR-TO-HEX MODE
    9. ... CODE PAGE INTO f1
    10. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See You Cannot Use Implicit Field Names in Clusters.
    Effect
    Imports the data objects obj1 ... objn from the data buffer declared. The data buffer must be of type XSTRING . The data objects obj1 ... objn can be fields, structures, complex structures, or tables. The system imports all the data that has been stored in the data buffer f using the EXPORT ... TO DATA BUFFER statement and is listed here. It also checks that the structure used in the IMPORT statement matches the one in the EXPORT statement.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged. (In some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. The contents of all the objects remain unchanged.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is stored in the field f.
    Addition 3
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end
    of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 4
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR
    fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 5
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is
    relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 3 (enlarge structure) or addition 4 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Addition 6
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition prevents the system from triggering a
    runtime error, if an error occurs when the character set is converted. '#' is used as a replacement character.
    Addition 7
    ... REPLACEMENT CHARACTER c
    Effect
    The replacement character is used if a particular
    character cannot be converted when the character set is converted.
    This addition can only be used in conjunction with addition 6.
    Addition 8
    ... IN CHAR-TO-HEX MODE
    Effect
    Not all character-type fields are converted. To convert
    a field, you must create a field (or structure) that is identical to the exported field or structure, except that all its character-type components must be replaced with hexadecimal fields.
    You can only use this addition in Unicode programs, to allow you to import camouflaged binary data as single-byte characters.
    Moreover, you cannot use this addition in conjunction with the additions 3, 4, 5, 6, or 7.
    Addition 9
    ... CODE PAGE INTO f1
    Effect
    The code page of the exported data is stored in the
    character-type field f1 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition.
    Addition 10
    ... ENDIAN INTO f2
    Effect
    The byte order (LITTLE or BIG) of the
    exported data is stored in the field f2 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition. The field f2 must have the type ABAP_ENDIAN, which is defined in the type group ABAP. For this reason, the type group ABAP must be included in the ABAP program using a TYPE-POOLS statement.
    Variant 2
    IMPORT obj1 ... objn FROM INTERNAL TABLE itab.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... ACCEPTING PADDING
    4. ... ACCEPTING TRUNCATION
    5. ... IGNORING STRUCTURE BOUNDARIES
    6. ... IGNORING CONVERSION ERRORS
    7. ... REPLACEMENT CHARACTER c
    8. ... IN CHAR-TO-HEX MODE
    9. ... CODE PAGE INTO f1
    10. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See No implicit field names in cluster.
    Effect
    Imports the data objects obj1 ... objn (fields, structures, complex structures, or tables) from the specified internal table itab. The first column in the internal table must be of the predefined type INT2 and the second must be type X. To define the first column you must refer to a data element in the ABAP Dictionary that has the predefined type INT2.
    All data that was stored in the internal table itab using EXPORT ... TO INTERNAL TABLE and listed, is imported. The system checks that the EXPORT and IMPORT structures match.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the specified data cluster were imported, the rest remain unchanged (it is possible that no data object was imported).
    SY-SUBRC = 4:
    The data objects could not be imported.
    The contents of all listed objects remain unchanged
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    Places the object in the field f.
    Addition 3
    ... ACCEPTING PADDING
    Effect
    This addition allows you to add new fields to the ends
    of structures, even to substructures and internal tables (the additional fields are filled with initial value during the IMPORT). It also allows you to increase the size of existing fields (C, N, X, P, I1, and I2) and to map Char fields to STRING type fields or byte fields to XSTRING type fields.
    Addition 4
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR
    field or omit the last component on the highest level (till Release 4.6 this was possible without specifying an addition).
    Addition 5
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the page order is
    relevant, that is any substructures match. With this addition, the system also ignores alignment changes arising from the Unicode conversion (for example, due to subsequent insertion of named includes).
    This addition rules out any subsequent structural enhancements (addition 3) or structural shortening (addition 4) because with this addition it is the structural limits and include limits that are to be ignored.
    As from Release 6.10, the include information will also be stored in the dataset, so that it is possible to also check whether the includes match, that is substructures and includes (named or unnamed) are treated the same. When importing data that was exported in a Release lower than 6.10, the includes are not checked.
    Addition 6
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition has the effect that an error in the
    character set conversion does not cause a runtime error. The system uses "#" as a replacement character.
    Addition 7
    ... REPLACEMENT CHARACTER c
    Effect
    The system uses the specified replacement character if a
    character cannot be converted during a character set conversion. If this addition is not specified, the system uses "#" as a replacement character.
    This addition can only be used in conjunction with addition 6.
    Addition 8
    ... IN CHAR-TO-HEX MODE
    Effect
    No character type fields are converted. For this you
    must create a field or structure that is identical to the exported field or exported structure, except that all character type fields must be replaced with hexadecimal fields.
    This addition, which is only allowed in programs with a set Unicode flag, allows you to import binary data disguised as single byte characters. This addition cannot be used in conjunction with additions 3, 4, 5, 6, and 7.
    Addition 9
    ... CODE PAGE INTO f1
    Effect
    The codepage of the exported data is stored in the
    character-type field f1 (for example, to be able to analyze the data imported with the addition IN CHAR-TO-HEX MODE).
    Addition 10
    ... ENDIAN INTO f2
    Effect
    The byte order (LITTLE or BIG) of the
    exported data is stored in the field f2 (for example, to be able analyze the data imported using the addition IN CHAR-TO-HEX MODE). The field f2 must be of type ABAP_ENDIAN, defined in type group ABAP. You must therefore include the type group ABAP in the ABAP program with a TYPE-POOLS statement.
    Variant 3
    IMPORT obj1 ... objn FROM MEMORY.
    Extras:
    1. ... = f (for each object to be imported) 2. ... TO f (for each object to be imported)
    3. ... ID key
    4. ... ACCEPTING PADDING
    5. ... ACCEPTING TRUNCATION
    6. ... IGNORING STRUCTURE BOUNDARIES
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See You Must Enter Identification and Cannot Use Implicit Field Names inClusters
    Effect
    Imports data objects obj1 ... objn (fields, structures, complex structures or tables) from a data cluster in the ABAP memory (see EXPORT). Reads in all data without an ID that was exported to memory with "EXPORT ... TO MEMORY.". In contrast to the variant IMPORT FROM DATABASE, it does not check that the structure matches in EXPORT and IMPORT.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because the ABAP memory was empty.
    The contents of all objects remain unchanged.
    Note
    You should always use the addition 3 (... ID key) with the statement. Otherwise, the effect of the variant is not certain (EXPORT statements in different parts of a program overwrite each other in the ABAP memory), since it exists only for reasons of compatibility with R/2.
    Additional methods for selecting and deleting data clusters in the ABAP memory are provided by the system class CL_ABAP_EXPIMP_MEM.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Addition 3
    ... ID key
    Effect
    Imports only data stored in ABAP memory under the ID key.
    Notes
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Addition 4
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 5
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR field, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 6
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 3 (enlarge structure) or addition 4 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Related
    EXPORT TO MEMORY, DELETE FROM MEMORY, FREE MEMORY
    Variant 4
    IMPORT obj1 ... objn FROM SHARED MEMORY itab(ar) ID key.
    Extras:
    1. ... = f (for each object to be exported) 2. ... TO f (for each object to be exported)
    3. ... CLIENT g (before ID key)
    4. ... TO wa (after itab(ar) or ID key )
    5. ... ACCEPTING PADDING
    6. ... ACCEPTING TRUNCATION
    7. ... IGNORING STRUCTURE BOUNDARIES
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See You Cannot Use Implicit Field Names in Clusters and You Cannot Use Table Work Areas.
    Effect
    Imports the data objects obj1 ... objn (fields, structures, complex structures, or tables) from shared memory. The data objects are read using the ID key from the area ar in the table itab - c.f. EXPORT TO SHARED MEMORY). You must use itab to specify a database table although the system reads from a memory table with the appropriate structure.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged. (In some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. You may have used the wrong ID. The contents of all the objects remain unchanged.
    Notes
    The table dbtab named according to SHARED MEMORY must be declared using TABLES (except in addition 2).
    The structure of fields (field symbols and internal tables) to be imported must match the structure of the objects exported in the dataset. The objects must be imported under the same names as those under which they were exported. Otherwise, they will not be imported.
    The key length consists of: the client (3 digits, but only if tab is client-specific); area (2 characters); ID; and line number (4 bytes). It must not exceed 64 bytes - that is, the ID must not be longer than 55 characters, if the table is client- specific.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the shared memory are provided by the system class CL_ABAP_EXPIMP_SHMEM.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is stored in the field f.
    Addition 3
    ... CLIENT g (before ID key)
    Effect
    The data is imported from client g (provided the import/export table is tab client-specific). The client, g must be a character-type data object (but not a string).
    Addition 4
    ... TO wa (after itab(ar) or ID key)
    Effect
    You need to use this addition if user data fields have been stored in the application buffer and are to be read from there. The work area wa is used instead of the table work area. The target area must correspond to the structure of the called table tab.
    Addition 5
    ... ACCEPTING PADDING
    Effect
    This addition allows you to: append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 6
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 7
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 4 (enlarge structure) or addition 5 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Related
    EXPORT TO SHARED MEMORY, DELETE FROM SHARED MEMORY
    Variant 5
    IMPORT obj1 ... objn FROM SHARED BUFFER itab(ar) ID key.
    Extras:
    1. ... = f (for each object to be exported) 2. ... TO f (for each object to be exported)
    3. ... CLIENT g (before ID key)
    4. ... TO wa (last addition or after itab(ar))
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See Cannot Use Implicit Fieldnames in Clusters und Cannot Use Table Work Areas.
    Effect
    Imports data objects obj1 ... objn (fields or
    tables) from the cross-transaction application buffer. The data objects are read in the application buffer using the ID key of the area ar of the buffer area for the table itab (see EXPORT TO SHARED BUFFER). You must use dbtab to specify a database table although the system reads from a memory table with an appropriate structure.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this means that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Example
    Import two fields and an internal table from the application buffer with the structure INDX:
    TYPES: BEGIN OF ITAB3_LINE,
             CONT(4),
           END OF ITAB3_LINE.
    DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
          F1(4),
          F2(8) TYPE P DECIMALS 0,
          ITAB3 TYPE STANDARD TABLE OF ITAB3_LINE,
          INDX_WA TYPE INDX.
    Import data.
    IMPORT F1 = F1 F2 = F2 ITAB3 = ITAB3
           FROM SHARED BUFFER INDX(ST) ID INDXKEY TO INDX_WA.
    After import, the data fields INDX-AEDAT and
    INDX-USERA in front of CLUSTR are filled with
    the values in the fields before the EXPORT
    statement.
    Notes
    You must declare the table dbtab, named after DATABASE using a TABLES statement.
    The structure of the fields, structures, and internal tables to be imported must match the structure of the objects exported to the dataset. Moreover, the objects must be imported with the same name used to export them. Otherwise, the import is not performed.
    The maximum total key length is 64 bytes. It must include: a client if the table is client-specific (3 characters); an area (2 characters); identification; and line counter (4 bytes). This means that the number of characters available for the identification of a client-specific table is 55 characters.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the cross-transaction application buffer are provided by the system class CL_ABAP_EXPIMP_SHBUF.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in the field f
    Addition 3
    ... CLIENT g (after dbtab(ar))
    Effect
    Takes the data from the client g (if the import/export table dbtab is client-specific). The client g must be a character-type data object (but not a string).
    Addition 4
    ... TO wa (as the last addition or after itab(ar))
    Effect
    You need to use this addition if you want to save user data fields in the application buffer and then read them from there later. The system uses a work area wa instead of a table work area. The target area must have the same structure as the table tab.
    Example
    DATA: INDX_WA TYPE INDX,
          F1.
    IMPORT F1 = F1 FROM SHARED BUFFER INDX(AR)
                   CLIENT '001' ID 'TEST'
                   TO INDX_WA.
    WRITE: / 'AEDAT:', INDX_WA-AEDAT,
           / 'USERA:', INDX_WA-USERA,
           / 'PGMID:', INDX_WA-PGMID.
    Variant 6
    IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... CLIENT g (before ID key )
    4. ... USING form
    5. ... TO wa (last addition or after dbtab(ar))
    6. ... MAJOR-ID id1 (instead of ID key)
    7. ... MINOR-ID id2 (with MAJOR-ID id1 )
    8. ... ACCEPTING PADDING
    9. ... ACCEPTING TRUNCATION
    10. ... IGNORING STRUCTURE BOUNDARIES
    11. ... IGNORING CONVERSION ERRORS
    12. ... REPLACEMENT CHARACTER c
    13. ... IN CHAR-TO-HEX MODE
    14. ... CODE PAGE INTO f1
    15. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Implicit Fieldnames in Clusters and Cannot Use Table Work Areas.
    Effect
    Imports data objects obj1 ... objn (fields, structures, complex structures, or tables) from the data cluster with ID key in area ar of the database table dbtab (see EXPORT TO DATABASE).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that not data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Example
    Import two fields and an internal table:
    TYPES: BEGIN OF TAB3_TYPE,
              CONT(4),
           END OF TAB3_TYPE.
    DATA: INDXKEY LIKE INDX-SRTFD,
          F1(4), F2 TYPE P,
          TAB3 TYPE STANDARD TABLE OF TAB3_TYPE WITH
                    NON-UNIQUE DEFAULT KEY,
          WA_INDX TYPE INDX.
    INDXKEY = 'INDXKEY'.
    IMPORT F1   = F1
           F2   = F2
           TAB3 = TAB3 FROM DATABASE INDX(ST) ID INDXKEY
           TO WA_INDX.
    Notes
    You must declare the table dbtab, named after DATABASE, using the TABLES statement (except in addition 5).
    The structure of fields, field strings and internal tables to be imported must match the structure of the objects exported to the dataset. In addition, the objects must be imported under the same name used to export them. If this is not the case, either a runtime error occurs or no import takes place.
    Exception: You can lengthen or shorten the last field if it is of type CHAR, or add/omit CHAR fields at the end of the structure.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the database table specified are provided by the system class CL_ABAP_EXPIMP_DB.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Addition 3
    ... CLIENT g (before the ID key)
    Effect
    Data is taken from the client g (in client-specific import/export databases only). Client g must be a character-type data object (but not a string).
    Example
    DATA: F1,
          WA_INDX TYPE INDX.
    IMPORT F1 = F1 FROM DATABASE INDX(AR) CLIENT '002' ID 'TEST'
                   TO WA_INDX.
    Addition 4
    ... USING form
    Note
    This statement is for internal use only.
    Incompatible changes or further developments may occur at any time without warning or notice.
    Effect
    Does not read the data from the database. Instead, calls the FORM routine form for each record read from the database without this addition. This routine can take the data key of the data to be retrieved from the database table work area and write the retrieved data to this work area. The name of the routine has the format <name of database table>_<name of form>; it has one parameter which describes the operation (READ, UPDATE or INSERT). The routine must set the field SY-SUBRC in order to show whether the function was successfully performed.
    Addition 5
    ... TO wa (after key or after dbtab(ar))
    Effect
    You need to use this addition if you want to save user data fields in the cluster database and then read from there. The system uses the work area wa instead of a table work area. The target area entered must have the same structure as the table dbtab.
    Example
    DATA WA LIKE INDX.
    DATA F1.
    IMPORT F1 = F1 FROM DATABASE INDX(AR)
                   CLIENT '002' ID 'TEST'
                   TO WA.
    WRITE: / 'AEDAT:', WA-AEDAT,
           / 'USERA:', WA-USERA,
           / 'PGMID:', WA-PGMID.
    Addition 6
    ... MAJOR-ID id1 (instead of the ID key).
    Addition 7
    ... MINOR-ID id2 (with MAJOR-ID id1)
    This addition is not allowed in an ABAP Objects context. See Cannot Use Generic Identification.
    Effect
    Searches for a record the first part of whose ID (length of id1) matches id1 and whose second part - if MINOR-ID id2 is also declared - is greater than or equal to id2.
    Addition 8
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 9
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 10
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 8 (enlarge structure) or addition 9 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Addition 11
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition prevents the system from triggering a runtime error, if an error occurs when the character set is converted. '#' is used as a replacement character.
    Addition 12
    ... REPLACEMENT CHARACTER c
    Effect
    The replacement character is used if a particular character cannot be converted when the character set is converted. If you do not use this addition, '#' is used as a replacement character.
    This addition can only be used in conjunction with addition 11.
    Addition 13
    ... IN CHAR-TO-HEX MODE
    Effect
    All character-type fields are not converted. To convert a field, you must create a field (or structure) that is identical to the exported field or structure, except that all its character-type components must be replaced with hexadecimal fields.
    You can only use this addition in Unicode programs, to allow you to import camouflaged binary data as single-byte characters. Moreover, you cannot use this addition in conjunction with the additions 8, 9, 10, 11, and 12.
    Addition 14
    ... CODE PAGE INTO f1
    Effect
    The code page of the exported data is stored in the character-type field f1 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition.
    Addition 15
    ... ENDIAN INTO f2
    Effect
    The byte order(LITTLE or BIG) of the exported data is stored in the field f2 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition. The field f2 must have the type ABAP_ENDIAN, which is defined in the type group ABAP. For this reason, the type group ABAP must be included in the ABAP program using a TYPE-POOLS statement.
    Variant 7
    IMPORT obj1 ... objn FROM DATASET dsn(ar) ID key.
    This variant is not allowed in an ABAP Objects context. See Cannot Use Clusters in Files
    Note
    This variant is no longer supported and cannot be used.
    Variant 8
    IMPORT obj1 ... objn FROM LOGFILE ID key.
    Note
    This statement is for internal use only.
    Incompatible changes or further developments may occur at any time without warning or notice.
    Extras:
    1. ... = f (for each field f to be imported) 2. ... TO f (for each field f to be imported)
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Implicit Field Names in Clusters
    Effect
    Imports data objects (fields, field strings or internal tables) from the update data. You must specify the update key assigned by the system (with current request number) as the key.
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. An incorrect ID may have been used.
    The contents of all objects remain unchanged.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Variant 9
    IMPORT DIRECTORY INTO itab FROM DATABASE dbtab(ar) ID key.
    Extras:
    1. ... CLIENT g (after dbtab(ar)) 2. ... TO wa (last addition or after dbtab(ar))
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Table Work Areas.
    Effect
    Imports an object directory stored under the specified ID with EXPORT TO DATABASE into the table itab. The internal table itab may not have the type HASHED TABLE or ANY TABLE.
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The directory was successfully imported.
    SY-SUBRC = 4:
    The directory could not be imported, probably because an incorrect ID was used.
    The internal table itab must have the same structure as the Dictionary structure CDIR (INCLUDE STRUCTURE).
    Addition 1
    ... CLIENT g (before ID key)
    Effect
    Takes data from the client g (only with client-specific import/export databases). Client g must be a character-type data object (but not a string).
    Addition 2
    ... TO wa (last addition or after dbtab(ar))
    Effect
    Uses the work area wa instead of the table work area. When you use this addition, you do not need to declare the table dbtab, named after DATABASE using a TABLES statement. The work area entered must have the same structure as the table dbtab.
    Example
    Directory of a cluster consisting of two fields and an internal table:
    TYPES: BEGIN OF TAB3_LINE,
             CONT(4),
           END OF TAB3_LINE,
           BEGIN OF DIRTAB_LINE.
             INCLUDE STRUCTURE CDIR.
    TYPES  END OF DIRTAB_LINE.
    DATA: INDXKEY LIKE INDX-SRTFD,
          F1(4),
          F2(8)   TYPE P decimals 0,
          TAB3    TYPE STANDARD TABLE OF TAB3_LINE,
          DIRTAB  TYPE STANDARD TABLE OF DIRTAB_LINE,
          INDX_WA TYPE INDX.
    INDXKEY = 'INDXKEY'.
    EXPORT F1 = F1
           F2 = F2
           TAB3 = TAB3
           TO DATABASE INDX(ST) ID INDXKEY " TAB3 has 17 entries
           FROM INDX_WA.
    IMPORT DIRECTORY INTO DIRTAB FROM DATABASE INDX(ST) ID INDXKEY
           TO INDX_WA.
    Then, the table DIRTAB contains the following:
    NAME     OTYPE  FTYPE  TFILL  FLENG
    F1         F      C      0      4
    F2         F      P      0      8
    TAB3       T      C      17     4
    The meaning of the individual fields is as follows:
    NAME:
    Name of stored object
    OTYPE:
    Object type (F: Field, R: Field string / Dictionary struc

  • How can i use the internal table as a WHERE clause ?

    Dear Support ,
    I have one internal table that save the material information ...
    data : begin of itab ,
              matnr like mara-matnr ,
    end of itab .
    And now i want to fetch the material desription text base on this internal table .
    As i know that the "FOR ALL ENTRIES" statement is not allowed us to use "IN" this keyword ....
    So , Has another solution for this case ? I don't want to use "LOOP AT ...." this way ...
    Many thanks .
    Carlos

    Why can't you do
    SELECT MATNR MAKTX INTO TABLE ITAB2 FROM MAKT FOR ALL ENTRIES IN ITAB WHERE MATNR = ITAB-MATNR.

Maybe you are looking for

  • What is the safest way to learn whether or not my MacBookPro has fallen victim to DNSChanger?

    Hundreds of Thousands Losing the Internet in July? I didn't know if anyone else had heard about this, but the following article was recently published in the Denver Post.  Since the Denver Post usually checks this type of stuff out pretty thoroughly,

  • SIS updation

    Hi experts, I am facing 2 error while updating the SIS. 1st Error- I have made all the necessary configuration in OVRO, OVRA. Assigned all the statistics group to the Order type, item cat,dly type etc. But when i am running the standard analuses repo

  • Getting parseException if filename is not enclosed within quotes.

    My Client has sent attachment with filename encoded in iso-8859-2. When I parse the mail using javamail, i had ended up parseException. Below is the header and exception details. header: Content-Type: application/pdf; name==?iso-8859-2?b?RmFrdPpyYV9G

  • I can print from every app on my MacBook except with Firefox. Printing and print preview only produces blank pages???

    I have a MacBook Pro with Mac OS 10.6.4. Within Firefox, if I select File -> Print and then select preview a get a blank page. The same thing occurs if I sent the print request to my printer. I can print and preview from Safari and from any other app

  • What is program Bonjour?

    It appears on my list of Programs under Windows XP as an Apple program.  But there is no explanation on the Apple website, as referenced in the description within the program entry.  I was considering un-installing it, as part of a cleanup of my PC,