SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Не работает SOI метод insert_one_table в ECC 6.0



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
den
Старший специалист
Старший специалист



Joined: 11 Oct 2007
Posts: 103

PostPosted: Thu Oct 22, 2009 4:28 pm    Post subject: Не работает SOI метод insert_one_table в ECC 6.0 Reply with quote

Здравствуйте!
Сделали апгрейд до ECC 6.0 и перестал работать метод insert_one_table класса I_OI_SPREADSHEET. Это относится к пакету SOFFICEINTEGRATION, вставка целой таблицы в Excel.

Кто-нибудь сталкивался с такой проблемой?
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 170
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri Oct 23, 2009 5:04 pm    Post subject: Reply with quote

Вот пример, работающий в ECC 6.0 (проверил).
Integration OLE через EXCEL
Сравнивайте...
Back to top
View user's profile Send private message Blog Visit poster's website
Alex80
Старший специалист
Старший специалист


Age: 44
Joined: 24 Jan 2008
Posts: 129

PostPosted: Fri Oct 23, 2009 9:20 pm    Post subject: Reply with quote

Ещё можете проверить, чтобы в таблице с данными не было типа string.
Back to top
View user's profile Send private message
ppeter
Участник
Участник



Joined: 29 Oct 2008
Posts: 15

PostPosted: Mon Oct 26, 2009 3:01 pm    Post subject: Reply with quote

Насколько я помню, этот метод некорректно выгружает русский текст из-за проблем с кодировкой. Советую лучше воспользоваться методами insert_range или insert_full.
Back to top
View user's profile Send private message
den
Старший специалист
Старший специалист



Joined: 11 Oct 2007
Posts: 103

PostPosted: Mon Oct 26, 2009 3:12 pm    Post subject: Reply with quote

Пробовал вместо текстов выгружать в каждом поле '1', все равно не работает. Не образает, как писали на сапфоруме, а вообще ничего не выгружает. Но пример vga работает. Разбираюсь.
Back to top
View user's profile Send private message
den
Старший специалист
Старший специалист



Joined: 11 Oct 2007
Posts: 103

PostPosted: Tue Oct 27, 2009 2:08 pm    Post subject: Reply with quote

Вообщем раньше для построения таблицы с описанием полей FIELDS_TABLE использовалась функция RFC_GET_STRUCTURE_DEFINITION, заменил ее на DP_GET_FIELDS_FROM_TABLE, как в примере и все поехало. Вот дела.

Code:
    DATA:
          lt_fields  TYPE TABLE OF RFC_FIELDS,

*    CALL FUNCTION 'RFC_GET_STRUCTURE_DEFINITION'
*      EXPORTING
*        TABNAME          = Struct_name
*      TABLES
*        FIELDS           = lt_fields
*      EXCEPTIONS
*        TABLE_NOT_ACTIVE = 1
*        OTHERS           = 2.

    CALL FUNCTION 'DP_GET_FIELDS_FROM_TABLE'
       TABLES
          data   = data_tab[]
          fields = lt_fields.

* Insert data table
    CALL METHOD spreadsheet->insert_one_table
      EXPORTING
        DATA_TABLE   = data_tab
        RANGENAME    = range_name
        FIELDS_TABLE = lt_fields
        wholetable   = 'X'
        no_flush     = ' '
      IMPORTING
        retcode      = retcode.



А насчет образания русских символов из sap пришел ответ, но как оказалось проблема была не в этом.

Quote:
This is design limitation in SAPGui and Unicode system.

The only possible work around for this problem
when you are using insert_one_table is below:

WorkAround1: The length of the table field which will contain mutibyte
character(Cyrlic Russian, Japanese etc) should have atleast double
the length of maximum number of character that can be entered
in the field.
This is because SAPGui is in Multibyte mode where as R/3 release
(Backend) is unicode mode.
In multibyte system each character takes 1 to 5 bytes. Where as
in Unicode it is always 2 bytes. If any field in table contain
mulibyte character which will become more than 2 bytes in multibyte
system then this truncation occurs.
For Example:
If you have entered 20 cyrlic russian character then minimum length
should be 40 characters.

Workaround2:
In this it is necessary to change the coding and stretch it
programmatically.

Please use function call DP_STRETCH_TABLE to stretch the required field.
Please apply note 1336789 in which I showed how to use stretch table
in the program "SAPRDEMO_MAILMERGE_INTERFACE".

CALL FUNCTION 'DP_STRETCH_TABLE'
IMPORTING
stretched_data_ref = gt_stretched_table
TABLES
data = <SFLIGHT_EX>
columns_to_stretch = columns_to_stretch
EXCEPTIONS
dp_stretching_error = 1
OTHERS = 2."

data parameter takes the table, while column_to_stretch is array string
which will take column names that has to be stretched.

With this we request you to change the length of the field in the table
which you are using with insert_one_table as explained above.

Since the issue is in basic design level of SAP it is not possible for
us to give any fix for this problem. After detail discussion about this
problem we concluded this and decided to give above mentioned workaround.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.