cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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

Former Member
0 Kudos

Hi Anil,

very good to know, very usefull information.

Regards,

Jürgen

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello everyone,

Note was created to solve this type of issues:

2183594 - Syntax error: "At the write position, you cannot use offset and length specifications with...

Regards,

Janaina

0 Kudos

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

Former Member
0 Kudos

Hi Oddmar,

I found this solution while I was just doing some R&D in our sandbox.

I am not sure is this the only solution.

I hope by this time SAP must have come up with some alternative.

If you found any, please update.

Regards,

Anil

former_member673163
Discoverer
0 Kudos

HI Anil

Please look SN-1823174 for more information. The domain RSCHAVL was changed from CHAR 60 to SSTRING 1333. As a result, some ABAP language constructs are no longer possible (syntax errors) or they cause runtime errors in customer-specific programs.

There are different data types in your case:

  7.3 RRRANGESID-LOW was RSCHAVL (CHAR 60)

  7.4 RRRANGESID-LOW now is RSCHAVL (SSTRING 1333)

Usefull Blog:

Best regards.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hiii,

Can you brief what you are trying to achieve .

So that can help with code better.

Regards,

Akshay

Former Member
0 Kudos

I think you just trying to check if the date is greater then 20 .

If it is less then you are assigning it 01.

and in next statement you are subtracting it by 1 which is wrong .

AND you need to specify diff variable to v_loc_date2 while assigning new value and then after condition use v_loc_date = v_loc_date2

Regards,

Akshay

Former Member
0 Kudos

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

0 Kudos

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


Former Member
0 Kudos

Hi,

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

Thanks,

Anil