Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Tags:
Former Member
Former Member replied

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

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question