Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Billing Issue

Former Member
0 Likes
805

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
750

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

6 REPLIES 6
Read only

Former Member
0 Likes
751

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

Read only

0 Likes
750

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

Read only

0 Likes
750

I'm not sure which parameter you're looking for.

Rob

Read only

0 Likes
750

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.

Read only

0 Likes
750

So after you execute the code I posted:


NAST-LDEST = itcpo-tddest

or:


XNAST-LDEST = itcpo-tddest

Rob

Read only

0 Likes
750

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,