cancel
Showing results for 
Search instead for 
Did you mean: 

Print button

Former Member
0 Kudos

Hi ALL,

I want to create a print button on my view and it should print the contents of the view(table). Can anyone please help me on the same

Thanks,

Shilpa DHawan

Accepted Solutions (0)

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hello,

please refer to the very recent thread

Depending on what you mean by "print" you may even want to have a look at ACFExecute as until the 7.02 browser print functionality, all "print" functionality is just opening the current view in another application in such a way that it can then be easily printed - export to PDF, Excel etc.

Chris

Former Member
0 Kudos

Hi,

I also have to print the output in a table and not ALV. So kindly guide me on the same. I could not follow th link send by THOMAS JUNG.

Regards,

SHilpa

ChrisPaine
Active Contributor
0 Kudos

using the code in my blog - which was linked in the other post will export to Excel.

As the other post mentions - it is very difficult to cause printing directly from WDA - as there is no browser functionality to do this - and WDA runs in browsers.

Thomas's link definitely works - you will need to use SAPLink to load the file into your system.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I could not follow th link send by THOMAS JUNG.

What kind of problems did you have with the link? The link is activate and does download the code sample from Google Code. So it isn't a broken link. Are you having problems installing or using the code sample?

Former Member
0 Kudos

Hi Thomas,

Many thanks for your reply!!!

I mean I couldnot understand how to use the code mentioned in the XML file(.nugg). All I know is that i have a table to be printed.

So I might need the basic knowledge required to understand the concept of the XML file.

Thanks,

Shilpa

ChrisPaine
Active Contributor
0 Kudos

[https://wiki.sdn.sap.com/wiki/display/ABAP/SAPlink|https://wiki.sdn.sap.com/wiki/display/ABAP/SAPlink]

[http://code.google.com/p/saplink/|http://code.google.com/p/saplink/]

Read and learn...

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

As was pointed out by Chris, the format of the file I linked to was a SAPLink Nugget. SAPLink is an open source community project that assists developers with moving code into and out of their ABAP systems. If you install SAPLink you can then import the file I linked to and it will create the corresponding development objects in your system. In the case of this example it is a class and some ddic objects. The class has a method that you can pass an ABAP internal table into (TYPE REF TO DATA) and it will print the data in that internal table.

Former Member
0 Kudos

Hi Thomas, Chris,

Many thanks for your replies.

I have installed the SAP_link report. Thats is, I have created a SE38 report and pasted the code written in that. Then I uploaded the NUGG_WEB_PRINT_TABLE.nugg but it gave an exception:

Short text

CREATE OBJECT: The class " " was not found.

What happened?

Error in the ABAP Application Program

The current ABAP program "ZTEST_SHI" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_CREATE_OBJECT_ERROR', was not

caught in

procedure "INSTALLNUGGET" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The dynamically specified class " " at CREATE OBJECT neither exists as

local, nor as global class in the system, or is overshadowed by a local

data type of the same name.

-


Am I missing something??? ..Kindly Guide again please.

Thanks and Regards,

Shilpa Dhawan

Former Member
0 Kudos

Hi Thomas,

Kindly ignore the last message.

Just one more question:

What do I need to fill in the following parameters:

PRINT_OPTIONS??

MESSAGES??

It would be great if you can elaborate on these two parameter.

Just for your information I am not passing anything in the ITERATOR or COL_DEF since they are optional.

Thanks for your help.

Regards,

Shilpa

Former Member
0 Kudos

Hi Thomas,

I need your help to use this functionality. I am using the importing parmeter col_def to set the title of the coulmns but I am not able to see the title completely , so i guess I have to use the width field to set the column width but still it is not working fine. Can you suggest any thing to set the width automatically as per the title of the columns.

Thanks a ton in advance ,

Shilpa

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Keep in mind that the print output is old style list processing. I suppose you could try and set the column widths of the SALV object, but I'm not sure how much control there is with the column widths in this format. How exactly have you tried to set the column widths?

In list processing the different DDic headers (small, medium, large) were often used for the appropriate column length. Perhaps you will simply have to consider shorter column headers.

Former Member
0 Kudos

HI Thomas,

Thanks for your reply.

I am setting the column title and name using the below code.

But I am not getting the title completely it is displaying for example 'Organizat' in the spool.

DATA: LT_TABLEVIEWCONTROLTAB TYPE TABLEVIEWCONTROLTAB.
  DATA: LS_TABLEVIEWCONTROL TYPE TABLEVIEWCONTROL.

  LS_TABLEVIEWCONTROL-COLUMNNAME = 'VA_ORG_ID'.
  LS_TABLEVIEWCONTROL-TITLE = 'Organization Unit ID'.
  LS_TABLEVIEWCONTROL-width = '800'.
  LS_TABLEVIEWCONTROL-WRAPPING = 'X'.
  APPEND LS_TABLEVIEWCONTROL TO LT_TABLEVIEWCONTROLTAB.

So please guide me on how to set the column width

Thanks n Regards,

Shilpa Dhawan