Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

import excel data to abap view tables

former_member383962
Participant
0 Kudos

Hello Experts,

I'm trying to import data from Excel to SAP View tables, for example view: V_REAJINDXPOYEAR., and so on.

and my Excel have multiple sheets for separate views.

is it possible to load data...?

I know to upload data to the table but view i don't have an idea..??

Please give me your suggestions and i'm also new to the ABAP.

1 ACCEPTED SOLUTION

rgore
Advisor
Advisor

Dear Kabilasaran,

If in your DEV system, the class CL_BCFG_CONFIG_MANAGER is available then you can use this API very easily to push the data to any customizing object.

Please check the documentation of the class + IF_BCFG_CONFIG_CONTAINER~APPLY for more information.

*   Declaration of internal table
    DATA: lt_mappings   TYPE if_bcfg_config_container=>ty_t_mapping_info,
          lt_key        TYPE if_bcfg_key_container=>ty_t_field_values,
          lt_view_data  TYPE STANDARD TABLE OF V_REAJINDXPOYEAR.

*   Populate the object mappings
    lt_mappings[] = VALUE #( ( objectname = 'V_REAJINDXPOYEAR' objecttype = 'V' ) ).

*   Create the configuration container using the mappings
    DATA(lo_container) = 
    cl_bcfg_config_manager=>create_container( io_container_type  = cl_bcfg_enum_container_type=>classic  " CLASSIC
                                              it_object_mappings = lt_mappings[]
                                              it_langus          = VALUE #( ( 'E' ) )
                                              io_commit_mode     = cl_bcfg_enum_commit_mode=>auto_commit " AUTO_COMMIT
                                            ).


*   Add the data to the container
    lo_container->add_lines( it_lines = lt_view_data[] ).

*   Write the contents to the DB
*   You may need to pass the transport number, so that entries are captured under the same request
    DATA(lo_results) = lo_container->apply( ).
7 REPLIES 7

0 Kudos

rgore
Advisor
Advisor

Dear Kabilasaran,

If in your DEV system, the class CL_BCFG_CONFIG_MANAGER is available then you can use this API very easily to push the data to any customizing object.

Please check the documentation of the class + IF_BCFG_CONFIG_CONTAINER~APPLY for more information.

*   Declaration of internal table
    DATA: lt_mappings   TYPE if_bcfg_config_container=>ty_t_mapping_info,
          lt_key        TYPE if_bcfg_key_container=>ty_t_field_values,
          lt_view_data  TYPE STANDARD TABLE OF V_REAJINDXPOYEAR.

*   Populate the object mappings
    lt_mappings[] = VALUE #( ( objectname = 'V_REAJINDXPOYEAR' objecttype = 'V' ) ).

*   Create the configuration container using the mappings
    DATA(lo_container) = 
    cl_bcfg_config_manager=>create_container( io_container_type  = cl_bcfg_enum_container_type=>classic  " CLASSIC
                                              it_object_mappings = lt_mappings[]
                                              it_langus          = VALUE #( ( 'E' ) )
                                              io_commit_mode     = cl_bcfg_enum_commit_mode=>auto_commit " AUTO_COMMIT
                                            ).


*   Add the data to the container
    lo_container->add_lines( it_lines = lt_view_data[] ).

*   Write the contents to the DB
*   You may need to pass the transport number, so that entries are captured under the same request
    DATA(lo_results) = lo_container->apply( ).

0 Kudos

Hello @Rakshith Gore

Really thanks for your answer... But I can't get you clearly...

Now I done it using FM VIEW_MAINTENANCE_SINGLE_ENTRY...

Here I faced another problem, this FM ask tr for each entry... For example if I have 100 entries for that view, TR pop ups 100 times...

It too bad .... Is there is any other way to do it...

Lots of experts said use FM VIEW_MAINTENANCE_NO_DIALOG ...

But I don't know how to use it...

As you mentioned already, the function module VIEW_MAINTENANCE_SINGLE_ENTRY calls the maintenance framework for each data loop, So your program will not be a performance efficient. To avoid the popup, you can populate the import parameter CORR_NUMBER, which will suppress the transport popup.

0 Kudos

Thanks rakshithgore ,

Now, that the FM: VIEW_MAINTENANCE_SINGLE_ENTRY wont pop up up for Transport Request.

0 Kudos

Hi rakshithgore,

Will this code working in production client as well ? I need to update certain maintenance views programmatically in production. I see that this API generates BC set internally and try to activate it but BC set cannot be activated in production as per SAP documentation. Please advice a similar API that can work in production as well.

Thank You,

Ibrahim.