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

Error de Dato no compatible

ricardjavier
Discoverer
0 Likes
1,220

Hola, podrian ayudarme a resolver este inconveniente?

Tengo el error de tipo de dato no compatible entre el lifnr y el s_id.

***********************************************************************************************

FORM get_list_vendors


CHANGING ex_zlfa1 TYPE zlfa1_tab.


SELECT *
FROM zlfa1
INTO TABLE @DATA(list_vendors)
WHERE lifnr = @s_id.

IF sy-subrc EQ 0.

"save list.

ex_zlfa1 = list_vendors.

ELSE.
"error

CLEAR ex_zlfa1.


ENDIF.


ENDFORM.

Hola, podrian ayudarme a resolver este inconveniente?

Tengo el error de tipo de dato no compatible entre el lifnr y el s_id.

***********************************************************************************************

FORM get_list_vendors


CHANGING ex_zlfa1 TYPE zlfa1_tab.


SELECT *
FROM zlfa1
INTO TABLE @DATA(list_vendors)
WHERE lifnr = @s_id.

IF sy-subrc EQ 0.

"save list.

ex_zlfa1 = list_vendors.

ELSE.
"error

CLEAR ex_zlfa1.


ENDIF.


ENDFORM.

3 REPLIES 3
Read only

vipinsaraika
Participant
1,145

Hi Ricardo,

Can you please make sure that data type for S_id is same as the filed LIFNR of table LFA1

Or else define it as below

data: s_id type lfa1-lifnr.

Read only

Sandra_Rossi
Active Contributor
1,145

Usually people like to prefix selection screen range fields with "S_", so I guess you declared S_ID like that:

TABLES zlfa1.
SELECT-OPTIONS s_id FOR zlfa1-lifnr.

If so, instead of "=", use "IN" (because "S_ID" is like a range table):

SELECT * FROM zlfa1 INTO TABLE @DATA(list_vendors) WHERE lifnr IN @s_id.
Read only

ricardjavier
Discoverer
1,145

Muchas gracias Vipin, efectivamente ya tenía declarada la variable " SELECT-OPTIONS s_id FOR zlfa1-lifnr."

Muchas gracias Sandra, efectivamente mi codigo solo cambie el " = " por el " IN " y funcionó.

Muy Agradecido por su ayuda!