Calling output type

Hi All,
Could you please help in an issue where i need to call output type by clicking on button in adobe form to show preview of form.
Regards,
Mohammed Quddus.

Hi Shweta,
A button on the Adobeform needs to be provided, which when pressed will call the default output type of the PO and show the preview.
Regards,
Mohammed Quddus.

Similar Messages

  • Error Message in calling output type

    Has anyone encountered an error " Processing routine ENTRY_TEST in program ZTEST does not exist" when calling an output type? The output type has already been configured and in the print program ZTEST, subroutine ENTRY_TEST is there.

    hi,
    Go to TCODE /nNACE
    if ur output type is related to order then choose V1 , billing V3
    choose  output types button in the application tool bar
    then choose the output type which u r using...
    in the left side u can see processing routines...
    double click that
    there u can give the program name which u want to call..
    Program           ZLS_TEST                                        
    FORM routine      ENTRY                                                                               
    then go to SE38
    ur logic should be within the form ENTRY...
    REPORT zls_proforma_invoice.
    INCLUDE rvadtabl.
    DATA: retcode   TYPE sy-subrc.         "Returncode
    FORM entry USING return_code type any us_screen type any."#EC CALLED
      CLEAR retcode.
        data: v_update(1) type c.
    clear v_update.
    ENDFORM
    Edited by: Sumi Vasu on May 14, 2008 8:49 AM

  • Calling output types from BAPI

    Dear All,
    I am creating PO using IDOC.
    A function module is used for creating PO from IDOC.
    The moment PO is created SO should also get created.For that i have used OUTPUT type and connected output type to
    application EF.
    can anybody guide me if routine for SO creation ie output type for SO will get triggered from BAPI/Function module for postiing PO application?
    thanks.

    Hello,
    The PDF Files of the Output are stored onto the spool. To retrieve these documents you will need some custom development both on the Java and ABAP stack.
    ABAP : Refer to this link: http://wiki.sdn.sap.com/wiki/display/ABAP/GettingSpoolRequestNumberfortheOutput+type
    Java:
    1. Put up a link on a JSP where you want to show the download option for the output type.
    2. Develop custom action, bo, backend objects
    3. Call a custom RFC in the SAP system from backend class which retrieves the PDF document based on the above link.
    4. Return PDF doc back to Java as a byte stream.
    5. Provide option to save/open  on the client.
    Hope this helps.
    Pradeep

  • Job_open FM called in output type is ending with dump

    Hi All,
    I have a job_open FM called in output type is ending with dump, In dump analysis its given as "Statement "COMMIT" is not allowed in this form." and "There is probably an error in the program
    "SAPLSYDB".
    This program is triggered in the update task. There, the
    following ABAP/4 statements are not allowed:
    -  CALL SCREEN
    -  CALL DIALOG
    -  CALL TRANSACTION
    -  SUBMIT
    Kindly advise me to avoid this.
    Thaks in advance.
    Joshi

    Hi,
    This update termination occurs when a DB commit occurs in update task.......and probably job_open FM must hav done the DB commit.....
    So issuing the output while saving the transaction is not possible with job_open FM in output program.....
    try putting 3 (send with application own transaction)  in  despatch time of output and issue it manually.....
    Cheers,
    Jose.

  • Need to call custom version of RSNAST00 from VF03 output type

    I have created a customized version of the RSNAST00 program which is valid for two existing ouptut types for billing condition "V3".  This new program (ZRSNAST00) works fine when called directly (i.e. se38).  However, when issuing output type via VF03, the old program is called (RSNAST00).  Is there a setting to tell the output type to use ZRSNAST00?
    FYI, I have checked NACE, and the output type references the print program (which is the same for both versions of the driver program. 
    Thanks for any help!
    jeff

    There is some special sort I had to include for printing.  Client needed to have page-number order (single page first, 2-page next, etc.) in the spool. 
    I may need to create new output type for the ZRSNAST00 version to run, and leave RSNAST00 for the "normal" single processing via VF03.

  • SAP Script is not getting called for GI Output type WA03

    Dear All,
    I have designed one SAP script for goods issue output type WA03 for Tcode Migo.
    I have assigned the form name in NACE. But the problem is it is not picking my form, It is giving some Express document error. I am not able to know how the transaction is picking up the form since it is not going to the standard program even though i have kept breakpoint there. Can anybody let me know how the print program (SAPM07DR)is getting called from MIGO.
    print program  name is SAPM07DR.  Standard Script name is WASCHEIN.
    Regards,
    Ravindra Jain

    HI Ravi,
    Did you check the entry in NACE. I think you need to configure the Driver program and sap script there. just try to put a session break point and check why it is not picking.
    Thanks,
    Chidanand

  • Output Type determination with BAPI call

    Hello SAP experts,
    Thank you in advance for any guidance or ideas you may have.
    We are modifying an outbound delivery document with the following functions:
    bapi_outb_delivery_change and ws_delivery_update
    and we need to cause an outbound type to be determined(executed) 
    This process works when we post goods issue manually but does not work when we post goods issue via an ABAP program using the above mentioned functions
    Sincerely,
    Jim

    Hi,
    For Output determination the condition technique has to be followed.
    1) Maintain Output condition table -V/57
    2)maintain Access sequence
    3)Maintain Output condition type-V-30
    4)Maintain Output determination procedure
    5)Maintain condition records in VV11
    Besides you should also assign the Output types to Partner function
    Assign Output det.pro to sales document header & sales document type (eg: OR)-V/43
    Assign Output det.pro to Item category-V/69
    The condition types for Output in your case is BA00(standard).
    Have you done all these ?
    I hope this would be helpful for you.
    Saplinx

  • Need to call another progarm in Zdriver program for a specific output type

    For billing document they had configured a Zdriver program and Zsmart form in Nace.
    Now, we had created an output type and when user clicks on that specific output type my ZXYZ program should run.
    ZXYZ program will convert the spool request into .pdf files.
    So what I had done is I have given a condition in Zdriver program saying that If output type is ZD0p.
    Submit ZXYZ program so that this program will automatically run.
    I just want to make sure that is it the right way I mean shoudl I add something else to the Submit statement...here
    and can any one tell me how can I generate spool request by giveing a billing document number in VF02--> Click on Enter > Click on Header>Click on Output-->Enter the Output type and give the communication method details and click on Save...will this generate the spool request..?

    Hi
    and can any one tell me how can I generate spool request by giveing a billing document number in VF02--> Click on Enter --> Click on Header-->Click on Output-->Enter the Output type and give the communication method details and click on Save...will this generate the spool request..
    After doing the whole porcess...re enter the vfo2 transacrion, give the document number and in Menu..Under "Billing Document"..Select issue output to...and there select the output type..and select Print button, it will generate spool request.
    Regards,
    Vishwa.

  • How do automate using two output types in an invoice based on plant

    Hello,
    Can you tell me how to configure automatically two output types for the same invoice.
    My client has business in USA and Europe.We are using only one sales organization. But we need to print invoices in letter size and A4 size depending on whether the invoice is created in europe or in USA. So , I have created two output types, one for letter size and one for A4 size. How do I configure so that if it is based in a plant/shipping point in Europe it is printed using the A4  output type else in letter size. Please suggest.
    SAPSDUSER

    I do not think you can use plant/shipping point in your access sequence for invoice output on header level, unless you add these fields to header level kommunication structure and populate these fields in userexit.
    You can either
    1. define requirement routines for your 2 output types which are mutually exclusive (if plant = A routine 1 returns sy-subrc = 0, routine 2 returns sy-subrc <>0, if plant = B routine 1 returns sy-subrc <>0, routine 2 returns sy-subrc = 0). You can assign requirements to output type either in output determination procedure OR in the access sequence. I would do it in output determination procedure. Check transactions NACO or NACE.
    OR
    2. add your fields to komkbv3 communication structure, populate your fields in thsi structure in userexits which are called from the function module komkbv3_fill and then you can either use then in the access sequence for your output types or create routines as in case 1. but the logic will be a simple check statement since KOMKBV3 is available in these routines.
    3. In fact you can use one output type and select your layout in the print program itself... which may be even easier for you. We use this approach to select proper layout for GEOs which may have several layouts depending on region for example... so the output type is defined per country, then layout is selected by print program. (tnapr-fonam = ..., nast-spras = proper language, set country '' to use proper decimal & date format...)
    Message was edited by:
            Siarhei Mahulenka

  • How to generate a Spool based on output type in SAP Script

    Hi all,
    Is it possible to generate a spool based on output type for a SAP Script (without explicitly trigger in Tcode VF02 and selecting output type from there )
    Actually a background job will be scheduled to process output types selected in VF01 / VF02
    When output type is ZABC in the background a work flow is called pdf is generated

    Any suggestions please

  • How to define output types email or external send in the report program

    Hi all,
    now we are using a zprogram for output type printer and standard program RVADOR01 for output type external send. Now i want to modify my zprogram itself to support external send email as well as printer also. What modifications should I have to make in my zprogram. My form is a script.
    Thank you,
    Mallik

    hi all,
    i made the following changes in my code and it worked well.
    thank you for all who tried to share my pain.
    thanks one and all.
    hope this code will help anybode.
    thanks & regards
    FORM OPEN_FORM_EMAIL.
    TABLES: TNAPR,                         "Programs & Forms
            ITCPO,                         "Communicationarea for Spool
            ARC_PARAMS,                    "Archive parameters
            TOA_DARA,                      "Archive parameters
            ADDR_KEY.                      "Adressnumber for ADDRESS
    TYPE-POOLS SZADR.
    DATA: LVF_DEVICE LIKE ITCPP-TDDEVICE,
          LVF_DIALOG(1)     TYPE   C   VALUE ' ',
          LVS_RECIPIENT     LIKE   SWOTOBJID,
          LVS_SENDER        LIKE   SWOTOBJID,
          LVS_SNAST         TYPE   SNAST,
          LVF_PROGRAM       LIKE   SY-REPID,
          LVS_COMM_TYPE     TYPE   AD_COMM,
          LVS_COMM_VALUES   TYPE   SZADR_COMM_VALUES,
          LVS_TITLE LIKE SNAST-TDCOVTITLE.
    reset return code
      RETCODE = 0.
    if there is a communication strategy used ...
    IF NOT NAST-TCODE IS INITIAL AND NAST-NACHA EQ '5'.
      ... use stratagy to get communication type
        CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
             EXPORTING
                  STRATEGY           = NAST-TCODE
                ADDRESS_TYPE       =
                 ADDRESS_NUMBER     = KNA1-ADRNR
                PERSON_NUMBER      = VBDKA-ADRNP
                  PERSON_NUMBER      = ADDR_KEY-PERSNUMBER
             IMPORTING
                  COMM_TYPE          = LVS_COMM_TYPE
                  COMM_VALUES        = LVS_COMM_VALUES
           TABLES
                STRATEGY_TABLE     =
             EXCEPTIONS
                  ADDRESS_NOT_EXIST  = 1
                  PERSON_NOT_EXIST   = 2
                  NO_COMM_TYPE_FOUND = 3
                  INTERNAL_ERROR     = 4
                  PARAMETER_ERROR    = 5
                  OTHERS             = 6.
        IF SY-SUBRC <> 0.
          RETCODE = SY-SUBRC.
          SYST-MSGTY = 'E'.
          PERFORM PROTOCOL_UPDATE.
        ENDIF.
    ENDIF.
       LVS_COMM_TYPE = 'INT'.
      CLEAR LVS_COMM_VALUES-ADSMTP-SMTP_ADDR.
      CLEAR LVS_SNAST.
            LVS_COMM_VALUES-ADSMTP-SMTP_ADDR = V_CUST_EMAIL.
    convert communication data
       MOVE-CORRESPONDING NAST TO LVS_SNAST.
            LVS_SNAST-ANZAL = 1.
            LVS_TITLE = 'Mail Header Title'.
      MOVE LVS_TITLE TO LVS_SNAST-TDCOVTITLE.
       MOVE SY-REPID TO LVF_PROGRAM.
      CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
           EXPORTING
                PI_COMM_TYPE              = 'INT'
                PI_COMM_VALUES            = LVS_COMM_VALUES
                PI_SCREEN                 = XSCREEN
              PI_NEWID                  =
                PI_COUNTRY                = ADRC-COUNTRY
                PI_REPID                  = SY-REPID
                PI_SNAST                  = LVS_SNAST
                PI_MAIL_SENDER            = SY-UNAME
           IMPORTING
                PE_ITCPO                  = ITCPO_LS
                PE_DEVICE                 = LVF_DEVICE
                PE_MAIL_RECIPIENT         = LVS_RECIPIENT
                PE_MAIL_SENDER            = LVS_SENDER
           EXCEPTIONS
                COMM_TYPE_NOT_SUPPORTED   = 1
                RECIPIENT_CREATION_FAILED = 2
                SENDER_CREATION_FAILED    = 3
                OTHERS                    = 4.
      IF SY-SUBRC <> 0.
        RETCODE = SY-SUBRC.
        SYST-MSGTY = 'E'.
        PERFORM PROTOCOL_UPDATE.
      ENDIF.
      CHECK RETCODE EQ 0.
    fill structure itcpo
      ITCPO = ITCPO_LS.
    open form
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
              APPLICATION        = 'TX'
               ARCHIVE_INDEX      = TOA_DARA
               ARCHIVE_PARAMS     = ARC_PARAMS
                DEVICE             = 'MAIL'
                DIALOG             = 'X'
                FORM               = 'ZSDLS003'
                LANGUAGE           = SY-LANGU
                OPTIONS            = ITCPO_LS
                MAIL_SENDER        = LVS_SENDER
                MAIL_RECIPIENT     = LVS_RECIPIENT
              MAIL_APPL_OBJECT   = ' '
              RAW_DATA_INTERFACE = '*'
         IMPORTING
              LANGUAGE           =
              NEW_ARCHIVE_PARAMS =
              RESULT             =
           EXCEPTIONS
                CANCELED           = 1
                DEVICE             = 2
                FORM               = 3
                OPTIONS            = 4
                UNCLOSED           = 5
                MAIL_OPTIONS       = 6
                ARCHIVE_ERROR      = 7
                OTHERS             = 8.
      IF SY-SUBRC NE 0.
        CASE SY-SUBRC.
          WHEN 7.
            RETCODE = SY-SUBRC.
            SYST-MSGID = 'VN'.
            SYST-MSGNO = '096'.
            SYST-MSGTY = 'E'.
            SYST-MSGV1 = NAST-KSCHL.
            SYST-MSGV2 = NAST-KAPPL.
            PERFORM PROTOCOL_UPDATE.
          WHEN OTHERS.
            RETCODE = SY-SUBRC.
            PERFORM PROTOCOL_UPDATE.
        ENDCASE.
      ENDIF.
      SET COUNTRY ADRC-COUNTRY.
    ENDFORM.

  • Output type for the managed codes cut letter is hard coded

    Hello,
    Very Good afternoon!
    I have a requirement to create new Output Types for a Smart Form.
    The already existing Output types are hard coded as shown Below :
    CONSTANTS : c_kschl_order LIKE nast-kschl
                             VALUE 'ZUS0',
                c_kschl_order1 LIKE nast-kschl
                             VALUE 'ZUS1',
    Now they do not want to use ZUS1. Insted they wnat to use New Output Types.
    u2022 Remove ZUS1 as we no longer use this one.
    u2022     Add ZAU0
    u2022     Add ZNZ0
    u2022     Add ZJP0
    u2022     Add ZCN0
    u2022     Add ZKR0
    How to add these Output types without Hardcoding as shown ABove.
    Any Suggestions will be appreciated.....
    For reference..I will paste the code of the Program here.
    Here is the code  :
                     PROGRAM DECLARATION
    PROGRAM ID           Z_RVADOR01_SALES_CUT_LETTER
    TABLES: vbak,    "Sales Document: Header Data
           vbap,    "Sales Document: Item Data
           vbpa,    "Sales Document: Partner
           vbep,    "Sales Document: Schedule Line Data
           kna1,    "General Data in Customer Master
           MARA,    "Material Master
            KOMK,                          "Communicationarea for conditions
            KOMP,                          "Communicationarea for conditions
            KOMVD,                         "Communicationarea for conditions
            VBCO3,                         "Communicationarea for view
            VBDKA,                         "Headerview
            VBDPA,                         "Itemview
            VBDPAU,                        "Subitemnumbers
            CONF_OUT,                      "Configuration data
            SADR,                          "Addresses
            TVAG,                          "Reason for rejection
            VEDKA,                         "Servicecontract head data
            VEDPA,                         "Servicecontract position data
            VEDKN,                         "Servicecontract head notice data
            VEDPN,                         "Servicecontract pos. notice data
            RISERLS,                       "Serialnumbers
            KOMSER,                        "Serialnumbers for print
            TVBUR,                         "Sales office
            TVKO,                          "Sales organisation
            ADRS,                          "Communicationarea for Address
            FPLTDR,                        "billing schedules
            WTAD_ADDIS_IN_SO_PRINT,        "additional
            WTAD_BUYING_PRINT_EXTRA_TEXT,  "texts belonging to additional
            adrc,
            adr6,
            t247.
    INCLUDE RVADTABL.
    INCLUDE RVDIREKT.
    INCLUDE VEDADATA.
    data for access to central address maintenance
    INCLUDE SDZAVDAT.
    TYPE-POOLS: ADDI.
    DATA PRICE_PRINT_MODE(1) TYPE C.       "Print-mode
    DATA: RETCODE   LIKE SY-SUBRC.         "Returncode
    DATA: REPEAT(1) TYPE C.
    DATA: XSCREEN(1) TYPE C.               "Output on printer or screen
    DATA: BEGIN OF STEU,                   "Controldata for output
            VDKEX(1) TYPE C,
            VDPEX(1) TYPE C,
            KBKEX(1) TYPE C,
            KBPEX(1) TYPE C,
          END OF STEU.
    DATA: BEGIN OF TVBDPA OCCURS 0.        "Internal table for items
            INCLUDE STRUCTURE VBDPA.
    DATA: END OF TVBDPA.
    DATA: BEGIN OF TKOMV OCCURS 50.
            INCLUDE STRUCTURE KOMV.
    DATA: END OF TKOMV.
    DATA: BEGIN OF TKOMVD OCCURS 50.
            INCLUDE STRUCTURE KOMVD.
    DATA: END OF TKOMVD.
    DATA: BEGIN OF TVBDPAU OCCURS 5.
            INCLUDE STRUCTURE VBDPAU.
    DATA: END   OF TVBDPAU.
    DATA: BEGIN OF TKOMCON OCCURS 50.
            INCLUDE STRUCTURE CONF_OUT.
    DATA: END   OF TKOMCON.
    DATA: BEGIN OF TKOMSERVH OCCURS 1.
            INCLUDE STRUCTURE VEDKA.
    DATA: END   OF TKOMSERVH.
    DATA: BEGIN OF TKOMSERVP OCCURS 5.
            INCLUDE STRUCTURE VEDPA.
    DATA: END   OF TKOMSERVP.
    DATA: BEGIN OF TKOMSERVHN OCCURS 5.
            INCLUDE STRUCTURE VEDKN.
    DATA: END   OF TKOMSERVHN.
    DATA: BEGIN OF TKOMSERVPN OCCURS 5.
            INCLUDE STRUCTURE VEDPN.
    DATA: END   OF TKOMSERVPN.
    DATA: BEGIN OF TKOMSER OCCURS 5.
            INCLUDE STRUCTURE RISERLS.
    DATA: END   OF TKOMSER.
    DATA: BEGIN OF TKOMSER_PRINT OCCURS 5.
            INCLUDE STRUCTURE KOMSER.
    DATA: END   OF TKOMSER_PRINT.
    DATA: BEGIN OF TFPLTDR OCCURS 5.
            INCLUDE STRUCTURE FPLTDR.
    DATA: END   OF TFPLTDR.
    DATA: TADDI_PRINT TYPE ADDI_SO_PRINT_ITAB WITH HEADER LINE.
    TYPES:BEGIN OF ty_orders ,
         xblnr    LIKE  mkpf-xblnr,       "delivery number
         erfmg    LIKE  mseg-erfmg,       "goods issue quantity
         custname LIKE  kna1-name1,       "customer name
         bstnk    LIKE  vbak-bstnk,       "purchase order number
         ean11    LIKE  vbap-ean11,       "upc
         kdmat    LIKE  vbap-kdmat,       "customer material code
         arktx    LIKE  vbap-arktx,       "description
         csrno    LIKE  kna1-kunnr,       "customer service rep number
         spras    LIKE  kna1-spras,       "customer language key
         csrname  LIKE  kna1-name1,       "customer service rep name
         csremail LIKE  adr6-smtp_addr,   "csr email
         csrphone LIKE  kna1-telf1,       "csr telephone
         csrext   LIKE  adrc-tel_extens,  "csr extension
         csrfax   LIKE  kna1-telfx,       "csr fax
         total    LIKE  lips-lfimg,       "cut quantity
         ldate(18)    TYPE c,
       END OF ty_orders.
    CONSTANTS: c_kschl_order LIKE nast-kschl
                             VALUE 'ZUS0',
                c_kschl_order1 LIKE nast-kschl
                             VALUE 'ZUS1',            c_parvw_shipto LIKE vbpa-parvw
                             VALUE 'WE',
                c_parvw_csr    LIKE vbpa-parvw
                             VALUE 'ZS',
                 c_eng(1)       TYPE c VALUE 'E',
                 c_sep(1)       TYPE c VALUE '/',
                 c_sale(25) type c VALUE 'Sales Order'.
    DATA: WA_VBAK TYPE VBAK,
          tbl_ord TYPE ty_orders OCCURS 0 WITH HEADER LINE,
          w_csrname(30)  TYPE c,
         w_csrno(30)    TYPE c,
         w_email    LIKE adr6-smtp_addr,
         f_shipto_found     TYPE c,
         w_custname(30) TYPE c,
         w_month(2),
         w_ldate(18),
         w_total LIKE lips-lfimg,
         w_lines        TYPE i VALUE 0,
         f_mail(1)  TYPE c,
         cnt_1          TYPE i VALUE 0,
         cnt_2          TYPE i VALUE 0,
         tbl_otf     LIKE itcoo OCCURS 0 WITH HEADER LINE,
         w_type(25)     TYPE c,
         st_doc_data   LIKE sodocchgi1,
         tbl_objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE,
         tbl_line      LIKE tline OCCURS 0 WITH HEADER LINE,
         tbl_attach    LIKE solisti1 OCCURS 10 WITH HEADER LINE,
         tbl_objhead   LIKE solisti1 OCCURS 10 WITH HEADER LINE,
         tbl_proc_para LIKE soparai1 OCCURS 10 WITH HEADER LINE,
         tbl_maillist  LIKE somlreci1 OCCURS 10 WITH HEADER LINE,
         tbl_pack_list LIKE sopcklsti1 OCCURS 10 WITH HEADER LINE,
         tbl_cpo      LIKE itcpo OCCURS 0 WITH HEADER LINE,"SAPscript output
                                                                " interface
         tbl_cpp LIKE itcpp OCCURS 0 WITH HEADER LINE,"SAPscript output
                                                       " parameters
         tbl_smtp  TYPE szadr_adsmtp_line OCCURS 0 WITH HEADER LINE,
         tbl_cdhdpos LIKE cdshw OCCURS 0 WITH HEADER LINE,
         tbl_cdpos LIKE cdshw OCCURS 0 WITH HEADER LINE,
         wrk_lines LIKE sy-tabix,
         hltlines   TYPE i,
         off1       TYPE p,
         fle1(2)    TYPE p,
         fle2(2)    TYPE p,
         htabix     LIKE sy-tabix,
         hfeld(500) TYPE c.
    FORM ENTRY USING RETURN_CODE US_SCREEN.
    if sy-tcode = 'VA01'.
      IF nast-kschl = c_kschl_order.
      SELECT SINGLE * FROM VBAK INTO WA_VBAK WHERE vbeln = nast-objky.
      IF SY-SUBRC = 0.
      CLEAR RETCODE.
      XSCREEN = US_SCREEN.
      PERFORM PROCESSING USING us_screen.
      IF RETCODE NE 0.
        RETURN_CODE = 1.
      ELSE.
        RETURN_CODE = 0.
      ENDIF.
       ELSE.
          retcode = sy-subrc.
          syst-msgid = 'ZVERROR'.
          syst-msgno = '000'.
          syst-msgty = 'E'.
          syst-msgv1 = NAST-KSCHL.
         syst-msgv1 = 'Sales Order cut letter
                       for this order already issued'.
         syst-msgv2 = ' '.
          PERFORM protocol_update.
        ENDIF.
    ELSE.
        CLEAR retcode.
        xscreen = us_screen.
        PERFORM processing USING us_screen.
        IF retcode NE 0.
          return_code = 1.
        ELSE.
          return_code = 0.
        ENDIF.
      ENDIF.
    endif.
    ENDFORM.
          FORM PROCESSING                                               *
    FORM PROCESSING USING proc_screen.
    CASE nast-kschl.
        WHEN c_kschl_order.
          PERFORM get_orders.
          CHECK retcode = 0.
          PERFORM openform USING proc_screen vbak-landtx.
          CHECK retcode = 0.
          PERFORM layout.
          CHECK retcode = 0.
          CHECK proc_screen NE 'X'.
          w_type = c_sale.
          PERFORM send_email USING proc_screen.
      WHEN c_kschl_order1.
         PERFORM get_orders.
         CHECK retcode = 0.
         CHECK proc_screen NE 'X'.
         w_type = c_sale.
         PERFORM send_email USING proc_screen.
       WHEN OTHERS.
          retcode = 1.
          syst-msgid = 'E0'.
          syst-msgno = '430'.
          syst-msgty = 'E'.
          PERFORM protocol_update.
      ENDCASE.
      IF retcode EQ 0.
        syst-msgid = '69'.
        syst-msgno = '254'.
        syst-msgty = 'S'.
        syst-msgv1 = nast-kschl.
        PERFORM protocol_update.
      ELSE.
        syst-msgid = 'CKCC'.
        syst-msgno = '036'.
        syst-msgty = 'E'.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.
          FORM PROTOCOL_UPDATE                                          *
          The messages are collected for the processing protocol.       *
    FORM PROTOCOL_UPDATE.
      IF xscreen EQ space.
        CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
           EXPORTING
                MSG_ARBGB = SYST-MSGID
                MSG_NR    = SYST-MSGNO
                MSG_TY    = SYST-MSGTY
                MSG_V1    = SYST-MSGV1
                MSG_V2    = SYST-MSGV2
                MSG_V3    = SYST-MSGV3
                MSG_V4    = SYST-MSGV4
           EXCEPTIONS
                OTHERS    = 1.
       ELSE.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    ENDFORM.
    *&      Form  get_orders
          text
    -->  p1        text
    <--  p2        text
    FORM get_orders.
    DATA : f_csr_found        TYPE c.
    SELECT SINGLE vbeln vkorg vdatu bstnk kunnr
        FROM   vbak
        INTO  (vbak-vbeln,vbak-vkorg,vbak-vdatu,vbak-bstnk,vbak-kunnr)
        WHERE vbeln EQ nast-objky.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'VN'.
        syst-msgno = '203'.
        syst-msgty = 'E'.
        syst-msgv1 = 'VBAK'.
        syst-msgv2 = sy-subrc.
        PERFORM protocol_update.
      ENDIF.
      SELECT vbeln posnr matnr pmatn arktx abgru kdmat werks
      FROM vbap
      INTO (vbap-vbeln,vbap-posnr,vbap-matnr,vbap-pmatn,
    vbap-arktx,vbap-abgru,vbap-kdmat,vbap-werks)
      WHERE vbeln = vbak-vbeln
      AND abgru NE space "select items havng Rejection Reason
      and PSTYV NE 'ZHDR'.
    to check whether the reason for rejection was picked from the
    managed codes tables
    data: war_abgru type abgru,
          w_exist type c.
    clear : war_abgru, w_exist.
      select single abgru  from ZMAT_REJ002
                    into war_abgru
                    where vkorg = vbak-vkorg
                    and kunnr <> vbak-kunnr
                    and MATNR = vbap-matnr
                    and datef <= vbak-vdatu
                    and datet >= vbak-vdatu.
       if sy-subrc <> 0.
             select single abgru from ZMAT_REJ003
                              into war_abgru
                              where vkorg = vbak-vkorg
                              and kunnr <> vbak-kunnr
                              and MATNR = vbap-matnr
                              and datef <= vbak-vdatu
                              and datet >= vbak-vdatu.
             if sy-subrc <> 0.
                    select single abgru from ZMAT_REJ001
                              into war_abgru
                              where vkorg = vbak-vkorg
                              and werks <> vbap-werks
                              and matnr = vbap-matnr
                              and datef <= vbak-vdatu
                              and datet >= vbak-vdatu.
                    if sy-subrc <> 0.
                         select single abgru from ZMAT_REJ004
                                             into war_abgru
                                             where vkorg = vbak-vkorg
                                             and matnr = vbap-matnr
                                             and datef >= vbak-vdatu
                                             and datet <= vbak-vdatu.
                         if sy-subrc <> 0.
                         else.
                         w_exist = 'X'.
                         endif.
                   else.
                   w_exist = 'X'.
                   endif.
             else.
             w_exist = 'X'.
             endif.
       else.
       w_exist = 'X'.
       endif.
    if w_exist = 'X'.
    end for check from managed codes table
    *to find the quantity fields
        SELECT SINGLE wmeng bmeng
        FROM vbep
        INTO (vbep-wmeng,vbep-bmeng)
        WHERE vbeln EQ vbap-vbeln
        AND   posnr EQ vbap-posnr.
    *to get info about the customer
        SELECT SINGLE kunnr
        FROM vbpa
        INTO vbpa-kunnr
        WHERE  vbeln EQ vbak-vbeln
        AND    parvw EQ c_parvw_shipto.
         IF sy-subrc EQ 0.
          f_shipto_found = 'X'.
          SELECT SINGLE name1 spras
            FROM kna1
            INTO (kna1-name1,kna1-spras)
            WHERE kunnr EQ vbpa-kunnr.
          IF sy-subrc EQ 0.
            w_custname = kna1-name1.
            CLEAR kna1-name1.
          ENDIF.
         ENDIF.
         SELECT SINGLE kunnr
        FROM vbpa
        INTO vbpa-kunnr
        WHERE vbeln EQ vbak-vbeln
        AND   parvw EQ c_parvw_csr.
        IF SY-SUBRC EQ 0.
         f_csr_found = 'X'.
          SELECT SINGLE kunnr name1 name2 adrnr
           FROM kna1
           INTO (kna1-kunnr,kna1-name1,kna1-name2,
                 kna1-adrnr)
           WHERE  kunnr EQ vbpa-kunnr.
          IF sy-subrc EQ 0.
            w_csrno = kna1-kunnr.
            w_csrname = kna1-name1.
            CLEAR kna1-name1.
               SELECT SINGLE tel_number tel_extens fax_number
                 FROM adrc
                 INTO (adrc-tel_number,adrc-tel_extens,
       adrc-fax_number)
                 WHERE addrnumber EQ kna1-adrnr.
            CLEAR: adr6, w_email.
            SELECT SINGLE * FROM adr6 WHERE addrnumber = kna1-adrnr.
            IF sy-subrc = 0.
              w_email = adr6-smtp_addr.
            ENDIF.
          ENDIF.
        ENDIF.
    *to get the date format in french
        IF kna1-spras NE c_eng.
          w_month = sy-datum+4(2).
          SELECT SINGLE ltx
            FROM t247
            INTO t247-ltx
            WHERE spras EQ kna1-spras
            AND mnr EQ w_month.
          CONCATENATE sy-datum+6(2)
                      t247-ltx
                      sy-datum+0(4)
                      INTO w_ldate
                      SEPARATED BY space.
          ELSE.
          CONCATENATE sy-datum+4(2)
                      sy-datum+6(2)
                      sy-datum+0(4)
                      INTO w_ldate
                      SEPARATED BY c_sep.
        ENDIF.
        w_total = vbep-wmeng - vbep-bmeng.
         IF w_total GT 0.
         PERFORM fill_orders.
        ELSE.
          IF vbap-abgru NE space.
            w_total = vbep-wmeng.
            PERFORM fill_orders.
          ENDIF.
        ENDIF.
        CLEAR vbap.
        endif.           " check for w_exist for Managed Codes entry
    ENDSELECT.
    IF tbl_ord[] IS INITIAL.
        retcode = 1.
        syst-msgid = 'FZ'.
        syst-msgno = '027'.
        syst-msgty = 'E'.
        PERFORM protocol_update.
      ENDIF.
      IF f_csr_found IS INITIAL.
        syst-msgid = '8B'.
        syst-msgno = '127'.
        syst-msgty = 'W'.
        syst-msgv1 = c_parvw_csr.
        PERFORM protocol_update.
      ENDIF.
      IF f_shipto_found IS INITIAL.
        syst-msgid = '8B'.
        syst-msgno = '127'.
        syst-msgty = 'W'.
        syst-msgv1 = c_parvw_shipto.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " get_orders
    *&      Form  layout
          text
    -->  p1        text
    <--  p2        text
    FORM layout.
    SORT tbl_ord BY bstnk kdmat.
      LOOP AT tbl_ord.
        AT FIRST.
          PERFORM writeform_text.
        ENDAT.
        PERFORM writeform.
        AT LAST.
          PERFORM writeform_footer.
        ENDAT.
      ENDLOOP.
      CLEAR : cnt_1,cnt_2.
      PERFORM closeform.
    ENDFORM.                    " layout
    *&      Form  openform
          text
    FORM openform USING us_screen us_country.
    DESCRIBE TABLE tbl_ord LINES w_lines.
      IF w_lines EQ 0.
        retcode    = '1'.
        syst-msgid = 'FE'.
        syst-msgno = '078'.
        syst-msgty = 'E'.
        PERFORM protocol_update.
      ENDIF.
      CHECK retcode EQ 0.
    INCLUDE zrvadopfo.
    ENDFORM.                    " openform
    *&      Form  send_email
          text
         -->P_PROC_SCREEN  text
    FORM send_email USING    PROC_SCREEN.
    f_mail = 'X'.
      PERFORM openform USING proc_screen vbak-landtx.
      LOOP AT tbl_ord.
        AT FIRST.
          PERFORM writeform_text.
        ENDAT.
        PERFORM writeform.
        AT LAST.
          PERFORM writeform_footer.
        ENDAT.
      ENDLOOP.
      CLEAR cnt_2.
      PERFORM closeform.
      CALL FUNCTION 'CONVERT_OTF'
           EXPORTING
                format                = 'PDF'  "'ASCII'
           IMPORTING
                bin_filesize          = st_doc_data-doc_size
           TABLES
                otf                   = tbl_otf
                lines                 = tbl_line
           EXCEPTIONS                                           "DEVK912166
                err_max_linewidth     = 1
                err_format            = 2
                err_conv_not_possible = 3
                OTHERS                = 4.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'OA'.                                      "DEVK912166
        syst-msgno = '186'.                                     "DEVK912166
        syst-msgty = 'E'.                                       "DEVK912166
        PERFORM protocol_update.
      ENDIF.
      REFRESH tbl_objtxt.
      CLEAR tbl_objtxt.
      CLEAR tbl_proc_para.
      REFRESH tbl_proc_para.
      CLEAR tbl_maillist.
      REFRESH tbl_maillist.
      CLEAR tbl_pack_list.
      REFRESH tbl_pack_list.
      st_doc_data-obj_name   = 'Sales Order Cut Letter'.
      st_doc_data-obj_langu   = 'E'.                            "DEVK905849
      st_doc_data-sensitivty  = 'F'.                            "DEVK905849
      st_doc_data-obj_prio    =  1.                             "DEVK905849
      CONCATENATE w_type 'Cut Letter' INTO          "#EC NOTEXT
                                  st_doc_data-obj_descr  SEPARATED BY space.
      DATA w_line(3) TYPE c.
      PERFORM format_pdf.                                       "DEVK905849
      concatenate VBAK-VBELN '.PDF' into tbl_objhead.
    tbl_objhead = 'Sales Order Cut Letter.PDF'.
      APPEND tbl_objhead.
           "DEVK905849
      CLEAR wrk_lines.
      DESCRIBE TABLE tbl_attach LINES wrk_lines.
    fields needed for email
      tbl_maillist-com_type = 'INT'.
      tbl_maillist-receiver =  w_email.
      tbl_maillist-rec_type = 'U'.
      APPEND tbl_maillist.
    send email
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                                      STARTING NEW TASK 'MAIL'
           EXPORTING
                document_data              = st_doc_data
                document_type              = 'PDF'
                COMMIT_WORK                = 'X'    " added after ECC6.0 upgrade
           TABLES
                object_header              = tbl_objhead
                object_content             = tbl_objtxt
                receivers                  = tbl_maillist
           EXCEPTIONS                                           "DEVK912166
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'ZA_G'.                                    "DEVK912166
        syst-msgno = '922'.                                     "DEVK912166
        syst-msgty = 'E'.                                       "DEVK912166
        syst-msgv1 = sy-subrc.                                  "DEVK912166
        syst-msgv2 = tbl_smtp-adsmtp-smtp_addr.                 "DEVK912166
        PERFORM protocol_update.
        syst-msgid = 'VW'.
        syst-msgno = '001'.
        syst-msgty = 'E'.
        syst-msgv1 = 'Print successful:email Recepient Invalid'."#EC NOTEXT
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " send_email
    *&      Form  fill_orders
          text
    -->  p1        text
    <--  p2        text
    FORM fill_orders.
    tbl_ord-bstnk    = vbak-bstnk.
      tbl_ord-kdmat    = vbap-kdmat.
      tbl_ord-xblnr    = vbak-vbeln.
      tbl_ord-ean11    = vbap-pmatn.
      tbl_ord-arktx    = vbap-arktx.
      tbl_ord-csrno    = w_csrno .
      tbl_ord-csremail = w_email.
      tbl_ord-spras    = kna1-spras .
      tbl_ord-csrphone = adrc-tel_number.
      tbl_ord-csrfax   = adrc-fax_number.
      tbl_ord-csrext   = adrc-tel_extens.
      tbl_ord-total    = w_total.
      tbl_ord-custname = w_custname.
      tbl_ord-csrname  = w_csrname .
      tbl_ord-ldate    = w_ldate.
      APPEND tbl_ord.
      CLEAR tbl_ord.
      CLEAR w_total.
      CLEAR w_ldate.
    ENDFORM.                    " fill_orders
    *&      Form  writeform_text
          text
    -->  p1        text
    <--  p2        text
    FORM writeform_text.
    CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'WTEXT'
                window  = 'WINDOW2'
           EXCEPTIONS
                element = 1
                window  = 2.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'EBR'.
        syst-msgno = '056'.
        syst-msgty = 'E'.
        syst-msgv1 = 'WTEXT'.
        syst-msgv2 = 'WINDOW2'.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " writeform_text
    *&      Form  writeform
          text
    -->  p1        text
    <--  p2        text
    FORM writeform.
    CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'EMAIN'
                window  = 'MAIN'
           EXCEPTIONS
                element = 1
                window  = 2.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'EBR'.
        syst-msgno = '056'.
        syst-msgty = 'E'.
        syst-msgv1 = 'WTEXT'.
        syst-msgv2 = 'WINDOW2'.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " writeform
    *&      Form  writeform_footer
          text
    -->  p1        text
    <--  p2        text
    FORM writeform_footer.
    IF nast-spras = 'N'.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  element = 'FOOTER'
                  window  = 'MAIN'
             EXCEPTIONS
                  element = 1
                  window  = 2.
      ENDIF.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'WFOOTER'
                window  = 'WINDOW12'
           EXCEPTIONS
                element = 1
                window  = 2.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'EBR'.
        syst-msgno = '056'.
        syst-msgty = 'E'.
        syst-msgv1 = 'WFOOTER'.
        syst-msgv2 = 'WINDOW12'.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " writeform_footer
    *&      Form  closeform
          text
    -->  p1        text
    <--  p2        text
    FORM closeform.
    CALL FUNCTION 'CLOSE_FORM'
           TABLES
                otfdata                  = tbl_otf
           EXCEPTIONS
                unopened                 = 1
                bad_pageformat_for_print = 2
                OTHERS                   = 3.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        syst-msgid = 'PS'.
        syst-msgno = '005'.
        syst-msgty = 'E'.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    " closeform
    *&      Form  format_pdf
          text
    -->  p1        text
    <--  p2        text
    FORM format_pdf.
    FIELD-SYMBOLS <fs>.
      DESCRIBE TABLE tbl_line    LINES  hltlines.
    DESCRIBE FIELD tbl_line    LENGTH fle1 IN BYTE MODE . Defect#1579-
    DESCRIBE FIELD tbl_objtxt  LENGTH fle2 IN BYTE MODE . Defect#1579-
    Start of Defect#1579+
      DESCRIBE FIELD tbl_line    LENGTH fle1 IN CHARACTER MODE.
      DESCRIBE FIELD tbl_objtxt  LENGTH fle2 IN CHARACTER MODE.
    End of Defect#1579+
      CLEAR   tbl_objtxt.
      REFRESH tbl_objtxt.
      LOOP AT tbl_line.
        htabix = sy-tabix.
        MOVE tbl_line TO hfeld+off1.
        IF htabix = hltlines.
          fle1 = strlen( tbl_line ).
        ENDIF.
        off1 = off1 + fle1.
        IF off1 GE fle2.
          CLEAR tbl_objtxt.
          tbl_objtxt = hfeld(fle2).
          APPEND tbl_objtxt.
          SHIFT hfeld BY fle2 PLACES.
          off1 = off1 - fle2.
        ENDIF.
        IF htabix = hltlines.
          IF off1 GT 0.
            CLEAR tbl_objtxt.
            tbl_objtxt = hfeld(off1).
            APPEND tbl_objtxt.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " format_pdf
    ANy Suggestion or help will be appreciated!
    Regards,
    Kittu
    Edited by: Kittu on Jun 30, 2008 12:32 PM

    Hello Julie Waller,
    Very Good evening!
    Thank you very much for your response!
    Sometimes...I miss the basic things and start concentarcting on typical ways to fix the issue. ....which will only make my issue critical. 
    Hello Sathya,
    Thank you for your response!
    POints are rewarded..
    Have a great day ahead!
    Regards,
    Kittu

  • Processing of Sales order output type BA00 processes another Z output type for acknowledgement.

    Hi Friends,
    I am facing below mentioned issue and request your suggestion to solve it
    Via processing of sales order output type BA00 another Z output type is processed and acknowledgment is sent to SAP inbox( sost).
    This is working incase of manual addition of BA00 output type and via standard program " sd70av1a", but this functionality is not working when i am calling this standard program in a Z report via batch job.     
    with the below code-
    DATA: name TYPE tbtcjob-jobname.
             DATA: number  TYPE tbtcjob-jobcount.
             DATA: print_parameters TYPE pri_params.
             name = 'ORDER_PRINTING'.
             CLEAR: range1.
    *REFRESH: range.
             range1-sign = 'I'.
             range1-option = 'EQ'.
             range1-low = 'BA00'.
    *        range1-high = 'ZBA1'.
             APPEND range1 TO range.
             CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                 jobname          = name
               IMPORTING
                 jobcount         = number
               EXCEPTIONS
                 cant_create_job  = 1
                 invalid_job_data = 2
                 jobname_missing  = 3
                 OTHERS           = 4.
             IF sy-subrc = 0.
               SUBMIT sd70av1a WITH  rg_kschl IN range
                               WITH  rg_vbeln IN order_tab
                               TO SAP-SPOOL
                               SPOOL PARAMETERS print_parameters
                               WITHOUT SPOOL DYNPRO
                               VIA JOB name NUMBER number
                               AND RETURN.
               IF sy-subrc = 0.
                 CALL FUNCTION 'JOB_CLOSE'
                   EXPORTING
                     jobcount             = number
                     jobname              = name
                     strtimmed            = 'X'
                   EXCEPTIONS
                     cant_start_immediate = 1
                     invalid_startdate    = 2
                     jobname_missing      = 3
                     job_close_failed     = 4
                     job_nosteps          = 5
                     job_notex            = 6
                     lock_failed          = 7
                     OTHERS               = 8.
                 IF sy-subrc <> 0.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
    In this case only BA00 is getting processed but Z output type created for sending acknowledgment is not triggered.
    Please suggest how can i achieve the required functionality.
    Thanks,
    Surya

    Solved myself..
    Thanks.
    Br,
    Surya

  • VL02N Output type issue.

    Hi,
    When I execute the tcode VL02N for any output type (ZEU5) for print preview and external mail then it is giving error that "Output could not be issued".
    I have also checked the config of NACE , it seems to be ok.
    So what are the other possibilities of this error.
    Thanking you in advance,
    Regards,
    Vikram

    Configuration of NACE does not make all the difference. The only way to come to the solution is to debug from point when button is clicked for print preview or etc.
    Possible reasons may be there calling program before making a call to script or smartform encountering a problem. It may be that program is not able to get the desired data correctly from the tables or some other problem(Mainly due to subrc not coming to be 0).
    Apart from this even if call is made successfully to the form but inside there could be problem like using command in smartform.
    Thanks,
    Mark

  • Triggering output type when sales order is saved

    Hello all,
                I have a small question. Whenever I create a drop ship sales order it triggers a custom output type and prints the form by default even though this output type hasnt been saved in the sales order messages. Similarly from a drop ship PO when it is created with reference to the drop ship order and a requisition it tries to call this cusotm output type and prints the form.
    Please advice how to find the settings and make it not print this form.
    Thanks in advance.

    Hello,
             There are few other custom output types configured for a sales order. I wonder why it picks this particular output type and prints the form.
             If I uncheck 'Print Immediately' then would it stop from just printing or even calling the form too.
              Please advice if there might be any other config which tells to call this particular form whenever a drop ship sales order is created.

Maybe you are looking for

  • Cant hear anything in my macbook pro

    i cant hear anything just when i move something to the trash

  • How to use Default parameters

    Hello, How do I use default parameters from ODP.NET. I have a proc in Oracle that shows Default? = Y when I do Describe in PL/SQL Developer. Therefore, I don't want to pass this parameter at all via ODP.NET/C# call. If I omit this parameter, I get th

  • Authorisation to be restrict to plant level for VA01

    hi experts, is it possible to restrict the user to plant level for the transaction VA01. if possible authorization object for the same or some other process

  • Format Into File bug, repost#2

    Dear All, I have found a strange bug/feature in Format Into File.  A 3 digit integer number argument (eg. 123) together with the format string " %04d" should result in " 0123" being written to file but instead fails with error cluster; STATUS=TRUE CO

  • Can clock synchronization be implemented by pure java?

    I want to build a simple distributed application, whose main purpose is to synchronize the local system clock in the slave JVM with the clock in the master JVM. Can it be implemented by pure java? Or I have to use JNI to implement it? And although th