Application Development and Automation 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: 
Read only

Problem when downloading using WS_EXCEL

Former Member
0 Likes
716

Hi All,

I'm using FM 'WS_EXCEL' to download Customer and bank details to an excel file.

When the bank account number (knbk-bankn) is large like 254...20 it is

been displayed as 2.54E+15, but our user want it to be displayed in full format without any manual cell formatting.

Please suggest a solution for this.

Thanks in advance.

Regards,

Manoj Kumar P

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
664

hi

It is an Excel issue. For example if you enter 222222222222222222 in any cell of Excel sheet , it takes it as 2.22222E+17. So one solution I can give is instead of giving account number as 222222222222222222 give as 22222222222-2222222 to

FM WS_EXCEL. If there are more than 11 digits continuously, Excel considers it as number and acts accordingly. If there is any character or space in between Excel will not consider it as number

5 REPLIES 5
Read only

Former Member
0 Likes
664

Duplicate Post of; by Read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/HOME/RulesofEngagement] before posting more. Are you working for a same company or thats your another User Id?

Regards

Karthik D

Read only

0 Likes
664

Hi Karthik,

It is neither that post is from my another id nor we aork for the same company.

More over that is the duplicate post of mine.

Please refer the time of posting.

Regards,

Manoj Kumar P

Read only

0 Likes
664

Hi,

See my reply here

DATA : it_KNBK type table of KNBK.

select * from KNBK
into table it_KNBK.

CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
  EXPORTING
    FILE_NAME                       = 'C:Documents and SettingssapDesktopank2.xls'
*   CREATE_PIVOT                    = 0
*   DATA_SHEET_NAME                 = ' '
*   PIVOT_SHEET_NAME                = ' '
*   PASSWORD                        = ' '
*   PASSWORD_OPTION                 = 0
  TABLES
*   PIVOT_FIELD_TAB                 =
    DATA_TAB                        = it_KNBK
*   FIELDNAMES                      = it_KNBK
* EXCEPTIONS
*   FILE_NOT_EXIST                  = 1
*   FILENAME_EXPECTED               = 2
*   COMMUNICATION_ERROR             = 3
*   OLE_OBJECT_METHOD_ERROR         = 4
*   OLE_OBJECT_PROPERTY_ERROR       = 5
*   INVALID_PIVOT_FIELDS            = 6
*   DOWNLOAD_PROBLEM                = 7
*   OTHERS                          = 8
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Regards

Read only

Former Member
0 Likes
665

hi

It is an Excel issue. For example if you enter 222222222222222222 in any cell of Excel sheet , it takes it as 2.22222E+17. So one solution I can give is instead of giving account number as 222222222222222222 give as 22222222222-2222222 to

FM WS_EXCEL. If there are more than 11 digits continuously, Excel considers it as number and acts accordingly. If there is any character or space in between Excel will not consider it as number

Read only

Former Member
0 Likes
664

Hi All,

Thanks for giving your sugggestions.

I solved that issue by using OLE.

Regards,

Manoj Kumar P