cancel
Showing results for 
Search instead for 
Did you mean: 

Work Order printer selection through dialog still picking default printer

Former Member
0 Kudos

Hi,

When i'm printing Work Order (trx: IW32) programs picks up default printer assigned to the user.

in my case this also happening when user selects different printer though dilog.

was trying to get it from NAST-LDEST but in my case NAST is empty and ITCPO pointing to LP01(Local Printer of user).

can anyone please help how to get printer name which is selected by user.

Thanks in advance,

Kian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Below code show you the way to assign any printer to form. (Pls find the code in you print prog )

DATA: output_options        TYPE ssfcompop. 
DATA: control_parameters TYPE ssfctrlop.

  output_options-tdimmed       = 'X'.
  output_options-tddest         =  'PR01'. --- > here we can hard code the printer name and pass to FM
  control_parameters-no_dialog = 'X'.  

CALL FUNCTION fm_name
    EXPORTING
      control_parameters = control_parameters
      output_options       = output_options
      user_settings        = ''
      nota_fiscal            = i_nota_fis
    EXCEPTIONS
      formatting_error   = 1
      internal_error       = 2
      send_error           = 3
      user_canceled     = 4
      OTHERS               = 5.

  IF sy-subrc <> 0.
  ENDIF.

As you need to know form where the value of output_options-tddest is coming then you can debug the flow and try to find the value of output_options-tddest ...

Pls tell me if you need to know anything else.

Regs,

Lokesh.

Former Member
0 Kudos

Yes Lokesh,

I wanted to check how can i populate this output_options-tddest value from Dialog screen to my driver program.

usually it will be though NAST-LDEST but in my case for WORK ORDER its value is blank.

any idea.?

Thanks in advance,

Kiran

Former Member
0 Kudos

I am not getting..

Pass output_options-tddest = 'LOCL' or whatever printer you like to give.. then it same printer will come on your Dialog screen..

What type of print parameter you need all will come on print screen..

Former Member
0 Kudos

Thanks for the help.

It solved in this way.

actually for work order(IW32) the structure W_WORKPAPER brings the printer information.

Former Member
0 Kudos

Hi,

Using smartform or Sap script? and if yes then are u using customized print program?

Regs,

Lokesh.

Former Member
0 Kudos

Sorry, it is smartform and it's ouput customized.