Smartform output in the background

Hello all,
Now I met a problem about smartform output in the background:
The default printer is LP01. When I execute the program which calls this smartform in background, I change the printer to LP03.
Then I use the t-code:SP02 and find the printer is LP01 not LP03.
(But if I use the hardcode 'LP03', the printer is changed to LP03)
What can i do change the printer to LP03?
---part of my code:
DATA: ls_pri_params         TYPE pri_params,
      ls_control_parameters TYPE ssfctrlop,
      lv_print              TYPE sypdest,
      lv_valid              TYPE bool,
      ls_output             TYPE ssfcompop,
      lv_repid              TYPE syrepid.
  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      mode                   = 'BATCH'
      report                 = lv_repid
    IMPORTING
      out_parameters         = ls_pri_params
      valid                  = lv_valid.
  lv_print = ls_pri_params-pdest.
  ls_output-tddest = lv_print.
ls_output-tddest = 'LP03'.
  CALL FUNCTION '/1BCDWB/SF00000004'
    EXPORTING
      output_options     = ls_output
      user_settings      = space.
Thanks in advance!

Hi Nina,
You can use sy-batch. See the following codes:
IF SY-BATCH = 'X'. "means program is executed in the background.
   ls_output-tddest = 'LP03'.
ELSE.
   ls_output-tddest = lv_print.
ENDIF.
Regards,
Hendy

Similar Messages

  • How to check the ALV output for the background job

    Hi Guru,
    We are having a cutomized report which will display the result like a ALV report.
    We configured it as an background job, after the completion of the background job, it will send the result to the SPOOL, and we can use SP02 to check the output,
    But it is not easy for user to directly check the result easily, is there an method we can save it as an spreadsheet and send the output to a specific location or mailbox and then user can check it easily
    thanks,

    In SM37 ,select the Job > Spool > Select Spool No > Display Contents > Here it will show you the Output of the Report.Now select Ctrl +Shift + F12 , it will ask you to save the Spread sheet in specified location.
    Best Regards,
    Ankur

  • Output after the background job finished successfully

    Hi All,
    We executed a Dunning job  in the background (sm37) and the job finished succesfully.  How to check whether the job has created an output ? Where to look for the output ?
    Regards
    Shiva

    You can check the spool request of your job via SM37 or SMX. Go to SM37 select your job and check the spool request.
    Regards
    Subhash

  • Using analog output in the background

    Hi,
    I need to use the analog output channel on a NI PCIe-6351 to play an audio signal, and while the signal plays i need make some changes the UI dialog box, is it possible for me to move the playing of the audio to the background and proceed with program execution?
    Here is a simple piece of code that explains what I'm trying to do: 
    #include<stdio.h>
    #include<stdlib.h>
    #include<conio.h>
    #include<math.h>
    #include<string.h>
    #include<memory.h>
    #include<wchar.h>
    #include "sndfile.h" //include file for the sound library
    #include "NIDAQmx.h"
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    float *fWavSample;
    SNDFILE *SoundFile;
    SF_INFO SoundFileInfo;
    int iNoOfSamples=0;
    int32 error=0;
    TaskHandle AOtaskHandle = 0;
    float64* AIOSample;
    char errBuff[2048]={'\0'};
    int32 fnCreateTask(TaskHandle *AOTaskHandle)
    int32 error=0;
    DAQmxErrChk(DAQmxCreateTask("", AOTaskHandle));
    Error:
    return error;
    int ReadWavFile()
    //Open the wav file for reading
    SoundFile=sf_open("sin_10s.wav",SFM_READ,&SoundFileInfo);
    //Check if file is opened sucessfully
    if (SoundFile == NULL)
    puts("File not opened");
    return FALSE;
    //allocate memory for the buffer that is to hold the wav data&colon;
    fWavSample = new float[SoundFileInfo.channels * SoundFileInfo.frames];
    iNoOfSamples = SoundFileInfo.channels * SoundFileInfo.frames;
    //Read data into the float structure that has been copied in
    sf_readf_float(SoundFile, fWavSample, SoundFileInfo.frames);
    //Allocate memory for the structure that is to hold the sound samples
    AIOSample = new float64[iNoOfSamples+660];
    //Copy wavefile data into the new float64 array (needs to be typecasted to float64)
    int i=0;
    for(i=0;i<(SoundFileInfo.channels * SoundFileInfo.frames);i++)
    AIOSample[i] = (float64)fWavSample[i];
    //After the float64 array has been filled, release the memory used by fWavSample
    free(fWavSample);
    return 0;
    int main(int argc, char** argv)
    DAQmxErrChk(fnCreateTask(&AOtaskHandle));
    //Create an analog out channel
    DAQmxErrChk (DAQmxCreateAOVoltageChan(*(&AOtaskHandle),"Dev1/ao1","",-10.0000000,+10.00000,DAQmx_Val_Volts,NULL));
    //16 bit output resolution needed, sampling rate matched to the WAV file's
    DAQmxErrChk (DAQmxCfgSampClkTiming(AOtaskHandle,"",44100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
    //Set the output to trigger on a rising edge on PFI6
    //DAQmxErrChk (DAQmxCfgDigEdgeStartTrig (AOtaskHandle,"PFI6",DAQmx_Val_Rising));
    //Start the task in the background
    DAQmxStartTask(AOtaskHandle);
    ReadWavFile();
    DAQmxErrChk(DAQmxWriteAnalogF64(AOtaskHandle,(SoundFileInfo.channels * SoundFileInfo.frames),true,10.0, DAQmx_Val_GroupByChannel,AIOSample,NULL,NULL));
    printf("Playing audio\n");
    Error:
    if( DAQmxFailed(error) )
    DAQmxGetExtendedErrorInfo(errBuff,2048);
    //puts(errBuff);
    puts(errBuff);
    return TRUE;//DefWindowProc(hwndmon,message,wParam,lParam);
    getch();
    The program reads a 10 seconds long 1kHz sine wave signal from a WAV file and plays it over AO0.
    I want the program to  print "Playing Audio" on the console window while the audio is still playing, i.e when DAQmxWriteAnalogF64 is executing.
    I'm using Visual Studio 2005 on Windows XP and an NI PCIe6351.
    I'd really appreciate any help I can get.
    Thanks a lot!
    RaziM

    Hi RaziM, 
    It sounds like you will need to implement some sort of multithreading to accomplish playing audio in the background and also making changes in the UI dialog box in the foreground. Since DAQmx is thread safe this should definitely be possible, but it will probably take a little more work on your part.
    You may want to take a look at this page which gives a walkthrough to Multithreading with a Background component, http://msdn.microsoft.com/en-us/library/ywkkz4s1.aspx
    Here is another forum post about how DAQmx runs multiple threads, http://forums.ni.com/t5/Measurement-Studio-for-VC/DAQmx-how-does-it-multithread/td-p/221953
    I hope some of this helps!
    Rachel M.
    Applications Engineer
    National Instruments

  • Triggering smartform output from the report program

    Hi,
    I have developed a new report program.The selection screen of the report program is like this.
    plant:    ________
    warehouse:  ___________
    sheet #:      _________  to _________
    bay/bin:      ___________  to  __________
    building:     ___________ to __________
    counter sheet printer:  __________
    Auditor sheet printer:   _________
    When the data for sheet#,bay,building, counter sheet printer is given,then the counter sheet smartform has to be output on the screen.
    or
    When the data for sheet#,bay,building, auditor sheet printer is given,then the auditor sheet smartform has to be output on the screen.
    Is it pessible to trigger the smartform from the selection screen of the report.If so can anyone send me a sample code for that.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = <smartform name>
        IMPORTING
          fm_name            = v_form_fm
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
    Call Smartfrom to print the document
    CALL FUNCTION v_form_fm
        EXPORTING
          p_compensation   = p_comp  <--parameter list
          p_skill          =         p_skill
          p_deci_auhtority = p_da
        TABLES
          s_job            = s_job         <--select option list
          s_level          = s_level
          s_date           = s_date
            EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
    declare the paramters of your selection screen in the form interface section of the smartform.
    If you have a parameter in teh selection screen then declare it in the smartform as:
    P_matnr     TYPE     matnr (in form interface -     
                                                     >import)
    If you have a select option then
    S_LEVEL     LIKE  <dictionary structure like a range>
    this u declare it in the tables section of the form interface. For the select option , the dictionary sructures should be like a range (see RNGE_OBJID as an example). If you dont have a dictionary structure
    then u need to declare it in the dictionary.
    REWARD IF HELPFUL

  • Not generating a spool output in the background job

    Hi Team,
    I have an alv report and If I schedule the program using SM36 transaction it is not generating the spool ouput.
    If I run the same program in background mode when we use se38 and select execute in background in program menu and it works successfully and generates alv grid list in the spool output.
    But, user wants to schedule the job in sm36 and check the same output in spool. Please advise why it is not generating.
    Note:I am using the cl_salv_table=>factory method to generate the output.
    Thanks in advance,
    Sunil Kumar.

    This is not really an ABAP question and you might want to ask your Basis admin for assistance. But I believe that spool will not be generated if you don't specify print parameters for a step. When you define the step in SM36, make sure to specify the print parameters.

  • Sending Smartform output as a body of the mail not as the attachement

    Hi All,
      my requirement is like this...
      I need to send a smartform output as the body of a mail. and not as the attachment.
      Hope you got my question
    Regards
      Raghu

    Hi,
           I hope the following links might help you,
    Smartform output as Email.
    Smartform to PDF and e_mail? Urgent
    Regards,
    Hema.
    Reward points if it is useful.

  • How to send a SmartForm output as Email to external id?

    I want the Smartform output to email to extrenal email-id.
    I don't want the Smartform output as any kind of attachment, but the Smartform output needs to be shown on the main email body. Can anyone pls. help me out?

    First, thanks for your responses.
    I haven't found the demo program 'BCS_EXAMPLE_6' in SAP 4.7. But then I got it in SAP 5.0 version. But this program only describes how to send Form output as PDF attachment with email. But this is well-known and I haven't asked for this. I want the Smartform output within the mail-body without attachment.
    The weblog at "/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp seems a more logical one, though I have already tried it out. Here the html page creation and graphics load -- everything is going right. But this HTML page is being delivered as an Attachment within the email. The normal HTML Email is not coming. I think this technique wouldn't work with all mailing tools. Here in the weblog, Pavan has shown the example with Microsoft Outlook. But I have tested with Lotus Notes and Yahoo. And In both cases, the mail is coming with attached HTML file (in .mht format), but not as a notmal html mail without attachments.

  • Send smartform output as Fax

    Hello All,
    I have a requirement where i need to send the PO reminder smartform output to the user as Fax.
    Same is sent using the Program SAPFM06P using the form routine ENTRY_MAHN, which uses 2 FM's, but for SAP Scripts.
    Can anybody guide me over same requirement using smartforms.
    Waiting for useful pointers.
    Thanks in advance...
    Regards,
    Tarun

    Hi Tarun,
    I am also having the same requirement, to send a PO Reminder Smartform through Fax.
    Could you please let me know whether you were able to send it?
    Hi Folks,
    Could you please tell me what are all the settings and parameters to be passed while calling the smartform to send it through fax?

  • How to get the output of a background report to be shown on the screen

    When we run the background process it goes to spool request. my requirement is to show it on the screen may be after some time to the user. how can we do that. Thanks in advance

    Hello Varun,
    You cqan submit the report as a JOB and export the out put to memory, once the job is complete you can read the list to display the output.
    Cheers,
    Mano
    Cut & Paste form SAP help.
    Submit report ....
    EXPORTING LIST TO MEMORY
    Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".

  • Page breaks appear in the spool output of report when run in the background

    Hi All,
    Report is using fm 'REUSE_ALV_GRID_DISPLAY' to display the report. parameters passed to this fm for display are :it_fieldcat,is_layout,it_events,t_outtab.
    Page breaks appear in the spool output when report is run in the background.These page breaks needs to be removed. When executed in the background, the excel extract should be the same as if pulling directly from the report itself.
    How to remove the page breaks in background?
    Thanks & Regards,
    Abhishek Singh

    Hi
    You can use the below code , which the reprt run in background. If you run the report in background thenyou need to use  'REUSE_ALV_LIST_DISPLAY'
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
    RECEIVING e_offline = off.
    IF off IS INITIAL.
    CREATE OBJECT g_custom_container
    EXPORTING container_name = g_container.
    ENDIF.
    Regards

  • How do I - change the background colour of the output HTML page

    Captivate 5
    I am publishing my project to html, but wish to change the background colour of the html page to match the projects colour scheme.
    I can find no option in Captivate to do this, and it is always output as white = <body   bgcolor="#f5f4f1">
    I change the colours used within captivate and change the html colour of the borders, or the captivate project background, but this does not effect the html page when published.
    Is this possible?
    At present I am having to manual amend the html to the colour of my choice.

    Hi there
    Can you post a screen grab of what you are seeing? The instructions Orange_Sean provided should have done the trick for you. Even though you aren't using Borders, it still should have changed the HTML background color. Unless we have unearthed a bug or something.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Problem in displaying data in the smartform output.

    Dear Freinds,
                    I have a requirement as per my requirement i have to display the employee dependents details in the smartform output.
    I have taken a table in smartform and collected all teh employee dependents details . Each dependents his own  details around 8 fields. so iam displaying in the smartform it is working till now no problem ........iam getting data as below
    Dependentrelation | dependentname|passportno|expirydate|visano|visadate|visa expire date| ResidenceNo|Residence issuedate|
    spouse                 | Raja                   |123456       |10/09/2009|122233|10/01/2009|10/01/2010 | 1001             |10/01/2009
    These are the one of the dependentds details iam having till now , like this i have another dependts details. Now the problem i have
    to add some fields to this list ( to this internal table) ...........if iam adding one more feild data is getting truncated as i dont have any more fields to add to right in the horizontal line........how can i solve this issue and how can i add further fields to this list
    like date of birth of the dependents and gender
    please could any one tell how i can solve this issue.
    regards
    divya.

    If this is a Tablethen only thing you can do is re-size the grid and font size to adjust your data. Like, displaying HEADINGS & DATAs in 2 rows instead of 1, etc.
    Nothing else can be done. Otherwise you have to trim down the data to adjust in one page.

  • Problem in sending the Smartform Output as PDF through Mail

    Dear All,
    I am sending the Smartform Output as an attachment by converting it into PDF. But when I am recieve this attachment I am unable to open the PDF file, it is giving error that FILE IS DAMAGED. Below is the code:
    REPORT  Y_SEND_MAIL2.
    TABLES: vbrk, vbrp.
    TYPE-POOLS: abap.
    DATA: it_vbrk TYPE TABLE OF vbrk WITH HEADER LINE.
    DATA: i_formname      TYPE       tdsfname,
          i_fm_name       TYPE       rs38l_fnam,
          it_vbak TYPE TABLE OF vbak WITH HEADER LINE,
          it_ekko TYPE TABLE OF ekko WITH HEADER LINE.
    DATA:  is_bil_invoice TYPE lbbil_invoice,
           output_options      TYPE ssfcompop,
           control_parameters  TYPE ssfctrlop,
           e_devtype           TYPE rspoptype,
           job_output_info     TYPE ssfcrescl,
           bin_file            TYPE xstring,
           lines               TYPE TABLE OF tline WITH HEADER LINE,
           doctab_archive      TYPE TABLE OF docs WITH HEADER LINE,
           filelength          TYPE i,
           bin_filesize        TYPE i,
           docs          TYPE TABLE OF docs WITH HEADER LINE.
    *"Types
    TYPES: t_document_data TYPE sodocchgi1,
           t_packing_list TYPE sopcklsti1,
           t_attachment TYPE solisti1,
           t_body_msg TYPE solisti1,
           t_receivers TYPE somlreci1,
           t_pdf TYPE tline.
    *"Workareas
    DATA :w_document_data TYPE t_document_data,
          w_packing_list TYPE t_packing_list,
          w_attachment TYPE t_attachment,
          w_body_msg TYPE t_body_msg,
          w_receivers TYPE t_receivers,
          w_pdf TYPE t_pdf.
    *internal tables
    DATA : i_document_data TYPE STANDARD TABLE OF t_document_data,
           i_packing_list TYPE STANDARD TABLE OF t_packing_list,
           i_attachment TYPE STANDARD TABLE OF t_attachment,
           i_body_msg TYPE STANDARD TABLE OF t_body_msg,
           i_receivers TYPE STANDARD TABLE OF t_receivers,
           i_pdf TYPE STANDARD TABLE OF t_pdf.
    DATA: BEGIN OF line_bin,
             data(1024) TYPE x,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    So please suggest a solution.
    Regards,
    Vishal

    Continued:
    SELECT-OPTIONS: s_vbeln FOR vbrk-vbeln,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY DEFAULT sy-datum.
    SELECT * FROM vbrk
    INTO TABLE it_vbrk
    WHERE fkdat IN s_fkdat
          AND vbeln IN s_vbeln.
    i_formname = 'Z_SD_JINDAL_INVOICE10'.
    output_options-tddest        = 'LP02'.
    output_options-tdimmed       = 'X'.
    output_options-tdnewid       = 'X'.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = i_formname
      IMPORTING
        fm_name            = i_fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.          "checking subrc
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.                     "IF sy-subrc <> 0
    READ TABLE it_vbrk INDEX 1.
    IF sy-subrc = 0.
      is_bil_invoice-hd_gen-bil_number = it_vbrk-vbeln.
    ENDIF.
    control_parameters-no_dialog = 'X'.
    control_parameters-getotf = 'X'.
    CALL FUNCTION i_fm_name        "'/1BCDWB/SF00000097'
      EXPORTING
       control_parameters         = control_parameters
       output_options             = output_options
       user_settings              = space
       is_bil_invoice             = is_bil_invoice
    IMPORTING
       job_output_info            = job_output_info
    TABLES
       it_vbak                    = it_vbak
    EXCEPTIONS
       formatting_error           = 1
       internal_error             = 2
       send_error                 = 3
       user_canceled              = 4
       OTHERS                     = 5.
    IF sy-subrc <> 0.
    *      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *FORM convert_otf_2_pdf.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
    *      EXPORTING
    *        USE_OTF_MC_CMD               = 'X'
    *        ARCHIVE_INDEX                =
        IMPORTING
          bin_filesize                 = bin_filesize
        TABLES
          otf                          = job_output_info-otfdata[]
          doctab_archive               = docs[]
          lines                        = lines[]
        EXCEPTIONS
          err_conv_not_possible        = 1
          err_otf_mc_noendmarker       = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    *      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *ENDFORM.                    "convert_otf_2_pdf

  • Text and table structure getting jumbled up in the smartform output

    Hi all ,
    While viewing the print preview of a smartform output , i am facing  a strange issue.
    The hardcoded text is getting jumbled up .For eg:"As soon as possible"  becomes " as possible . soon as"
    The structure of the table is also getting reversed.That is the table is now getting displayed with the last couloum first.The data in the table is also coming in the reverse order.
    While executing the smartform directly , the layout is coming in the proper order.But while executing this through a transaction (FINT) , this issue is coming up.The print program is a standard program.
    I have tried deleting the window , copying it to a new smartform etc.I have also tried in different systems to check whether if it is an issue with the system.
    If anyone has faced a similar issue , please let me know how to solve it.Thanks a lot in advance.
    Regards,
    Rashmi

    Hi
    Please check the Printout rather the print Preview. and also check the Structure/table entries also that u printing and also if u r using template, then check the assignment 1 of 1 , etc to the texts.
    surya

Maybe you are looking for

  • How to get a Canon MF4150 to scan

    I've recently moved from a PC to Mac. Canon provides print and fax drivers for Macs for my laser multi-function Canon MF4150. But not a driver for scanning, and they say they don't have any plans to produce one (in spite of the fact that they still a

  • Can you record the audio from a Video embedded in a pdf?

    I can't seem to find anything on this, so I will ask. A client sent us a company produced interactive pdf and wants us to use the audio from a video clip that is in the pdf. We asked for the audio clip but they don't know who to get it from and just

  • 23-d038c all-in-one computer: speakers won't play? or don't exist? help!

    I am setting up a HP ENVY 23-d038c. It is an all-in-one Touchscreen with Beats audio. I already have an HP ENVY laptop with Beats audio, and liked it, so I decided to get this new one to fill a need for a computer in the family room. It is "new' but

  • Hyperion config utility release 9.3.1 installation error

    Dear, During the installation of Hyp Confi Utility, I am getting an error saying that " specify the password for the database for product Hyperion Shared Services" I tried to give the diff passwords and Essbase password but its not working. I want to

  • Why do 2 diff. undo tablespace required in RAC

    Hi - 1 - I can understand that we do require 2 diff. log files as 2 process can not write on the same redo log files. But I could not understand the logic of using 2 diff. undo tablespaces, when tablespaces can be in shared mode. They what is the rea