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

Similar Messages

  • How to disply internal table with grid format .

    HI ,
    how to disply internal table with grid format .
    Regards
    venkat

    Grid format can be disaplyed using two ways,
    1. Using reuse_alv_grid_display
    2. using object oriented ABAP with the methos set_table_for_first_display.
    For example program search in where used list for standard SAP programs.
    If this is not the answer then please explain your issue in detail
    Thanks,
    Rama Krishna

  • 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

  • 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 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 display the Internal table records in table format?

    Hi Gurus,
    I want to display my print prg internal table records in d appropriate form in a table format, give some solution
    with regards
    Thambe

    There are lot many options to do that
    one way is create template  in the maikn window  and define the line types according to your data  cretae text and put your data in the text and go to output options and give  the line type to be used . You can also select details option to have lines in your output.
    similarly YOU CAN CREATE TABLE IN THE MAIN WINDOW FOR THIS YOU DONT NEED TO DEFINE THE LINE TYPES .
    WHEN YOU ARE IN MAIN WINDOW RIGHT CLICK ON TABLE AND GO TO PATH
    CREATE  -> TABLE
                  -> TEMPLATE
    REWARD IF USEFUL
    Regards,
    Nageswar

  • 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.

  • How to know the internal table's last record

    Dear friends,
    Just I want to know my internal table last records, Ex:
    I am having the records in my internal table like this:
    Itab-col1
    1
    2
    3
    4
    5
    6
    7
    8
    9
    I want to know and print the last record, it maybe n number of records in my itab.
    If I used at last within a loop but it dosn't work its taking the all *** in header.
    How to know which is the last record in my internal table.
    Thanks,
    Sridhar.

    hi,
    sridher reddy
    1st describe ur table i.e read the number of entries in the table .....
    data : count type i.
    DESCRIBE TABLE <table name > LINES count.
    READ TABLE <table name > INDEX count.
    write : <table name>-<fieldname>.......... .
    by this way u can print the last record of your table

  • How to use the internal table of the submitted program

    Hi,
    In the main program i have submitted a program and that program is running  successfully and data is populated in to it_final, now i want to use this data populated internal table it_final in my main program.
    Thanks,
    Sudhakar.

    Hi,Mathew,
    *& Report  ZMB51                                                       *
    REPORT  ZMB51                                   .
    DATA LIST_TAB TYPE TABLE OF ABAPLIST.
    DATA: BEGIN OF olist OCCURS 0,
            filler1(1500)   TYPE c,
          END OF olist.
    submit <b>RM07DOCS</b> EXPORTING LIST TO MEMORY
                     AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        LISTOBJECT = LIST_TAB
      EXCEPTIONS
        NOT_FOUND  = 1
        OTHERS     = 2.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX         = -1
        TABLES
          LISTASCI           = oLIST
          LISTOBJECT         = LIST_TAB
        EXCEPTIONS
          EMPTY_LIST         = 1
          LIST_INDEX_INVALID = 2
          OTHERS             = 3.
    BREAK-POINT.
    write:/ sy-subrc.
    ENDIF.
    OLIST will contain the report output that you have executed but you need to tweak this internal table so that it can be used for further processing.The current example will get you MB51 output into OLIST,so change the program name to your program name at the SUBMIT statement and then try.
    K.Kiran.

  • How to print the data in ALV list  format using an existing layout

    Hi all
    Iam displaying the output in ALV list format and I saved the layout with some name
    now my requirement is i have to provide a field to select the layout name with F4 help and if i execute the program it should show the output with that layout format
    I tried this iam getting F4 help for that layout and selecting the layout but iam not getting the output with that layout iam getting the normal basic layout
    Can anyone send me a sample program code or what to do to get that
    Thank you

    Hi,
    refer this code.
    DATA : wa_variant  TYPE disvariant,       "Work area for variant
           wa_variant1 TYPE disvariant,       "Work area for variant
           wa_layout   TYPE slis_layout_alv,  "Work area for layout
    *&      Form  sub_get_default_variant                                  *
    This form will initialize the variant                               *
    FORM sub_get_default_variant .
    *--Clear
      CLEAR wa_variant.
    *--Pass the report name
      v_repid = sy-repid.                     "Report ID
      wa_variant-report = v_repid.
    *--Call the function module to get the default variant
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = c_save
        CHANGING
          cs_variant    = wa_variant1
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
    *--Check Subrc
      IF sy-subrc = 0.
        p_varnt = wa_variant-variant.
      ENDIF.
    ENDFORM.                                  "sub_get_default_variant
    *&      Form  sub_f4_for_variant                                       *
    This form will display the List of Variants                         *
    FORM sub_f4_for_variant .
    *--Local Variables
      DATA: lv_exit(1) TYPE c.                "ALV exit
    *--Call the function module to display the list of Variants
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = wa_variant
          i_save        = c_save
        IMPORTING
          e_exit        = lv_exit
          es_variant    = wa_variant1
        EXCEPTIONS
          not_found     = 1
          program_error = 2.
    *--Check Subrc
      IF sy-subrc <> 2 AND lv_exit IS INITIAL.
        p_varnt = wa_variant1-variant.
      ENDIF.
    ENDFORM.                                  "sub_f4_for_variant
    *&      Form  sub_check_variant                                        *
    This form will check the variant                                    *
    FORM sub_check_variant .
      IF NOT p_varnt IS INITIAL.
        CLEAR wa_variant1.
        MOVE wa_variant TO wa_variant1.
        MOVE p_varnt TO wa_variant1-variant.
    *--Call the function module to check the variant exist
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = c_save
          CHANGING
            cs_variant = wa_variant1.
        wa_variant = wa_variant1.
      ENDIF.
    ENDFORM.                                  "sub_check_variant
    Regards,
    Prashant

  • How to export internal table and pass the internal table to another screen?

    Hi,
    I have a sql SELECT statement that select data from table into internal table. I would like to export out the internal table and pass to another screen and display the data in ALV list. How to export it out? I try but the error given was " The type of "OUT_SELECT_ITAB" cannot be converted to the type of  "itab_result".
    Another question is, how to pass the internal table that i export out from the function module to another screen?
    Here is the code
    ==============================================================
    FUNCTION ZNEW_SELECT_ZSTUD00.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IN_SELECT_YEAR) TYPE  ZSTUD00-EYEAR
    *"  EXPORTING
    *"     REFERENCE(OUT_RESULT) TYPE  CHAR9
    *"     REFERENCE(OUT_SELECT_ITAB) TYPE  ZSTUD00
    *& Global Declarations
    DATA: itab TYPE ZSTUD00,
          itab_result TYPE TABLE OF ZSTUD00.
    *& Processing Blocks called by the Runtime Environment
    itab-eyear = IN_SELECT_YEAR.
    SELECT *
    FROM ZSTUD00
    INTO TABLE itab_result
    WHERE eyear = IN_SELECT_YEAR.
    IF sy-subrc = 0.
      out_result = 'Success'.
      OUT_SELECT_ITAB = itab_result.
    ELSE.
      out_result = 'Fail'.
    ENDIF.
    ENDFUNCTION.
    ===============================================================
    Please advise. Thanks
    Regards,
    Rayden

    Hi Nagaraj,
    I try to change it in Tables tab page but it state that TABLES parameters are obsolete. when i "Enter". I try to "Enter" again. it seem to be ok but it stil give me the same error.
    ================================================================
    FUNCTION ZNEW_SELECT_ZSTUD00.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IN_SELECT_YEAR) TYPE  ZSTUD00-EYEAR
    *"  EXPORTING
    *"     REFERENCE(OUT_RESULT) TYPE  CHAR9
    *"  TABLES
    *"      OUT_SELECT_ITAB STRUCTURE  ZSTUD00
    *& Global Declarations
    DATA: itab TYPE ZSTUD00,
          itab_result TYPE TABLE OF ZSTUD00.
    *& Processing Blocks called by the Runtime Environment
    itab-eyear = IN_SELECT_YEAR.
    SELECT *
    FROM ZSTUD00
    INTO TABLE itab_result
    WHERE eyear = IN_SELECT_YEAR.
    IF sy-subrc = 0.
      out_result = 'Success'.
      OUT_SELECT_ITAB = itab_result.
    ELSE.
      out_result = 'Fail'.
    ENDIF.
    ENDFUNCTION.
    ===============================================================
    regards,
    Rayden

  • Divide the internal table for months

    How to divide the internal table itab for the months?
    I have a field data in internal table itab and now i have need to divide itab in n table for months.
    The data interval is max 4 months.
    Sorry for my english.
    ex. itab.
    data: begin of itab occurs 0,
                 data LIKE vbak-erdat,
                 num_ord LIKE vbap-vbeln,
                 gruppo LIKE mara-labor,
            end of itab.

    I have solved in this method:
    SORT tab_gia DESCENDING BY data.
      tmp_mese = tab_gia-data+4(2).
      LOOP AT tab_gia.
        IF tmp_mese EQ tab_gia-data+4(2).
          IF flag1 = 'TRUE'.
            MOVE tab_gia-data     TO mese1-data.
            MOVE tab_gia-gruppo   TO mese1-gruppo.
            MOVE tab_gia-tipo     TO mese1-tipo.
            MOVE tab_gia-matnr    TO mese1-matnr.
            MOVE tab_gia-giacenza TO mese1-giacenza.
            APPEND mese1.
          ENDIF.
          IF flag2 EQ 'TRUE'.
            MOVE tab_gia-data     TO mese2-data.
            MOVE tab_gia-gruppo   TO mese2-gruppo.
            MOVE tab_gia-tipo     TO mese2-tipo.
            MOVE tab_gia-matnr    TO mese2-matnr.
            MOVE tab_gia-giacenza TO mese2-giacenza.
            APPEND mese2.
          ENDIF.
          IF flag3 EQ 'TRUE'.
            MOVE tab_gia-data     TO mese3-data.
            MOVE tab_gia-gruppo   TO mese3-gruppo.
            MOVE tab_gia-tipo     TO mese3-tipo.
            MOVE tab_gia-matnr    TO mese3-matnr.
            MOVE tab_gia-giacenza TO mese3-giacenza.
            APPEND mese3.
          ENDIF.
          IF flag4 EQ 'TRUE'.
            MOVE tab_gia-data     TO mese4-data.
            MOVE tab_gia-gruppo   TO mese4-gruppo.
            MOVE tab_gia-tipo     TO mese4-tipo.
            MOVE tab_gia-matnr    TO mese4-matnr.
            MOVE tab_gia-giacenza TO mese4-giacenza.
            APPEND mese4.
          ENDIF.
        ELSE.
    * trovato un altro mese.
          cnt = cnt + 1.
          tmp_mese = tab_gia-data+4(2).
          CASE cnt.
            WHEN 2.
              flag1 = 'FALSE'.
              flag2 = 'TRUE'.
            WHEN 3.
              flag2 = 'FALSE'.
              flag3 = 'TRUE'.
            WHEN 4.
              flag3 = 'FALSE'.
              flag4 = 'TRUE'.
          ENDCASE.
        ENDIF.
      ENDLOOP.
    thanks!!!
    Edited by: Alfonso Manzo on May 28, 2008 1:51 PM
    Edited by: Alfonso Manzo on May 28, 2008 1:52 PM

Maybe you are looking for