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

Statement is not accessible?

Former Member
0 Likes
432

Hi anybody ,

i am getting an error 'Statement is not accessible'

for the below read statement. Can you suggest how can we replace this statement in Unicode System.

BEGIN OF t_rfrk OCCURS 0, "Referenzbelegkopf

rfbel LIKE vbrk-vbeln, "Referenzbelegnummer

waerk LIKE vbrk-waerk, "Belegwährung

END OF t_rfrk,

READ TABLE t_rfrk WITH KEY rfbel = t_vbrp-rfbel

BINARY SEARCH TRANSPORTING waerk.

CHECK sy-subrc IS INITIAL.

thanks in advance

3 REPLIES 3
Read only

Former Member
0 Likes
391

Hi,

after end of declaration of an internal table you forgot to period, instead you put comma. Just check it.

the modified code would be as follows.

BEGIN OF t_rfrk OCCURS 0, "Referenzbelegkopf

rfbel LIKE vbrk-vbeln, "Referenzbelegnummer

waerk LIKE vbrk-waerk, "Belegwährung

END OF t_rfrk.

READ TABLE t_rfrk WITH KEY rfbel = t_vbrp-rfbel

BINARY SEARCH TRANSPORTING waerk.

CHECK sy-subrc IS INITIAL.

Read only

Former Member
0 Likes
391

Try using internal tables withhout header line like


TYPES: begin of ty_rfrk,
               rfbel   type vbrp-rfbel,
               waerk type vbrk-waerk,
            end of ty_rfrk.

DATA: it_rfrk type standard table of ty_rfrk,
          ls_rfrk type ty_rfrk.

In the READ statement, try

 READ TABLE <int-tbl> into <work-rea> WITH KEY... BINARY SEARCH. 

Hope this helps.

Thanks,

Balaji

Read only

Former Member
0 Likes
391

Hi

You have not written the read in START-OF-SELECTION. Hence you are getting the stmt not accessible error. After data declaration, use the event START-OF-SELECTION and then give your read stmt.

This should work.

THanks

Vijay

PLZ reward points if helpful