‎2016 Jan 28 11:30 PM
Hi ,
I am not able to select pages while printing labels through SAP script. If I provide a value in page selection(ITCPP-TDPAGESLCT), it is not taking that value and printing all the pages.
Has anyone faced the similar problem, if yes, how did you solve it?
‎2016 Jan 29 4:25 AM
in ur script one page for printing for mutliple printings?
may that give ur error.
‎2016 Jan 29 3:49 PM
Hi Krishna,
No, there are different pages and I want to print only starting 2 pages.
‎2016 Jan 29 1:28 PM
‎2016 Jan 29 3:50 PM
Hi Leonardo,
That is for Smartform, I am looking for to do it in Script.
‎2016 Jan 29 4:02 PM
Can detail the code into your OPEN_FORM and CLOSE_FORM ?
Regards,
LeoBuryan
‎2016 Jan 29 6:20 PM
OPEN_FORM and CLOSE_FORM FM are called as below
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z_QM_UD_LABEL_SF' " Script Name
options = lv_option.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
result = itcpp
TABLES
otfdata = lt_otfdata
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
‎2016 Jan 29 6:35 PM
Hi Anil,
Try to fill :
lv_option-TDPAGESLCT = 'page number'.
Regards.
‎2016 Jan 29 7:25 PM
I want to put the page no in Dialog box which appear during print. I do not want to pass from program. And the pages I put in dialog, it should print based on that.
‎2016 Jan 29 7:32 PM
And also, this page number is not passing when I print. (even if I fill lv_option-TDPAGESLCT = 'page number'.) it is still printing all the pages
‎2016 Jan 29 7:33 PM
Try include in open_form
IMPORTING
result = itcpp
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z_QM_UD_LABEL_SF' " Script Name
options = lv_option
IMPORTING
result = itcpp.
IF sy-subrc <> 0.
ENDIF.
Regards.
‎2016 Jan 29 7:43 PM
Still it is not working
DATA: lv_option TYPE itcpo,
itcpp TYPE itcpp.
* Open the Script
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z_QM_UD_LABEL_SF' " Script Name
options = lv_option
IMPORTING
result = itcpp.
IF sy-subrc <> 0.
ENDIF.
I am not passing any values either in options or in result parameters of OPEN_FORM Function Module
‎2016 Jan 29 8:09 PM
Hi Anil,
maybe you could add the exceptions to the call function 'open_form' and then check sy-subrc.
One of the exceptions is OPTIONS and documentation says, that one of the reasons for this exception could be:
"The field TDPAGESLCT for selecting the pages to be printed contains invalid characters."
Best regards,
Dominik