How to print smartform from a report

Im displaying a report, which contains several documents, whereby which ewch document is connected to a smartform.
The page displaying the report contains a button 'Print'
When clicking on the Print button, all the documents in the report should be printed.
But my program is creating a spool file of the report, which will be printed further - its not what I want
I want the program to print the smartforms of each documents on the report directly.
heres my code and I dont know what I should do to be able to print the smartforms directly
Get the function module name of the smartform.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname = '/EU000/FI_PRINT_DEBIT_NOTE'
      IMPORTING
        fm_name  = g_fm_name.
gw_options-tdnoprev = ' '.
gw_options-tddest = 'LOCL'.
gw_options-tdprinter = 'LOCL'.
gw_options-tdnewid = 'X'.
gw_options-tdimmed = 'X'.
gw_control-preview = ' '.
gw_control-no_dialog = 'X'.
write: text-006,' ', text-007, ' ', text-008.
write:/.
For all the documents
    LOOP AT gi_all_data INTO gw_all_data.
      write: gw_all_data-gjahr(4), ' ',gw_all_data-belnr,'     ', gw_all_data-belnr.
      write:/.
CASE SY-UCOMM.
WHEN 'PRINT'.
Call the smarform
      CALL FUNCTION g_fm_name
        EXPORTING
          gw_all_data = gw_all_data
          user_settings = ' '
          output_options = gw_options
          control_parameters = gw_control.
WHEN 'BACK'.
LEAVE SCREEN.
ENDCASE.

DATA:   x_control_parameters TYPE ssfctrlop,
        x_output_options TYPE ssfcompop.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_prin LIKE usr01-spld.
SELECTION-SCREEN BEGIN OF LINE.
INITIALIZATION.
  SELECT  spld
          FROM usr01
          INTO p_prin UP TO 1 ROWS
          WHERE bname = sy-uname.
  ENDSELECT.
START-OF-SELECTION.
  x_output_options-tdimmed = c_x.
  x_output_options-tddest = p_prin.
  x_output_options-tdnewid = c_x.
  x_output_options-tdreceiver = sy-uname.
  x_output_options-tdcopies = '001'.
  x_control_parameters-device = 'PRINTER'.
  x_control_parameters-no_dialog = c_x.
  x_control_parameters-langu = sy-langu.
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
   EXPORTING
     formname                 = 'Z_SMARTFORM'
  VARIANT                  = ' '
  DIRECT_CALL              = ' '
  IMPORTING
    fm_name                  = f_name1
  EXCEPTIONS
    no_form                  = 1
    no_function_module       = 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.
IF P_PRI = 'X'.
  CALL FUNCTION F_NAME1
    EXPORTING
  ARCHIVE_INDEX              =
  ARCHIVE_INDEX_TAB          =
  ARCHIVE_PARAMETERS         =
   CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
  MAIL_APPL_OBJ              =
  MAIL_RECIPIENT             =
  MAIL_SENDER                =
   OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
  USER_SETTINGS              = 'X'
      wa_header                  = wa_zmexh51
IMPORTING
  DOCUMENT_OUTPUT_INFO       =
  JOB_OUTPUT_INFO            =
  JOB_OUTPUT_OPTIONS         =
    TABLES
      tab_item                   = TAB_ZMEXD51
      tab_item1                  = TAB_ZMEXS51
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.
ELSEIF P_PRE = 'X'.
  CALL FUNCTION F_NAME1
    EXPORTING
  ARCHIVE_INDEX              =
  ARCHIVE_INDEX_TAB          =
  ARCHIVE_PARAMETERS         =
  CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
  MAIL_APPL_OBJ              =
  MAIL_RECIPIENT             =
  MAIL_SENDER                =
  OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
  USER_SETTINGS              = 'X'
      wa_header                  = wa_zmexh51
IMPORTING
  DOCUMENT_OUTPUT_INFO       =
  JOB_OUTPUT_INFO            =
  JOB_OUTPUT_OPTIONS         =
    TABLES
      tab_item                   = TAB_ZMEXD51
      tab_item1                  = TAB_ZMEXS51
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.
ENDIF.
Check the above code its just similar requirement  it may helpful to you.
Thanks,
Phani.

Similar Messages

  • How to exctract data from a report to use it in a process

    Hi! I would like to know how to exctract data from a report to use it in a process. Let's say that I have a report which have following fields: id_person, name_person. And then, I want to make a process which introduce the id_person (from report) into an associative tabel. How can I reffer to the fields from my report?
    I was thinking about something like that( this should be the code from my process)
    insert into associative_table(id_person)
    values(id_person) or
    insert into associative_table(id_person)
    values(Report_name.id_person) but it doesn't work....
    Thank you very much.

    Another option, use collections.
    Create an on load process that loads all the rows you would have in your report into a collection:
    begin
    HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
    p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS' );
    for x in (SELECT CONTACT_ID, CONTACT_FNAME, CONTACT_LNAME
    FROM CONTACT
    WHERE InStr( pkg_CalendarMgr.f_FetchContactIDsForDay( TO_DATE( :P3_CALENDAR_DT, 'YYYYMMDD' ), 'OF' ), CONTACT_ID ) > 0 )
    loop
    htmldb_collection.add_member(p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS',
    p_c001 => x.CONTACT_ID,
    p_c002 => x.CONTACT_FNAME,
    p_c003 => x.CONTACT_LNAME);
    end loop;
    end;
    Then, instead of your report selecting from the table, have it select from the collection, this way your display will match what's in the collection:
    SELECT c001, c002 || Chr(32) || c003 CONTACT_NAME, 'Remove' remove
    FROM htmldb_collections
    WHERE collection_name = 'ASSIGNED_CALENDAR_CONTACTS'
    ORDER BY c003, c002
    Then you can have a button on the form that steps through the collection, one element at a time and does whatever you want it to.

  • How to print texts from iphone 4

    how to print text from iphone 4 without having to screenshot?

    An iOS cannot be downgraded or uninstalled...Apple has never supported doing this and removes the older iOS version files when a new iOS is released.

  • How to print photos from my iphone?

    I have the HP Photosmart C309a,(wireless) and would like to know how to print photos from my iphone 3G.
    I have the "app" "HP ePrint Home & Biz", but I don't know if it's compatible with my printer?

    The app is compatible with your printer IF it is connected to a network (not via USB to a printer).
    If it is not working restart your router by pulling its power plug momentarily.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • How to print information from my Apple I pad to my HP Photosmart D110 series printer

    How to print information from my Apple I Pad to my HP Photosmart D110 series printer ?

    Hello 518,
    Welcome to the HP Support Forums!
    It would appear that the HP Photosmart Plus 209B is not compatible with AirPrint. Without AirPrint you can only print via an App.
    I suggest the ePrint App. Getting Started with HP ePrint Mobile Apps<---
    Cheers,
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • How to print labels from my Christmas card list?

    Does anyone know how to print labels from the Christmas card list in Contacts?
    I am new to computers and having managed to type in all my addresses I was hoping to print some labels!    Please can anyone help!

    Welcome to the Support Communities. What version of OS X is your Mac running? ...Click on the  menu at top left of your screen and choose About This Mac. Note the version in the form 10.n.n and then see this ASC tutorial:
    Update your product list
    Then see this Apple doc, which is for OS X 10.9 (Mavericks)...
    Contacts (Mavericks): Print contact information
    ...Found by searching here:
    http://support.apple.com/kb/index?page=search

  • Does anyone know how to discard printer information from a report?

    Hello all,
    We've got several reports in which printer info is saved in the report.
    We would like to remove that info programmatically from the report.
    Does anyone how to do that and to save this modified info to the report?
    I would be pleased to be given a code example.
    I guess it should be something like the fragment below, but saving this to the report doesn't seem to be doable.
    printOptions.SavedDriverName = printOptions.DriverName = "DISPLAY";
    printOptions.SavedPortName = printOptions.PortName = string.Empty;
    printOptions.SavedPrinterName = printOptions.PrinterName = string.Empty;
    printOptions.PaperSize = CrPaperSizeEnum.crPaperSizeDefault;
    printOptions.PaperOrientation = CrPaperOrientationEnum.crPaperOrientationDefault;
    printOptions.PaperSource = CrPaperSourceEnum.crPaperSourceAuto;
    report.ReportClientDocument.PrintOutputController.ModifyPrintOptions(printOptions);
    report.ReportClientDocument.PrintOutputController.ModifyPrinterName(string.Empty);
    report.ReportClientDocument.PrintOutputController.ModifyPageMargins(0, 0, 0, 0);
    report.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationDefault);
    Thanks,
    Henk Spaan.

    Hello Henk,
    You could simply check the 'No Printer' option in the report.
    From designer check File --> Page Setup --> No Printer.
    Or do it programatically.
    http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2010/09/15/how-to-check-no-printer-on-a-crystal-report-using-the-ras-sdk-in-net
    - Bhushan
    Senior Engineer
    SAP Active Global Support
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Getting started and moving ahead with Crystal Reports .NET applications.

  • Print smartform from background

    Dear Experts,
    I have requirement to create delivery then create bill automatically so i open background job from program (A) and submit the creating program for bill (B) via this job what happened is the delivery creating is ok, the delivery printing is ok and the billing creation is ok but the billing printing program (C) is not ok where the spool is creating with status waiting so can any body help how to print from background job??
    program (A) (Create backgroundjob and submit program via it)
    FORM USEREXIT_SAVE_DOCUMENT.
    DATA: jobcount TYPE tbtcjob-jobcount,
          new_time type TBTCJOB-SDLSTRTTM.
    data : p_vbeln TYPE likp-vbeln.
    DATA : v_JOB_WAS_RELEASED LIKE  BTCH0000-CHAR1.
    break rurik.
    if T180-TRTYP = 'H'
      and ( likp-lfart = 'ZDCF'
    or    likp-lfart = 'ZDCI'
      or    likp-lfart = 'ZDCO'
      or    likp-lfart = 'ZDCP'
      or    likp-lfart = 'ZDCR'
      or    likp-lfart = 'ZDOB'
      or    likp-lfart = 'ZDOT'
      or    likp-lfart = 'ZDQT'
    or    likp-lfart = 'ZDRE' - Ian
      or    likp-lfart = 'ZDSO').
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname               = 'SD_AUTOMATION'
      SDLSTRTDT             = NO_DATE
      SDLSTRTTM             = NO_TIME
      JOBCLASS              =
    IMPORTING
       JOBCOUNT               = jobcount
    CHANGING
      RET                   =
    EXCEPTIONS
       CANT_CREATE_JOB        = 1
       INVALID_JOB_DATA       = 2
       JOBNAME_MISSING        = 3
       OTHERS                 = 4.
    SUBMIT zsd_create_billing_document
            with vbeln EQ LIKP-VBELN
            AND RETURN
            VIA JOB 'SD_AUTOMATION'
            NUMBER jobcount.
    new_time = sy-uzeit + 10.  "short delay
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount                         = jobcount
        jobname                          = 'SD_AUTOMATION'
       STRTIMMED                       = 'X'
        SDLSTRTDT                        = sy-datum
        SDLSTRTTM                        = new_time
    IMPORTING
        JOB_WAS_RELEASED                 = v_JOB_WAS_RELEASED
    EXCEPTIONS
       CANT_START_IMMEDIATE              = 1
       INVALID_STARTDATE                 = 2
       JOBNAME_MISSING                   = 3
       JOB_CLOSE_FAILED                  = 4
       JOB_NOSTEPS                       = 5
       JOB_NOTEX                         = 6
       LOCK_FAILED                       = 7
       INVALID_TARGET                    = 8
       OTHERS                            = 9
    ENDIF.
    ENDFORM.
    Program B (Creat bill)
    REPORT zsd_create_billing_document
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES: vbup, vbak, vbuk.
    DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
    DATA done(1).
    PARAMETERS vbeln TYPE likp-vbeln.
    DATA  sal_vbeln TYPE vbeln..
    DATA  messtab LIKE TABLE OF bdcmsgcoll WITH HEADER LINE.
    DATA   billing_doc TYPE vbeln.
    DATA  messagetext(200).
    MESSAGE s002(zsd).
    WRITE: / vbeln.
    DATA :  v_print TYPE i.
    CALL FUNCTION 'ENQUEUE_EVVBLKE'
    EXPORTING
      MODE_LIKP            = 'E'
      MANDT                = SY-MANDT
       vbeln                = vbeln
      X_VBELN              = ' '
      _SCOPE               = '2'
        _wait                = 'X'
    " _wait                 = space
      _COLLECT             = ' '
    EXCEPTIONS
       foreign_lock         = 1
       system_failure       = 2
       OTHERS               = 3
    MESSAGE s005(zsd).
    *In case ZSOT automatic billing once we create delivery and post goods issue manual.
    SELECT SINGLE vbelv
      FROM vbfa
      INTO sal_vbeln
      WHERE vbeln = vbeln
      AND   vbtyp_v = 'C'.
    SELECT SINGLE *
      FROM vbak
      WHERE vbeln = sal_vbeln.
    import v_print to v_print FROM MEMORY id 'PRINTFLAG'.
    IF vbak-auart EQ 'ZSOT'.
    IF v_print eq '1'.
        PERFORM create_document USING vbeln
                              CHANGING sy-subrc.
    ENDIF.
    ELSE.
    *Other than ZSOT Post Goods issue from ZPGI2 and from there automatic billing.
    ENDIF.
    *&      Form  CREATE_DOCUMENT
          text
         -->P_VBELN    text
    FORM create_document USING p_vbeln
                         CHANGING sysubrc.
      PERFORM bdc_dynpro      USING 'SAPMV60A' '0102'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'KOMFK-VBELN(01)'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'KOMFK-VBELN(01)'
                                    p_vbeln."'1130010202'.
      PERFORM bdc_dynpro      USING 'SAPMV60A' '0104'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'VBRK-FKART'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=SICH'.
      CALL FUNCTION 'DEQUEUE_EVVBLKE'
       EXPORTING
          MODE_LIKP       = 'E'
          MANDT           = SY-MANDT
            vbeln           = vbeln
          X_VBELN         = ' '
          _SCOPE          = '3'
          _SYNCHRON       = ' '
          _COLLECT        = ' '
      CALL TRANSACTION 'VF01' USING bdcdata
                       MODE   'N'
                       UPDATE 'S'
                       MESSAGES INTO messtab.
      READ TABLE messtab WITH KEY msgtyp = 'E'.
      IF sy-subrc EQ 0.
        sysubrc = 4.
      ELSE.
        sysubrc = 0.
      ENDIF.
      LOOP AT messtab.
        sy-msgty = messtab-msgtyp.
        sy-msgid = messtab-msgid.
        sy-msgno = messtab-msgnr.
        sy-msgv1 = messtab-msgv1.
        sy-msgv2 = messtab-msgv2.
        sy-msgv3 = messtab-msgv3.
        sy-msgv4 = messtab-msgv4.
        CALL FUNCTION '/SAPTRX/GET_MESSAGE_TEXT'
          EXPORTING
            msgid                = sy-msgid
            msgno                = sy-msgno
            msgv1                = sy-msgv1
            msgv2                = sy-msgv2
            msgv3                = sy-msgv3
            msgv4                = sy-msgv4
          IMPORTING
            messagetext          = messagetext
          EXCEPTIONS
            no_message_retrieved = 1
            OTHERS               = 2.
        WRITE: / messagetext.
        CLEAR messagetext.
      ENDLOOP.
    *... refresh tables
      REFRESH: messtab, bdcdata.
    ENDFORM.                    "CREATE_DOCUMENT
    *&      Form  BDC_DYNPRO
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  change_status
          text
    -->  p1        text
    <--  p2        text
    FORM change_status .
    *Change status if delivery and the billing document has been created
      SELECT  *
        FROM vbup
        WHERE vbeln = vbeln
        AND   fksta NE 'C'.
        vbup-fksta = 'C'.
       vbup-gbsta = 'C'.
        MODIFY vbup.
      ENDSELECT.
      UPDATE vbuk
      SET fkstk = 'C'
         gbstk = 'C'
      WHERE vbeln = vbeln.
    ENDFORM.                    " change_status
    Program C (Print Bill)
    REPORT  z_sdps_invoice.
    *&    <Module>:  SD Smart Forms.
    *& Type       : Executable
    *& Request No.:
    *& Author/Co. : Ahmed Al Eryani
    *& Created On : 26.02.2007
    *& Finished   : 24.2007
    *& Description:
    *&                    MODIFICATION LOG
    *& Modified by  :
    *& Request No.  :
    *& Dev. Class   :
    *& Date Modified:
    *& Description  :
    TABLES: vbrk, kna1, vbrp, makt, konv, vbkd.
    SELECTION-SCREEN BEGIN OF BLOCK a.
    PARAMETER: p_vbeln LIKE vbrp-vbeln OBLIGATORY MATCHCODE OBJECT vmcf. "Billing document No
    "SELECT-OPTIONS s_bukrs FOR bkpf-bukrs. "Company Code
    SELECTION-SCREEN END OF BLOCK a.
    *itab is object of our smart form structre
    DATA: itab TYPE zsd_invoice OCCURS 0 WITH HEADER LINE.
    DATA: wa_footer TYPE zsd_invv1.
    DATA: t_items TYPE zsd_inv WITH HEADER LINE,
          w_items TYPE LINE OF zsd_inv,
          it_footer TYPE zsd_inv1,
          w_footer TYPE LINE OF zsd_inv1.
    DATA: amountspell LIKE spell.
    DATA: g_fm_name TYPE rs38l_fnam.
    DATA: mnumvflag(10) TYPE c.
    DATA: coun TYPE i,
          totalforitems TYPE kwert,
          lasttotal(8) TYPE p DECIMALS 2,
          lasttotalc(11) TYPE c,
          firstpart(11) TYPE c,
          secondpart(2) TYPE c.
    DATA: currency TYPE waerk.
    DATA: currtxet(50) TYPE c.
    *Header internal table
    DATA: BEGIN OF t_header OCCURS 0,
      vbeln LIKE vbrk-vbeln,"Document no
      name1 LIKE kna1-name1,"Customer Name
      adrnr LIKE kna1-adrnr,"Customer Address
      bstkd LIKE vbkd-bstkd,"
      kunnr LIKE kna1-kunnr,"Customer Account no
      waerk LIKE vbrk-waerk, "currency key
      aubel LIKE vbrp-aubel,
      kunrg LIKE vbrk-kunrg,
      street LIKE adrc-street,
      fkart LIKE vbrk-fkart,
      lgort LIKE lips-lgort,"Stord bin
      lgobe LIKE t001l-lgobe,
      ktokd LIKE kna1-ktokd,
      PSTYV LIKE vbrp-PSTYV,
      orgbil LIKE vbfa-vbelv,
    END OF t_header.
    *detail internal table
    DATA: BEGIN OF t_items1 OCCURS 0,
      matnr LIKE vbrp-matnr,"Material Number
      posnr LIKE vbrp-posnr,
      vgpos LIKE vbrp-vgpos,
      maktx LIKE makt-maktx,"Material Description
      lgort LIKE vbrp-lgort,"Storage location
      fkimg LIKE vbrp-fkimg,"
      knumv LIKE vbrk-knumv,"
      unitprice LIKE konv-kawrt,
      total LIKE konv-kawrt,
      waers LIKE konv-waers,
      kkurs LIKE konv-kkurs,
      vgbel LIKE vbrp-vgbel,
      lgpbe LIKE lips-lgpbe,
      vgtyp LIKE vbrp-vgtyp,
    END OF t_items1.
    DATA: v_belnr TYPE belnr_d.
    *Unit price internal table
    DATA: BEGIN OF t_untprice OCCURS 0,
      kschl LIKE konv-kschl,"condition type
      kawrt LIKE konv-kawrt,"unit price
    END OF t_untprice.
    *Condition(spcial deduction)
    DATA: BEGIN OF t_spcialcnd OCCURS 0,
      kschl LIKE konv-kschl,"condition type
      kwert LIKE konv-kwert,"Deduction value
    END OF t_spcialcnd.
    DATA: t_tax LIKE TABLE OF t_spcialcnd WITH HEADER LINE,
          v_tax LIKE konv-kwert.
    DATA: BEGIN OF t_curtxt OCCURS 0,
      ltext LIKE tcurt-ltext,
    END OF t_curtxt.
    DATA :return_code TYPE i," VALUE 999,
          us_screen TYPE c. "VALUE 'X'.
    declaration of data
    INCLUDE rlb_invoice_data_declare.
    definition of forms
    INCLUDE rlb_invoice_form01.
    INCLUDE rlb_print_forms.
    START-OF-SELECTION.
      "IF p_vbeln IS NOT INITIAL.
        PERFORM entry USING return_code us_screen.
      "ENDIF.
          FORM ENTRY
    FORM entry USING return_code us_screen.
      DATA: lf_retcode TYPE sy-subrc.
      CLEAR retcode.
      xscreen = us_screen.
    perform processing using us_screen
                        changing lf_retcode.
    if lf_retcode ne 0.
       return_code = 1.
    else.
       return_code = 0.
    endif.
      IF p_vbeln IS INITIAL.
        p_vbeln = nast-objky.
      ENDIF.
      "get header data
      SELECT SINGLE vbrk~vbeln vbrk~waerk vbrp~aubel vbrk~kunrg vbrk~fkart vbrp~lgort vbrp~PSTYV
      INTO (t_header-vbeln, t_header-waerk, t_header-aubel, t_header-kunrg, t_header-fkart,
        t_header-lgort, t_header-PSTYV)
      FROM vbrk JOIN vbrp ON vbrp~vbeln = vbrk~vbeln
                JOIN kna1 ON vbrk~kunrg = kna1~kunnr
      WHERE vbrk~vbeln = p_vbeln.
      IF t_header-PSTYV = 'ZREN'.
        SELECT SINGLE VBELV
          INTO t_header-orgbil
          FROM vbfa
          WHERE vbeln = p_vbeln
          and VBTYP_V = 'M'.
      ENDIF.
      SELECT SINGLE t001l~lgobe
        INTO t_header-lgobe
        FROM t001l
        WHERE t001l~lgort = t_header-lgort.
      SELECT SINGLE kna1~name1 kna1~adrnr kna1~kunnr kna1~ktokd
        INTO (t_header-name1, t_header-adrnr, t_header-kunnr, t_header-ktokd)
      FROM  kna1 "ON vbrk~kunrg = kna1~kunnr
      WHERE kna1~kunnr = t_header-kunrg
        AND spras = 'AR'.
      IF t_header-name1 IS INITIAL.
        SELECT SINGLE kna1~name1 kna1~adrnr kna1~kunnr kna1~ktokd
          INTO (t_header-name1, t_header-adrnr, t_header-kunnr, t_header-ktokd)
        FROM  kna1 "ON vbrk~kunrg = kna1~kunnr
        WHERE kna1~kunnr = t_header-kunrg
          AND spras = 'EN'.
      ENDIF.
      IF t_header-ktokd = 'ZONE'.
        SELECT SINGLE belnr
          INTO v_belnr
        FROM bkpf
        WHERE xblnr = p_vbeln.
        SELECT SINGLE name1
        INTO t_header-name1
        FROM bsec
        WHERE belnr = v_belnr.
      ENDIF.
      SELECT SINGLE adrc~street
        INTO t_header-street
        FROM adrc
        WHERE addrnumber = t_header-adrnr
        AND langu = 'AR'.
      IF t_header-street IS INITIAL.
        SELECT SINGLE adrc~street
          INTO t_header-street
          FROM adrc
          WHERE addrnumber = t_header-adrnr
          AND langu = 'EN'.
      ENDIF.
      "get details data
      SELECT vbrp~matnr vbrp~posnr vbrp~vgpos vbrp~fkimg
             vbrk~knumv vbrp~matnr vbrp~vgbel vbrp~vgtyp"makt~maktx
      INTO CORRESPONDING FIELDS OF TABLE t_items1
      FROM vbrp "JOIN makt ON vbrp~matnr = makt~matnr
                JOIN vbrk ON vbrp~vbeln = vbrk~vbeln
                "join konv on vbrk~knumv = konv~knumv
      WHERE vbrp~vbeln = p_vbeln
        AND vbrp~fkimg NE '0.000'.
      "AND makt~spras = 'E'.
      break arasmy.
      LOOP AT t_items1.
        SELECT SINGLE lips~lgpbe
          INTO t_items1-lgpbe
          FROM lips
          WHERE vbeln = t_items1-vgbel
          AND posnr = t_items1-vgpos.
        SELECT SINGLE makt~maktx
        INTO  t_items1-maktx
        FROM  makt
        WHERE matnr = t_items1-matnr
        AND   makt~spras = 'EN'.
        SELECT SINGLE konv~kbetr konv~kwert konv~waers konv~kkurs
          INTO (t_items1-unitprice, t_items1-total, t_items1-waers,
          t_items1-kkurs)
        FROM konv
        WHERE konv~kschl = 'NETW'"'ZSPC'                               "'ZSP1'
        AND   konv~knumv = t_items1-knumv
        AND   kposn      = t_items1-posnr.
        t_items1-unitprice = ( t_items1-total / t_items1-fkimg ) * t_items1-kkurs.
        MODIFY t_items1.
        mnumvflag = t_items1-knumv."Number of the document condition
      ENDLOOP.
    *get the deduction value for the document condiotion no
      SELECT konvkschl konvkwert
      INTO CORRESPONDING FIELDS OF TABLE t_spcialcnd
      FROM konv
      WHERE konv~kschl IN ('ZSSD', 'ZSCD', 'ZSDD', 'ZSPD', 'ZSWD', 'ZMW1', 'ZSGS', 'ZMW2')
      AND  konv~knumv = mnumvflag.
    Get tax 10%
        SELECT konvkschl konvkwert
        APPENDING CORRESPONDING FIELDS OF TABLE t_tax
        FROM konv
        WHERE konv~kschl = 'MWST'
        AND  konv~knumv = mnumvflag.
      itab-invn  = t_header-vbeln.
      itab-orgbil  = t_header-orgbil.
      itab-cusna = t_header-name1.
      itab-addr  = t_header-street.
      itab-custn = t_header-kunrg.
      itab-sord  = t_header-aubel.
      itab-fkart = t_header-fkart.
      itab-lgort = t_header-lgort.
      itab-lgobe = t_header-lgobe.
      itab-PSTYV = t_header-PSTYV.
      currency   = t_header-waerk.
      LOOP AT t_items1.
        w_items-matn   = t_items1-matnr.
        w_items-matdes = t_items1-maktx.
        w_items-stloc  = t_items1-lgpbe."lgort.
        w_items-qunt   = t_items1-fkimg.
        w_items-total  = t_items1-total.
        totalforitems  = totalforitems + w_items-total.
        COLLECT w_items INTO t_items.
      endloop.
      LOOP AT t_items1.
        LOOP AT t_items WHERE matn = t_items1-matnr.
          t_items-prc = t_items1-unitprice.
          MODIFY t_items.
        ENDLOOP.
      ENDLOOP.
      LOOP AT t_items.
          coun = coun + 1.
          t_items-itmn = coun.
          MODIFY t_items.
      ENDLOOP.
        w_footer-totalforitems = totalforitems.
        LOOP  AT t_spcialcnd.
          CASE t_spcialcnd-kschl.
            WHEN 'ZSSD'.
              w_footer-spdisc    = w_footer-spdisc      + t_spcialcnd-kwert.
            WHEN 'ZSCD'.
              w_footer-comdisc   = w_footer-comdisc     + t_spcialcnd-kwert.
            WHEN 'ZSDD'.
              w_footer-DIFMAT    = w_footer-DIFMAT      + t_spcialcnd-kwert.
            when 'ZSPD'.
              w_footer-trgtdisc  = w_footer-trgtdisc    + t_spcialcnd-kwert.
            WHEN 'ZMW2'.
              w_footer-comindisc = w_footer-comindisc   + t_spcialcnd-kwert.
            WHEN 'ZSWD'.
              w_footer-cshdisc   = w_footer-cshdisc     + t_spcialcnd-kwert.
            WHEN 'ZSGS'.
              w_footer-stampsdisc = w_footer-stampsdisc + t_spcialcnd-kwert.
          ENDCASE.
          w_footer-ttldisc = w_footer-spdisc + w_footer-comdisc + w_footer-trgtdisc
                           + w_footer-cshdisc + w_footer-DIFMAT + w_footer-stampsdisc.
        ENDLOOP.
        w_footer-aftrdiscnts = w_footer-totalforitems + w_footer-ttldisc.
        LOOP AT t_tax WHERE kwert NE '0.00'.
          w_footer-saltax = w_footer-saltax + t_tax-kwert.
        ENDLOOP.
        w_footer-totalaftrtax = w_footer-aftrdiscnts + w_footer-saltax.
        w_footer-total = w_footer-totalaftrtax + w_footer-comindisc.
        lasttotal = w_footer-total.
      APPEND w_footer TO it_footer.
      SELECT tcurt~ltext
      INTO CORRESPONDING FIELDS OF TABLE t_curtxt
      FROM   tcurt
      WHERE tcurt~spras = 'AR'
      AND   tcurt~waers = currency.
      LOOP AT  t_curtxt.
        currtxet = t_curtxt-ltext.
      ENDLOOP.
      itab[] = t_header[].
      lasttotalc = lasttotal.
      SPLIT lasttotalc AT '.' INTO firstpart secondpart.
      lasttotal = firstpart / 100.
      CALL FUNCTION 'SPELL_AMOUNT'
        EXPORTING
          amount    = lasttotal
          currency  = ''"CURRENCY
          filler    = space
          language  = 'A'
        IMPORTING
          in_words  = amountspell
        EXCEPTIONS
          not_found = 1
          too_large = 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.
    --split amount--
    BREAK radha.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = 'Z_INVOICE_PARTS2'
    VARIANT                  = ' '
    DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = g_fm_name
       EXCEPTIONS
         no_form                  = 1
         no_function_module       = 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.
      DATA : control_parameters    TYPE  ssfctrlop,
             print_options         TYPE  ssfcompop.
      DATA : document_output_info  TYPE  ssfcrespd,
             job_output_info       TYPE  ssfcrescl,
             job_output_options    TYPE  ssfcresop.
      DATA : count TYPE i.
      control_parameters-langu = 'AR'.
      control_parameters-no_dialog = 'X'."Don't show Dialog
    print_options-tdarmod = '1'.
    print_options-tdcopies = '001'.
    print_options-tddest = 'LP02'.
    print_options-tdprinter = 'ZARSWIN'.
       print_options-tdimmed = 'X'.
    print_options-tddelete = 'X'.
    print_options-tdlifetime = '8'.
       print_options-tddest = 'LP03'."nast-ldest.
      "print_options-tddest = nast-ldest.
      "print_options-tdcopies = pv_copies.
    print_options-tddelete = 'X'.
      print_options-tdfinal = 'X'.
    print_options-tdnewid = 'X'.
    WHILE count ne 1.
       IF job_output_info-outputdone ne 'X'.
         CALL FUNCTION g_fm_name
          EXPORTING
        ARCHIVE_INDEX             =
        ARCHIVE_INDEX_TAB         =
        ARCHIVE_PARAMETERS        =
           control_parameters       = control_parameters
        MAIL_APPL_OBJ             =
        MAIL_RECIPIENT            =
        MAIL_SENDER               =
            output_options          = print_options
            user_settings           = space
            header                  = itab
            amountspell             = amountspell
            currtxt                 = currtxet
            secondpart              = secondpart
         wa_footer                = w_footer
       IMPORTING
         DOCUMENT_OUTPUT_INFO       = document_output_info
         JOB_OUTPUT_INFO            = job_output_info
         JOB_OUTPUT_OPTIONS         = job_output_options
          TABLES
            it_items                = t_items
            it_footer               = it_footer
       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.
    ENDFORM.                    "ENTRY

    Hi,
    lw_control_param-device = 'PRINTER'.
    lw_control_param-getotf = c_x.
    lw_control_param-no_dialog = c_x.
    lw_composer_param-tdnoprev = c_x.
    <b>*lw_composer_param-tddest = 'LONSC0P310'.</b>
    <b>lw_composer_param-tddest = 'XXXX'.</b> <b>"Four digits</b>
    <i>lw_composer_param-tdnewid = c_x.
    lw_composer_param-tdfinal = c_x.</i> --> Not required
    In place of 'XXXX', replace it by a 4 digit value. It would be available in transaction SPAD->Output Devices->Double click your output device. On the right hand side there would be a field Short Name. Replace 'XXXX' with that value.
    Best regards,
    Prashant

  • Remove Printer Name from Crystal Report

    How can i remove the printer name from the Crystal Report so that the PrinterName property of the CRAXDRT.Report object in the RDC SDK is blank WITHOUT having the "No Printer" Option checkbox checked?
    Here's the scenerio.  When I first create a Report and don't go into Page Setup, PrinterName property is blank.  If I go into Page Setup and explicitly select a printer, PrinterName property equals the name of the printer selected.  If I check the "No Printer" checkbox in Page Setup, PrinterName property is blank.  But if i go back in and uncheck the "No Printer" checkbox in Page Setup, the PrinterName property equals the name of my Windows Default Printer.

    I'm still not sure what is unclear about my first question.  And I'm not sure how any of the info you are requesting is going to make any difference in answering my question.  And I'm not sure how your analogy fits here but ..
    Version of CR = 11.0.0.895
    CR Service Packs applied = None
    Web or Win app? = Win App
    OS? = Windows XP Service Pack 3
    Development language?  = Both Visual Basic 6 and C#.Net 2008
    Method of CR files deployment = email the .RPT file to a client
    Where were the runtime files downloaded from? = Runtimes are installed from Merge Modules donwload from SAP site
    What is the version of the craxdrt.dll on the deployed box? = 11.0.0.893
    So here are the exact steps so you can understand what is going on:
    I have the Crystal Reports Application open side-by-side with my Visual Basic development environment in debug mode so i can step through the code using the RDC SDK.
    1. I open the Crystal Reports Application and create a brand new report - "Test.RPT" and DO NOT go into Page Setup at all and save the report.
    2. In my Visual Basic development environment, i run the code that will generate the report, Here's the exact code
        Dim m_crApp As CRAXDRT.Application
        Dim m_crReport As CRAXDRT.Report
        Set m_crApp = New CRAXDRT.Application
        Set m_crReport = New CRAXDRT.Report
        Set m_crReport = m_crApp.OpenReport("Test.RPT")
    3. When i look at the PrinterName property in the CRAXDRT.Report object, it is blank.
        ie. crReport.PrinterName is equal to ""
    4. I reopen the Crystal Reports Application with report "Test.RPT" and go into Page Setup and check the "No Printer" option.
    5. I go back into my Visual Basic development environment and rerun the code that will generate the report.
    6. When i look at the PrinterName property in the CRAXDRT.Report object, it is still blank.
        ie.  crReport.PrinterName is equal to ""
    7. I reopen the Crystal Reports Application with report "Test.RPT" and go into Page Setup and uncheck the "No Printer" option. I have NOT specified any printer, nor have i clicked the "Printer..." button to setup a printer....i have just unchecked the "No Printer" option
    8. I go back into my Visual Basic development environment and rerun the code that will generate the report.
    9. When i look at the PrinterName property in the CRAXDRT.Report object, it is now set to my WINDOWS DEFAULT PRINTER, yet i had not specified any printer.
        ie.  crReport.PrinterName is equal to "
    MyNetwork\MyPrinter"
    PROBLEMS:
    1. The client needs the report to go to the default windows printer of their machine
    2. If the "No Printer" Option is checked, the Report does not print at all
    3. If the report is set to MY default windows printer and i give it to the client, at times it takes upwards of to a minute for the Print Dialog to disply.  As i've read on other forum posts, it appears Crystal is looking for MY printer on the clients machine and takes a minute before i realizes it can't find it and then sets it to the CLIENTS default windows printer.
    4. The client believes it is unreasonable to wait a minute for the print dialog to appear ...and i agree.
    5. I cannot change the code to use the Select Printer in the RDC SDK - it's a long explanation why but just suffice it to say that i cannot do this.
    All i want to do is either:
    1. Remove the Printer Name in the actual report from the Crystal Reports designer - basically undoing what Crystal did when i went into Page Setup.
    2. Via the RDC SDK, be able to detect the "No Printer" option is selected. Checkign CRAXDRT.PrinterName equal to "" is not an option.

  • How to print Data Model in Report??

    Do anyone know how to print Data Model??
    Thanks your help.
    - Frank

    Hi Venkat,
    Thanks alot.... i am checking the appendix k.
    I want to know that if i want to customize the report as per the client requirement,
    can you please let me know which template i will use if i required remittence advice as well as check print data on the layout.
    The following is the list of field i required:
    Vendor ID
    Check Date
    Check number
    invoice date
    invoice/ CR memo number
    invoice description
    invoice gross amount
    invoice discount amount
    invoice net amount
    total gross amount
    total discount amount
    total net amount
    logo
    company name and info
    bank name and info
    check number
    check amount spelled out
    check date
    check amount numeric
    payee name
    CEO signature
    MICR check number
    MICR routing number
    MICR bank account number
    mailing return address
    mailing address
    Venkat it would be great help if you please let me know the exact process to be follow for check printing report.
    I worked on bi publisher report in 11i, but in 12i the process is bit different.
    also if you have any template ready can you please send me on my mail id ... i forwarded you the test mail from my official id or on [email protected]
    Looking forward to your kind response.
    Regards
    Ratnesh

  • Can't Print Landscape from Crystal Reports Viewer XI

    Post Author: conrad
    CA Forum: General
    Product: Crystal Reports Viewer XI, version 12.0.0.r130_v20070725 and
    Crystal Reports XI, version 11.0.0.1282
    Patches Applied: none
    Operating System(s): XP Pro SP2
    Database(s):
    Error Messages: noneSteps to Reproduce:
    Download and install Crystal Reports Viewer XI
    Open a Crystal Report that prints landscape.
    Save report with data.
    Open that report with Crystal Reports Viewer XI.  Report will display landscape.
    Click Print..OK
    Viewer will attempt to scale output to fit on portrait paper, with varying degrees of success.
    Checking the properties of the report from Viewer (File...Report Properties...) shows a "Page Orientation" of "Landscape" and a message "Page Orientation and size defined by the application (no page information set by report author)."
    Any ideas on how to get the report to print landscape?  It prints that way from Crystal Reports XI.

    Hello Glenda,
    as you refer to the legacy technology I recommend to post this query to the [Legacy Application Development SDKs|SAP Crystal Reports - Legacy SDKs; forum.
    This forum is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Legacy Application Development SDKs queries remain in one place and thus can be easily searched in one place.
    Thanks a lot,
    Falk

  • How to Print preview from Form9i

    I using forms & Report 9i i want to know that it is possible to print or print priview from form9i how, please help me

    Thanks jeet
    I received following error when i try to run report from form9i
    FRM-41213 : Unable to connect to the Report server repserve
    after starting report server by entering following command from Dos
    rwserver server=repserver
    report server repserver start
    after i try to run report from form9i i received following
    FRM-41214 : unable to run report
    following code i enter in when button press trigger
    DECLARE
    Report_Id report_object;
    hTimer timer;
    vcFile varchar2(255);
    vcResult varchar2(30);
    BEGIN
    /* Generate a pseudo-unique filename */
    vcFile := get_application_property(USERNAME)||TO_CHAR(SYSDATE,'YYYYMMDDHHMISS');
    /* We will be producing Postscript output in this case so add a .rrpp extension */
    vcFile := vcFile||'.rrpp';
    /* Find an existing Report Object and set parameters */
    report_id:=FIND_REPORT_OBJECT('JUMREP');
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,FILE);
    /* Format to Postscript */
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'ps');
    /*Desname to our generated filename
    Note: <PhysicalDir> refers to a location on the
    Webserver which we read from with SHOW_DOCUMENT() */
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESNAME,'D:'||vcFile);
    /*Set the name of the Reports Server, again this would be softcoded */
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,'repserver');
    /* Save the Report Handle to a global as well */
    :GLOBAL.ReportHandle := RUN_REPORT_OBJECT(report_id);
    /* Save the generated Filename away for use in the When-Timer-Expired */
    :GLOBAL.PrintOutPut := vcFile;
    /* Create a timer to monitor the Report,
    This one is set to check 4 times a minute */
    hTimer := CREATE_TIMER('PRINTER_QUEUE','15000',REPEAT);
    END;

  • How to print automatically from Reports6i?

    Hi all,
    How to print from Reports6i automatically once it is generated?
    Thanx in advance
    ranjith

    Set the destype to PRINTER, hide the parameter form, run the report and it goes directly to the printer.

  • How to Print the Attachment in Reports

    Hi,
    I am having a Custom form which captures information related to Items. User is attaching Picture of the Item as Attachments. I will generate the information what the User entering in this form.
    Now, my question is, how to print this Item Picture attached as attachments in the report.
    Regards/Prasanth

    You can use a distribution file to define an attachment, have a look at http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_dist.htm#i1006076

  • How to print date/time in report page footer?

    Hi
    I have a report which users can print as PDF.
    However, I like to display current date/time in report footer.
    I can see the Page Footer in section but can't figure out how to print date/time there.
    Thanks for help.

    hi movilogo
    Please try this.
    Create hidden item P1_DATE
    Create On load process in page 1 and put this code
    begin
    :P1_DATE:=TO_CHAR(SYSDATE,'DD-MON-YYYY HH:MM:SS');
    end;
    Open your region in Page 1 put this code in Footer area
    *&P1_DATE.*
    Refresh your page.
    you will get the output like this.
    16-SEP-2009 11:09:17
    thanks
    Mark Wyatt

Maybe you are looking for