How to pass internal table to method of class

Hi all,
I am new to abap objects, i want to pass one internal table to class.
i am trying in this way.
class c1 definition.
method get_material importing t_stpo  type any table
                               exporting t_mast type any table.
endmethod.
endclass.
class c1 implementation.
method get_material.
select f1 f2 f3 from <tab> into table t_mast
        for all entries in t_stpo
        where stlnr = t_stpo-stlnr.
endmethod.
endclass.
ERROR:
"stlnr" is not available
if i use this way. its not giing error.
class c1 definition.
method get_material exporting t_mast type any table.
endmethod.
endclass.
class c1 implementation.
method get_material.
select f1 f2 f3 from <tab> into table t_mast
        for all entries in it_stpo
        where stlnr = it_stpo-stlnr.
endmethod.
endclass.
how to pass internal table with some specific reference may be using like or type <it_xxxx>
thanks

Try this.
TYPES : BEGIN OF ty_stpo,
         stlnr TYPE stpo-stlnr,
         idnrk TYPE stpo-idnrk,
         menge TYPE stpo-menge,
        END OF ty_stpo,
        BEGIN OF ty_mast,
         matnr TYPE mast-matnr,
         werks TYPE mast-werks,
         stlnr TYPE mast-stlnr,
        END OF ty_mast,
        tt_stpo TYPE TABLE OF ty_stpo,
        tt_mast TYPE TABLE OF ty_mast.
DATA : it_stpo TYPE tt_stpo,
       it_mast TYPE tt_mast.
*       CLASS c1 DEFINITION
CLASS c1 DEFINITION.
  PUBLIC SECTION.
    METHODS : get_bom_numbers EXPORTING ex_stpo type tt_stpo,
              get_parent_material IMPORTING im_stpo TYPE tt_stpo
                                  EXPORTING ex_mast TYPE tt_mast.
    endclass.
*       CLASS c1 IMPLEMENTATION
CLASS c1 IMPLEMENTATION.
  METHOD get_bom_numbers.
  ENDMETHOD.                    "get_bom_numbers
  METHOD get_parent_material.
  ENDMETHOD.                    "get_parent_material
START-OF-SELECTION.
  DATA : obj TYPE REF TO c1.
  CREATE OBJECT obj.
  CALL METHOD obj->get_bom_numbers
    IMPORTING
      t_stpo = it_stpo.
  CALL METHOD obj->get_parent_material
    EXPORTING
      im_stpo = it_stpo
    IMPORTING
      ex_mast = it_mast.
Regards,
Rich Heilman

Similar Messages

  • How to pass  internal table values to parameter

    hi,
             how to pass  internal table values to parameter in selection screen.if is it possible means please sent codeings.
    thanks.
      stalin.

    hi,
    tables : mara.
    data :  begin of itab_mara occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              end of itab_mara.
    selection-screen : begin of block blk1 with frame title text-001.
    parameters : p_matnr like mara-matnr.
    selection-screen : end of block blk1.
    select matnr ernam from mara into corresponding fields of itab_mara
                                                                    where matnr = p_matnr.
    loop at itab_mara.
    write :/ itab_mara-matnr,
               itab_mara-ernam.
    endloop.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Internal table in method of class (BADI)

    Hello people !!
    I need to use an internal table into method of class. I don´t know very well how to use it. I know that it hasn´t a header; but I don´t know how to defined and use it.
    I need to use in a method of badi.-
    I will be grateful by the help that your could offer to me.-
    Thank you so much,
    Esther.-

    Thank you for your answer.
    But, I had defined as de fist item, but I had defined with a structure of dictinary.
    Now, in my code, I need to deposit information to the above mentioned table. Then, when I try to accede to the fields of the estructure, when I compile it gives me the following mistake:
    "ACC_DATA" is a table without a header line and therefore has no          
    component called "CUENTA".     
    I attach departs from the code:
    types: es_accdata type standard table of Z_ES_ACCDATA.
    data: acc_data  type es_accdata.
          loop at it_mseg into r_mseg.
          si es Entrada de Mercancía
            if r_mseg-bwart = '101'.
              at first.
                acc_data-cuenta = r_mseg-sakto.
                if not r_mseg-kostl is initial.
                  acc_data-centro_coste = r_mseg-kostl.
                else.
                  acc_data-orden_inversion = r_mseg-aufnr.
                endif.
              endat.
              monto = monto + r_mseg-dmbtr.
            endif.
          endloop.
    Thank you againg, for a new answer !!!!
    bye, Esther.-

  • ABAP OO - Passing Internal Tables from Method to Method

    I'm new to writing methods.
    I have a need to build an internal table in METHOD1 and pass the internal table to METHOD2. I'm confused how to declare the table in 'Parameter' section of the METHOD2. I have specified the following:
    Parameter = WTAB1
    Type = Import
    Pass value = blank
    Optonal = Blank
    Typing Method = Type
    Associated type =  ZSCIW and this is declared in DDIC as a data type with fields ZZLINE(72) and ZZPOS(4)
    Default value = blank
    METHOD1 (simplified example)
    method METHOD1.
    Table of individual words from source code
      types: begin of wline,
               WORD(72),
               POSN(4),
             end of wline,
             wlines     type standard table of wline  with default key.
      data:  wx          type wlines,
               wa          like line of wx.
    Clear past results
      REFRESH: Wx.
    Look through source code...
      LOOP AT ref_include->lines into wa.
        APPEND wa.
      ENDLOOP.
    Call METHOD2 and pass internal table wa
    METHOD2 ( ).
    1. How to you define the parameters in METHOD2.
    2. What is the coding in METHOD1 to call METHOD2.
    Your help will really be appreciated.
    Thanks.
    Soyab

    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    Check these links.
    http://www.henrikfrank.dk/abapuk.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Go through the below links,
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    OO ABAP links:
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    go through these links
    http://www.erpgenie.com/abap/index.htm
    http://sic.fh-lu.de/sic/bic.nsf/(vJobangebote)/EC8AD2AE0349CE92C12572200026FDB8/$File/Intern%20or%20Working%20Student%20as%20ABAB%20OO%20Developer.pdf?Open
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
    ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
    DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
    DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
    DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
    DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
    DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
    DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
    DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    <b>good book on ABAP objects(OOPS)
    http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications</b>
    Rewards if useful..............
    Minal

  • How to pass internal table to form routine..?

    Gurus,
    I am creating a custom Function module in which i have declared few perform statements and passing internal table to it..but when i declare the form it gives me error that the internal table is unknown...Can u please suggest me what am i doing wrong...
      DATA: Begin of tb_set_values occurs 0.
            include structure rgsb4.
      DATA: End of tb_set_values.
    PERFORM read_sets_with_values USING wa_setheader CHANGING tb_set_values[].
    FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
                               CHANGING rtb_set_values LIKE tb_set_values[].
    DATA: v_setid TYPE setid.
    *DATA: Begin of rtb_set_values occurs 0.
         include structure rgsb4.
    *DATA: End of rtb_set_values.
      CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
        EXPORTING
          SHORTNAME = rwa_setheader-setname
        IMPORTING
          NEW_SETID = v_setid.
      CALL FUNCTION 'G_SET_GET_ALL_VALUES'
        EXPORTING
          SETNR      = v_setid
        TABLES
          SET_VALUES = rtb_set_values.
    ENDFORM.
    What can be the error..please help

    Well actually, I just tested it and it works fine as you have written it in my test program, so not sure what you are doing wrong. This was tested in NW 7.0
    REPORT rich_0001.
    DATA: setheader TYPE string.
    DATA: wa_setheader TYPE string.
    DATA: BEGIN OF tb_set_values OCCURS 0.
            INCLUDE STRUCTURE t000. "<<-- Test with T000 instead    "rgsb4.
    DATA: END OF tb_set_values.
    SELECT * INTO TABLE tb_set_values  FROM t000.
    PERFORM read_sets_with_values USING wa_setheader
                                  CHANGING tb_set_values[].
    *&      Form  read_sets_with_values
    *       text
    *      -->VALUE(RWA_SETHEADER)  text
    *      -->RTB_SET_VALUES        text
    FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
                               CHANGING rtb_set_values LIKE tb_set_values[].
      DATA: ls_set_values LIKE LINE OF rtb_set_values.
      LOOP AT rtb_set_values INTO ls_set_values.
        WRITE:/ ls_set_values.
      ENDLOOP.
    ENDFORM.                    "read_sets_with_values
    Regards,
    RIch Heilman

  • How to pass internal table between views

    Hello Experts,
      How to pass an internal table between views? I have followed some steps but its showing an error.
    i have created a table type of ZTTYPE_VBAP and line type  VBAP.
    I have declared in component controllers attribute  LT_VBAP of associated type ZTTYPE_VBAP .
    But when i am using this in my method in component controller its not taking.

    Venkata123# wrote:
    Hello Experts,
    >
    >   How to pass an internal table between views? I have followed some steps but its showing an error.
    >
    > i have created a table type of ZTTYPE_VBAP and line type  VBAP.
    > I have declared in component controllers attribute  LT_VBAP of associated type ZTTYPE_VBAP .
    > But when i am using this in my method in component controller its not taking.
    you will have to declare a node with the attributes in the context tab of component controller. by doing this you will make this node a global one in your entire application . now copy the value you have in the internal table of yours in this node.
    after doing so you can read this node anywhere in the program and you can retrieve the values.
    regards,
    sahai.s

  • How to pass internal table with data in ABAP OO

    Hi experts ,
    Here is the problem...
    I create a screen 100 and use the internal table to get data from database, and then press the button on screen 100 , it will call screen 200.
    I use ABAP OO code in screen 200, and i want to keep the internal table with data that i get from the sceen 100 parts, but it seems that it just supports to create a new internal table and get data from database in ABAP OO. That means i need to create a new table to save the data in internal table ? Or there is any other solution something like exporting or memory id ...
    ps . the internal table in screen 100 is declared in global area, the beginning of the code.
    Please give me some advice, thanks a lot!
    Regards ,
    Claire

    I have already know how to do, here is my code:
    METHODS fill_tree importing itab2 like itab1.
    CALL METHOD: me->fill_tree exporting itab2 = itab1.
    In METHOD fill_tree,
    declare
    data: itab3 TYPE STANDARD TABLE OF itab,
    itab3[] = itab1[].
    It is useful to me, thanks a lot.

  • How to pass  Internal table in submit

    Hi  Friends-
    i have a internal table with two fields it is like
    begin of error occurs 0,
    num(8)  type n,
    msg(50) type c,
    end of error .
    now  this table i have to submit in another report and i have to use this table in that other report
    but how i can pass this in submit   pls guide me.
    Regards
    Meeta

    Hi ,
    I am writing the 2 options that I know of my knowledge:
    OPTION 1 :
    in prog1
    loop at itab.
    r_matnr-sign = 'I'.
    r_matnr-option = 'EQ'.
    r_matnr-low = itab-matnr.
    append r_matnr.
    clear r_matnr.
    endloop.
    submit prog2 via selection-screen
    with s_matnr in r_matnr and return.
    in prog2
    select-options: s_matnr for mara-matnr no-display.
    loop at s_matnr.
    itab-matnr = s_matnr-low.
    append itab.
    clear itab.
    endloop.
    OPTION 2:
    report zashish_1.
    data: imara type table of mara with header line.
    start-of-selection.
    select * into table imara from mara up to 10 rows.
    export imara to memory id 'YOURID'.
    submit zashish_2 and return.
    The submitted program.
    report zashish_2 .
    data: imara type table of mara with header line.
    import imara from memory id 'YOURID'.
    loop at imara.
    write:/ imara-matnr.
    endloop.
    Hope these option might have clarified most of your doubts.
    Regards,
    Ashish Arora

  • How to Pass internal table from a program to Samrt form

    Hi Pals
    I want to pass an internal table which I have declared in the program to Smartform..can you please help
    me asap.
    Regards
    Praveen

    Hai.
    check link.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    check this.
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    check this:
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    check this linkls------>
    https://www.sdn.sap.com/irj/sdn/collaboration
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Insert Images in smartforms
    regards.
    sowjanya.b.

  • Error while passing internal table between methods at design time

    Hi,
    In a method (say method1 for eg) I have declared an internal table, IT_RANGE2 as:
    DATA: IT_RANGE2 TYPE STANDARD TABLE OF ZTTRANGE
    ZTTRANGE is a tabletype in SE11 and has a line type ZRANGE.
    In this method, I am calling another method (method2)
    WD_COMP_CONTROLLER->HOLD_DATA( CHANGING IT_RANGE = IT_RANGE2 ).
    IT_RANGE has been declared as;
    PARAMETER       TYPE                    REFTO       ASSOCIATED TYPE
    IT_RANGE           CHANGING                                  ZTTRANGE.
    I am getting an error: IT_RANGE2 is not type-compatible with formal parameter IT_RANGE.
    Please help.
    MIck

    change it_range2 like this
    DATA: IT_RANGE2 TYPE ZTTRANGE

  • How to pass internal table from FM to mai report

    Hi,
    I have created a new FM and under this all mine data is coming in one internal table IT_OUTPUT. now how to take this internl table to main report along with whole data.

    hi
    As i understand, your are using this function module in your report, giving some parameters then u r getting complete data into one internal table if i am not wrong.
    When u execute ur report this function module will give u the data through internal table. Just use that internal table to display the data using write statement if it is classical report. If it is ALV report use REUSE_ALV_LIST_DISPLAY or REUSE_ALV_GRID_DISPLAY to display the internal table data in screen
    Thanks
    Siva Kumar

  • How to pass internal table data from model to BSP page.

    Hi Experts,
    I have requirement where I have got data from deep structure in Model.
    The structure has two fields > 1. normal data tyoe + the other one is of table type.
    Thanks and Regards,

    if you have defined the attribute then you can ABAP coding to use it in BSP.
    for eg, here i am looping the intenal table and passing the data to list item box.
        <%
      LOOP AT lt_dyn_uom INTO wa_dyn_uom.
        %>
                <htmlb:listBoxItem key   = "<%= wa_dyn_uom-name %>"
                                   value = "<%= wa_dyn_uom-value %>" />
         <%
      ENDLOOP.
         %>
    Thanks,
    Chandra

  • How to pass internal tables dynamically in the subroutine

    Hi Folks,
    I need to take 3 input files from presentation server. instead of writing the gui_upload for 3 times i want to have it in a subroutine. but i need to specify the tables structure in the subroutine which is not possible to specify in the form ...endform since 3 itabs are fully different.
    is there a way i can handle this dynamically...!
    Please send the code if u have the same kind of stuff.
    Thanks for ur valuable time.

    Hi Hasmath,
    Try this
    data: begin of itab1 occurs 0,
            field1(2),
          end of itab1.
    data: begin of itab2 occurs 0,
            field1(10),
          end of itab2.
    data: filename type string.
    start-of-selection.
    perform file_upload tables itab1.
    perform file_upload tables itab2.
    *&      Form  file_upload
          text
         -->P_ITAB1  text
    form file_upload  tables   p_itab1." type any
    call function 'GUI_UPLOAD'
      exporting
        filename                      = filename
       FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      tables
        data_tab                      = p_itab1
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform.                    " file_upload
    REgards,
    Ravi Kanth Talagana

  • Pass Internal Table to Memory

    Dear Experts.
    I have the following problem.
    I am using a User-Exit for Travel  that is called from a program standard with use the T.Code TRIP. The program standard use a structure that when entry in the user exit not is. I need use this structure in the user exit. (p_t_req_head).
    I had read abour SAP and ABAP Memory but from the program standar How can Pass Internal Table to Memory SAP or ABAP from the program standard to user-exit?
    When I am doing debugging in the program Standard and this call to the user exit, I use ()namestructure for example ()p_t_req_head  and I get the datas of the structure, But In the Source Code ABAP, How can do this with instructions?
    Regards

    Hi,
    You try with Import & Export Statements as follows ---
    DATA : t_itab LIKE TABLE OF spfli.
    EXPORT t_itab TO MEMORY ID 'ABCD'.
    After sending the internal table to ABAP memory you need to get that by IMPORT in the called session.
    IMPORT t_itab FROM MEMORY ID 'ABCD'.

  • Passing internal tables dynamically to a subroutine

    Hi All,
    How to pass internal tables dynamically to a subroutine?
    In subroutine logic i'm fetching data from MARA table for all entries in the internal table passed to the subroutine. Based on some condition the internal table varies. I'm placing the code below
    Both GT_AUFM & GT_AUFM1 are of 2 different structures having MATNR.
    IF WA_AUFM1-BWART EQ '261'.
        PERFORM GET_IF_SEMIFINISHED USING GT_AUFM1.
    ELSE IF WA_AUFM1-BWART EQ '262'.
        PERFORM GET_IF_SEMIFINISHED TABLES GT_AUFM.
    ENDIF.
    FORM GET_IF_SEMIFINISHED  USING P_TABLE TYPE ANY TABLE.
      REFRESH GT_MARA.
      SELECT MATNR FROM MARA INTO TABLE GT_MARA
                     FOR ALL ENTRIES IN P_TABLE
                     WHERE MATNR EQ P_TABLE-MATNR
                       AND MTART IN R_MTART.
      ENDFORM.
    With this logic i'm getting an error that the specified type has no structure and therefore no component called MATNR.
    Thanks,
    Anil.

    refer this link
    dynamic internal table

Maybe you are looking for

  • How to create automatic creation of BP from customer and vendor master data

    Hi gurus, can any one tell how to create automatic creation of BP from customer and vendor master data. Please give me the steps. Thanks Sasikanth.

  • Switcher Error in Hgrid

    I ' ve created Hgrid , with switchers at detailed record. But when i 've tried to expand the Hgrid , the page has gone into error and showing the error as Definition of <view attribute> not found in view object. so for the cross verification, i' ve c

  • Is there a lavalier mic for iPhone 5?

    Is there a lavalier mic for iPhone 5?

  • Trading Scenario in SAP

    Hi all, I am working for a project where there is total trading scenarios. No manufacturing at all. But the scenario is like when the PO is received from the customer then only all the procurement process begins: 1. Sales order Created & requirements

  • Since upgrading to iOS7 I can't get rid of the number of emails it says I have

    I still can't clear my emails.  They have all been read, but it shows I still have 22 messages.  Going into messages and hitting Edit and then tagging each one isn't the issue.  That didn't help. Also, since upgrading to the iOS7 everytime a call com