Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Move Internal table data into database table which is created in SE11..

Hi Experts,,

I have data in Internal table ..Now i want move that data into my database table which is created in SE11..Both tables fields are same..How to map...?

here is my code:


<%@page language="abap"%>

<%@extension name="htmlb" prefix="htmlb"%>

<htmlb:content design="design2003">

<htmlb:page title = "Upload" >

<htmlb:form method="post" encodingType="multipart/form-data">

                     <htmlb:fileUpload id       = "excel_uploader"

                        size     = "20"

                        onUpload = "OnInputProcessing()" />




Input processing:

Types: begin of tab_type,

       city type string,

       city_id type string,

       state_id type string,

       end of tab_type.

DATA: fileupload    TYPE REF TO cl_htmlb_fileupload,

      file_content  TYPE xstring,

      content       TYPE string,

      conv          TYPE REF TO cl_abap_conv_in_ce,

      len           TYPE i,

      data_table type table of tab_type,

      aux_data      TYPE tab_type,


      tab_upload    TYPE STANDARD TABLE OF string.

fileupload ?= cl_htmlb_manager=>get_data(

                       request = request

                       id      = 'excel_uploader'

                       name    = 'fileUpload' ).

file_content   = fileupload->file_content.

conv = cl_abap_conv_in_ce=>create( input = file_content ).

conv->read( IMPORTING data = content len = len ).

SPLIT content AT cl_abap_char_utilities=>cr_lf INTO TABLE tab_upload.

CLEAR content.

LOOP AT tab_upload INTO content.

  SPLIT content AT ',' INTO aux_data-city aux_data-city_id aux_data-state_id.

  Append aux_data TO data_table.

  CLEAR aux_data.


Here in data_table i can see my excel content..But now i want to move that content into my database table zstate..It contains same fields of data_table.

Can any one help me...

Thanks and regards






Helpful Answer

Not what you were looking for? View more on this topic or Ask a question