Skip to Content
author's profile photo Former Member
Former Member

How can we pass a variable working with Native SQL

Dear Friends,

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

Regards,

Alok.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 09:16 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.