Get Spool number for Smartform

Hi All,
I have created a smartform to print the POs created through ME21n. I have changed the config to use this smartform when a PO is changed/created. Everything is working fine. All I need is the spool number for each of the PO this is being printed. Can you please let me know how I can achieve this through the FM for smartform?
I AM USING 4.6C.
This is how I am using the function module
  CALL FUNCTION FM_NAME
       EXPORTING
            CONTROL_PARAMETERS = CONTROL
            OUTPUT_OPTIONS     = OUTPUT
            USER_SETTINGS      = ' '
            EKKO               = L_DOC-XEKKO
            PEKKO              = L_DOC-XPEKKO
            DRUVO              = L_DRUVO
       IMPORTING
            JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
       TABLES
            EKPO               = L_DOC-XEKPO
            PEKPO              = L_DOC-XPEKPO
            XAEND              = IT_XAEND
       EXCEPTIONS
            FORMATTING_ERROR   = 1
            INTERNAL_ERROR     = 2
            SEND_ERROR         = 3
            USER_CANCELED      = 4
            OTHERS             = 5.
All your inputs are greatly appreciated.
Thanks!
Sandeep

Hi,
JOB_OUTPUT_OPTIONS is of type SSFCRESOP, which does not have a SPOOLIDS field/table.
I knwo that the function module SSF_CLOSE returns the spool id in a table. But, I am not sure how to use SSF_OPEN and SSF_CLOSE. Can you please throw some light on how I can use these to get the spool numbers?
This is what I have right now.
  JOB_OUTPUT_OPTIONS-TDDEST = ITCPO-TDDEST.
  JOB_OUTPUT_OPTIONS-TDNEWID = 'X'.
  L_FORMNAME = TNAPR-FONAM.
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
             FORMNAME           = TNAPR-SFORM
            FORMNAME           = L_FORMNAME
       IMPORTING
            FM_NAME            = FM_NAME
       EXCEPTIONS
            NO_FORM            = 1
            NO_FUNCTION_MODULE = 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.
  ENDIF.
  CALL FUNCTION FM_NAME
       EXPORTING
            CONTROL_PARAMETERS = CONTROL
            OUTPUT_OPTIONS     = OUTPUT
            USER_SETTINGS      = ' '
            EKKO               = L_DOC-XEKKO
            PEKKO              = L_DOC-XPEKKO
            DRUVO              = L_DRUVO
       IMPORTING
            JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
       TABLES
            EKPO               = L_DOC-XEKPO
            PEKPO              = L_DOC-XPEKPO
            XAEND              = IT_XAEND
       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.
  ELSE.
    SELECT RQIDENT RQOWNER RQCRETIME FROM TSP01 INTO TABLE IT_TSP01
    WHERE RQOWNER = SY-UNAME.
    IF SY-SUBRC = 0.
      SORT IT_TSP01 BY RQCRETIME DESCENDING.
      READ TABLE IT_TSP01 INDEX 1.
      SPOOLID = IT_TSP01-RQIDENT.
      PERFORM PROTOCOL_UPDATE USING '320' SPOOLID SPACE SPACE SPACE.
    ENDIF.
  ENDIF.
The SELECT part is wrong, I need to replace this code to get the correct spool numbers.
Thanks in advance.
Sandeep

Similar Messages

  • Get spool number for delivery output.

    Hi,
    Is it possible to get the spool number for a print output type generated for a delivery? I use the Tcode VL02N to view the output types generated for a delivery. I want to use this spool number to generate a PDF file.

    Hi,
    The below mentioned link shows how to get the Spool Request Number for the Output type and convert it to PDF and download. It uses mainly NAST and CMFP table.
    Link: http://wiki.sdn.sap.com/wiki/display/ABAP/GettingSpoolRequestNumberfortheOutput+type

  • Getting only one spool number for every print out

    hi guys,
    when i execute my customize program i suppose to get a form in my screen, showing customer statement, when I exicute customer A out put as expected with 5 pages but after that if i exicute customer B which is supposed to be 3 pages but I am getting 8 pages which is including first out put also, its repeating same spool number for every thing and keep on adding every page , please let me know where to see for this ?? 
    for spool request    RS38L_FNAM
    and to display         'COM_SE_SPOOL_DISPLAY'

    Change ur table declaration as shown below, replace the word <b>TYPE</b> with <b>LIKE</b>
    DATA: BEGIN OF i_final OCCURS 0,
    srno TYPE i, " Serial no
    anln1 LIKE anla-anln1, " asset code no
    txt50 LIKE anla-txt50, " Brief Description of Assets
    txa50 LIKE anla-txa50, " Further Description
    ktogr LIKE anla-ktogr, " Asset Class No.
    ktgrtx LIKE t095t-ktgrtx, " Asset Class Name
    sernr LIKE anla-sernr, " Serial Number
    invnr LIKE anla-invnr, " Assets Identification No
    menge LIKE anla-menge, " Qty
    meins LIKE anla-meins, " UOM
    raumn LIKE anlz-raumn, " Location
    lifnr LIKE anla-lifnr, " Vendor
    liefe LIKE anla-liefe, " Capitalisation Date
    aktiv LIKE anla-aktiv, " Date put to use
    g_kansw LIKE anlc-kansw, " Opening Gross Block
    b_kansw LIKE anlc-kansw, " Additions during the period
    b_answl LIKE anlc-answl," Deductions/ Adjustmentsduring d period
    g_total LIKE bsis-dmbtr, " Closing Gross Block
    d_open LIKE anlb-afabg, " Dep on opening block
    d_sold LIKE anlb-afabg, " Dep on assets sold/written off
    d_add LIKE anlb-afabg, " dep on additions during the period
    afabg LIKE anlb-afabg, " Total dep for the period
    cd_sold LIKE bsis-dmbtr, " *** Dep on assets sold
    cd_asst LIKE bsis-dmbtr, " *** Dep on assets written off
    cd_dep LIKE bsis-dmbtr, " Total *** dep on deductions
    ccd_dep LIKE bsis-dmbtr, " Closing Acc Dep
    a LIKE bsis-dmbtr, " WDV of assets sold
    b LIKE bsis-dmbtr, " Selling Price
    c LIKE bsis-dmbtr, " Profit / (Loss) on sale
    d LIKE bsis-dmbtr, " Loss on write off
    e LIKE bsis-dmbtr, " Opening WDV
    f LIKE bsis-dmbtr, " Closing WDV
    END OF i_final.

  • Create spool number for sap script

    how to create a spool number for a SAP script. What is the program name which we should modify to write the code logic for spool creation for the tcode ME9F ?

    Hi,
    Spool Request in Transaction SP01 and there by generated a Spool Request Number.
    Spool request is a document for which a print function has been selected. However, it has not yet been output to a printer or another device. The output data for the print document is stored partly formatted in a data store until an output request is created, that is, until it is sent to a particular output device.
    The spool system uses a spool request to store the print data temporarily and to access it. The data is stored in a temporary format. You can also display the print document. The system automatically assigns a 10-digit ID number to a spool request.
    Output request: From the point of view of the SAP spool system, an output request outputs the print data of a spool request to a particular output device.
    Multiple output requests may exist for a single spool request. Each represents an instance of the output of the same spool request. Each of these output requests may have different attributes, such as the target printer or number of copies.
    By differentiating between spool request and output requests, the spool system provides a means of storing the data temporarily.
    You will get the spool no. in the parameter JOB_OUTPUT_INFO after calling the smartform function module in print program. The spool ids of the prints is stored in table JOB_OUTPUT_INFO-SPOOLIDS.
    Also if this spool is being generated internal to your program, then SY-SPONO should have the value.
    You need to create an Adobe Form Application, get the data from the backend based on Spool request number.
    You can create an application in Webdynpro, wherein when you click on a button and the Adobe Form is displayed with all the data from the backend and you should be able to print it.
    Does that answer your question ?
    Cheers,
    PANKAJ

  • How to get spool number when using SUBMIT job

    Hi All,
    I am calling standard program using SUBMIT through JOB as below. Now I need spool number for this job to covert the output to PDF and send to mail. See the below code and guide me.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      data: Zscreen type table of RSPARAMS with header line.
       Zscreen-selname = 'PM_AENNR'.
       Zscreen-kind = 'P'.
       ZSCREEN-LOW = '500000000125'.
       APPEND ZSCREEN.
    SUBMIT RCC00130 WITH selection-table Zscreen TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                       WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5

    Hi,
    Do this way, first get print parameters by using function module 'GET_PRINT_PARAMETERS'
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = 'LP01'
          list_name      = 'TEST'
          list_text      = 'SUBMIT ... TO SAP-SPOOL'
          immediately    = ' '
          line_size      = '1023'
          no_dialog      = 'X'
        IMPORTING
          out_parameters = wa_pri_params
          valid          = w_valid.
    If it returns success then
        IF w_valid EQ 'X'.
          CONCATENATE 'R'                                   
                       w_tabix                                
                       sy-datum+4(4)
                       sy-uzeit INTO
                       wa_pri_params-plist.
        ENDIF.
        SUBMIT rprccc00
               WITH firmennr = w_cid
               WITH bel_clus = 'X'
               WITH testlauf = ' '
               WITH not_lokl = 'X'
               WITH file_in  = w_arc_out
               TO SAP-SPOOL WITHOUT SPOOL DYNPRO
               SPOOL PARAMETERS wa_pri_params AND RETURN.
        COMMIT WORK AND WAIT.
    SELECT rqident
             FROM tsp01
             INTO w_rqident
             UP TO 1 ROWS
             WHERE rq2name = wa_pri_params-plist.
      ENDSELECT.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid     = w_rqident
          no_dialog       = 'X'
          dst_device      = 'LP01'
          pdf_destination = 'X'
        TABLES
          pdf             = t_pdf.
    Hope it solves your problem
    Regards
    Krishna

  • GET spool  number  according  to Message type (nast-kschl)

    hi all ,
    i want  to  get  the  oldest spool  number  for  a message type and PO number via  abap  program
    thinks in advancs.
    karim .

    hi,
    field dsnam of the table nast can give spool request name..
    may be this field can help u in solving ur issue ..
    regards,
    prashanti

  • How  to  crate a spool number for the abap program

    hi
    how  to  create a spool number for the abap program

    Hi,
    Check this thread
    how to create a spool requset for 'z program'.
    Regards,
    Satish

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

  • Same spool number for same job on mutilple days

    Hi all,
    We have daily Batch job which runs at 9:00 PM for a 1 variant and with 2 variant after first job is done.
    On 11/05 we have got one spool number 845411 for the spool  and on the 11/09 for the same job we got the same spool number for 2 jobs , and the data is also showing as 11/05 only and the spool creation date is showing as 11/05 and modified on 11/10...
    This is happening for only 1  batch job, we have checked the other  jobs all are fine with different spool #, we have checked spool number range and every thing is fine.
    Please suggest   what can be the reason for this scenario...
    Thanks,
    Subhash.G

    Hi Subhash,
    Check the print parametes of the job, can be seen under steps --> double click on program --> print properties. There we have option to select new spool number.
    So every time the job runs it will have a new spool number. Hope this helps.
    Regards
    Sushant

  • Where to get serial number for photoshop cs2?

    Hi! where do i get serial number for photoshop cs2 free dl? Thanks

    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    CS2 is not free. The download is for existing owners of CS or CS2.

  • How do i get serial number for my element12 i have the redemption code

    how do i get serial number for my element12 i have the redemption code

    Hi ylee0y0te,
    Please follow the steps here.
    1. http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    2.http://helpx.adobe.com/x-productkb/global/find-serial-number-student-teacher.html
    3.http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Hope it helps you.
    Regards,
    Rajshree

  • Get spool number

    hello experts,
    how will i get the spool number of an output in transaction VT03N? i have to get the spool number because i will use it in the print program configured in the transaction's output.
    please help me with this.
    thank you.

    hi march,
    first goto se38 then any prg execute(F8).
    find print (List in menubar)
    click print then u can get spool number with last four numbers. u remember the number.
    then goto se38 pgm name is RSTXPDFT4. its executed.
    u put spool number(last four numbers) only.
    its executes then save as extension with pdf in ur system.
    Reward if useful,
    Regards,
    S.Suresh.

  • I cant get a number for my ipod on iMessage?

    I'm having troubles, I can't get a number for my ipod on iMessage. Like I send &amp; receive texts from my email but I cant get a phone number. If I try to add it on the field it wont let me put it in. So what do I do?

    An iPod (and iPad) will only have a phone number for Messages (and FaceTime) if the same ID is used on an iPhone with iOS 6
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage

  • Where can I get serial number for Lightroom to start using it?

    Hello. I have just created Adobe CC account and purchased a Photography membership plan for Individuals. The price is 9,99 per month and this sum has already been taken from my card. On this page (https://accounts.adobe.com/plans) I can see the confirmation that I have obtained this plan.
    Now I want to use Lightroom but it asks me for serial number. After reading some help I found that I should get serial number from here - https://www.adobe.com/account.html. But on this page it says that "You have no registered products.". So I see no serial number.
    So there's a simple question - where can I get serial number for Lightroom to start using it?

    Jeff, thanks for your answer but it doesn't help. I've successfully passed all checks on page Sign in, activation, or connection errors | CS5.5 and later . My internet connection is ok, hosts file ok, certificates ok, etc. It's not a source of the problem.
    I've found that on page Adobe ID it says that I have free membership. Somehow it turns that my purchased Photography membership plan is not there at all. in order to proof that I really purchased it please see screen from my internet-banking page below:
    Why it is displayed only free membership in my account page and not Photography subscription which was already paid?

  • I cant get the number for imessage

    I cant get the number for imessage
    i press receive at and it only gives me my email

    An iPod uses the email address that you assign for Messages to receive messages. It is usually your Apple ID email address but you can add others to.

Maybe you are looking for

  • How do i export a slide show to my apple tv

    I have made a slideshow using iPhoto, but when I try and export to my apple tv it reads error! Does anyone know what the problem might be? Thanks

  • How to change the "com" in a Vi?

    I would like to change the com1 to com2 in the attached Vi. Do you know how I can do that? Thanks Attachments: Copy (A) of manual pump drive single execution_last.vi ‏75 KB

  • How can I change selection texts of standard report (S_P99_41000192)?

    Hi: I want to change selection texts of  tcode s_P99_41000192. ( Our SAP verison is SAP 4.7 version, non unicode) Because we can see only Deutch. It looks standard sap query so we can not add it into package. How can we change it? Please help me.

  • Can't set Optional Element to Nil in Xquery Transformation

    I am new to Workshop and I am performing a transformation between two XML files that I will call source and target for example. I have multiple time/date elements that are optional in the target XML schema. I want to know how to set their values to n

  • Can connect with AE but fail on connecting with internet

    For some reasons I needed to re-conflict my AE and changed the wireless name. 2 of my Mac computer and my iTouch could connect with no problem. But my PC (XP2) could connect with this AE but failed on internet with error message "limited or not conne