cancel
Showing results for 
Search instead for 
Did you mean: 

How can we pass a variable working with Native SQL

Former Member
0 Kudos

Dear Friends,

Please suggest how can we pass a variable working with Native SQL using a Select statement?

Regards,

Alok.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can achieve this by typing ":" before the name of the ABAP variable likewise:

EXEC SQL.

SELECT ERNAM INTO :LV_ERNAM FROM MARA WHERE MATNR = :P_MATNR

ENDEXEC.

Where LV_ERNAME is a local variable which will recieve the data from the query and P_MATNR is a parameter which holds the material number before the query is executed.

Hope it helps,

Alex