Skip to Content
author's profile photo Former Member
Former Member

Get program name from print spool number


My requirement is user is able to create a PDF from a SAP spool job with a proper defined filename .

User launches the application i.e ME23N , CV04n etc...

Application provides the list of recent print jobs with proper name.

In the coding , I had select the spool number from TSP01 now i am looking for the link table between a spool request and the corresponding

abap program .

following things done in the coding

1> get spool number from TSP01

2> Pass the spool number to TBTCP-LISTIDENT

but here i am not getting any result .

Please suggest me some table or FM which gives me the program name for print spool number.

Thanks and Regards,

Prakash Kolhe

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 16, 2014 at 08:51 AM


    Use the TSP01, TBTCO and TBTCP table to get the Program name and other characteristics based on the spool no.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Praveer Sen

      Hello ,

      thanks again.

      But i need the program name which has a given spool request number not any .

      Spool Request Number : i.e user run the T-code and print it then spool request generate .

      suppose i am the User : PRAK and execute the t-code ME23N and print it .

      Here system generate the spool number so we need to find out the executable program name .


      Prakash Kolhe

  • Posted on Dec 16, 2014 at 09:32 AM

    I do not think there is such stored information (i'm checking a bit in my system without success).

    You can still work a tricky work around.

    In each print program you can fill the spool parameters




    with TCODE/sy-repid and the recover them reading TSP01 table.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 16, 2014 at 09:48 AM

    Hello Prakash,

    unfortunately the R/3 spooler does not use a dedicated table/field to store the value which program has created the spool.

    The nearest solution is to use the Spool Name: if the application does not override this data, the creating program can be seen in TSP01-RQ0NAME, TSP01-RQ1NAME, TSP01-RQ2NAME.

    For example, if you print the demo program SHOWCOLO and you don't change the Spool Name, the default Spool Name will be:


    Where "SHOWCOLO" is the report name.

    Since this value can be easily overritten by the application, the better solution would be to check the spools from the application. For example: as far as I know the applications which use table NAST contain the spool data in fields NAST-LDEST, NAST-DSNAM, NAST-DSUF1, NAST-DSUF2 (as well as a few other fields), where DSNAM, DSUF1 and DSUF2 are the same as the previously mentioend RQ0NAME, RQ1NAME and RQ2NAME.

    Best regards,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.