Creating spool requests using smartforms

hi folks,
I need help in this area...
I have an ABAP print program that I run to create monthly statements. There are two categories while running the monthly statements identified by the code '6' or '7' Now, i have to create separate spool requests so that while running the print program for these monthly customers.
How can I do this?
Santhosh

Ok,  first lets say that ACCITAB has the records that are printed in the main window of the form.  The number of pages for each customer depends on how many records are present in the ACCITAB for the customer.
For example....   ACCITAB.
<b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
1234      08/26/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
1234      08/27/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/21/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/22/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/23/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/24/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/25/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
5678      08/26/2005        <b>Customer  Invoice Date  Passed Due</b>
1234      08/25/2005        $1.00
1234      08/26/2005        $1.00
1234      08/27/2005        $1.00
5678      08/21/2005        $1.00
5678      08/22/2005        $1.00
5678      08/23/2005        $1.00
5678      08/24/2005        $1.00
5678      08/25/2005        $1.00
5678      08/26/2005        $1.00
.00
Lets say we have two customers in our table, customer 1234 has only two records associated with him,  customer 5678 has like 75 lets say.  Here you will need to loop at this table and count how many records are there for each customer and store it in another internal.  Maybe you can have a separate internal table for each category.
Types: begin of titab,
       kunnr type kna1-kunnr,
       count type i,
       end of titab.
Data:  itab_1   type table of titab with header line.
Data:  itab_2_5 type table of titab with header line.
Data:  itab_6_M type table of titab with header line.
One for 1 pagers,  one of 2-5 pagers, and one for 6 and more pages.
Now loop thru ACCITAB and at the end of a customer you need to write a record to one of these tables with the record count.  Use the AT END statement.  You will need to determine the maximum number of printed lines that your form handles in the MAIN window.  Example,  how many printed lines does it take to make the form go to the next page.  You need to find what this number is.
When you have this number, now you can do some logic which will split the customers into there categorys.
Let's say that the max is 50 lines per page.
Data: counter type i.
LOOP AT ACCITAB.
counter = counter + 1.
at end of kunnr.
IF counter < '50'.
itab_1-kunnr = accitab-kunnr.
itab_1-count = counter.
append itab_1.
elseif counter => '51'
   and counter =< '250'.
itab_2_5-kunnr = accitab-kunnr.
itab_2_5-count = counter.
append itab_2_5.
elseif counter => '251'.
itab_6_m-kunnr = accitab-kunnr.
itab_6_m-count = counter.
append itab_6_m.
ENdif.
clear counter.
endat.
ENDLOOP.
Now you have the customers split out into separate internal tables depending on how many pages for thier statement.  Now you can start printing.
call fucntion 'OPEN_FORM'.
Loop at itab_1.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
call fucntion 'OPEN_FORM'.
Loop at itab_2_5.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
call fucntion 'OPEN_FORM'.
Loop at itab_6_m.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
Please remember to award points for helpful answers. Thanks.
Regards,
Rich Heilman

Similar Messages

  • SPOOL REQUEST FOR SMARTFORM

    HI experts,
    how to create the spool request for smartform. can anyone help me. give me the complete procedure.
    thanks in advance for ur responce.

    The user which send the smartform to the spool (probably wf-batch) needs an output device. You can maintain this in SU01.
    Just look at sample code:
    1.Send Smart Form output to spool using the FM <ws_formname> (FM name derived from the export parameters of SSF_FUNCTION_MODULE_NAME).
    //Start of Code Sample
    DATA : ws_formname TYPE rs38l_fnam.
    TYPES: BEGIN OF ty_script,
    trans_ref LIKE eanl-anlage,
    cont_ref TYPE e_edmideservprovcontractid,
    trans_code TYPE char05,
    trans_reason TYPE char05,
    market_sect LIKE eanl-zzmktscode,
    efffrm_date LIKE sy-datum,
    mprn LIKE iflot-zzmprn,
    mlc TYPE char01,
    subbuild_no(40) TYPE c,
    build_no LIKE adrc-str_suppl1,
    dep_fare LIKE adrc-str_suppl3,
    post_town LIKE adrc-city1,
    post_code LIKE adrc-post_code1,
    asset_code LIKE egerh-kombinat,
    paymnt_code(2) TYPE c,
    model_code LIKE equi-typbz,
    manuf_code LIKE equi-herst,
    year_manuf LIKE equi-baujj,
    serial_no LIKE equi-sernr,
    meter_code TYPE char01,
    meter_mech(2) TYPE c,
    meas_cap TYPE zmeasur_cap,
    role_code TYPE char03,
    market_name LIKE eservice-serviceid,
    status TYPE char01,
    END OF ty_script.
    DATA: i_scriptdata TYPE STANDARD TABLE OF ty_script
    WITH HEADER LINE.
    DATA: wa_output_options TYPE ssfcompop,
    wa_control_params TYPE ssfctrlop,
    wa_spoolnum TYPE rspoid,
    wa_printdata TYPE efg_strn_printdata.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Your Form Name'
    IMPORTING
    fm_name = ws_formname
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    CALL FUNCTION ws_formname
    EXPORTING
    control_parameters = wa_control_params
    c = wa_printdata
    IMPORTING
    job_output_info = wa_job_output_info
    TABLES
    i_scriptdata_input = i_scriptdata(Your Script Data)
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    MOVE wa_job_output_info-spoolids] TO wa_spoolids[.
    READ TABLE wa_spoolids INTO wa_spoolnum INDEX 1.
    IF sy-subrc = 0.
    DATA :id LIKE tsp01-rqident.
    MOVE wa_spoolnum TO id.
    ENDIF. .
    Comments-Id Contains the Spool Request for the given smart form
    //End of Code Sample
    Convert Smart Form Output to Raw
    Format
    2.Convert the Spool Output to OTF using the FM RSPO_RETURN_SPOOLJOB.
    //Start of Code Sample
    data i_soli LIKE soli occurs 0 with header line.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
    EXPORTING
    rqident = id
    desired_type = 'OTF'
    TABLES
    buffer = i_soli
    EXCEPTIONS
    no_such_job = 1
    job_contains_no_data = 2
    selection_empty = 3
    no_permission = 4
    can_not_access = 5
    read_error = 6
    type_no_match = 7
    OTHERS = 8.
    Comments- i_soli contains the OTF data
    //End of Code Sample
    3.Convert the OTF using FM
    SX_OBJECT_CONVERT_OTF_RAW.
    DATA content_bin TYPE solix_tab.
    DATA objhead TYPE soli_tab.
    DATA i_soli_tab TYPE soli_tab.
    DATA boolean TYPE sx_boolean.
    DATA length TYPE so_obj_len.
    LOOP AT i_soli.
    APPEND i_soli TO i_soli_tab[].
    ENDLOOP.
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_RAW'
    EXPORTING
    format_src = 'OTF'
    format_dst = 'RAW'
    CHANGING
    transfer_bin = boolean
    content_txt = i_soli_tab
    content_bin = content_bin
    objhead = objhead
    len = length
    Convert Smart Form Output to Raw
    Format
    EXCEPTIONS
    err_conv_failed = 1
    OTHERS = 2.
    REward points if useful.

  • Pop problem while creating spool request in reuse_alv_grid_display

    Hi Experts,
    I am trying to create a spool request of alv
    and problem is that i do not want pop-up window for asking output devices,
    actually i am calling reuse alv in loop and following steps i have done:
    w_print-print = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_BYPASSING_BUFFER = 'X'
          I_CALLBACK_PROGRAM = SY-REPID
          IT_FIELDCAT         = FIELDCAT[]
          I_DEFAULT           = 'X'
          I_SAVE                = 'X'
          is_print                 = w_print
        TABLES
          T_OUTTAB           = T_FINAL
        EXCEPTIONS
          PROGRAM_ERROR      = 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.
    Please give the solution.
    Thanks
    Pankaj

    Hi,
    Use FM GET_PRINT_PARAMETERS ,  and  use command NEW-PAGE PRINT ON PARAMETERS <wa_params> NO DIALOG. before calling the alv FM.
    ls_print-print = 'X'.
    DATA: lwa_params TYPE pri_params,
          lv_valid TYPE c.
    CLEAR: lwa_params, lv_valid.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        in_parameters          = lwa_params
        layout                 = 'X_65_132'
        line_count             = 65
        line_size              = 132
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = lwa_params
        valid                  = lv_valid
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    MOVE-CORRESPONDING lwa_params TO ls_print-print_ctrl-pri_params.
    ls_print-print_ctrl-pri_params-pdest = 'LP01'. " your printr device
    NEW-PAGE PRINT ON PARAMETERS lwa_params NO DIALOG.
    then call FM CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.
    this will work.
    refer link [ALV - print - create spool request;
    Regards,
    Ravi.

  • FM "open form  ; how to craete create SPOOL REQUEST

    Hi.
    I have a Z program n layout . We have used a FM "open form."
    But when I run, i dont get spool      
    In this case I want to create SPOOL REQUEST whenever I run program.Can anyone
    suggest what fields I need to mark in ITCPO and NAST or more than these.

    Hi,
    Check this link :
    http://www.thespot4sap.com/articles/SAPscript_example_code.asp
    Regards
    Appana

  • How to create new spool request in smartforms??????

    hi all,
    i have to ctreate a new spool request for a smartform...
    The driver program for this smartform is a standard program.
    when i run the transaction, the spool for standard sap-script gets created but not for my smartform.
    the code is something like this:-
    wa_ssfcompop-TDDEST = 'LOCL'.
    wa_ssfcompop-TDIMMED  = space.
    wa_ssfcompop-TDNEWID = 'X'.
    wa_ssfcompop-TDFINAL = 'X'.
    *wa_ssfcompop-XSF = 'X'.
    wa_SSFCTRLOP-no_dialog = 'X'.
      CALL FUNCTION v_fm_name
        EXPORTING
         CONTROL_PARAMETERS = wa_SSFCTRLOP
          OUTPUT_OPTIONS     = wa_ssfcompop
          wa_rldri         = xrldri
          wa_rldrp         = xrldrp
          wa_rldru         = xrldru
          wa_t329p         = xt329p
          wa_resb          = xresb
          wa_rldrc         = xrldrc
          wa_vblkk         = xvblkk
          wa_vblkp         = xvblkp
          wa_rldrh         = xrldrh
          wa_rlvek         = xrlvek
          wa_reftab        = xreftab
          wa_lthu          = xlthu
          v_date           = v_date
          v_time           = v_time
          v_label          = v_label
          v_bzeit          = v_bzeit
          v_name1          = v_name1
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          it_rldri         = xrldri
          it_rldrh         = xrldrh
          it_rldrc         = xrldrc
          it_vblkk         = it_vblkk
          it_vblkp         = it_vblkp
          it_rldrp         = it_rldrp
          it_rldru         = it_rldru
          it_t329p         = it_t329p
          it_resb          = it_resb
          it_rlvek         = it_rlvek
          it_reftab        = it_reftab
          it_lthu          = it_lthu
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Help would be greatly appreciated and definitely rewarded

    hi
    good
    Use the function module 'GET_PRINT_PARAMETERS'.
    sample:
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    ARCHIVE_ID = C_CHAR_UNKNOWN
    ARCHIVE_INFO = C_CHAR_UNKNOWN
    ARCHIVE_MODE = C_CHAR_UNKNOWN
    ARCHIVE_TEXT = C_CHAR_UNKNOWN
    AR_OBJECT = C_CHAR_UNKNOWN
    ARCHIVE_REPORT = C_CHAR_UNKNOWN
    AUTHORITY = C_CHAR_UNKNOWN
    copies = g_copies
    COVER_PAGE = C_CHAR_UNKNOWN
    DATA_SET = C_CHAR_UNKNOWN
    department = ''
    destination = g_destination
    expiration = g_days
    immediately = ' '
    IN_ARCHIVE_PARAMETERS = ' '
    IN_PARAMETERS = ' '
    layout = 'X_65_200'
    line_count = 65
    line_size = 200
    list_name = g_listname
    list_text = g_listtext
    MODE = ' '
    new_list_id = 'X'
    PROTECT_LIST = C_CHAR_UNKNOWN
    no_dialog = 'X'
    receiver = 'SAP*'
    release = ' '
    REPORT = C_CHAR_UNKNOWN
    sap_cover_page = 'X'
    HOST_COVER_PAGE = C_CHAR_UNKNOWN
    PRIORITY = C_NUM1_UNKNOWN
    SAP_OBJECT = C_CHAR_UNKNOWN
    TYPE = C_CHAR_UNKNOWN
    USER = SY-UNAME
    USE_OLD_LAYOUT = ' '
    UC_DISPLAY_MODE = C_CHAR_UNKNOWN
    DRAFT = C_CHAR_UNKNOWN
    ABAP_LIST = ' '
    USE_ARCHIVENAME_DEF = ' '
    DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN
    PO_FAX_STORE = ' '
    NO_FRAMES = C_CHAR_UNKNOWN
    IMPORTING
    OUT_ARCHIVE_PARAMETERS =
    out_parameters = g_params
    valid = g_valid.
    IF g_valid <> space.
    NEW-PAGE PRINT ON PARAMETERS g_params NO DIALOG.
    IF NOT tb_output3[] IS INITIAL.
    LOOP AT tb_output3 INTO wa_output3.
    PERFORM write_summary.
    ENDLOOP.
    ENDIF.
    Reward if useful...
    thanks
    mrutyun^

  • Creating Spool request

    Hi friends,
    as per the old message I am trying to create a spool request which further will be downloaded to PDF format. I am facing a problem, as per message  when I try to do write in worte_perform I am receving ABAP dumps with Illegal page number
    anyidea why is it so .
    Thanks
    Lakhbir
    data: loc_dest like pri_params-pdest .
      clear : wf_listname , loc_dest , wf_listtext .
      move: 'List name' to   wf_listname .
      move: 'List header text' to   wf_listtext .
    select single spld into usr01-spld from usr01 where bname eq sy-uname .
      if sy-subrc eq 0 .
        move: usr01-spld to loc_dest .
      endif .
      call function 'GET_PRINT_PARAMETERS'
           exporting
                destination    = loc_dest
                copies         = wf_copies
                list_name      = wf_listname
                list_text      = wf_listtext
                immediately    = ' '
                release        = ' '
                new_list_id    = 'X'
                expiration     = wf_days
                line_size      = 200
                line_count     = 65
                layout         = 'X_65_200'
                sap_cover_page = 'X'
                receiver       = 'SAP*'
                department     = ''
                no_dialog      = 'X'
           importing
                out_parameters = wf_params
                valid          = wf_valid.
      if wf_valid <> space.
        new-page print on parameters wf_params no dialog.
        perform write_summary .
        new-page print off.
      endif .
    within the write_summary do a normal write operation.
    loop at <itab> .
    write:/
    endloop .

    We encountered a similar problem on 4.6C using a custom BAPI to save invoices to PDF for an internal web app.  We used a BDC/call transaction to access the output function from there.  This was only supposed to be a temporary workaround but has been working and we probably won't revisit until our next upgrade.  Hopefully this idea will help on your version, if so I am new here and need points!
    *Generate Transaction
      PERFORM dynpro USING :
                     'X' 'SAPMV60A'   '0101'   ,
                     ' ' 'VBRK-VBELN' v_invoice ,
                     ' ' 'BDC_OKCODE' '=DRCK'   .
      PERFORM dynpro USING :
                     'X' 'SAPLVMSG'   '0110'   ,
                     ' ' 'DNAST-KSCHL' v_kschl,
                     ' ' 'BDC_OKCODE' '=STAR'   .
      SELECT * UP TO 1 ROWS
        FROM nast WHERE objky = v_invoice
                  AND   vstat = '1'
                  AND   kappl = 'V3'
                  AND   kschl = v_kschl
                  AND   aktiv = space.
      ENDSELECT.
      IF sy-subrc = 0.
        PERFORM dynpro USING :
                       'X' 'SAPLSPO1'   '0300'   ,
                       ' ' 'BDC_OKCODE' '=YES'   .
      ENDIF.
      PERFORM dynpro USING :
                     'X' 'SAPLVMSG'   '0100'   ,
                     ' ' 'NAST-LDEST' 'TD06',
                     ' ' 'NAST-DIMME'  space,
                     ' ' 'NAST-TDOCOVER' space,
                     ' ' 'NAST-TDRECEIVER' space,
                     ' ' 'NAST-DELET' 'X',
                     ' ' 'BDC_OKCODE' '=STAR'   .
      CALL TRANSACTION   'VF03'
           USING         i_bdcdata
           MODE          v_mode
           UPDATE        'S'
           MESSAGES INTO i_bdcmsgcoll.

  • Long time for generating spool request for smartforms

    Hi,
    I'm have designed a  smartforms for printing a Receipt form. It takes about 1 minute for generating spool request after pressing the PRINT button in PRODUCTION Server only.
    The Code i used is below
    CALL FUNCTION lv_fname
      EXPORTING
          p_belnr                    = p_belnr
          p_bukrs                    = p_bukrs
          p_gjahr                    = p_gjahr
    EXCEPTIONS
       formatting_error           = 1
       internal_error             = 2
       send_error                 = 3
       user_canceled              = 4
       OTHERS                     = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      Please help me out to sort this issue.
    Thanks,
    Ramesh
    Edited by: Rameshkumar Raamasamy on Mar 4, 2012 6:21 AM

    Hi Rameshkumar,
    you may look at the code sections of your smartform: If you have a lot more data in production than you have in development, it is especially important to use a fully specified primary key for any SELECTs.
    You may also ask your basis people to check if any performance warnings have been recorded with database system. This happens quite frequently that growing database tables cause problems when table spaces are not properly assigned or table sizes are not maintained adequately.
    Regards
    Clemens

  • ALV - print - create spool request

    Hi all,
    We have made SAP Query (The majority and 'was written in ABAP code), a report using ALV grid (function 'REUSE_ALV_GRID_DISPLAY'). There is a 'Print' button on the grid. If the user presses this button the system will send a screen where the user can choose print parameters (name of printer, printing, direct or not, etc..) If the user presses 'Continue' a spool request is then created.
    But the users do not want to see the screen parameters.
    After pressing the button 'Print' on the grid, the spool request should be immediately created using the parameters seted in the ABAP program, the same program that creates ALV.
    Any idea how to do this?
    Thanks in advance

    Hi,
    Please refer to the link to add button in the ALV tool bar:
    [http://www.sapalv.net/2009/07/sap-alv-tutorial-4-%E2%80%93-add-button-to-toolbar/]
    For creating spool on click of this pushbutton you can use the following:
    * Set the Spool Parameters
      DATA: lwa_params TYPE pri_params,
            lv_valid TYPE c.
      CLEAR: lwa_params, lv_valid.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          in_parameters          = lwa_params
          layout                 = 'X_65_132'
          line_count             = 65
          line_size              = 132
          no_dialog              = 'X'
        IMPORTING
          out_parameters         = lwa_params
          valid                  = lv_valid
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF sy-subrc EQ 0.
        NEW-PAGE PRINT ON PARAMETERS lwa_params NO DIALOG.
    *                  Write code for displaying the ALV here......
        NEW-PAGE PRINT OFF.
      ENDIF.
    Regards,
    Aparna Alashe.

  • Don't create spool request

    Hi averybody,
    Is there any parameter to avoid I create a spool request? I work with Smartforms.
    thanks in advance
    Regards

    Hi,
    You need pass these parameter in the OUTPUT_OPTIONS parameter of Smartform FM
    OUTPUT_OPTIONS-TDNEWID  = ' '  "---> No Spool Request
    OUTPUT_OPTIONS-TDIMMED = 'X'  " --> Print Immdietly

  • Append New Line Item(s) onto the created Purchase Request using Function

    Dear Expert,
    I am trying to append new lines into the created purchase request via Function Module/ BAPI.
    Say, now, the Purchase Request has already 1 line item. And i want to append new line items into
    this purchase request via function module/ bapi.
    Do you know if there is any function module/ bapi exists to do this?
    Thanks.
    Tee

    Hi,
    It's weird.
    I tried on the BAPI_PR_CHANGE, and the return message says that it has successfully changed the PR. But, when i see it via ME53N, it's not being updated.
    Does anyone has sample usage/ code using this BAPI?
    Thanks.
    Tee

  • Saving a delivery, does not create spool request

    Hi,
    I have a delivery and 2 output types. The print program of first output type already exists and I created one for the second one.
    When I save the delivery, spool request gets created for the first output type but doesn for the one I created. Can anyon tell why?

    hi,
    It has to be assigned to the second output type, the first one is for a different purpose.
    Is there any change need to be done in program to correct it?
    But, It does work when run through transaction.

  • CRM_ORDER_MAINTAIN - Create Service Request using IT_SERVICE_OS

    Hi,
    I am using CRM_ORDER_MAINTAIN to create Service requests. To enter the Category (1 to 3) fields I am using the parameter IT_SERVICE_OS. But somehow it is not working. The Service request has been created but the Category is missing. The code used is given below. Please let me know where I am wrong.
        lw_subject-ref_handle   = 1.
        lw_subject-ref_handle_h = 1.
        lw_subject-katalogart = 'C'.
        lw_subject-codegruppe = 'ZSRCAT'.
        lw_subject-code       = 'LD02'.
        lw_subject-katalog_type = 'D'.
        CALL FUNCTION 'CRM_INTLAY_GET_HANDLE'
          IMPORTING
            ev_handle = lw_subject-ref_handle.
        lw_subject-mode       = gc_mode-create.
        INSERT lw_subject INTO TABLE lt_subject .
        CLEAR lw_osset.
        lw_osset-ref_handle      = 1.
        lw_osset-subject_profile = 'ZHRSERV'.
        lw_osset-profile_type    = 'A'.
        CALL FUNCTION 'CRM_SERVICE_OS_SET_DATA'
          EXPORTING
            is_srv_osset_com   = lw_osset
            iv_ref_handle      = lw_osset-ref_handle
            iv_ref_kind        = gc_object_ref_kind-orderadm_h
            it_srv_subject_com = lt_subject
          EXCEPTIONS
            error_occurred     = 1
            invalid_guid       = 2
            no_record_exist    = 3
            OTHERS             = 4.
        CALL FUNCTION 'CRM_SERVICE_OS_PUT_DATA'
          IMPORTING
            et_srv_osset_com = lt_service_os
            et_input_fields  = lt_input_fields_f.
        APPEND LINES OF lt_service_os TO gt_service_os.
        INSERT LINES OF lt_input_fields_f INTO TABLE gt_input_fields.
        CALL FUNCTION 'CRM_INTLAY_CLEAR_HANDLE'.
    Thanks
    Vinod

    Hi Vinod,
    In CRM4, I use something similiar to update categories through subject code.
    Something like this:
    *- Subject code create
    *- Get Subject profile
    CLEAR: ls_input_field_names, ls_input_field.
    CALL FUNCTION 'CRM_ORDER_SERVICE_H_SELECT_CB'
      EXPORTING
        iv_process_type = iv_process_type
      IMPORTING
        es_service_h    = ls_service_h
      EXCEPTIONS
        entry_not_found = 1
        OTHERS          = 2.
    *- Subject data
    ls_subject-ref_handle = gv_handle.
    ls_subject-katalogart = iv_katalogart.
    ls_subject-codegruppe = iv_codegruppe.
    ls_subject-code = iv_code.
    ls_subject-mode = 'A'.
    APPEND ls_subject TO lt_subject.
    *- Osset data
    ls_osset-ref_handle = gv_handle + 1.
    ls_osset-subject = lt_subject.
    ls_osset-subject_profile = ls_service_h-subject_profile.
    ls_osset-profile_type = 'A'.
    APPEND ls_osset TO ls_service_os-osset.
    *- Service OS data
    ls_service_os-ref_handle = gv_handle.
    ls_service_os-ref_kind = 'A'.
    APPEND ls_service_os TO gt_service_os.
    *- Input fields
    ls_input_field-ref_handle = gv_handle.
    ls_input_field-ref_kind  = gc_object_kind-orderadm_h.
    ls_input_field-objectname  = gc_object_name-service_os.
    ls_input_field_names-fieldname = 'CODE'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    ls_input_field_names-fieldname = 'CODEGRUPPE'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    ls_input_field_names-fieldname = 'KATALOGART'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field  INTO TABLE  gt_input_fields.
    It works for me. Check if may help you a little more.
    Kind regards,
    Garcia

  • Need to create Meeting Request using Powershell with Outlook 2010 / 2013

    We will be creating around 100 meeting request based on data from excel, so planning to migrate it to SQL & using powershell we need to speed-up the progress.
    Script tried :
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/e88ca51c-62dd-493b-a0d1-ffe6a8696fdf/create-view-in-outlook-2013-using-powershell?forum=ITCG
    http://en.community.dell.com/techcenter/powergui/f/4833/t/19576698.aspx
    http://www.amandhally.net/2013/08/30/powershell-and-outlook-create-and-send-a-new-email-using-powershell-outlooktools-module/
    Do we have any working scripts, i tried few scripts it fails throwing error as below:
    New-Object : Exception calling ".ctor" with "0" argument(s): "Retrieving the COM class factory for component with CLSID 
    {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 
    0x80080005 (CO_E_SERVER_EXEC_FAILURE))."
    At line:2 char:6
    + $o = New-Object Microsoft.Office.Interop.Outlook.ApplicationClass
    +      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
    You cannot call a method on a null-valued expression.
    At line:4 char:1
    + $a = $o.CreateItem($olAppointmentItem)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    Ganapathy

    Hi Ganapathys,
    For the error "failed due to the following error: 80080005", please Make sure that Outlook and Powershell are either both running as a standard user (not elevated) or that they are both running elevated as Administrator. They need to be running at the same
    integrity level to avoid that error.
    Please try to run powershell as standard user without "run as admin".
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Creating spool requests

    Hi Friends,
    I have to print like 5000 checks . In my custom program I need to create new spool for every 1000 checks so that I can send them to 5 printers from the Spool .
    Please advise What paramenters I need to take care of .
    Thanks,

    You can write simple logic ,just fill the ITCPO Structure in OPEN_FORM FM's
    count the records in internal table.
    if internal table data reaches 1000 records then use below logic.
    if i_data-count = 1000.
      itcpo-tddest      =  p_print.
      itcpo-tdnewid     = 'X'.
      itcpo-tdpreview   = 'X'.
      itcpo-tdimmed     = 'X'.
      itcpo-tdcopies    = '1'.
    endif.
      call function 'OPEN_FORM'
           exporting
                device   = 'PRINTER'
                dialog   = ' '
                form     = 'ZAUTO_REPLPRINT'
                language = sy-langu
                options  = itcpo.
    Thanks
    Seshu

  • How to create Spool through ABAP program

    How to create spool request for Smartforms through program. So I can go in TCODE SP01 and see the output of my smartforms.

    Include the below code in ur program .......
      DATA: PRINT_PARAMETERS TYPE PRI_PARAMS,
            VALID_FLAG       TYPE C LENGTH 1.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
      IMMEDIATELY = 'X' "C_IMMEDIATELY
    *LAYOUT = 'Z_48_144'
    *LINE_COUNT = '48'
      LINE_SIZE = '255'
    *NEW_LIST_ID = C_NEW_LIST_ID
      NO_DIALOG = 'X'
      RELEASE = 'X'
      IMPORTING
      OUT_PARAMETERS = PRINT_PARAMETERS
      VALID = VALID_FLAG
      EXCEPTIONS
      ARCHIVE_INFO_NOT_FOUND = 1
      INVALID_PRINT_PARAMS = 2
      INVALID_ARCHIVE_PARAMS = 3
      OTHERS = 4 .
      G_PDEST = PRINT_PARAMETERS-PDEST.
      NEW-PAGE PRINT ON PARAMETERS PRINT_PARAMETERS
                        NO DIALOG.
    List of write statements to be output.......
    NEW-PAGE PRINT OFF.
    Reward if useful..............

Maybe you are looking for

  • Discoverer report print issues

    Hi, I have a peculiar issue in printing the Disco reports (plus). version is Oracle Business Intelligence Discoverer Plus 10g (10.1.2.48.18) when i do a print preview it shows me a single page, but when i give a print it is printing in 2 pages and th

  • MOVED: help me choose a new graphics card for Vista

    This topic has been moved to Vista problems. https://forum-en.msi.com/index.php?topic=107569.0

  • How to edit the find-and-replace dialog in Dreamweaver 8

    For over 13 years I have been a happy user of Macromedia Dreamweaver 8. And I still see no reason to use any other program for editting PHP. However, 1 thing has been bugging me for years. In the find-and-replace dialog there is a select "Find in". T

  • Two dimension in JTable

    Hi, Can anyone tell me how to write two dimension in JTable?1 row for title and 1 column for another title. Another question is,how to write JTable in a report format,such as few columns for expenses and at the end a total for the whole expenses.How

  • Database Frequently shutting down

    Database is running in NoArchivelog Mode on Windows Server. Database was frequently shutting down automatically. How to overcome the below error. When I try to open the database I am encountering the below error Errors in file d:\oracle\admin\gentool