‎2006 Nov 28 8:27 PM
Hi,
I would like to let user to change the printer from a Pop-up screen input in t-code VF01 to let the user to take the layout from the which printer he wants at that time .
I included the Code in user-exit RVCOMFZZ but I couldn' t find an easy way to change the value of XNAST-LDEST .
the simple code is like this :
data: ival type table of sval with header line.
ival-tabname = 'SSFPP'.
ival-fieldname = 'TDDEST'.
ival-field_obl = 'X'. " Required Field
append ival.
call function 'POPUP_GET_VALUES'
exporting
popup_title = 'Printer Name:'
tables
fields = ival.
with best regards,
Caglar.
‎2006 Nov 28 8:44 PM
Why not do it automatically?
SELECT SINGLE * FROM usr01
WHERE bname = sy-uname .
IF sy-subrc EQ 0.
printer = usr01-spld.
ELSE.
CLEAR printer.
ENDIF.
CLEAR itcpo.
itcpo-tdcopies = '1'.
itcpo-tddest = printer.
itcpo-tddataset = 'SCRIPT'.
itcpo-tdsuffix1 = printer.
itcpo-tdprogram = sy-tabix.
itcpo-tdimmed = immed.
itcpo-tddelete = delete.
itcpo-tdnewid = 'X'.
itcpo-tdfinal = 'X'.
itcpo-tdlifetime = 1.
itcpo-tdsenddate = sy-datum.
itcpo-tdsendtime = sy-uzeit.
itcpo-tdteleland = 'CA'.
itcpo-tdprogram = sy-repid.
itcpo-tdcover = 'D'.
itcpo-tdreceiver = sy-uname.
itcpo-tdnoprev = ' '.
CALL FUNCTION 'GET_TEXT_PRINT_PARAMETERS'
EXPORTING
OPTIONS = itcpo
no_print_buttons = print_buttons
device = 'PRINTER'
IMPORTING
newoptions = itcpo
EXCEPTIONS
canceled = 1
archive_error = 2
device = 3
OTHERS = 4.
Rob
‎2006 Nov 28 8:44 PM
Why not do it automatically?
SELECT SINGLE * FROM usr01
WHERE bname = sy-uname .
IF sy-subrc EQ 0.
printer = usr01-spld.
ELSE.
CLEAR printer.
ENDIF.
CLEAR itcpo.
itcpo-tdcopies = '1'.
itcpo-tddest = printer.
itcpo-tddataset = 'SCRIPT'.
itcpo-tdsuffix1 = printer.
itcpo-tdprogram = sy-tabix.
itcpo-tdimmed = immed.
itcpo-tddelete = delete.
itcpo-tdnewid = 'X'.
itcpo-tdfinal = 'X'.
itcpo-tdlifetime = 1.
itcpo-tdsenddate = sy-datum.
itcpo-tdsendtime = sy-uzeit.
itcpo-tdteleland = 'CA'.
itcpo-tdprogram = sy-repid.
itcpo-tdcover = 'D'.
itcpo-tdreceiver = sy-uname.
itcpo-tdnoprev = ' '.
CALL FUNCTION 'GET_TEXT_PRINT_PARAMETERS'
EXPORTING
OPTIONS = itcpo
no_print_buttons = print_buttons
device = 'PRINTER'
IMPORTING
newoptions = itcpo
EXCEPTIONS
canceled = 1
archive_error = 2
device = 3
OTHERS = 4.
Rob
‎2006 Nov 28 9:06 PM
Hi Rob,
Actually I' ve to do this in user-exit and I couldn't find the right parameter while user pressing the push-button 'SAVE' in t-code 'VF01'. I said I have to because , they wanted to do this in this way.
I almost did what you' ve said in the layout program and it is alright for the t-codes 'VF02' & 'VF03'.
have any ideas
with best regards,
Caglar
‎2006 Nov 28 9:29 PM
‎2006 Nov 28 9:38 PM
Hi again ,
I am trying to change the parameter NAST-LDEST. As you know it reads from the user values as default printer and sends to spool with that value when user saves.
I am trying to step in to that value by the pop-up value in a user-exit and change the value in nast-ldest with that value .
for example after user pushed 'SAVE' button, in the users' default settings he has the printer 'B' and he enters 'A' in the pop-up screen in VF01. I want to change the value for Nast-ldest to send it to that printer.
Am I clear enough? , if not please let me know.
Kind regards.
Caglar.
‎2006 Nov 28 9:46 PM
So after you execute the code I posted:
NAST-LDEST = itcpo-tddestor:
XNAST-LDEST = itcpo-tddestRob
‎2006 Nov 28 9:56 PM
Hi again Rob,
I got your point but i couldn' t find the right exit to add your code , that is actually the problem. I debugged the code but i didn' t find the exit which uses the NAST or XNAST structure. And I tried to do it as following but it dumped as field symbol not assigned.
FIELD-SYMBOLS <F1> TYPE nast.
DATA NAME(50) VALUE '(MV60AF0F_FCODE_WDOP)NAST'.
ASSIGN (NAME) TO <F1>.
<F1>-LDEST = ival-value. " this part has the printer value.
Kind regards,