Skip to Content
Author's profile photo Rayapudi Praveen

Play with print preview

In projects output play very vital role especially forms. Many documents like invoices, legal forms, shipping notifications, packing labels, etc. are printed out of SAP. Before printing a form we see print preview to check accuracy of content.

While seeing print preview we generally struggle to navigate across pages, problem in copying data from print preview or taking output into a PDF file.

To address these common issues we have some codes which can help in making our job easy. The below table explains code and its functionality.

Code

Description

P–

Display First page if multiple pages exist

P-

Display Previous page if exist

P+

Displays Next page if exist

P++

Shows Last Page

PDF!

Opens output in PDF-Preview

SGOT

Jump to page

SPRI

Print

SFAX

Fax

SEML

Mail

SARC

Archive

SARP

Print & archive

BKGR

Background

SEXI

Exit

SBAC

Back

SCAN

Cancel

SLIS

List display

These codes are called in Include LSTXBWFCC.

All codes will work for smartforms and sap scripts. Some codes like SFAX, SEML, SARC, BKGR work based on the way it is programmed.

Out of all the above PDF!, SGOT and SLIS are very helpful in my projects. I would like to explain only few of the above as most of the codes are self explanatory.

Output to PDF:

Taking output to PDF is a very common requirement below we will see how we can do this from print preview.

In the command box enter the code PDF! As shown below

untitled.PNG

The output is opened in PDF file where we have further options to save, navigate and print as seen below.

pdf1.PNG

Note: The above options may differ based on the adobe reader version installed in your machine.

Jump to page:

Have you ever come across an output having more pages in which you particularly need to see a page which is in middle?

We can simply reach the required page by using command SGOT.

pdf2.PNG

Enter the page number and press goto.

Copy text from print preview:

Have you ever tried copying the text directly from print preview? Will this work?

If we use the command SLIS the whole output (all pages) are displayed on screen and you can copy required content.

Now you are well equipped to play with print preview.

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Just tried them in the invoice print preview - neat! Thanks for sharing!

      Author's profile photo Thomas Zloch
      Thomas Zloch

      If you don't mind, please move your blog to the Output Management space.

      Thanks

      Thomas

      Author's profile photo Former Member
      Former Member

      Wonderful. Saves a lot of work especially for pdf conversion.

      Regards,

      Rijuraj

      Author's profile photo Former Member
      Former Member

      Hi Praveen,

      Nice informative article. Tried some of the codes and they work. However I was particularly interested in PDF!. It does not work for me. I debugged the sapscript output and found out where other fcodes were handled, but could not find out PDF!. Does it work for smartforms only. Also I cannot use adobe forms on my system. Does this have anything to do with that. I am on an ECC 6.0 system if you were wondering.  

      Regards,

      Shravan

      Author's profile photo Rayapudi Praveen
      Rayapudi Praveen
      Blog Post Author

      Hi Shravan,

      Check whether PDF reader is installed properly if so what is the version of it?

      what is the message when used code PDF! ?

      FYI Include LSTXBWFCC will have all the codes. I tried in my system all the codes work for smart forms and sap scripts.

      Pls. let me know on what type of form you are using.

      Regards,

      Praveen

      Author's profile photo Former Member
      Former Member

      Hi Praveen,

      I do not get any messages. The system ignores PDF! for me. I have a free PDF reader installed and it has the latest version. I dont think there is anything there. My FCODE is not getting handled in SAP.

      I opened include LSTXBWFCC and I see the piece of code which handles all these FCODE's. However my script takes me to LSTXWFCC Module CC_DISPLAY. Here I see other fcodes like P++. But I do not see PDF!. There sure is some difference in the flow. May be the difference is the print program or Adobe forms not installed.

      I am using standard output  type NEU for purchase order. Program - SAPFM06P, routine ENTRY_NEU and form MEDRUCK. Let me know if you are using any standard type and I will try it out.

      Regards,

      Shravan

      Author's profile photo Rayapudi Praveen
      Rayapudi Praveen
      Blog Post Author

      Hi Shravan,

      Thanks for the update. Based on your update I checked for standard output type order confirmation BA00. As you said the include LSTXWFCC is called. Which is not having PDF!.

      So it’s a standard behaviour.

      My sincere apologies if I have misguided you in my previous reply.

      Regards,

      Praveen

      Author's profile photo Former Member
      Former Member

      sincere thnks

      Author's profile photo SuryaPraveen Pati
      SuryaPraveen Pati

      Thank you, Praveen.

      Author's profile photo Amala Srinivasa Rao
      Amala Srinivasa Rao

      Good Document dear !!! 🙂

      Author's profile photo Former Member
      Former Member

      Really helpful tips. Thanks for sharing!

      Author's profile photo vemuri santosh kumar
      vemuri santosh kumar

      Thank you praveen

      I saved these shorts and can refer whenever i require

      so handy btw

      thank you

      Author's profile photo vemuri santosh kumar
      vemuri santosh kumar

      Hi Praveen,

      One quick question. Is the generation of PDF with Common is available in all versions ?

      Author's profile photo Rayapudi Praveen
      Rayapudi Praveen
      Blog Post Author

      Hi Vemuri,

      I have checked this in ECC 6. So i assume the same will work on ECC6 and above of any SP. din't get a chance to check in lower versions.

      Regards,

      Praveen

      Author's profile photo venu gopal
      venu gopal

      Hi Praveen,

      Very good post, it helps a lot in time saving.

      But I have tried to give  some Commands like ,SARP,SFAX,SEML, BKGR,but I could not find these functionalities.

      Could you please let me know

      Author's profile photo Juan Carlos Da Silva Teixeira
      Juan Carlos Da Silva Teixeira

      The pdf is shown but i can´s save it, I got the error: Adobe Reader stopped working!

      Author's profile photo Former Member
      Former Member

      Hi Praveen,

      I have been using PDF! for a while now, but it happened many times that it does not work with some documents, but works with others on the same program. Would you know the reason?

      Thanks

      Author's profile photo NR Singh
      NR Singh

      Hi experts ,

      I have a strange issue for Invoice Output type (Ztype) . when I do "PRINT PREVIEW" , output displays , then I choose from menu  "GOTO->PDF PREVIEW"  . but it does not show the output in PDF , rather its showing some other image .

      I checked in debug mode, inside  module cc_display input , program "LSTXBWFCC" the Fcode = PDFV .  but if I am using "PDF! " on command bar , it shows output in PDF format .  This is happening for Invoice , PO too .

      In debug mode I found  inside  module cc_display output. , it goes to  perform cc_pdf_preview. inside this perform after converting OTF to PDF (  call function 'CONVERT_OTF' ) , there is some logic for Debugging branch & Standard branch  . System  goes to standard branch in PDF Preview , but doesn't show output in PDF . whereas in debug when I forced it to go Debug branch , it created values for   "l_url  =  smart.pdf "  ( via  call method pdf_control->load_data  ) and displayed output in PDF format .

      I am not able to understand what is the Debug branch here and when  program flow goes in debug branch .   just to mention its showing output in PDF format if I am forcing to go debug branch . else directly I put PDF!  in command bar .

      Not able to find what is the root cause for PDF preview not working ???

      Please suggest.
      Thanks in Advance

      Nihar