Smartform click Print to add the number of prints or the last printing time to the data table.

Source: Internet
Author: User

Refresh : Gtd_out , Gtd_prps .
Gtd_prps = Gtd_list .
Loop At Gtd_listInto Gth_list Where Flag = 'X' .
Move-corresponding Gth_list To Gth_header .
Select Single Printdate Into Gth_header - PrintdateFrom Ztzrps002_n1
Where Rsnum = Gth_header - Rsnum And Aufnr = Gth_header - Aufnr And Vornr = Gth_header - Vornr And Pspid= Gth_header - Pspid And Posid = Gth_header - Posid .

"The User-Defined table ztzrps002_n1 reads the data after the printing is last stored.
IfSy-Subrc <>0.
Gth_header-Printdate=Sy-Datum. "Not printed, set to the current date
Endif.



data : v_output_info type ssfcrescl ,
v_output_options type ssfcompop ,
v_print_count ( 3 ) type C .
v_output_options - tdiexit = 'X' . "(this parameter must be passed so that the following outgoing parameter v_output_info-outputdone will not be assigned after clicking the back button on the smartform preview Interface)


CallFunction'Ssf _ function_module_name'
Exporting
Formname='Zpsf002 _ N1'
Importing
Fm_name=Gwk_fname.

Call Function Gwk_fname
Exporting
Output_options = V_output_options
Importing
Job_output_info = V_output_info
Exceptions
Formatting_error= 1
Internal_error = 2
Send_error = 3
User_canceled = 4
Others = 5 .

If Sy - Subrc = 0 . "After smartform is executed, execute hereCode
If V_output_info - Outputdone = 'X' "To determine whether the data is actually printed, store the data in the data table.
Loop At Gtd_header Into Gth_header .
Select Single Printdate Into Gth_header - Printdate From Ztzrps002_n1
Where Rsnum = Gth_header - Rsnum And Aufnr = Gth_header - Aufnr And Vornr = Gth_header - Vornr And Pspid = Gth_header - PspidAnd Posid = Gth_header - Posid .
If Sy - Subrc <> 0 .
Itab_wa - Rsnum = Gth_header - Rsnum .
Itab_wa - Aufnr = Gth_header - Aufnr .
Itab_wa - Vornr = Gth_header - Vornr .
Itab_wa - Pspid= Gth_header - Pspid .
Itab_wa - Posid = Gth_header - Posid .
Itab_wa - Printdate = Sy - Datum .
Modify Ztzrps002_n1 From Itab_wa .
Endif .

Endloop.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.