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

SmartForms: Passing Internal Tables

I am trying to pass an internal table to a SmartForm and I am having no luck at all. I have tried so many things that I am starting to get confused. I do not want to have to create this internal table type in the data dictionary se11. Can anyone help me out? Here is what I have:

<u>In the Print Program:</u>

TYPES:

BEGIN of mytab,

my_batch type c,

my_char(20) type c,

my_unit(10) type c,

my_value(10) type c,

charg(10) type c,

END OF mytab.

TYPES: wa_mytab TYPE STANDARD TABLE OF mytab initial size 0.

...... code to put data into table .....

CALL FUNCTION func_mod_name

EXPORTING

OUTPUT_OPTIONS = output_options

USER_SETTINGS = space

Plant_Addr = kna1-adrnr

mytab = mytab

EXCEPTIONS

OTHERS = 5.

<u>SmartForms Global Data Types Tab:</u>

TYPES:

BEGIN of mytab,

my_batch type c,

my_char(20) type c,

my_unit(10) type c,

my_value(10) type c,

charg(10) type c,

END OF mytab.

TYPES: wa_mytab TYPE STANDARD TABLE OF mytab initial size 0.

<u>Global Data Tab:</u>

wa_mytab TYPE mytab

<u>Form Interface Import Tab:</u>

mytab TYPE mytab

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Nov 18, 2005 at 05:34 PM

    Hi Janice,

    re you sure about this statement?

    TYPES: wa_mytab TYPE STANDARD TABLE OF mytab initial size 0.

    Don't you think it should be

    data: wa_mytab TYPE STANDARD TABLE OF mytab initial size 0.

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I'm not sure about anything anymore :). I changed the statement in my print program as you suggested. Everything in the print program and in the smart form compiles o.k., but when I run the actual program I get the horrid ABAP Dump and it says:

      <i>The function module interface allows you to specify only

      fields of a particular type under "MYTAB"

      The field WA_MYTAB Specified here is a different field type</i>

      Any other suggestions?

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 06:16 PM

    Hi,

    I will give u a method which i have implemented to pass internal tables and it works.

    Create a structure in data dictionary say ZMYTAB with fields as your mytab structure. Create a Table Type in data dictionary ZTY_MYTAB with Line Type as ZMYTAB.

    Then In the Form Interface in Tables tab, pass Parameter name as your Internal table name, Type Assignment TYPE and Associated Type as ZTY_MYTAB.

    In the print program ,

    Declare ur itab as

    itab TYPE TABLE OF zmytab WITH HEADER LINE.

    And while passing the internal table in the call function module, pass as itab[].

    Let me know if it helps.

    Thanks

    sharmistha

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I am trying to pass it in the Import Tab of the Form Interface -- only because I was told by someone that the Tables Tab is for old backwards compatibility and because the only way I could get it to work with the Tables Tab was by defining the Table Type in the Data Dictionary se11 -- I don't want to have to do this.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 06:26 PM

    Hi Janice,

    Try out having the declaration of your internal table structure under <b>types</b> in smartform.

    Regards,

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      To pass Internal table in smartforms, you have to declare your Internal table in TABLES tab of Form Interface and Associated Type of the Internal table has to be:

      <b>"ABAP associated type for an interface parameter. The associated type must be a global Dictionary type or exist in a type pool. In the latter case, the type pool must be declared in the function group."</b>

      There is no other way to pass Internal table. Please try the method I have given and you will achieve your result.

      thanks

      sharmistha

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 07:22 PM

    Hi Janice,

    Define your internal table under tables and same the way..

    Tables tab in smartforms is meant for passing tables of data.

    Regards,

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Sounds to me like I have no choice.

      - I will have to use the tables tab and

      - I will have to create a type for my internal table in the data dictionary se11

      Not the answer I was hoping for, but I do appreciate your responses and at least I now have the answer. I'm not sure of the best way to reward points so I will give them to both of you. thx again

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.