Skip to Content
author's profile photo Former Member
Former Member

How to populate dynamic internal table fields with data??

Hi Folks,

How to assign a particular internal table field to a dynamically assigned internal table?

I have an excel sheet, and i upload the excel sheet data into an internal IT_EXLOAD table using FM ALSM_EXCEL_TO_INTERNAL_TABLE

Now i created a dynamic internal table which has the same column as in my DB table.

I have to fill the dynamically created Internal table with the IT_EXLOAD data dynamically.

Suppose in future if i add some field in DB table and for that field if i add some column in excel sheet there is no need to change in the program.

Looking for reply...

Best Regards,

Sayak

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:13 AM

    hi

    Pls. check the below links.

    /people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table

    http://www.sap-img.com/ab030.htm

    https://blogs.sap.com/?p=40600

    Regards

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 08:44 AM

    hi,

    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    EXPORTING

    filename = p_path

    i_begin_col = '1'

    i_begin_row = '2'

    i_end_col = '2'

    i_end_row = '1000'

    TABLES

    intern = intern

    EXCEPTIONS

    inconsistent_parameters = 1

    upload_ole = 2

    OTHERS = 3.

    *declare intern_tmp as internal table tb_data in wich you want the data

    *and declare a field symbol <fs_123>

    LOOP AT intern.

    ASSIGN COMPONENT intern-col OF STRUCTURE

    intern_tmp TO <fs_123>.

    IF NOT <fs_123> IS ASSIGNED.

    CLEAR intern.

    CLEAR intern_tmp.

    CONTINUE.

    ENDIF.

    <fs_123> = intern-value.

    AT END OF row.

    CLEAR tb_data.

    MOVE-CORRESPONDING: intern_tmp TO tb_data.

    APPEND tb_data.

    CLEAR intern_tmp.

    ENDAT.

    CLEAR intern.

    ENDLOOP.

    **paste this code and you can see the data in ur tables dynamically.

    Thanks

    Nitin Sachdeva

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 20, 2008 at 09:03 AM

    Refer max bianchi reply in this thread

    populating-dynamic-internal-table-from-internal-ta

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.