Application Development 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: 

The row structure of the table BANFTAB is incorrect

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

Hi.

just add this statement on the top.

tables: eban.

0 Kudos

sorry its wrong

Former Member
0 Kudos

Hi,

if i understand you right, BANFTAB is an internal table.

Do you try to define you FM with table-parameter?

Regards, Dieter

Former Member
0 Kudos

Hi,

im not 100% sure, but i guess that using "IN" in the WHERE-Clause suggests, that you ar using a range or a select-options. These kind of tables have a different line-Structure as: SIGN, OPTION, LOW and HIGH. If you want to use a custom itab you have to use the FOR ALL ENTRIES IN itab. In the cocumentation of the select command you should find further explanation. They are using the word "seltab" for Ranges or select-options in the Where-Part.

regards

Jan Martin

faisal_altaf2
Active Contributor
0 Kudos

HI,

Please Define BANFTAB This in Table Tab rather than Changing hope will solve out your problem,

and also not use TYPE if you are using it as RANGE.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 10, 2009 5:13 PM

SuhaSaha
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

pls notice:

The type BANFN has no structure and therefore no component called

BANFN.

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

Thats all. All what I want to do is to pass a table to the Function Module

with couples of Requision Number. I cant use Table Parameter at Function Module

because it shows many errors. Changing parameter is also not working.

Regards

ilhan