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

Declaring Global Variables in a Function

Hi,

I have a function. At the end of the function I have a subroutine ( Form ).

Instead of passing data to the form, is it possible to declare , some of my varibles in the function as Global so they are visible in the Form.

These variables, are Internal tables with header line.

If it is possible how do I declare them.

The type of internal tables I have are like the following:

data lt_itemdata TYPE TABLE OF bapi_incinv_create_item

WITH HEADER LINE.

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jul 20, 2005 at 11:44 AM

    You have to declare this variable in the main program.

    When you create a function you have first to create function group. This function group have a global program with include. Create an include with global declaration.

    Regards

    Frédéric

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2005 at 11:44 AM

    Hi Sims,

    you can certainly declare global data for the function module (or function group rather). There will be a <i>top include</i> for every function group which will enable you to write the data declarations. these will be global and visible across all the function modules of the function group.

    From the function module code, use the menu option <i>Goto-->Global data</i>.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2005 at 11:59 AM

    Yes. you can do this by declaring the internal table as a global field.

    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.