How to import the internal table into subroutine as parameter

how to import the internal table into subroutine as parameter, and its structure can be recognized inside the subroutine

Hi Yong,
try this:
parameters: p_tabnm like dd03l-tabname.
field-symbols: <fs_tabname> type standard table.
data: itab_ref type ref to data.
create data itab_ref type standard table of (p_tabnm)
                     with default key.
assign itab_ref->* to <fs_tabname>.
select * from (p_tabnm) into table <fs_tabname>.
perform subroutine tables <fs_tabname>
                   using p_tabnm.
*&      Form  subroutine
      text
     -->P_<FS_TABNAME>  text
     -->P_P_TABNM  text
form subroutine  tables   p_tabname type standard table
                 using    p_tabnm.
Here p_tabname already has the structure of the table you gave as input
parameter
endform.                    " subroutine

Similar Messages

  • How to copy complete internal table into main dababase table

    please tell me how to copy complete internal table into main dababase table by overwriting all the entries of the main DBtable.

    HI,
    you can use<b> Insert Or  Modify statement ..</b>
    <b>Modify updates the existing record, insert creates a new one. ...</b>
    insert ZDBTAB from table itab.
    Modify ZDBTAB from table Itab.
    The structure of itab should be exactly the same as the z table.
    You should not update standard tables directly though.
    rewards if usefuyl
    regards,
    nazeer

  • How to Read the internal table for the data download from the spool

    HI all,
    I have one issue regarding the spool ,we are getting the correct output as per requirement of  user but when we send the same to the user in pdf format they did notget the same.
    they are telling that the due date is missing from the pdf.
    Please advice me how to track the internal  table for the spool data converted intopdf in a readable format.
    the FM used for the above task is : 
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
    Please reply if any one worked on the same.
    Thanks in advance.
    Gaurav,

    Hi Wang,
    Please let me know how you solved your question.
    Points will be rewarded.
    Thanks,
    Arun.

  • How to pass the internal table data to smartforms

    Hi Gurus,
    I have a problem in passing the internal table data to the smartforms. In the print program
    I get the data into one internal table "LT_PRDLBL1". I am passing this internal table to the other in print program by calling the FM_NAME.
    CALL FUNCTION fm_name
      EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = T_SSFCTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
        OUTPUT_OPTIONS             = T_SSFCOMPOP
        USER_SETTINGS              = ' '
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        LT_PRDLBL                 = LT_PRDLBL1
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    In the print program I had defined the internal tables like
    Data: lt_prdlbl  type standard table of zprdlbl.
    Data: Begin of lt_prdlbl1 occurs 0.
            include structure zprdlbl.
    Data: End of lt_prdlbl1.
    How do I define the internal table in the smartform to get the values printed in the smartform?.
    <REMOVED BY MODERATOR>
    Thanks,
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:01 PM

    Nehal,
    Thanks for quick response.
    In the smartform under the Form Interface->Tables tab
    I had defined
    LT_PRDLBL LIKE ZPRDLBL. If I define TYPE instead of LIKE I get the error message saying "FLAT TYPES may only be referenced using LIKE for table parameters".
    In the main window I have created LOOP, in which I have ticked the internal table and
    LT_PRDLBL INTO LT_PRDLBL. In the text node I am passing the values of this internal table
    &LT_PRDLBL-XXXX&.
    I am able to get the print but the data is not printing.
    Please help me with this.
    Thanks,

  • How to Import customized internal table to smartform from Print Program

    Hi Gurus,
    I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
    With regards,
    S.Saravanan

    There is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
    Regards,
    Raymond

  • Reg: Downloading the internal table into excel file.

    Hi,
    My requirement is i am collecting data in the internal table and i have to download the contents in an excel file and i have declared like this.
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt'.
    I have given the default file path  like this and i am using the function module .
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          FILENAME                      = OUTPUT_PATH
          FILETYPE                      = 'DAT'
    IMPORTING
      FILELENGTH                      =
        TABLES
          DATA_TAB                        = INT_INPUT
      FIELDNAMES                      =
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                        = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                    = 4
         NO_AUTHORITY                    = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                       = 17
         DP_TIMEOUT                      = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                          = 22.
    My requirement is i dont want to change my extension as .txt from .exl to my parameter addition and in the function module the file type should be 'dat' only and in the runtime i want to change the file name which i have given in the .
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt' this file.txt into datas.xls.
    it would be grateful if some one share some valuable views to wards this query
    Thanks and Regards,
    Keny

    Hi,
    Use this code.
    It will ask for the file name...there u can change.
      data : l_filename type string,
             l_filetype type char10,
             l_path type string,
             l_fullpath type string.
      l_filetype = 'DAT'.
    *Get the file name
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          FILE_FILTER          = '*.DAT'
          INITIAL_DIRECTORY    = 'C:\'
        CHANGING
          FILENAME             = l_filename
          PATH                 = l_path
          FULLPATH             = l_fullpath
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_GUI = 3
          others               = 4.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      check l_fullpath is not initial.
    *Download file
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = l_fullpath
          FILETYPE                = l_filetype
        CHANGING
          DATA_TAB                = t_data_sum[]
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          others                  = 24.
      IF sy-subrc NE 0.
        MESSAGE e398(00) WITH sy-subrc ' Error downloading file' '' ''.
      ENDIF.
    Regards
    Sandeep REddy

  • How to consolidate 4 internal table into one

    how can we consolidate data from
    two or more internal tables into one
    please help
    its a bit uegent
    thanks in advance

    Hi,
    If you want to combine two internal table,you can follow 2 approaches.
    Case1: If both the internal table are of same structure,
    append lines of itab1 to itab2.
    The above statement will append all the records in itab1 to itab2.
    Case2:If both the internal table are of differnt structure,
    you need one or more common fields in the two tables to connect.
    loop at itab1.
    move-corresponding itab1 to itab.
    loop at itab2 where f1 = itab1-f1.
    move-corresponding itab2 to itab.
    append itab.
    clear : itab2, itab.
    endloop.
    clear itab1.
    endloop.
    Now itab will hold the entries from itab1 and itab2.

  • How to Pass the Internal table of a report to Smart Form

    Hi Experts,
    I have one report in which from selection screen i am getting the values from the users, and upon that values i am filling data in to the internal table.
    Now i want to pass that internal table data to the smart form
    and print that data in the smart form.
    So could you pls give me some pseudo code or any steps to achieve it.
    Thanks & Regards,
    DS

    Hi DS,
    First of all you need to create a SF and then need to call the FM generated by the FM in your report.
    In the SF in the form interface>tables tab>mention the name of the table and its type structure.
    Pls note that a new structure has to be created as the same type of your internal table which holds the data.
    And the import and export parameters as just the same as in a FM.
    Now after you create and activate your SF a FM will be generated (wen u execute your SF you will be taken to this SE37 screen with the name of FM so no probs..)
    You can call this FM in your report. Hope this helps.
    Ex:
    say itab has your final data, and you also want to export a variable var1 to the SF.
    after your normal report operations end, call the FM and pass on these data.
    say your FM name is FM1.
    call function FM1
    exporting
    var1 = var1
    tables
    itab1 = itab1.
    pls note that in the SF also i gave the same names, it is not mandatory to give the same names.
    and as you want to print a table in the smartforms, you need to create a table in the smart forms and then display the data which is quite simple.
    Hope this helps...
    if you need any further explanations, pls revert...
    Regards,
    Narendra.
    Reward points if helpful!!!

  • How to pass the internal table defined in program to ALV

    Hi Friends,
    I have a doubt regaring the ALV's,
    How can we pass the internal table defined in the program to ALV by not filling the attribute (I_STRUCTURE_NAME) in the REUSE_ALV_LIST_DISPLAY.
    I have tried many ways but unable to pass the structure of the internal table. I am getting the error message "Field Catalog Not Specified......" and its terminating and when i am giving the I_STRUCTURE_NAME = 'INTERNAL-TABLE-NAME' then its displaying a blank screen with all the tool-bars and icons...(No output of internal table data is seen on the screen) .
    and when i am passing the DDIC table or structure ( for eg. LFA1) to I_STRUCTURE_NAME then its displaying with any error.
    Plaese help in resolving this problem....
    Regards
    Pradeep Goli

    Hi,
    Check this thread which gives example of ALV. This will give you an idea.
    Interactive ALV
    ashish

  • How to Pass the internal table data?

    DearAll,
    How to pass the Data of one internal table on a 1.html page to another html page for output, in BSP Application.
    regards.

    Hi ,
    In the onInputProcessing event of the first page , write the following code...
    call method NAVIGATION->SET_PARAMETER exporting
        name = 'it_filt_cur'
        value = it_filt_cur.
    Here it_filt_cur is internal table.
              NAVIGATION->GOTO_PAGE('next.htm').
    In the next page , you can make the internal table as auto in the attributes.
    Since you have made the itab as auto transfer , you can directly access the itab in the initialization event of the next page if it is stateless.
    Regards,
    Laxman Nayak.
    Message was edited by: Laxman  Nayak

  • How to pass a internal table into Java Bean

    Hi Experts,
    I created a JSPDyn page to display Sales orders form R/3 using bapi_sales_order_getlist.
    I used JCO to establish connectivity between JSP Dynpage and R/3. I executed the bapi successfully, i want to move the sales orders retrieved from the Bapi to a Java Bean. So that i can use the bean to populate the value as a table.
    with regards,
    James.
    Valuable answers will be rewarded.....

    Hi Bala,
    If you want to pass this internal table between different methods of the same view then write the contents of this internal table to a context node of your view using BIND_TABLE. You can then read the contents of this internal table from the other method using the reference of that node & the GET_STATIC_ATTRIBUTES_TABLE method.
    However if you want to pass the internal table between methods of different views then create a context node at the COMPONENTCONTROLLER level & then do a context mapping of this node to your local views context in both your views. You can follow the same BIND_TABLE & GET_STATIC_ATTRIBUTES_TABLE methods approach.
    Regards,
    Uday

  • How to structure the internal table issue I want to download to excel

    Hi ,
    I am trying to download the data from the internal table whose structure was
    i HAVE ONE INTERNAL TABLE WHICH IS
    123 ABC MIKE
    123 ABC DALLAS
    123 ABC BOMBAY
    345 BCD MEENAL
    345 BCD SHINDE
    345 BCD UJWALA
    I want the output the i WANT THE INTERNAL TABLE TO STRUCTURE IN THIS WAY
    123 ABC  MIKE
                   DALLAS
                   BOMBAY
    345 BCD  MEENAL
                   SHINDE
                   UJWALA

    U have to fill internal table as ..
    Loop at ITAB. <-- contains all the values
      at new field2.
        itab1 = itab.
        append itab1.
        clear itab1.
        continue.
      endat.
      clear : itab-field1 , itab-field2.
      itab1 = itab.
      append itab1.
      clear itab1.
    endloop.
    Now download ITAB1.

  • Export and import the internal table

    Hi,
    Could you explain the total internal table data how we export and import please give me example.
    Thanks,
    Hari

    Hi,
    Check this thread..
    exporting internal table to memory variable

  • How to print the internal tables in grid format

    i have an internal table with 3 fields
    ITAB1
    1   a
    2   b
    3   c
    I want to print this in the gird like
    1   2   3
    a   b   c
    Can any one help me how to do it
    Thank you

    DATA: BEGIN OF S_STRUC,
    KEY1,
    KEY2,
    KEY3,
    KEY4,
    FIRST TYPE CHAR10 VALUE 'FIRST',
    SECOND TYPE CHAR10 VALUE 'SECOND',
    THRIRD TYPE CHAR10 VALUE 'THIRD',
    END OF S_STRUC.
    DATA: ITAB LIKE S_STRUC OCCURS 0 WITH HEADER LINE.
    DATA: V_INT TYPE INT4.
    FIELD-SYMBOLS: <FS>, <FS1>.
    DO 3 TIMES.
    V_INT = SY-INDEX + 4.
    ITAB-KEY1 = 'A'.
    ITAB-KEY2 = 'B'.
    ITAB-KEY3 = 'C'.
    ITAB-KEY4 = 'D'.
    ASSIGN COMPONENT V_INT OF STRUCTURE S_STRUC TO <FS>.
    ASSIGN COMPONENT V_INT OF STRUCTURE ITAB TO <FS1>.
    <FS1> = <FS>.
    APPEND ITAB.
    ENDDO.
    LOOP AT ITAB.
    WRITE: / ITAB.
    ENDLOOP.
    Regards
    vasu

  • How to Convert an internal table into Text File

    Hello friends,
    Can you help me to find out the way to convert an internal table data into a flat file.
    the problem is that my internal table contains fields with data type INT also.

    please  go through the code and the parameter passed to the  finction module  ... since  you didn't show your coding  i am giving you the sample code  also ..
    REPORT y_ss_test_ekko .
    * To hold selection data
    DATA: i_ekko TYPE STANDARD TABLE OF ekko.
    * To hold converted text data
    DATA: i_text(4096) TYPE c OCCURS 0.
    * Selection Screen
    PARAMETERS: p_ebeln LIKE ekko-ebeln.
    * Select data into an ITAB based on the selection Criteria
    SELECT * FROM  ekko
             INTO  TABLE i_ekko
             WHERE ebeln = p_ebeln.
    * Process further only if found some data
    IF NOT i_ekko[] IS INITIAL.
    * Convert data in internal table to a delimited text data
      CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
           EXPORTING
                i_field_seperator    = '|'
           TABLES
                i_tab_sap_data       = i_ekko
           CHANGING
                i_tab_converted_data = i_text
           EXCEPTIONS
                conversion_failed    = 1
                OTHERS               = 2.
      IF sy-subrc <> 0.
        WRITE: / 'Program failed to Convert data.'.
      ELSE.
    *   Download convert data to Presentation Server
        CALL FUNCTION 'DOWNLOAD'
             TABLES
                  data_tab = i_text
             EXCEPTIONS
                  OTHERS   = 8.
        IF sy-subrc <> 0.
          WRITE: / 'Program failed to download data.'.
        ENDIF.
      ENDIF.
    ENDIF.
    reward  points  if it is  usefull   ....
    Girish

Maybe you are looking for

  • I bought films for my kids on itunes in my itunes account and want to put them onto my wifes itunes account, how do I do this?

    I purchased disney films for my kids to watch when we go away on holidays.We have two iPads in our house, mine and my wifes, both on two different itunes accounts, how do I add the films I just purchased onto my wifes itunes account so the kids can v

  • Error in a book ?

    Hi. I have a book from Wrox called "Beginning Java Databases". In it is a MVC example using an EJB with the following interface: import org.w3c.dom.*; public interface MVCObject extends EJBObject {     public Document retrieve (HttpServletRequest _re

  • How to create a background job in CE and assign a Web Service to it?

    Hi, We have a specific requirement here. We have an application service which perform some updates based on timestamp etc, it will be exposed as a Web Service. The requirement here is that a background job should invoke this Web Service everyday at M

  • Use old domain controller AD user profile with new domain (profile changed)

    Dear All, I have built Win Server 2012 for Domain migration from Windows Server 2003 to Windows Server 2012. I have tested all thing on VMware including user creation and tested Domain join using power shell for Win 7 and .VBs batch file for Win XP c

  • Name changes

    Someone asked me what will happen if someone marries, gets divorced and/or remarries. What name do you choose? I suggested that you could use "aka" for also known as, but that gets cumbersome. Maybe go by the first name? But what if there are several