cancel
Showing results for 
Search instead for 
Did you mean: 

update database table when print button clicked

Former Member
0 Kudos

Hello,

I want to update database table when print button is clicked from Sap Script Print Preview window. How do I insert my custom code that updates the table from script window ? This is req. to maintain list of printed document number.

Let me know if you have other alternative solution.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi!

These modifications can be done only in your SAPScript's printer program.

If the user clicks on the print preview, you can first show a popup to ask "Save entries into the database?" or something l ike this.

If the user choose the yes, you save the values into the relevant tables.

Regards

Tamá

Former Member
0 Kudos

Can you please show this with a step by step example ?

Former Member
0 Kudos

Hi!

For example if you copied your PO's SAPScript (to ZMEDRUCK) and the printer program (to ZSAPFM06P).

You have to modify your printer program ZSAPFM06P like this:

- check the structure NAST, to identify, when user pressed print preview, or the print button

- add the SWO_POPUP_TO_CONFIRM fm, or the POP_UP_CONFIRM fm to your code

- if the user pressed the yes button, you have to make the databes changes with the printed document number.

Regards

Tamá

Former Member
0 Kudos

I didn't understand this, "check the structure NAST, to identify, when user pressed print preview, or the print button"

- Where NAST has to be checked ?, because when print button in print preview window is clicked the control goes to SAP standard program.

- what i want is when print button in print preview window is clicked it should update database table.