2008 Nov 14 4:44 PM
Hi
I have this code
IF l_return IS INITIAL.
READ TABLE lt_sval INDEX 1.
IF lt_sval-value IS INITIAL.
CONTINUE.
ELSE.
it_dados-zzpernr = lt_sval-value.
*(RPimenta-14.11.2008 - Validação de executantes por direcão técnica)
READ TABLE zsd_exec_valido WITH KEY zzpernr =
it_dados-zzpernr.
IF sy-subrc <> 0.
MODIFY it_dados TRANSPORTING zzpernr WHERE selec EQ 'X'.
ELSE.
MESSAGE ID 'ZSD' TYPE 'E' NUMBER '075'
WITH lt_sval-value lgnum.
ENDIF.
*<-
ENDIF.
And i need check if the value in it_dados-zzpernr appears in table zsd_exec_valido .
At verify i have this error:
Programa ZRPWM_CONF_OTS
Field "ZZPERNR" is unknown. It is neither in one of the specified
tables nor defined by a "DATA" statement . . . . . . . . . .
The table zsd_exec_valido isn't an internal table, could this be the problem ?
How can I solve this problem ?
Thanks
2008 Nov 14 4:55 PM
use select single instead of read table.
Select single from zsd_exec_valido where zzpernr =
it_dados-zzpernr.
Hi
I have this code
IF l_return IS INITIAL.
READ TABLE lt_sval INDEX 1.
IF lt_sval-value IS INITIAL.
CONTINUE.
ELSE.
it_dados-zzpernr = lt_sval-value.
*(RPimenta-14.11.2008 - Validação de executantes por direcão técnica)
READ TABLE zsd_exec_valido WITH KEY zzpernr =
it_dados-zzpernr.
IF sy-subrc <> 0.
MODIFY it_dados TRANSPORTING zzpernr WHERE selec EQ 'X'.
ELSE.
MESSAGE ID 'ZSD' TYPE 'E' NUMBER '075'
WITH lt_sval-value lgnum.
ENDIF.
*<-
ENDIF.
And i need check if the value in it_dados-zzpernr appears in table zsd_exec_valido .
At verify i have this error:
Programa ZRPWM_CONF_OTS
Field "ZZPERNR" is unknown. It is neither in one of the specified
tables nor defined by a "DATA" statement . . . . . . . . . .
The table zsd_exec_valido isn't an internal table, could this be the problem ?
How can I solve this problem ?
Thanks
2008 Nov 14 4:50 PM
if its not an internal table, how can you read it usign Read Table command?
2008 Nov 14 4:55 PM
use select single instead of read table.
Select single from zsd_exec_valido where zzpernr =
it_dados-zzpernr.
2008 Nov 14 4:58 PM
Hello Ricardo,
you worte zsd_exec_valido isn't an internal table, than you can't read a database table with this code line:
READ TABLE zsd_exec_valido WITH KEY zzpernr =
it_dados-zzpernr.
From database you must read with OpenSQL:
Select *
from zsd_exec_valido
into [structure]
where zzpernr = it_dados-zzpernr.
This is very dirty, because you should only select the field you realy need from databae. but this should only a hint for you. I'm not sure but from the naming it_dados could be a internal table. If this so, you must check if the internal table has a header line. in other case you must read the tableline in an workarea before using a field for the select statement.
Regards
Dirk