Skip to Content
avatar image
Former Member

At the write position, you cannot use offset and length specifications

Hi,

When I am trying to write below code in BW 7.4 i am getting error at highlighted line, same code was working in BW 7.3.

Error :- At the write position, you cannot use offset and length specifications with fields of type "STRING" or "XSTRING". -

WHEN 'ZABC_MTD'.

       v_loc_date = sy-datum.

       IF v_loc_date+6(2) LE 20.

         v_loc_date+6(2) = '01'.

         v_loc_date  =  v_loc_date - 1.

       ENDIF.

       l_s_range-low = v_loc_date.

     l_s_range-low+6(2) = '01'.

       l_s_range-high = v_loc_date.

       l_s_range-sign = 'I'.

       l_s_range-opt = 'BT'.

       APPEND l_s_range TO e_t_range.

       EXIT.


Kinldy help


Regards,


Anil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 05, 2014 at 09:40 AM

    Hi All,

    I found the solution.

    In 7.4 its not not allowing to use offset for l_s_range-low.

    Instead, what I did is below

    SAP BW 7.3 Code

    WHEN 'ZABC_MTD'.

           v_loc_date = sy-datum.

           IF v_loc_date+6(2) LE 20.

             v_loc_date+6(2) = '01'.

             v_loc_date  =  v_loc_date - 1.

           ENDIF.

           l_s_range-low = v_loc_date.

         l_s_range-low+6(2) = '01'.

           l_s_range-high = v_loc_date.

           l_s_range-sign = 'I'.

           l_s_range-opt = 'BT'.

           APPEND l_s_range TO e_t_range.

           EXIT.

    SAP BW 7.4 Code

    DATA : LV_DATE TYPE D.

    WHEN 'ZABC_MTD'.

           v_loc_date = sy-datum.

           IF v_loc_date+6(2) LE 20.

             v_loc_date+6(2) = '01'.

             v_loc_date  =  v_loc_date - 1.

           ENDIF.

           LV_DATE = v_loc_date.

         LV_DATE+6(2) = '01'.

           l_s_range-low = LV_DATE.

           l_s_range-high = v_loc_date.

           l_s_range-sign = 'I'.

           l_s_range-opt = 'BT'.

           APPEND l_s_range TO e_t_range.

           EXIT.

    Regards,

    Anil

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 05, 2014 at 06:42 AM

    Hi Former Member,

    The only main change that has happened in 7.4 compared to 7.3 on coding part is the one mentioned in the note below:

    1943752 - SYNTAX_ERROR Dump Occurs when Executing a BW Query with Customer Exit Variable after Upgrading to BW7.4

    BR

    Prabhith


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I referred that note earlier it self and I did the change in declarations accordingly.

      Thanks,

      Anil

  • avatar image
    Former Member
    Jun 05, 2014 at 06:49 AM

    Hiii,

    Can you brief what you are trying to achieve .

    So that can help with code better.

    Regards,

    Akshay

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I am just writing a code to get month to date, actually i written the same code in 7.3 , there it's working fine, but when i try to write the same code in 7.4, i am getting error.

      It's 7.4 new installation, we are testing in sandbox, do we need to do any thing in SPRO to make abap work properly.

      Basically system is not allowing to use offset for this line  l_s_range-low+6(2) = '01'.

      Thanks,

      Anil

  • Sep 11, 2014 at 08:08 AM

    Hi Anil,

    I'm experiencing the same issue now in a upgraded Sandbox system where we upgraded to SAP BW 7.4 SP07.

    All Customer Exit include ZXRSRU01 is throwing samme error as you got.

    Did you find any other solution on this or is the only solution to change ABAP logic?

    Since we have approx 3000 lines with ABAP and many of the Customer Exits is using Offset and string loginc on l_s_range objects, it will be a hugh job to fix all this.

    Btw, where did you find the information that In 7.4 its not not allowing to use offset for l_s_range-low?

    regards

    Oddmar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Omar:

          We have just migrated to 7.4 and we found the same issue in ZXRSRU01 user exit with STRING or XSTRING offsets. Did you find any SAP solution to solve it or did you made ABAP logic changes ?

      Thanks in advance

      Abel

  • avatar image
    Former Member
    Nov 23, 2015 at 03:46 PM
    Add comment
    10|10000 characters needed characters exceeded