Report output into internal table and going ahead

Hi Folks,
We have a report MB51.It is showing some details.Now along with these details I wanna fetch some more detail and show it in the same report.
One way is I can copy this into Z and then go ahead with the changes.But I would like to know can we SUBMIT MB51  program in my ZPROGRAM and then get the output into an internal table and then again populate this internal table with the rest of the data and again display it as final output.
To be precise,is it possible to get the final output of MB51 into an internal table by using submit.
K.Kiran.

dear kian
pls check the below code for example:
DATA LIST_TAB TYPE TABLE OF ABAPLIST.
DATA: BEGIN OF olist OCCURS 0,
        filler1(1500)   TYPE c,
      END OF olist.
SUBMIT YTEST04 WITH MATNR EQ 't000001'
                 EXPORTING LIST TO MEMORY
                 AND RETURN.
BREAK-POINT.
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.
ENDIF.

Similar Messages

  • Save report painter output into internal table

    Hi,
      i have created a report painter for vendor aging report. got output in drill down format.
    i need to show the data in smartform as well. so need to save the report painter output into an internal table. can anyone please help me resolving this.
    regards,
    sudha.m

    Hi Sudha
    You can use sample below:
    DATA: list_tab TYPE TABLE OF ABAPLIST.
    SUBMIT NROWS EXPORTING LIST TO MEMORY
                  AND RETURN VIA SELECTION-SCREEN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Best regards

  • Bi report output into a table

    is there any way I can dump a report output ina table using bi-publisher?

    The previous solution is probably more suitable, but you could also write a web service call, get the XML or CSV parse it and write it to a data base. That would work if you can't write a PL/SQL package in the database.

  • Retrieve Filtered ALV output into Internal Table in Program

    Guys,
    I want to update my internal table with the filtered output that the user has selected in the output.
    Lets say my internal table had 6 entries which was outputted.
    Now the the user filters that output ( say where material is initial ) so that there are only 2 entries left on the output.
    How can i know which 2 entries are left on the output screen ?
    ( i need to know as i am deleting entries from a table )
    I came across this slis_filter_alv0 but could not use it in my user exit command routine.
    Any ideas would be very helpful.
    Cheers.....

    Try the method get_filtered_entries
    This method teturns a table with all indexes that are currently hidden on the screen using the standard "filter" function.
    CALL METHOD
    <ref.var. to CL_GUI_ALV_GRID>->get_filtered_entries
       IMPORTING
          ET_FILTERED_ENTRIES  = <int tbl of type LVC_T_FIDX >.
    Then by using this internal table you can find out the entries which are shown in the output.
    Hope this helps.
    Thanks,
    Balaji

  • REPORT OUTPUT to Internal table

    Hi,
    I order to achieve my requirement i need to know if this can happen:
    Q: I want to write a report REP1 (which has ITAB1) in which I want to run an already existing report REP2 and direct the result of the REP2 to ITAB1. So that upon this ITAB1 contents i will again perform some queries.
    Is this possible? If YES can anyone please let me know how?
    Thanks in advance,
    Karuna.

    Hi,
    Try using the command
    SUBMIT report_name AND RETURN EXPORTING LIST TO MEMORY.
    This will call the report and store the output of called report in momory. Then you can retrieve it in your main program by FM 'LIST_FROM_MEMORY'.
    See Below Sample Code.
    Hope it Helps. Reward points if useful.
        SUBMIT zefl_soff_update_single
                           WITH so_objid IN fin_tran
                          AND RETURN
                          EXPORTING LIST TO MEMORY.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = t_list
          EXCEPTIONS
            not_found  = 1.
        REFRESH t_ascii.
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listasci           = t_ascii " list converted to ASCII
            listobject         = t_list
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
    Regards,
    Shailesh Jadhav

  • How to store output of SQ01 into internal table.

    Hello Experts
    How to store output of SQ01 into internal table.
    Thanks,
    Umesh

    You can't store the sq01 output into internal table.
    Once you create the query it will generate the abap program, in that program you can see the contents.
    Regards
    Sasi

  • Issue with uploading XML file from application server into internal table

    i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module   SMUM_XML_PARSE and the error message is "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?  
        TYPES: BEGIN OF T_XML,
                 raw(2000) TYPE C,
               END OF T_XML.
    DATA:GW_XML_TAB TYPE  T_XML.
    DATA:  GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
    DATA:GI_STR TYPE STRING.
    data:  GV_XML_STRING TYPE XSTRING.
    DATA: GI_XML_DATA TYPE  TABLE OF SMUM_XMLTB INITIAL SIZE 0.
    data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
        OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          MESSAGE 'File does not exist' TYPE 'E'.
        ELSE.
          DO.
    * Transfer the contents from the file to the work area of the internal table
            READ DATASET LV_FILE1 INTO GW_XML_TAB.
            IF SY-SUBRC EQ 0.
              CONDENSE GW_XML_TAB.
    *       Append the contents of the work area to the internal table
              APPEND GW_XML_TAB TO GI_XML_TAB.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ENDIF.
    * Close the file after reading the data
        CLOSE DATASET LV_FILE1.
        IF NOT GI_XML_TAB IS INITIAL.
          CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
        ENDIF.
    * The function module is used to convert string to xstring
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            TEXT   = GI_STR
          IMPORTING
            BUFFER = GV_XML_STRING
          EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
        IF SY-SUBRC <> 0.
          MESSAGE 'Error in the XML file' TYPE 'E'.
        ENDIF.
      ENDIF.
      IF GV_SUBRC = 0.
    * Convert XML to internal table
        CALL FUNCTION 'SMUM_XML_PARSE'
          EXPORTING
            XML_INPUT = GV_XML_STRING
          TABLES
            XML_TABLE = GI_XML_DATA
            RETURN    = GI_RETURN.
      ENDIF.
      READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
      IF SY-SUBRC EQ 0.
        MESSAGE 'Error converting the input XML file' TYPE 'E'.
      ELSE.
        DELETE GI_XML_DATA WHERE TYPE <> 'V'.
        REFRESH GI_RETURN.
      ENDIF.

    Could you please tel me  why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
    Becuase there will be lot of  XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
    what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?>   ??????
    Is there any other way we can do with out removing the lines?

  • Read DMS document into internal table

    Hi,
    I have a requirement to read DMS document in binary format into internal table.
    and i want to print the data in internal table through SAP spool.
    Please let me know how to handle this requirement.
    Thanks
    Srini

    Hi,
    Check scms pakage, FG - SCMS_CONV for conversions..
    Regards
    Surjit

  • How to caputre report output into an internal table?

    Hi,
    Is there a way to capture report output into one internal table?
    Regards,
    Amruth

    Hi Amruth,
    Use SUBMIT.. EXPORTING LIST TO MEMORY.
    It saves  the output of a report into memory. Use the function modules LIST_FROM_MEMORY. WRITE_LIST & DISPLAY_LIST to retrieve the data.
    All these function modules belongs to function group 'SLST'.
    However the submit does not display hte output list of the called report, but saves it in ABAP memory & leaves the called report immediately. Since the calling program can read the list from memory & process it furthe, you need to use the addition ..AND RETURN.
    Regards,
    Chandru

  • Get ALV Report's Result Into Internal Table

    Hello everyone,
    is there a way to get a alv reports result into an internal table?
    For example: is it possible to get the values from transaction S_ALR_87012078.
    I mean i want to write a function an it will give you the alv reports result as internal table, so  you won't have to dig the reports code in.
    thanks to any answers from now. bye.

    Hi
    This is a wrapper program which will execute the standard program and capture the output as we are using list to memory
    Then after we will be using LIST_FROM_MEMORY and 'LIST_TO_ASCI'
    submit rhrhaz00 exporting list to memory
    and return
    with pchplvar = pchplvar
    with pchotype = pchotype
    with pchobjid in pchobjid
    with pchsobid in pchsobid
    with pchseark = pchseark
    with pchostat = pchostat
    with pchistat = pchistat
    with pchztr_d = pchztr_d
    with pchztr_a = pchztr_a
    with pchztr_z = pchztr_z
    with pchztr_m = pchztr_m
    with pchztr_p = pchztr_p
    with pchztr_y = pchztr_y
    with pchztr_f = pchztr_f
    with pchobeg = pchobeg
    with pchoend = pchoend
    with pchtimed = pchtimed
    with pchbegda = pchbegda
    with pchendda = pchendda
    * with pchwegid = pchwegid
    * with pchsvect = pchsvect
    * with pchdepth = pchdepth
    with infty in infty
    with subty in subty
    with vdata = vdata
    with info = info.
    data: list like abaplist occurs 0 with header line.
    data: txtlines(1024) type c occurs 0 with header line.
    clear list.
    refresh list.
    clear tbl_reportlines.
    refresh tbl_reportlines.
    call function 'LIST_FROM_MEMORY'
    tables
    listobject = list
    exceptions
    not_found = 1
    others = 2.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    call function 'LIST_TO_ASCI'
    * EXPORTING
    * LIST_INDEX = -1
    * WITH_LINE_BREAK = ' '
    * IMPORTING
    * LIST_STRING_ASCII =
    * LIST_DYN_ASCII =
    tables
    listasci = txtlines
    listobject = list
    exceptions
    empty_list = 1
    list_index_invalid = 2
    others = 3
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    tbl_reportlines[] = txtlines[].
    call function 'LIST_FREE_MEMORY'.
    endif.
    Here is the simple example program
    *Example Code (Retrieving list from memory)
    DATA BEGIN OF itab_list OCCURS 0.
    INCLUDE STRUCTURE abaplist.
    DATA END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
    filler1(01) TYPE c,
    field1(06) TYPE c,
    filler(08) TYPE c,
    field2(10) TYPE c,
    filler3(01) TYPE c,
    field3(10) TYPE c,
    filler4(01) TYPE c,
    field4(3) TYPE c,
    filler5(02) TYPE c,
    field5(15) TYPE c,
    filler6(02) TYPE c,
    field6(30) TYPE c,
    filler7(43) TYPE c,
    field7(10) TYPE c,
    END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = itab_list
    EXCEPTIONS
    not_found = 4
    OTHERS = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
    list_index = -1
    TABLES
    listasci = vlist
    listobject = itab_list
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    IF sy-subrc NE '0'.
    WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.
    Re: alv to internal table

  • Read Application server file and upload into internal table

    Another help needed guys,
    My file in the application server is of format
    Name       Marks 1    Marks  2       Marks 3............
    A                10             15               20
    The only thing separating the columns is space.
    Actually this file was downloaded from an internal table into the app server.
    Now I want to load it back into the internal table.
    How do I load this into internal table so that each column goes in separate internal table field.
    Currently am using cl_abap_char_utilities=>HORIZONTAL_TAB but I can get only the first column name in my field1 of the internal table.
    How should I applroach this?
    Points will be awarded for useful answers.
    Regards
    Ankit

    Hi ankit,
    i think u have uploaded the tab delimited file in the application sever.
    then suppose see if u r file is in the format of name#marks1#marks2#marks3.
    then in the program u do like this..
    first declare one internal table with one filed.
    data:
      c_hextab(1)      TYPE x VALUE '09'.
    data:
      begin of t_data occurs 0,
          line(256) type c,
      endof t_data.
    and declare one more intternal table
    data:
    begin of  t_itab occurs 0,
      name(15)    type c,
      marks1(4)   type c,
      marks2(4)   type c,
      marks3(4)   type c,
    endof t_itab.
    then
    open the file with
    OPEN DATASET p_file FOR INPUT IN TEXT MODE.
    then  between do and endo do like this..
    DO.
    clear t_data.
    READ DATASET p_file INTO t_data.
    if sy-subrc ne 0.
      exit.
    else.
    split t_data at c_hextab
          into t_itab-name
                t_itab-marks1
    t_itab-marks2
    t_itab-marks3.
    append t_itab.
    endif.
    enddo.
    i think it will be helpful to u
    Please let me know wht type of file has been uploaded into application server.(tab deleimted, comma separated or something else).
    Regards,
    Sunil Kumar Mutyala.

  • How to join  fields from different internal tables and display into one int

    hai i have one doubt...
    how to join  fields from different internal tables and display into one internal table..
    if anybody know the ans for this qus tell me......

    hii
    you can read data as per condition and then can join in one internal table using READ and APPEND statement..refer to following code.
    SELECT bwkey                         " Valuation Area
             bukrs                         " Company Code
        FROM t001k
        INTO TABLE i_t001k
       WHERE bukrs IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT bwkey                       " Valuation Area
               werks                       " Plant
          FROM t001w
          INTO TABLE i_t001w
           FOR ALL ENTRIES IN i_t001k
         WHERE bwkey = i_t001k-bwkey
           AND werks IN s_werks.
        IF sy-subrc EQ 0.
          LOOP AT i_output INTO wa_output.
            READ TABLE i_t001w INTO wa_t001w WITH KEY werks = wa_output-werks.
            READ TABLE i_t001k INTO wa_t001k WITH KEY bwkey = wa_t001w-bwkey.
            wa_output-bukrs = wa_t001k-bukrs.
            MODIFY i_output FROM wa_output.
            CLEAR wa_output.
          ENDLOOP.                         " LOOP AT i_output
        ENDIF.                             " IF sy-subrc EQ 0
    regards
    twinkal

  • Upload excel data into Internal table

    Hi,
    I'm trying to upload excel data into internal table, well the excel file layout will be different on each run of the report.
    Excel file will have 60 columns and 500 record limit. I can upload the excel data using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'KCD_EXCEL_OLE_TO_INT_CONVERT' but the output table is generates 60 lines for each record i.e.., 60 * 500 = 30,000 which could cause performance.
    I try with the FM 'TEXT_CONVERT_XLS_TO_SAP', but this will only work if the file structure is static. It didn't work for dynamic file layout. Even GUI_UPLOAD doesn't work to upload excel file, it will work if I convert the file to Tab delimited file.
    Please advise if you know any alternate procedure to upload excel data into internal table.
    Thanks,
    Kumar.

    Moderator message - Cross post locked
    Rob

  • Read info about files in specific folder into internal table

    Hi Experts
    I need to have last modified date and filename information read into an internal table. I need to read in the information of all files in a specific (UNIX) folder (I do not know the name of the single files).
    I really hope someone can help.
    Thanks a lot
    Kind regards,
    Torben

    Hi Guys
    Thanks a lot for you input.
    I managed to get my program to works as follows:
    REPORT  ZDELETE_ARCHIVING_FILES.
    *Step 1: Get the list of files in the directory into internal table :
    DATA: DLIST    LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
          DPATH    LIKE EPSF-EPSDIRNAM,
          MDATE    LIKE SY-DATUM,
          MTIME    LIKE SY-UZEIT.
    DATA: BEGIN OF FATTR OCCURS 0,
              FILE_NAME  LIKE EPSF-EPSFILNAM,
              FILE_SIZE  LIKE EPSF-EPSFILSIZ,
              FILE_OWNER LIKE EPSF-EPSFILOWN,
              FILE_MODE  LIKE EPSF-EPSFILMOD,
              FILE_TYPE  LIKE EPSF-EPSFILTYP,
              FILE_MTIME(12),
          END OF FATTR.
    DATA: P_PATH(50) TYPE C.
    CONCATENATE '/ARCHIVE/' sy-sysid '/archive' INTO P_PATH.
    *        WRITE: / P_PATH.
    DPATH = P_PATH.
    *Get files in folder - read into internal table DLIST
    *if filenames are longer than 40 characters
    *then use FM SUBST_GET_FILE_LIST.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
         EXPORTING
              DIR_NAME               = DPATH
         TABLES
              DIR_LIST               = DLIST
         EXCEPTIONS
              INVALID_EPS_SUBDIR     = 1
              SAPGPARAM_FAILED       = 2
              BUILD_DIRECTORY_FAILED = 3
              NO_AUTHORIZATION       = 4
              READ_DIRECTORY_FAILED  = 5
              TOO_MANY_READ_ERRORS   = 6
              EMPTY_DIRECTORY_LIST   = 7
              OTHERS                 = 8.
    IF SY-SUBRC EQ 0.
    *Step 2: Read the file attributes into an internal table
    *Read info about the files (attributes) into the internal table FATTR
    *as we need info about the last time it was changed (MTIME)
      LOOP AT DLIST.
        CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
             EXPORTING
                  FILE_NAME              = DLIST-NAME
                  DIR_NAME               = DPATH
             IMPORTING
                  FILE_SIZE              = FATTR-FILE_SIZE
                  FILE_OWNER             = FATTR-FILE_OWNER
                  FILE_MODE              = FATTR-FILE_MODE
                  FILE_TYPE              = FATTR-FILE_TYPE
                  FILE_MTIME             = FATTR-FILE_MTIME
             EXCEPTIONS
                  READ_DIRECTORY_FAILED  = 1
                  READ_ATTRIBUTES_FAILED = 2
                  OTHERS                 = 3.
        IF SY-SUBRC EQ 0.
          FATTR-FILE_NAME = DLIST-NAME.
          APPEND FATTR.
        ENDIF.
      ENDLOOP.
      SORT FATTR BY FILE_NAME.
      DATA: time(10), date LIKE sy-datum.
      DATA: months TYPE i.
      DATA: e_file TYPE string.
      LOOP AT FATTR.
      CLEAR: time, months, e_file.
        IF FATTR-FILE_NAME(10) = 'archive_BW'.
    *Convert the unix time into readable time
          PERFORM p6_to_date_time_tz(rstr0400) USING FATTR-FILE_MTIME
                                                     time
                                                     date.
    *Calculate the number of months between date (MTIME) and current day
    *ex 31.03.2009 - 01.04.2009 = 1 month
    *ex 01.02.2009 - 01.04.2009 = 2 month
        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
          EXPORTING
            i_datum_von = date
            i_datum_bis = sy-datum
          IMPORTING
            e_monate = months.
            CONCATENATE DPATH '/' FATTR-FILE_NAME INTO e_file.
    *        WRITE: / FATTR-FILE_NAME,
    *                 FATTR-FILE_SIZE,
    *                 date,
    *                 time,
    *                 sy-datum,
    *                 months,
    *                 e_file.
    *Step 3: Delete files where months > 1
          IF months > 1.
            OPEN dataset e_file for output in text mode encoding default.
            DELETE dataset e_file.
            CLOSE dataset e_file.
          ENDIF. "months > 1
        ENDIF.
      ENDLOOP.
    ENDIF.

  • Merging the internal table and structure for PO text material download

    Hi Experts,
       I have a query regarding downloading the PO text from material master.Actually i have successfully downloaded the PO text using TLINE structure along with FM like READ_TEXT and GUI_Download.But when i had to append the PO text for corresponding material,there i got the problem.Let me explain clearly.Below is my coding for PO text download.In that i have used TLINE structure/table for get the POtext via FM READ_TEXT.Also I am using an internal table(It_tab) which consist fields of TDFORMAT,TDLINE and MATNR,So what i need is,i want to merge TLINES structure/table into internal table(it_tab).That is I want to display the PO text along with material No.That is my requirement.But when i append the it_tab using my coding,it was not displaying in the correct order.Attached screen shot is the sample output(excel sheet).column B and C respectively for POtext and material number.I want to get in correct order as it gets the misarrangemnt.(i.e) PO text and material number should come with the same line.So Please help me to complete this task.Kindly point out if i am wrong.
    PO TEXT download from material master :
    DATA :  BEGIN of IT_LINES OCCURS 0.
                INCLUDE STRUCTURE TLINE.
    DATA : END of IT_LINES.
    DATA : t_line TYPE STANDARD TABLE OF IT_LINES WITH HEADER LINE.
    TYPES: BEGIN OF tp_matnr,
            matnr type TDOBNAME,
            END OF tp_matnr.
          DATA:lv_matnr TYPE matnr,
           t_mara TYPE TABLE OF tp_matnr WITH HEADER LINE.
    SELECT-OPTIONS : s_matnr FOR lv_matnr.
    SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TL1.
    PARAMETERS: P_FILE(50) TYPE C.
    *PARAMETERS: P_DOWNL as CHECKBOX.
    SELECTION-SCREEN END OF BLOCK BL1.
    INITIALIZATION.
    TL1 = 'PO TEXT DOWNLOAD'.
    START-OF-SELECTION.
    SELECT matnr FROM mara INTO TABLE t_mara WHERE matnr IN s_matnr.
    DATA : BEGIN OF it_tab OCCURS 0,
             TDFORMAT type TDFORMAT,
             TDLINE type TDLINE,
             MATNR type TDOBNAME,
             END OF it_tab.
    LOOP AT t_mara.
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    *   CLIENT                        = SY-MANDT
        id                            = 'BEST'
        language                      = 'E'
        name                          = t_mara-matnr
        OBJECT                        = 'MATERIAL'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        =
    *   OLD_LINE_COUNTER              =
       TABLES
        lines                         = t_line
    * EXCEPTIONS
    *   ID                            = 1
    *   LANGUAGE                      = 2
    *   NAME                          = 3
    *   NOT_FOUND                     = 4
    *   OBJECT                        = 5
    *   REFERENCE_CHECK               = 6
    *   WRONG_ACCESS_TO_ARCHIVE       = 7
    *   OTHERS                        = 8
    IF sy-subrc = 0.
         APPEND LINES OF t_line to it_tab.
         it_tab-tdline = t_line-tdline.                                           
         it_tab-matnr = t_mara-matnr.
         APPEND it_tab.
      ENDIF.
      ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'D:\Test.xls'
    FILETYPE = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    SHOW_TRANSFER_STATUS = 'X'
    TABLES
    DATA_TAB = it_tab

    Hi Manish,
      Thanks for the support.I did simple modify in coding.Now I got the output in the correct order.If i follow the step of it_tab-tdline = t_mara-matnr, it is storing in the column B as you mentioned.But it was displayed in the second line.So i did adjust your below coding.Finally got the solution.Thanks manish
    DATA wa_line LIKE LINE OF t_line.
    LOOP AT t_line INTO wa_line.
      it_tab-tdformat = wa_line-tdformat.
      it_tab-tdline = wa_line-tdline.
      it_tab-matnr = IT_TAB-matnr.
      APPEND it_tab.
    ENDLOOP.
    Regards,
    Kavi

Maybe you are looking for