Search code examples
excelabapole

SAP BC-IC Excel Interface send format_string


I'm implementing the SAP BC-IC Interface, for interacting with Excel. This works like expected more or less. But now I face the problem, that I want to set a cell value to 1.1 1.2 1.3 and so on. Excel automatically interprets this as a Date and use the DD.MM Format. How can I avoid this with SAP BC-IC Desktop Office Integration? I think the only method which can help me is this: set_format_string. But I don't know how this should look like. Need to format the cell in text-format.

Here is a link to the official documentation of the set_format_string method. Tried set_range_format as well which just can format borders, numbers, colors and some stuff, but no text.

Hope some guy out there can help me :).


Solution

  • You have to use set_format() and pass typ parameter as 0. Cited from the documentation:

    Type for currency formatting:

    0: Display as text

    The method call looks like this:

    CALL METHOD l_iref_spreadsheet->set_format
      EXPORTING
        rangename = 'rangename'
        typ       = 0
        currency  = 'EUR'
      IMPORTING
        retcode   = l_retcode.