Skip to Content

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

The row structure of the table BANFTAB is incorrect

Dear Experts,

I get right here the error message

The row structure of the table BANFTAB is incorrect

ZBANFN is a table type and has the line tab BANFN.

Can you pls tell me what is wrong here ?

FUNCTION Z_CHANGE_EBAKZ_FLAG.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  CHANGING
*"     VALUE(BANFTAB) TYPE  ZBANFN
*"----------------------------------------------------------------------

  data lt_eban type table of eban.
  data ls_eban type eban.


  SELECT * FROM eban into table lt_eban where BANFN IN BANFTAB AND EBAKZ EQ 'X'.

  IF SY-SUBRC IS INITIAL.
    LOOP AT lt_eban INTO ls_eban .
      ls_eban-EBAKZ = ' '.
      modify eban from ls_eban.
    ENDLOOP.
  ENDIF.
ENDFUNCTION.

Tags:
Former Member
replied

Hello,

You have to use a ranges table in this case.

FUNCTION Z_CHANGE_EBAKZ_FLAG.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  CHANGING
*"     VALUE(BANFTAB) TYPE  ZBANFN
*"----------------------------------------------------------------------
 
  data:lt_eban type table of eban.
  data:ls_eban type eban.
 
data: 
l_r_banfn type range of banfn,
l_wa_banfn like line of l_r_banfn,
l_wa_banftab like likne of BANFTAB.

loop at banftab into l_wa_banftab.
l_wa_banfn-sign = 'I'.
l_wa_banfn-option = 'EQ'.
l_wa_banfn-low = l_wa_banftab-banfn.
append l_wa_banfn into l_r_banfn.
clear l_wa_banfn.
endloop. 

  SELECT * FROM eban into table lt_eban 
  where 
  BANFN IN L_R_BANFN "BANFN IN BANFTAB 
AND EBAKZ EQ 'X'.
 
  IF SY-SUBRC IS INITIAL.
    LOOP AT lt_eban INTO ls_eban .
      ls_eban-EBAKZ = ' '.
      modify eban from ls_eban.
    ENDLOOP.
  ENDIF.
ENDFUNCTION.

or you can use FOR ALL ENTRIES :

FUNCTION Z_CHANGE_EBAKZ_FLAG.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  CHANGING
*"     VALUE(BANFTAB) TYPE  ZBANFN
*"----------------------------------------------------------------------
 
  data lt_eban type table of eban.
  data ls_eban type eban.
 
 
  SELECT * FROM eban into table lt_eban 
  FOR ALL ENTRIES IN BANFTAB "--> Add this
  where BANFN = BANFTAB-BANFN
  AND EBAKZ EQ 'X'.
 
  IF SY-SUBRC IS INITIAL.
    LOOP AT lt_eban INTO ls_eban .
      ls_eban-EBAKZ = ' '.
      modify eban from ls_eban.
    ENDLOOP.
  ENDIF.
ENDFUNCTION.

Try this & let me know in case of any issues.

BR,

Suhas

Edited by: Suhas Saha on Feb 10, 2009 5:43 PM

0 View this answer in context

Helpful Answer

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