Tables parameter at Form routines

Dear All!
I have heard that this version is obselete:
Form showMara tables itab_mara type mara.
Endform.
Can you pls say to me what the cuurent coorectly
version is to handle with tables at form routines.
rregards
sas

yes it works
no prblem...
this is worarea
Form showMara tables itab_mara type mara.
Endform.
this is for table
Form showMara tables itab_mara[] type table mara.
Endform.
like that
for exact checking ...c the help
ok

Similar Messages

  • Dynamic TABLE parameter in Sub routine call

    Hi,
    Is it possible to have a dynamic TABLE parameter in a sub-routine call? The structure of the internal table will be different during different calls to the sub-routine.
    I have a subroutine which has the FM "HR_INFOTYPE_OPERATION" to update the infotype data for an Applicant. Now i want to call this subroutine for every Infotype update. So every time the structure of the internal table to be passed will vary depending on Infotype ( eg P0002 for Infotype 0002, p0006 for infotype 0006).
    Any pointers will be appreciated.
    Thanks in advance.

    Hi Navin,
    yes, why not.
    just use a generic type parameter, i.e.
    FORM process USING IT_00x type table IV_type typc.
    It depend what yout FORM shall do. If you pass the types name, you can dynamically assign to a field-symbol of the respective type.
    Regards,
    Clemens

  • Internal table in a form routine

    Hi,
    I have a problem when I try to use an internal table to pass it into a form/Perform subroutine.
    Here is my code :
      DATA: BEGIN OF i_table_exple OCCURS 0,
        ncont TYPE char18,
        cdmvt TYPE char1,
       END OF i_table_exple.
    perform test_form using i_table_exple.
    form test_form using i_table like i_table_exple.
      loop at i_table.
        write : / i_table-ncont.
        write : / i_table-cdmvt.
      endloop.
    endform.
    when I try to activate it, I have an error : "i_table" is neither specified under "tables" nor is it defined as an internal table
    I think the way I pass my table to the form is not correct, but I don't know how to deal with it.

    Try the following code:
    TYPES:  BEGIN OF t_table_exple ,
    ncont TYPE char18,
    cdmvt TYPE char1,
    END OF t_table_exple.
    DATA : i_table_exple TYPE t_table_exple OCCURS 0 WITH HEADER LINE.
    perform test_form tables i_table_exple.
    form test_form table i_table like i_table_exple.
    loop at i_table.
    write : / i_table-ncont.
    write : / i_table-cdmvt.
    endloop.
    endform.

  • Calling form-routines

    Hello ABAP gutus,
    i am using 10 form-routines to get some data, in all subroutines code is  same, but i am  passing different internal tables to all form-routines  with USING, CHANGING parameters.
    for example
    perform get_header1 using itab changing jtab.
    perform get_header2 using itab1 changing jtab1.
    FORM get_header1  USING    P_ITAB
                      CHANGING P_JTAB.
       CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table = r_alvtab
        CHANGING
          t_table      = itab[].
      CALL METHOD r_alvtab->get_columns
        RECEIVING
          value = r_col.
      CALL METHOD r_col->get
        RECEIVING
          value = r_cols.
      loop at r_cols into wa_col.
        ref_col = wa_col-r_column.
        CALL METHOD ref_col->get_medium_text
          RECEIVING
            value = lv_text.
        jtab-header = lv_text.
        APPEND jtab.
        endloop.
    endform.
    FORM get_header2  USING    P_ITAB
                      CHANGING P_JTAB.
       CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table = r_alvtab
        CHANGING
          t_table      = itab1[].
      CALL METHOD r_alvtab->get_columns
        RECEIVING
          value = r_col.
      CALL METHOD r_col->get
        RECEIVING
          value = r_cols.
      loop at r_cols into wa_col.
        ref_col = wa_col-r_column.
        CALL METHOD ref_col->get_medium_text
          RECEIVING
            value = lv_text.
        jtab1-header = lv_text.
        APPEND jtab1.
        endloop.
    endform.
    as above i used 10 form-routines.but i passed different internal tables.after these subrotines  i am using those internal table in function modules.
    now my client wants me to maintain one form-routine instead of 10 form-routines.
    Is it possible that? please tell me . its urgent
    Regards
    Mahesh

    Hello Naredran.
    see the below code
    perform get_header1 using it changing it1.
    perform get_header1 using itab changing it2.
    *&      Form  get_header1
          text
         -->P_IT  text
         <--P_IT1  text
    FORM get_header1  USING    P_IT
                      CHANGING P_IT1.
        FIELD-SYMBOLS : <FS>.
    CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table   = r_alvtab
        CHANGING
          t_table        = p_it.
      CALL METHOD r_alvtab->get_columns
        receiving
          value  = r_col
                       CALL METHOD r_col->get
                         receiving
                           value  = r_cols
      loop at r_cols into wa_col.
        ref_col = wa_col-r_column.
    CALL METHOD ref_col->get_medium_text
       receiving
         value  = lv_text.
      assign IT1 to <FS>.    
      <FS> = lv_text.
      append it1.
      endloop.
    ENDFORM.                    " get_header1
    bellow error is coming while use the code which you said.
    A USING reference parameter should not be used. Instead, define the
    parameter as a USING-VALUE(...) or CHANGING parameter.
    please let me know waht is wrong .

  • Passing internal table to FORM routine

    Hi friends,
    how do i do the following:
    i have an internal table with data and i want the internal table to be passed in a FORM routine, as i need to do some operations on the data within the table, so what i need is how to do the FORM test_itab USING ... statement.
    thanks for your help,
    points will be awarded instantly!
    clemens

    Hi,
    Below will give you a detailed over view of how to achive the following.
    If you specify the addition TABLES, each table parameter t1 t2 ... for the subroutine called that is defined with the addition TABLES to the FORM statement must be assigned an internal table itab as the actual parameter. The assignment of the actual parameters to the formal parameters takes place using their positions in the lists t1 t2 ... and itab1 itab2 ... .
    You can only specify standard tables for itab. Transfer takes place by means of a reference. If a specified table itab has a header line, this is also transferred; otherwise, the header line in the corresponding table parameter t is blank when it is called.
    Note
    Use of table parameters in the interface for subroutines is obsolete but a large number of subroutines have not yet been converted to appropriately typed USING or CHANGING parameters, so that they must still be supplied with data by the TABLES addition to the PERFORM statement.
    Example
    Static call of the internal subroutine select_sflight transferring a table parameter.
    PARAMETERS: p_carr TYPE sflight-carrid,
                p_conn TYPE sflight-connid.
    DATA sflight_tab TYPE STANDARD TABLE OF sflight.
    PERFORM select_sflight TABLES sflight_tab
                           USING  p_carr p_conn.
    FORM select_sflight TABLES flight_tab LIKE sflight_tab
                        USING  f_carr TYPE sflight-carrid
                               f_conn TYPE sflight-connid.
      SELECT *
             FROM sflight
             INTO TABLE flight_tab
             WHERE carrid = f_carr AND
                   connid = f_conn.
    ENDFORM.
    Thanks,
    Samantak
    Rewards points for useful answers.

  • How to delete a Form Routine in Table Maintenance?

    Hello,
    Very Good Morning!
    How to delete a Form Routine in Table Maintenance?
    I had created a Form Routine at Environment>Modifcation>Events.
    I want to delete a Form Routine that I had created. Can any one please explain me the way I can delete it.
    Any suggestions are appreciated!
    Thanks & Regards
    Kittu

    Hello Rudra,
    Very Good morning!
    I am in Environment>Modification>Events.
    Here is had created a form routine ie...
    01   From_entry    Editor Icon
    In Editor Icon we will write the code.
    This will create a Include in the Function group.
    I had already comented that Include from the Function group. I can even delete it. But, I want to delete the Form Routine that I had created....
    01   From_entry    Editor Icon
    Can any one hepl me please...
    Thanks & Regards,
    Kittu

  • Issue when passing table parameter to perform...

    Hello,
    I have a table parameter (S_KOSTL) defined as RSRANGE in a function module.
    Now when I am passing the table to an perform staeement as follows:
    PERFORM get_cost_center_info USING s_kostl
                                       CHANGING lt_output.
    Inside the form routine I am using following:
    FORM get_cost_center_info USING S_KOSTL TYPE RSRANGE
                                            CHANGING ct_output TYPE tt_output.
    LOOP AT it_ausp INTO ls_ausp WHERE atwrt IN s_kostl.
    ENDLOOP.
    But it says relational operator 'IN' not supported even if I defined S_KOSTL LIKE RSRANGE in function module tbale parameter.
    Please help.
    Regards,
    Rajesh.

    Since you are passing the Range which is a Table you have to pass it with the TABLES addition instead of the Using.
    Try like this:
    PERFORM get_cost_center_info TABLES s_kostl
    CHANGING lt_output.
    Inside the form routine I am using following:
    FORM get_cost_center_info TABLES S_KOSTL TYPE RSRANGE
    CHANGING ct_output TYPE tt_output.
    LOOP AT it_ausp INTO ls_ausp WHERE atwrt IN s_kostl.
    ENDLOOP.
    Regards,
    Naimesh Patel

  • Form Routines

    Hi  ABAP Gurus,
                             i am new to abap.i Have some small doubts.please explain me some doubts.please do explain me in simple words dont send links.
    1. what is a FORM Routine?
    2. what is importing ,Exporting?
    3. what is the diff. b/w exporting & Returning?
    4.what is changing?
    5. what is returning ,receiving?
    6.what is PERFORM Statement?
    7.explain me about public,protected and private?
    note:please do explain me these with simple coding so that i can be familiar to know where to use them.

    Check this link -
    http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html
    PERFORM
    Variants:
    1. PERFORM form.
    2. PERFORM form IN PROGRAM prog.
    3. PERFORM n OF form1 form2 form3 ... .
    4. PERFORM n ON COMMIT.
    5. PERFORM n ON ROLLBACK.
    6. PERFORM form(prog).
    Variant 1
    PERFORM form.
    Extras:
    1. ... USING    p1 p2 p3 ... 2. ... CHANGING p1 p2 p3 ...
    3. ... TABLES   itab1 itab2 ...
    Effect
    Calls the subroutine form defined usng a FORM statement. After the subroutine has finished, processing continues after the PERFORM statement. The parameters of the subroutine are position parameters, and must be passed in the call according to the definition of the formal parameters in the corresponding FORM statement.
    Example
    PERFORM HELP_ME.
    FORM HELP_ME.
    ENDFORM.
    The PERFORM statement calls the subroutine HELP_ME.
    Note
    Non-Catchable Exceptions:
    PERFORM_PARAMETER_MISSING: The subroutine called has more parameters than you passed to it.
    PERFORM_TOO_MANY_PARAMETERS: You passed more parameters to the subroutine than it was expecting.
    PERFORM_CONFLICT_TYPE,
    PERFORM_CONFLICT_TAB_TYPE,
    PERFORM_STD_TAB_REQUIRED,
    PERFORM_CONFLICT_GENERIC_TYPE,
    PERFORM_BASE_WRONG_ALIGNMENT,
    PERFORM_PARAMETER_TOO_SHORT,
    PERFORM_CAST_DEEP_MISMATCH,
    PERFORM_TABLE_REQUIRED: The type of a parameter did not correspond to the type specified in the FORM statement.
    Addition 1
    ... USING    p1 p2 p3 ...
    Addition 2
    ... CHANGING p1 p2 p3 ...
    Effect
    These two additions have an identical function. However, you should always use the same addition as is used in the corresponding FORM definition (for documentary reasons).
    The statement passes the parameters p1 p2 p3 ... to the subroutine. A subroutine may have any number of parameters.
    The order in which you list the parameters is crucial. The first parameter in the PERFORM statement is passed to the first formal parameter in the FORM defintion, the second to the second, and so on.
    You can specify offset and length of a parameter as variables. If you use the addition ' ...USING p1+off(*)', the parameter p1 will be passed with the offset off, but the length will not exceed the total length of the field.
    Example
    DATA: NUMBER_I TYPE I VALUE 5,
          NUMBER_P TYPE P VALUE 4,
          BEGIN OF PERSON,
            NAME(10)      VALUE 'Paul',
            AGE TYPE I    VALUE 28,
          END   OF PERSON,
          ALPHA(10)       VALUE 'abcdefghij'.
    FIELD-SYMBOLS <POINTER> TYPE ANY.
    ASSIGN NUMBER_P TO <POINTER>.
    PERFORM CHANGE USING 1
                         NUMBER_I
                         NUMBER_P
                         <POINTER>
                         PERSON
                         ALPHA+NUMBER_I(<POINTER>).
    FORM CHANGE USING VALUE(PAR_1)
                      PAR_NUMBER_I
                      PAR_NUMBER_P
                      PAR_POINTER
                      PAR_PERSON STRUCTURE PERSON
                      PAR_PART_OF_ALPHA.
      ADD PAR_1 TO PAR_NUMBER_I.
      PAR_NUMBER_P = 0.
      PAR_PERSON-NAME+4(1) = ALPHA.
      PAR_PERSON-AGE = NUMBER_P + 25.
      ADD NUMBER_I TO PAR_POINTER.
      PAR_PART_OF_ALPHA = SPACE.
    ENDFORM.
    Field contents after the PERFORM statement:
    NUMBER_I    = 6
    NUMBER_P    = 6
    <POINTER>   = 6
    PERSON-NAME = 'Paula'
    PERSON-AGE  = 25
    ALPHA       = 'abcde    j'
    Notes
       1. If you want to pass the body of an internal table itab that has a header line, you must use the notation itab[] (see Data Objects). If you do not use the brackets, the header line of the tabel is passed.
       2. The field types and lengths of the parameters remain the same. If a parameter is changed within the subroutine, it will still have the changed value after the subroutine has finished. This does not apply to parameters passed using VALUE. werden.
       3. If you pass literals, they may not be changed unless you pass them to a formal parameter defined with USING VALUE.
    Addition 3
    ... TABLES itab1 itab2 ...
    Effect
    TABLES allows you to pass internal tables to a subroutine.
    Example
    TYPES: BEGIN OF ITAB_TYPE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_TYPE.
    DATA:  ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 100,
           BEGIN OF ITAB_LINE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_LINE,
           STRUC like T005T.
    PERFORM DISPLAY TABLES ITAB
                    USING  STRUC.
    FORM DISPLAY TABLES PAR_ITAB STRUCTURE ITAB_LINE
                 USING  PAR      like      T005T.
      DATA: LOC_COMPARE LIKE PAR_ITAB-TEXT.
      WRITE: / PAR-LAND1, PAR-LANDX.
      LOOP AT PAR_ITAB WHERE TEXT = LOC_COMPARE.
      ENDLOOP.
    ENDFORM.
    Within the subroutine DISPLAY, you can use any internal table operation to work with the internal table that you passed to it.
    Note
    If you use TABLES, it must always be the first addition in a PERFORM statement.
    Variant 2
    PERFORM form IN PROGRAM prog.
    Extras:
    1. ... USING    p1 p2 p3 ... 2. ... CHANGING p1 p2 p3 ...
    3. ... TABLES   itab1 itab2 ...
    4. ... IF FOUND
    Passsing SY-REPID not allowed and Receiving SY-SUBRC not allowed.
    Effect
    This variant is similar to variant 2 (external perform). However, here you can specify the names of both the subroutine and the program in which it occurs dynamically at runtime. If you do this, you should place the variables form and prog in parentheses. The names in form and prog must be entered in uppercase, otherwise a runtime error occurs. If you do not specify any additions (such as USING) you do not need to specify the program after IN PROGRAM. In this case, the system looks for the subroutine in the current program.
    Example
    DATA: RNAME(30) VALUE 'WRITE_STATISTIC',   "Form and program
                                               "names must
          PNAME(8)  VALUE 'ZYX_STAT'.          "be written in
                                               "upper case
    PERFORM (RNAME)         IN PROGRAM ZYX_STAT.
    PERFORM WRITE_STATISTIC IN PROGRAM (PNAME).
    PERFORM (RNAME)         IN PROGRAM (PNAME).
    All three PERFORM statements have the same effect, that is, they call the subroutine 'WRITE_STATISTIC', which is defined in the program 'ZYX_STAT'.
    Notes
    Dynamic PERFORM statements require more CPU time, since the system has to locate the subroutine each time.
    Note
    Non-Catchable Exceptions:
    PERFORM_NOT_FOUND: Unable to find the specified subroutine.
    LOAD_PROGRAM_NOT_FOUND: Unable to find the specified main program.
    PERFORM_PROGRAM_NAME_TOO_LONG: The specified program cannot exist because the program name is longer than 40 characters.
    Addition 1
    ... USING p1 p2 p3 ...
    Effect
    See variant 1, addition 1.
    Addition 2
    ... CHANGING p1 p2 p3 ...
    Effect
    See variant 1, addition 2.
    Addition 3
    ... TABLES itab1 itab2 ...
    Effect
    See variant 1, addition 3.
    Addition 4
    ... IF FOUND
    Effect
    The system only calls the subroutine if it and its main program exist. If this is not the case, the statement is ignored.
    Variant 3
    PERFORM n OF form1 form2 form3 ... .
    Effect
    Calls the subroutine with the index n from the list of subroutines in the statement. At runtime, n must contain a value between 1 (first name) and the total number of subroutines listed in the PERFORM statement (last name). The list can contain up to 256 subroutines.
    Note
    Non-Catchable Exceptions:
    PERFORM_INDEX_0: The specified index was too small.
    PERFORM_INDEX_NEGATIVE: The specified index was negative.
    PERFORM_INDEX_TOO_LARGE: The specified index was too big.
    Variant 4
    PERFORM n ON COMMIT.
    Extras:
    1. ... LEVEL idx
    Effect
    Calls the specified subroutine at the next COMMIT WORK statement. This allows you to delay the subroutine until the logical transaction is finished. Even if you register the same subroutine more than once, it is only executed once. For further information, refer to COMMIT WORK. The ROLLBACK WORK statement deregisters all subroutines registered using this addition.
    Notes
       1. You cannot use USING or CHANGING with the ... ON COMMIT addition. If you need to pass data to the subroutine, you must place it in global variables or use the EXPORT ... TO MEMORYstatement.
       2. The PERFORM ... ON COMMIT statement can also be used during update. The corresponding subroutine is called at the end of the update task.
    Addition 1
    ... LEVEL idx
    Effect
    The LEVEL addition, followed by a field, determines the sequence in which the specified subroutines will be executed at the COMMIT WORK statement. The subroutines are called in ascending order of their level. If you do not use the LEVEL addition, the subroutine assumes the level zero. If two or more subroutines have the same level, they are executed in the sequence in which they are called in the program. You assign levels by defining constants in an include program. The level must have type I.
    Variant 5
    PERFORM n ON ROLLBACK.
    Effect
    The specified subroutine is executed if a ROLLBACK WORK occurs. This allows you, for example, to delete data, such as an internal table or data in memory, that was intended for use in PERFORM...ON COMMIT. If you register the same subroutine more than once, it will still only be executed once per ROLLBACK WORK.
    Notes
       1. Subroutines registered using PERFORM... ON COMMIT cannot have USING or CHANGING parameters. Any data you want to pass to them must be contained in global variables or buffered using EXPORT ... TO MEMORY.
       2. If you catch a type A message ( MESSAGE) using the EXCEPTIONS..ERROR_MESSAGE addition in the CALL FUNCTION statement, a ROLLBACK WORK occurs, in which the subroutines registered using PERFORM ... ON ROLLBACK are executed.
    Variant 6
    PERFORM form(prog).
    Extras:
    1. ... USING    p1 p2 p3 ... 2. ... CHANGING p1 p2 p3 ...
    3. ... TABLES   itab1 itab2 ...
    4. ... IF FOUND
    PERFORM form(prog) not allowed.
    Effect
    Calls the subroutine form defined in program prog ("external PERFORM").
    Notes
       1. You pass parameters to the external subroutine as described in variant 1.
       2. However, you can also do it using a shared data area ( DATA BEGIN OF COMMON PART).
       3. Please consult Data Area and Modularization Unit Organization documentation as well.
       4. You can use nested calls, including several different subroutines in different programs.
       5. When you call a subroutine that belongs to a program prog, prog is loaded into the PXA buffer (if it has not been loaded already). To minimize the possibility of memory problems, try not to use too many external subroutines from a large number of different programs.
    Hope this helps.
    ashish

  • Use of us_screen in the form routine :  FORM entry USING retcode us_screen

    Hello All,
    I have one print program entry routine as below.
    FORM entry USING retcode us_screen.
    Some code to print the form data...
    EndForm.
    When i Check the value of us_screen in the debuging, its value is coming as blank.
    When i checked the other form routine the value of us_screen is coming as 'X.
    I am my getting why in my case value of us_screen is coming as blank.
    What is significant of this field.
    Thanks & Regards
    Sachin Yadav

    Cusomization might be missing for that output type in transaction NACE.
    us_screen is blank because below query fails due to missing entry in table TNAPR.
    SELECT SINGLE * FROM TNAPR WHERE KSCHL = P_KSCHL
                               AND   NACHA = P_NACHA
                               AND   KAPPL = P_KAPPL.
    First assign the output type with a Transmission medium, Program, Form Routine, Form in transaction NACE
    Take the help of your functional consultant.

  • Error-handling in form routines to be called from maintenance  view

    hello,
    i have created a table maint. dialog. Under 'enviroment->modification->events' you can create form-routines for your own coding.
    I have the maint.event '01 - Before saving the data in the database'. Here i do some checks if entered values in some fields are okay or not etc.....
    When the users enters 'wrong' data i do a "message e000 with 'text' " So i got a error-message and the user is not able to save the data before changing it.
    BUT: i get the right error-message in the status-line, but i got an EMPTY screen, all the fields disapear. I have to go back with enter or the red cancel button. But then i 'fall back' to the selection screen of the maint. view. Thats not very user-friendly.
    Any ideas ?

    hi,
    think you have place your module not correct:
    try that: (without event)
    PROCESS AFTER INPUT.
      LOOP AT EXTRACT.
        FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
        CHAIN.
          FIELD Y789.
          FIELD Y012.
          MODULE LISTE_UPDATE_LISTE.
        ENDCHAIN.
    *begin of insertation
        CHAIN.
          FIELD Y123.
          FIELD Y456.
          module check_field  ON CHAIN-input.
        ENDCHAIN.
    *end of insertation
      ENDLOOP.
    Andreas

  • SMARTFORMS - Change an import parameter in form interface

    Hello everyone,
    I don't know if it's possible, but I put some program lines in my smartform to clear some fields if the last page is not reached. The problem is that these fields are from a table that's stated as an import parameter in form interface, which means that data is taken from the program, right?
    Am I able to clear these fields anyway? If so, which way?
    In my code I'm comparing the systems fields sfsy-page and sfsy-formpages, if they're different I clear the fields, otherwise I don't, actually I did it because the conditions don't get the result as I wish. If I check "only after the end of main window" the whole table doesn't appear in my form and I don't want that.
    PS: I didn't set this condition on table, I set it in the text.
    Any ideas?
    Thanks in Advance.

    Hi,
    You can do one thing.....create an internal table in the smartform itself....transport those values in this table and display the fields using this table only.
    Now if the last page is reached u can use the main table (that is imported from the program). This way the original data is not cleared.
    I hope it helps.
    Regards,
    Shraddha

  • TABLE parameter in FUnction module

    Hi Experts
    Iam modifying a FM, i have 10 fileds in export parameters,
    filed1
    filed2
    filed3
    filed 10.
    as per the requirement i need to display the same parameters in table form
    suppose the rows of table is like
    filed1filed2filed3
    filed4filed5filed6
    filed7filed8filed9filed10
    so iam planing to create internal table and pass it TABLE parameter option in FM
    please tell me is it make sense and how to define TABLE parameter in FM, and how to pass data to it
    thanks
    vasavi

    inside the fm you can declare some thing like this.. have a table parameter name some thing don't reference to any data type.
    and also you have 10 importing parameters.
    function ztest_function.
    data: begin of itab occurs 0,
             field1 type <datatype>,
             field2..
            field10,
          end of itab.
    "passing importing parameters
    itab-field1 = i_field1. "these are importing parameters
    itab-field2 = i_field2.
    itab-field10 = i_field10.
    append itab.
    table_parameter[] = itab[].
    endfunction.

  • Perform a form routine within a sap script form

    Hi!
    How can I
    perform a form routine within a sap script form.
    Regards
    sas

    OK,
    many thanks for your kindly reply.
    But basically there is a matter which I don't understand.
    Which way is the better way to loop at internal table:
    Solution1:
    FORM xxx.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
       DEVICE                           = 'PRINTER'
       FORM                             = 'ZSD_PACKING_LIST'
       LANGUAGE                     =  SY-LANGU   .
    LOOP AT gt_versand_plan INTO gw_versand_plan.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'SHELEM'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN' .
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'.
    ENDFORM.
    Solution 2:
    Having the LOOP within the  sapscript form -> 'ZSD_PACKING_LIST'
    Regards
    sas

  • How to psss a table from sapscript to routine program

    HI,
    i want to pass a table from sapscript to routine program.
    the requirment is to sor the table by material number wise.
    how do we pass throug itcsy structure.
    Regards,
    Balachandran

    REPORT YMMR_TDS_LPRG .
    TABLES: ADRC."Central address administration
          FORM FETCH_VEN_ADD                                            *
    -->  IN_TAB                                                        *
    -->  OUT_TAB                                                       *
    FORM FETCH_VEN_ADD TABLES IN_TAB STRUCTURE ITCSY
                              OUT_TAB STRUCTURE ITCSY.
      DATA: L_STREET4 LIKE ADRC-CITY2,
            L_STREET5 LIKE ADRC-LOCATION,
            L_INDEX1 LIKE SY-TABIX.
      DATA: LEN TYPE I.
      DATA: Z1(5) VALUE '00000'.
      LEN = STRLEN( IN_TAB-VALUE ).
      IF LEN = 5.
        CONCATENATE '00000' IN_TAB-VALUE INTO IN_TAB-VALUE.
      ELSEIF LEN = 6.
        CONCATENATE '0000' IN_TAB-VALUE INTO IN_TAB-VALUE.
      ENDIF.
      SELECT CITY2 LOCATION FROM ADRC
      INTO (L_STREET4,L_STREET5)
      WHERE ADDRNUMBER = IN_TAB-VALUE.
        IF SY-SUBRC = 0.
          LOOP AT OUT_TAB.
            CLEAR L_INDEX1.
            IF OUT_TAB-NAME = 'ADRC-CITY2'.
              L_INDEX1 = SY-TABIX.
              OUT_TAB-VALUE = L_STREET4.
              MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
            ELSE.
              L_INDEX1 = SY-TABIX.
              OUT_TAB-VALUE = L_STREET5.
              MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDSELECT.
    ENDFORM.
    Se71
    /:PERFORM FETCH_VEN_ADD IN PROGRAM YMMR_TDS_LPRG
    /:USING &T001-ADRNR&
    /:CHANGING &ADRC-CITY2&
    /:CHANGING &ADRC-LOCATION&
    /:ENDPERFORM

  • Get current FORM-Routine Name

    Hi,
    during runtime i want to know the current form-routine-name to write it in a variable and put it in an itab. The background-idea is to print out all procedures that have been executed after running the program.
    Any hints, suggestions how to get this done?
    Thanks in advance
    Gunther

    Hi, Gunther,
    The only way to do this is to read the ABAP Call Stack in an internal table.
    Code:
    TYPES: BEGIN OF t_s_abap_callstack,
             mainprogram LIKE sy-repid,
             include LIKE sy-repid,
             line TYPE i,
             eventtype LIKE abdbg-leventtype,
             event LIKE abdbg-levent,
             flag_system,
           END OF t_s_abap_callstack.
    variable for ABAP callstack
    DATA: g_callstack TYPE STANDARD TABLE OF t_s_abap_callstack,
          g_callstack_wa TYPE t_s_abap_callstack.
    call 'ABAP_CALLSTACK' id 'DEPTH' field 99
                            id 'CALLSTACK' field g_callstack.
    g_callstack now contains the program and routine names called, in sequence. 
    Pls be careful in using this C Call; in particular, usage in a Productive environment should only be envisaged with the utmost caution.
    Philippe

Maybe you are looking for