Steps for: Internal table - convert to PDF - Sotre PDF files on UNIX Server

Hi Experts,
                  My requirement is to Split an internal table into multiple tables and generate a PDF for each of them.Then I have to place these files on a unix server directory. How can I achieve this?
This seems like a very high level requirement description .Please let me know if the solution needs some more details.
Thanks In Advance
Abhishek
Edited by: Yatin Vishwas Parab on Oct 23, 2009 1:53 PM

Hi,
1) The logic for splitting a internal table into multiple tables should lie with you .
2) write each of the split internal table to spool and convert them to PDF using the FM 'CONVERT_ABAPSPOOLJOB_2_PDF'. This has been discussed many times and you can find relevant threads by searching.
3) For storing the PDF in application server, use OPEN DATASET statement in binary mode and transfer the data. Even this has been discussed quite a few times before and you can search for relevant threads
Vikranth

Similar Messages

  • Maximum record limit for internal table

    hello all,
    can any one tell me what is the maximum limit of internal table. i would like to add all records from bseg to internal table. so i can improve processing time.
    thanks,
    raj

    hi,
    Before Release 4.0A, ABAP stored the content of internal tables in a combination of main memory and file space. This means that the maximum size of all internal tables of all programs running on such an application server at one time is about 2 GB. With Release 4.0A or greater, this size decreases to about 500 MB. (Note that those values aren't fixed, but this is a good guide. This minimum of 500 MB is the lowest limit of the real value, which varies among different operating systems and even among different releases of the same operating system.)
    It may sound strange that a newer release has a higher restriction on capacity. But it's a consequence of the fact that the contents of internal tables move from a reserved file to shared memory. When you process internal tables this way in Release 4.0A or greater, you pay for much better performance with a smaller potential size.
    Regards,
    Sourabh

  • Why using workarea for internal table is better in performance

    Please tell me
    why using workarea for internal table is better in performance

    Hi Vineet ,
      Why would we choose to use an internal table without a header line when it is easier to code one  with a header line?
    it has following reason.
    1)Separate Internal Table Work Area:
         The work area (staging area) defined for the internal table   is not limited to use with just one internal table.
    take ex-
    Suppose you want two internal tables for EMPLOYEE – one to contain all records and one to contain only those records where country = ‘USA’.  You could create both of these internal tables without header lines and use only one work area to load data into both of them. You would append all records from the work area into the first internal table.  You would conditionally append the ‘USA’ records from the same work area into the second internal table.
    2)  Performance Issues:  Using an internal table without a header line is more efficient than one  with a header line
    3) Nested Internal Tables:  If you want to include an internal table within a structure or another   internal table, you must use one without a header line.
    If this one is helpful ,then rewards me
    Regards
    Shambhu

  • System Variable For Internal table count

    Can anybody tell me what the system variable for internal table count?
    I just wants to know how many recoreds are there in my internal table ?
    Regards,
    pandu.

    Hi ,
    DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].
    If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.
    using variable
    SY-TFILL
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM

  • Aggregate functions for internal table.

    Hi Gurus,
    I'm just wondering whether we can use aggregate functions for internal table. I wanted to know the max value for a particular column in my internal table. How can I achieve this easily and quickly.
    Thanks,
    David.

    sort the table on which you want the maximum value and read it. Please find below example code.
    TYPES : BEGIN OF ty_mvke,
            matnr TYPE mvke-matnr,
            vkorg TYPE mvke-vkorg,
            vtweg TYPE mvke-vtweg,
           AUMNG type mvke-AUMNG,
            END OF ty_mvke.
    DATA : wa_mvke TYPE ty_mvke,
           it_mvke TYPE STANDARD TABLE OF ty_mvke.
    data : temp_AUMNG type AUMNG.
    START-OF-SELECTION.
      SELECT matnr vkorg vtweg AUMNG FROM mvke INTO
            table it_mvke.
    sort it_mvke by AUMNG.
    read TABLE it_mvke into wa_mvke INDEX 1.
    if sy-subrc = 0.
    move wa_mvke-AUMNG to temp_AUMNG.
    write : temp_AUMNG.
    endif.
    Thanks,
    Sreekala.

  • Create Spool from Internal table & converrt the spool to PDF

    Hi All,
    My requirement is take data from a table and find amount specific to each Vendors . So I took all the data into ITAB and do all the calculation. Later after calculation I have to create a spool from this ITAB and this spool have to convert to PDF. Later this PDF have to seend via email.
    To convert the internal table to Spool , I used
    LOOP AT t_summ INTO wa_summ.
        w-amount = wa_summ-remittanceamount.
        CONCATENATE wa_summ-vendorcode
                    wa_summ-controlnum
                    w-amount INTO wa_textdata SEPARATED BY space.
        APPEND wa_textdata TO t_textdata.
      ENDLOOP.
      DESCRIBE TABLE t_textdata .
      w-file_length = syst-tfill * 1022.
      l_doctype = 'LIST'.
      l_layout = 'X_POSTSCRIPT'.
      CONCATENATE ' Listbill Summary Report for' syst-datum INTO
                          l_title SEPARATED BY space.
      l_receiver = syst-uname.
    * Create Spool
      CALL FUNCTION 'RSPO_SR_OPEN'
       EXPORTING
          dest                   = 'LOCL'
    *   LDEST                  =
          layout                 = l_layout
          name                   = 'SUMREP'
    *   SUFFIX1                =
    *   SUFFIX2                =
       copies                 = '1'
    *   PRIO                   =
    *      immediate_print        = ' '
    *   AUTO_DELETE            =
          titleline              = l_title
          receiver               = syst-uname           "
    *      division               = l_pri_params-prabt " abteilung
    *      authority              = l_pri_params-prber           "
    *   POSNAME                =
    *   ACTTIME                =
    *   LIFETIME               = '8'
    *   APPEND                 =
    *   COVERPAGE              =
    *   CODEPAGE               =
          doctype                = l_doctype
    *   ARCHMODE               =
    *   ARCHPARAMS             =
    *   TELELAND               =
    *   TELENUM                =
    *   TELENUME               =
         IMPORTING
          handle                 = l_spool_handle
          spoolid                = w-spoolid
    EXCEPTIONS
       device_missing         = 1
       name_twice             = 2
       no_such_device         = 3
       operation_failed       = 4
       OTHERS                 = 5
                .                                            "#EC DOM_EQUAL
      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 'SLVC_C1022_TO_C255'
        EXPORTING
          i_file_length = w-file_length
        TABLES
          it_c1022      = t_textdata
          et_c255       = lt_spool.
      l_length = w-file_length.
      LOOP AT lt_spool INTO ls_spool.
        l_length = l_length - 255.
        IF ( l_length > 0 ).
          l_line_length = 255.
        ELSE.
          l_line_length = l_length + 255.
        ENDIF.
    *   Write contents to spool
        CALL FUNCTION 'RSPO_SR_WRITE'
          EXPORTING
            handle = l_spool_handle
            text   = ls_spool
            length = l_line_length.
      ENDLOOP.
    * Close Spool
      CALL FUNCTION 'RSPO_SR_CLOSE'
        EXPORTING
          handle                 = l_spool_handle
         pages                  = 1
      FINAL                  = 'X'
       EXCEPTIONS
         handle_not_valid       = 1
         operation_failed       = 2
         OTHERS                 = 3
    By this I can see the spool with data in SP02.
    Then to conver to PDF, I used
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid                    = w-spoolid
          no_dialog                      = 'X'
          DST_DEVICE                     = 'LOCL'
    *      PDF_DESTINATION                =
        IMPORTING
    *      PDF_BYTECOUNT                  =
    *      PDF_SPOOLID                    =
          list_pagecount                 = list_pagecount
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
       TABLES
         pdf                            = t_pdf
       EXCEPTIONS
         err_no_abap_spooljob           = 1
         err_no_spooljob                = 2
         err_no_permission              = 3
         err_conv_not_possible          = 4
         err_bad_destdevice             = 5
         user_cancelled                 = 6
         err_spoolerror                 = 7
         err_temseerror                 = 8
         err_btcjob_open_failed         = 9
         err_btcjob_submit_failed       = 10
         err_btcjob_close_failed        = 11
         OTHERS                         = 12
      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 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = 'D:\t\t.pdf'
         filetype                        = 'BIN'
        TABLES
          data_tab                        = t_pdf
    *   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
    But later when I go and open the PDF, I am getting an error saying'Page cannot be open because it dont have any pages'
    Please help me
    Regards,
    Nikhil

    Hi Nikhil,
    <li>If you are still not able to find out the problem. You can an alternative way , which is used for the same purpose.
    <li>Try this way. It creates spool and and same CONVERT_ABAPSPOOLJOB_2_PDF fm is used to convert spool to PDF. It works. Test this test program.
       REPORT ztest_notepad.
       DATA:g_val         TYPE c,
            w_pripar      TYPE pri_params,
            w_arcpar      TYPE arc_params,
            i_pdf         TYPE TABLE OF tline,
            spoolid       LIKE tsp01-rqident,
            l_no_of_bytes TYPE i,
            l_pdf_spoolid LIKE tsp01-rqident,
            l_jobname     LIKE tbtcjob-jobname,
            l_jobcount    LIKE tbtcjob-jobcount.
       DATA:it_t001 TYPE TABLE OF t001 WITH HEADER LINE.
       START-OF-SELECTION.
         SELECT * FROM t001 INTO TABLE it_t001.
         "Read, determine, change spool print parameters and archive parameters
         CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
             in_archive_parameters  = w_arcpar
             in_parameters          = w_pripar
             layout                 = 'X_65_132'
             line_count             = 65
             line_size              = 132
             no_dialog              = 'X'
           IMPORTING
             out_archive_parameters = w_arcpar
             out_parameters         = w_pripar
             valid                  = g_val.
         IF g_val  NE space AND sy-subrc = 0.
           w_pripar-prrel = space.
           w_pripar-primm = space.
           NEW-PAGE PRINT ON  NEW-SECTION PARAMETERS w_pripar ARCHIVE PARAMETERS w_arcpar NO DIALOG.
         ENDIF.
         LOOP AT it_t001.
           WRITE:/ it_t001.
         ENDLOOP.
         NEW-PAGE PRINT OFF.
         CALL FUNCTION 'ABAP4_COMMIT_WORK'.
         spoolid = sy-spono.
         CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid   = spoolid
             no_dialog     = ' '
           IMPORTING
             pdf_bytecount = l_no_of_bytes
             pdf_spoolid   = l_pdf_spoolid
             btc_jobname   = l_jobname
             btc_jobcount  = l_jobcount
           TABLES
             pdf           = i_pdf.
         CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
             filename = 'C:\temp\test.pdf'
             filetype = 'BIN'
           TABLES
             data_tab = i_pdf.
    Thanks
    Venkat.

  • Function module to convert an internal table to an tab delimited XL file

    hi everyone
    can anyone tell me the name of the function module which can convert the data in the internal table to an Excel file (Tab de-limited).
    vamsi

    Hello Vamsi
    Just in case you need functions for the other way around (e.g. .csv-file -> internal table) SAP provides the following function modules:
    - TEXT_CONVERT_CSV_TO_SAP
    - SAP_CONVERT_TO_CSV_FORMAT
    This function group <b>TRUX </b>contains some more interesting function modules.
    Regards
      Uwe

  • How to parse XML for internal table

    hi guys, I would like to know how to parse xml for an internal table. I explain myself.
    Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the item level. When I received back the pdf completed by mail, I need to parse the xml and get the po qty that has been entered.
    This is how I do to get header data from my form
    lr_ixml_node = lr_ixml_document->find_from_name( name = ''EBELN ).
    lv_ebeln = lr_ixml_node->get_value( ).
    How do we do to get the table body??
    Should I used the same method (find_from_name) and passing the depth parameter inside a do/enddo?
    thanks
    Alexandre Giguere

    Alexandre,
    Here is an example. Suppose your internal table is called 'ITEMS'.
    lr_node = lr_document->find_from_name('ITEMS').
    lv_num_of_children = lr_node->num_children( ).
    lr_nodechild = lr_node->get_first_child( ).
    do lv_num_of_children times.
        lv_num_of_attributes = lr_nodechild->num_children( ).
        lr_childchild = lr_nodechild->get_first_child( ).
       do lv_num_of_attributes times.
          lv_value = lr_childchild->get_value( ).
          case sy-index.
             when 1.
               wa_item-field1 = lv_value
             when 2.
               wa_item-field2 = lv_value.
          endcase.
          lr_childchild = lr_childchild->get_next( ).
       enddo.
       append wa_item to lt_item.
       lr_nodechild = lr_nodechild->get_next( ).
    enddo.

  • Convert an internal table from ABAP to an xml file on the Unix server

    I'm trying to convert an internal table to an xml file.  This file will be downloaded to a unix server.  Can someone help?

    Hello Linda,
    You can combine the code given by Mahalakshmi with something like this:
    CALL FUNCTION 'FILE_GET_NAME'
          EXPORTING
            logical_filename = 'YOUR_LOGICAL_FILE_NAME
            parameter_1      = l_file_name_xml
          IMPORTING
            file_name        = l_file_server
          EXCEPTIONS
            file_not_found   = 1
            OTHERS           = 2.
        IF sy-subrc = 0.
          TRY.
            OPEN DATASET l_file_server FOR OUTPUT. "<IN TEXT MODE> <ENCODING DEFAULT>.
          ENDTRY.
          IF sy-subrc = 0.
          LOOP AT lt_xml INTO ls_xml.
            TRANSFER ls_xml TO l_file_server.
          ENDLOOP.
          CLOSE DATASET l_file_server.
    ENDIF.
    ENDIF.
    You need to have the server path defined (look at the paths with tcode AL11) and the file logical name with tcode FILE
    Best regards,
    Andri

  • Sy-tabix for internal table in smartform

    Hi friends,
    How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
    For every record the value of sy-tabix is showing 1 !!
    Advance Thanks
    Aadarsh

    Hi Aadarsh,
    Give ur sy-tabix at the end of the loop.
    loop at itab.
    //table node populations.
    endloop.
    give a seperate loop for this.
    loop at itab.
    sy-tabix.
    endloop
    get the total no and print it after the table.
    If u r using do loop then give sy-index.
    Hope tihs helps u,
    Regards,
    Nagarajan.
    Message was edited by: Nagarajan Kumarappan

  • Field catalog for internal table in ALV

    In my program the internal table consists many fields from various tables and structure doesn't belong to a single data table.
    In order to get output in ALV grid following FM has been used
    REUSE_ALV_GRID_DISPLAY
    for field catalog the fields are defined specifically.
      l_fieldcat-fieldname  = 'VBELN'.
      l_fieldcat-outputlen  = 10.
      l_fieldcat-seltext_l  = 'Billing doc'.
      l_fieldcat-no_zero = 'X'.
      l_fieldcat-hotspot = 'X'.
      append l_fieldcat to p_fieldtab.
    ..............and so on for all the fields.
    Just wanted to know is there any other method to display all the fields of this internal table automatically so each field is not specified specifically.
    anya

    Hi
    Try this instead:
    *& Form  create_fieldcatalog
    * Create a field catalogue from any internal table
    *      -->PT_TABLE     Internal table
    *      -->PT_FIELDCAT  Field Catalogue
    FORM  create_fieldcatalog
           USING     pt_table     TYPE ANY TABLE
           CHANGING  pt_fieldcat  TYPE lvc_t_fcat.
      DATA:
        lr_tabdescr TYPE REF TO cl_abap_structdescr
      , lr_data     TYPE REF TO data
      , lt_dfies    TYPE ddfields
      , ls_dfies    TYPE dfies
      , ls_fieldcat TYPE lvc_s_fcat
      CLEAR pt_fieldcat.
      CREATE DATA lr_data LIKE LINE OF pt_table.
      lr_tabdescr ?= cl_abap_structdescr=>describe_by_data_ref( lr_data ).
      lt_dfies = cl_salv_data_descr=>read_structdescr( lr_tabdescr ).
      LOOP AT lt_dfies
      INTO    ls_dfies.
        CLEAR ls_fieldcat.
        MOVE-CORRESPONDING ls_dfies TO ls_fieldcat.
        APPEND ls_fieldcat TO pt_fieldcat.
      ENDLOOP.
    ENDFORM.                    "create_fieldcatalog

  • Query statement for internal table

    is it possible to use a select statement to select data from an internal table? if yes, can anyone show me the codes to it? thx

    Hi Daphne,
    You use SELECT statement to read data from database table but not from Internal table.
    For reading data from Internal table, you have to use READ statement.
    Syntax:
    READ TABLE itab { table_key
                    | free_key
                    | index } result.
    Effect of using read statement:
    This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read.
    If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
    Reward if usefull
    thanks
    swaroop

  • Using aggregation in ABAP code for internal table

    I have written following code to get cumulative amount on a date but i have to hit database for each record.
    Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
    code is:
        SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
         INTO LV_BALMONTH   WHERE   DEBITOR = LV_DEBITOR AND
        CALMONTH GE LV_STARTMONTH AND CALMONTH  LE LV_LASTCALMON.
    I want to put  ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
    regards,
    rakesh

    Hi Rajesh,
    types : begin of ty_tab,
                date type dats,
                DEB_CRE_LC   type .....     " delare type & is the filed need to summerized
                end of ty_tab,
    data: itab type standard table of ty_tab.
    SELECT date
                  SUM( DEB_CRE_LC )  as DEB_CRE_LC  FROM /BIC/AZFIAR_O500
                  INTO corresponding fields of itab
                  where CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON
                  group by date.   " date is the field available in your ODS/transparent table
    simulate the above code in your program...
    Hope this will work..

  • Need a logic for Internal table processing

    Hi,
    I have a requirement...an internal table contains three fields material no, bin no, and Quantity
    Mat. No    |         Bin No        |              Quantity
    a              |              x1         |                   10
    a              |              x1         |                   10
    a              |              x2         |                   20
    b              |              x3         |                   10 
    c              |              x3         |                   20
    c              |              x4         |                   30
    c              |              x4         |                   40
    In this I need to append the records to new internal table say itab1 where multiple entries exist for some material no like mat no 'a' and 'c'  and
    if the material no. exist only once in the table, it has to be moved to another new internal table say itab2.
    Pls suggest some logic that does not have performance issues.
    Thanks in advance
    Saravana

    Hi there,
    a solution in brief...
    data: wa_itab1_a like itab1,
             wa_itab2_b like itab1,
             lv_tabix       type sytabix.
    sort itab1 by matnr.
    loop at itab1.
      wa_itab1_a = itab1.
      at new matnr.
        lv_tabix = sy-tabix + 1.
        clear wa_itab2_b.
        READ TABLE itab1 into wa_itab2_b
                            INDEX lv_tabix.
        if wa_itab2_b-matnr ne wa_itab1_a-matnr.
          append wa_itab1_a to itab2.
          delete itab1 where matnr = wa_itab1_a-matnr.
        endif.
      endat.
    endloop.
    Regards
    George Zervas
    Edited by: gzervas on Oct 20, 2010 12:08 PM

  • Defining attribute for internal table within class builder?

    Hello there,
    I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into the attribute lt_result, that is declared as private and typed with
    lt_result TYPE zml_output.
    Even the definition of that attribute causes the following error message:
    "lt_result" is not an internal table.
    I don't have any clue how to type lt_result differently. Actually I would need the following type of typing "TYPE TABLE OF" but that does not exist within the class builder.
    Thanks for your help in advanced!
    Robert

    Hi Konstantinidis ...
    Of course I can provide it to you. The code of my methode load_data reads as follows:
    method LOAD_DATA.
        CALL FUNCTION 'ZDATAGET'
        EXPORTING
          iv_dat    = iv_dat
          iv_time1  = iv_time1
          iv_delta  = iv_delta
        TABLES
          et_result = lt_result.
    endmethod.
    Especially the lt_result causes the mentioned error message
    The compiler seems to expect something "TABLE" like for attribute lt_result. But whatever I tried it doesn't seem to work out.
    Many thanks for help...

Maybe you are looking for