cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro - Print the Purchase Order details

Former Member
0 Kudos

Hi Experts,

Can anybody suggest me how printing is achieved in webdynpro abap?

I have Purchase order Header and item details in the internal table. I want to print all those details. Is there any BAPI / FM to print those values as in ME22n.

Please suggest it.

Thanks in advance

Saravanan R

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Saravanan,

I hope you got your answer provided by Yadav. This is the best approach.

Create a Link To Action or Button UI element and write the code to call an Adobe form from that ON_ACTION method. This will open the data in a pdf.

You can refer to the link below to get the code help for calling a Adobe form from a program.

How To Call Adobe Form through ABAP Program

And please close the question if you got your desired answer.

Thanks

Santanu

Former Member
0 Kudos

Hi Saravanan,

To make the print function available for end users, proceed as follows:

  1. Insert a Button UI element into the view of your application for which you want to enable printing. For this Button define an event handler, for example, ON_PRINT.
  2. Enter the following source code for the event handler:

    Syntax SYNTAX

    1. data:     l_api_componentcontroller type ref to if_wd_component,     l_appl type ref to if_wd_application. l_api_componentcontroller = wd_comp_controller->wd_get_api( ).     l_appl = l_api_componentcontroller->get_application( ).     l_appl->print_page( ).
  3. Register your event in the WDDOINIT method:

    Syntax SYNTAX

    1. DATA: lo_api_controller TYPE REF TO if_wd_view_controller,   lo_action         TYPE REF TO if_wd_action.   lo_api_controller = wd_this->wd_get_api( ).   lo_action = lo_api_controller->get_action( name = 'ON_PRINT' ).   IF lo_action IS BOUND.     lo_action->set( keep_messages = abap_true ).   ENDIF.

Note:

The name of the event handler in method lo_api_controller->get_action must have the same name that you assigned in your view for the Button event handler.

regards,

Amol.

Former Member
0 Kudos

you can use  adobe form or smart form to display these detail.

if you have any button created in view  on which you want to print detail without display you can onAction event of button

Former Member
0 Kudos

Thanks Jitendra.

So I need to design Smart form to display those details?

Thanks

Saravanan R

Former Member
0 Kudos

it depend on your requirement if user want to see details before printing then use smartform or adobe form.

Former Member
0 Kudos

Yes. I have used standard smartform and using the link I found the solution.

http://scn.sap.com/docs/DOC-25759

Former Member
0 Kudos

please mark it as answered