Restrict Sales Order for Delivery Creation

Dear Experts,
We are supplying material to our customer (He is our subsidiary company). All the material codes within the two companies (i.e., our customer and us) are same. My customer is creating Purchase Order on us and through BDC program auto sales order is getting generated at our company. Pricing conditions are also copied from the PO to SO. We are not maintaining any pricing conditions for this customer.
My customer wants to supply the materials only against the sales orders created during the month only. Example: If auto sales orders are created during August'09 till 31st Aug, delivery should be created before 31st August only. From 1st Sept'09 onwards delivery should not create against the open sales orders created till 31st aug'09. When we try to do the delivery, system should not allow for creation of delivery from 1st Sept'09 onwards.
Can u please guide me whether we have any standard process for this to control the delivery creation? or we need to go for any development?
Your early reply in this regard is highly appreciated.
Thanks
Murthy SD

hi you can use scheduling aggrement concept for the same.
Alternatively , you can write logic in the exits .
program:
MV50AFZ1
code:
loop at xlips.
          select single vbegdat venddat from VEDA into (VEDA-VBEGDAT,VEDA-VENDDAT)
                                               where vbeln = xlips-vgbel
                                                 and vposn = xlips-vgpos.
             if sy-subrc = 0.
             if VEDA-VBEGDAT is initial and VEDA-VENDDAT is initial.
             else.
              if sy-datum ge VEDA-VBEGDAT and sy-datum le  VEDA-VENDDAT.
              else.
              MESSAGE  'sales order referred is outside validity range' type 'E'.
              endif.
             endif.
             endif.
          endloop.
the code is to be writeen in exit of delivery i.e whenever delivery is being created wr to order it checks the dates in order
Rwd points if helpful
regards
chandresh

Similar Messages

  • Can't change quantity when copy from Sale order for Delivery

    Hi all!
    Can i use authorization for can't change quantity when copy from Sale order for Delivery.

    Tien,
    Approval will not work when you have mutiple rows of data.  You would have to work with SP Transaction Notification
    There has been threads before on the forum on the same topics.
    Block the Quantity in Sales Delivery
    Approval Procedure for chaning quantity in Delivery Document
    Suda

  • Sales orders and delivery creation

    Hi :
    im selecting sales orders , items and schedule line
    from a custom table based on plant, shipping point and delivery creation date.
    Is there any relation between Schedule lines and delivery creation date.
    For delivery creation date d_date = SY-DATUM, and should select Mat Avail dt MBDAT or Trans. planning dt TDDAT which ever comes earlier.
    vbep-edatu = itab-d_date.
    select a1belnr a1posnr vbep~etenr into corresponding fields of table itab from a1 inner join vbap
    on a1belnr = vbapvbeln
    inner join vbep on a1posnr = vbepposnr
    where a1~werks = p_werks
    AND vbap~vstel = p_vstel
    AND vbep~edatu = p_edatu
    AND (vbep~mbdat <= p_edatu OR
    vbep~tddat <= p_edatu ).
    can anyone help me with this select statement.
    Thanks.
    Raghu

    Hi,
    Modify the Selec as below:
    select a1belnr a1posnr vbep~etenr into corresponding fields of table itab from a1 inner join vbap
    on a1belnr = vbapvbeln
    inner join vbep
    <b>on  vbapvbeln =  vbepvbeln and vbapposnr = vbepposnr</b>
    where a1~werks = p_werks
    AND vbap~vstel = p_vstel
    AND vbep~edatu = p_edatu
    AND (vbep~mbdat <= p_edatu OR
    vbep~tddat <= p_edatu ).
    Regards,
    Anji

  • Ship to party address no change in sales order after delivery creation

    hi
    We have a below requirement
    After creation of delivery document,we should not be able to go and change ship to party in va02 of sales order..
    Tried using partner functions config,but it disables ship to party change completely...
    But we want to disable ship to party change only if delivery is already created.
    regards
    sudha

    hi swetha,
    as per my understanding goes:
    you need to make SH field GREY when a delivery document is generated for it.
    but now even if delivery is created or not SH field is GREYED.
    you can use
    USEREXIT_MOVE_FIELD_TO_VBAK in program MV45AFZZ
    LOGIC : when ever the sales order status is completed or partially completed then only this SH field should be GREYED other wise NOT.
    hope this clears your issue & please check from your end
    balajia

  • Wanted to restrict sales order for a particular region

    Hi all
    I want to restricted two sales order on the region parameter,while using same sales area.
    Ex:
    sales order A should be used in delhi region,where as sales order B should be used for outside delhi,though the sale area is same for both the order type.
    Hope my problemis clear to all.
    Thanks
    siddharth

    Dear Siddharth
    You can try with any of the following user eixts
    -  User exits in the program MV45AFZZ - USEREXIT_READ_DOCUMENT
    -  User exits in the program MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE
    -  User-Exits in program MV45AFZB - USEREXIT_CHECK_VBAK
    thanks
    G. Lakshmipathi

  • Restrict Sales Order Creation for Serial Numbers already in Sles Order/Sold

    We have recently implemented variant configuration and usage of serial numbers.
    Facing some problems because of this.
    1. If a Material is in Stock e.g Material xyz and serial number 123
    System allows us to create sales order and Deliver and Invoice Serial number 124.
    I have activated Indicator: Serial Number Existence Requirement thru OIS2. However it solves only part of my problem.
    If for Material xyz serial number 123 is in stock but serial number 124 has also been created and assigned to material xyz but not in stock, then system allows me to create sales order, delivery and billing for material xyz and serial number 124.
    When I check MMBE I see zero stock when I click on serial number I see serial 123, which is inconsistent.
    How to ensure that such a situation does not happen?
    Also I do not want the system to create a sales order for a material for which sales order has been created.
    e.g. for material xyz and serial 1234 if sales order exists then system should not allow creation of another sales order for the same combination.
    However in case of consignment orders the system should allow only the logical transactions like consignment fill up or consignment returns.
    Please help.
    Regards
    Rajkumar Reddy

    Hi
    This is nothing but Creating Roles  and assigning the respective authorizations to the Roles  for giving the access to the related Tcodes
    This has to be done by basis people
    using the Transactions
    PFCG
    SU21
    SUIM
    such that every user can not create the sales order or change it.
    Reward points if useful
    Regards
    Anji

  • Bapi for Delivery Creation from Sales Order

    Hi
    I have multiple sales order and i want to create 1 outbound delivery from it just like what Vl10A is doing.
    Can i have BAPI or fumctiona module for same.
    Best Regards
    Subham

    Check this thread:BAPI for Delivery Creation
    Also search the forums..there are many threads addressing the same issue.
    Regards,
    Kiran

  • Restricting Sales Order Creation for Customers with specific AccountGroup

    Hi
    We have 2 Accont Groups for Customers namely Actual & Prospective.
    We wish to allow Enquiry / Quotation and Order creation for customers with Account Group ACTUAL and wish to allow only Enquiry and Quotation creation for customers with Account Group as Prospective.Is there anyway i can apply Sales Order creation block on an ACCOUNT GROUP on whole and not on Individual customers...
    Regards
    Sanjeev Bagaria

    Hello
    I did this through Listing Inclusion / Exclusion.
    (1) We created a new Customer Group 99 for Prospective Customer
    (2) We then created a new Condition table xxx with Customer Group & Material Type(as footer)
    (3) We then created this new Access Sequence Customer Group / Material Type to Exclusion Procedure B00001
    (4) We then assign the Exclusion Type B00001 to Sales Documents ZDOM & ZEOR our Order Sales Documetn Types
    (5) And finally we created a record for Exclusion with 99 Customer Group and Material Type as FERT..
    This now restricts creation of Sales Orders for all my Prospective Customers provided Customer Group is maintained in Customer Master. We are now also able to make Enquiry / Quotation and Sample Sales Order for Prospective Customers sicne we have Different Sales Document Types for all these and have assigned Exclusion only to normal Sales Order Document Type.
    Thanks a lot for all the suggestions provided.
    Regards
    Sanjeev

  • Prevent Outbound delivery creation in sales orders with delivery block

    Hi gurus
         We are facing the following issue:
         Some sales orders have delivery block header and once they are saved an outbound delivery document is created; we want SAP system creates outbound deliveries only in those cases were sales orders have not a delivery block in header, is there any option or configuration we can use in order to prevent the creation of these documents?
    Regards,
    Edgar.

    Well Edgar,
    let's see then in spro
    Logistics Execution->Shipping->Deliveries->Define Reasons for Blocking in Shipping
    Check out the configuration of your delivery block reason and pay special attention to this instruction:
    "In sales documents, you can either enter delivery blocks manually at header level (business data in the sales document header) or they can be proposed automatically by the system. In the latter case, the delivery block must be entered in the respective sales document type (see chapter
    "Define sales document types"). In addition, the delivery block in the sales document header is only effective if the delivery block has been assigned to the respective delivery type."
    It must be something in the configuration of the delivery block reason you're using.
    Regards,
    Edgar

  • How to change the sequence that VL10 use for sales order during DN creation

    We are using VL10 for DN creation , VL10 is executed in  background as a batch job ..... we have created a variant and have given range of shipping points for which we want to create  the Deliveries.
    What we want to understand is that how SAP standard code for VL10,  sorts the sales orders for which the delivery are to be created using VL10?
    we would like VL10 to process the sales order which belong to same shipping point in some order....so that delivery needs to be created for the first sales order rather than last sales order for a given shipping point....
    Is there any sort order that SAP follows to pick which order it will consider for delivery creation ....first over the other sales order where the shipping happens to be same ?  if yes then is there any way we can change it  ?
    Any guidance is appreciated
    Thanks
    Rajey

    We are facing the same problem and are running at 4.7.
    There are orders with the same goods issue date and if so, it should be sorted by order no.
    Nevertheless, it does not sort it by order no but we could not find yet what the sort criteria is if it runs in the background and how to change these rules.

  • How to List Sales Orders based on Creation Date and Delivery Priority

    Dear all,
    How can we list Sales Orders based on creation date and delivery priority.
    I tried using vl10a transaction code, but there we can see sales order based on delivery date.
    we need to list all sales order based on delivery priority and sales order creation date.
    can any one of you tell me which standard report gives such kind of report. Your suggestions will be highly appreciated.
    Thank you
    Raghu Ram

    Hi Raghu,
    There is no st report available as per your req.
    Using SQVI, you develope one report that is list of sales orders based on your req.
    SQVI is used to convert a Quick View into a query.
    Quick Viewer:
    The Quick Viewer allows you to define reports without having to program yourself. The Quick
    Viewer is especially useful for new users and occasional use.
    Quick Viewer is a tool for generating reports. SAP Query offers the user a whole range of options for defining reports. SAP Query also supports different kinds of reports such as basic lists, statistics, and ranked lists. Quick Viewer, on the other hand, is a tool that allows even relatively inexperienced users to create basic lists.
    Quick View definitions are user-dependent. You can transfer a Quick View into SAP Query in order to make reports, for example, accessible to additional users, or to use the other functions available in SAP Query.
    The following is a comparison of Quick Views and queries:
    Quick Views possess the same functional attributes as queries. However, only basic lists may be defined with Quick Views.
    In contrast to queries, no user group assignment is necessary with Quick Views. Each user has his/her own personal list of Quick Views. Quick Views cannot be exchanged between users. Quick Views may, however, be converted to queries and then be made available to other users in a specific user group.
    Info Sets are not required for Quick View definition. Whenever you define a Quick View, you can specify its data source explicitly. Tables, database views, table joins, logical databases, and even Info Sets, can all serve as data sources for a Quick View. You can only use additional tables and additional fields if you use an Info Set as a data source.
    The Quick Viewer uses various controls. Certain hardware and software requirements must also be fulfilled before you can use the Quick Viewer.
    To define a Quick View, you select certain fields according to your data source that determine the structure of your report. The report can be executed in basis mode with standard layout or may be edited using drag and drop and the other toolbox functions available in WYSIWYG mode.
    Reports created using the Quick Viewer may also be passed to external programs (Excel, for example).
    Call the Quick Viewer using System -> Services -> Quick Viewer (or transaction SQVI).
    Enter the name of the Quick View. Quick View names can contain a maximum of 14 characters.
    Choose Create.
    Enter a title for the Quick View and remarks, if you think they are relevant.
    If you do not want to base your list on a table, use the possible entries pushbutton in the Data source field to select another data source. You can choose logical databases or Info Sets. In addition, you may also create table joins. For further information, see Selecting a Data Source.
    Choose Basis mode if you want to create the list directly with no list design. Choose Layout mode if you want to define the layout of your list yourself.
    SQVI Table Quick viewer – Used to created quick client dependent reports
    Probably the easiest and most flexible way to do this is thru one of the ABAP query transactions.
    Transaction SQVI can do this and it has a very good help function that explains how it works... the drawback is that it is only for one user.
    You can play around with it and see if it meets your needs...
    The query results will come back in an ALV Grid or Excel... you can select what fields are returned, and have a selection screen to enter the search criteria.
    You can get the report by joining the tables VBAK and VBAP.
    If you have any queries, i will forward screen shots to your id.
    Reward points pls.
    Regards,
    Govind.

  • Delivery from Sale Order for Inquiry stock

    Dear All,
    We have unique requirement from client mentioned below, any help would be greatly appreciated.
    This is a trading sale which is initiated from inquiry.
    1. Inquiry is created in SD, which in turn triggers Purchase Requisition.
    2. PR is converted to RFQ.
    3. Based on RFQ prices are negotiated with vendors, then Quotation is sent to Customer from VA21 which is created against inquiry.
    4. Now when the PO is created w.r.t RFQ, then GR is done , Stock will be lying against inquiry.
    5. But i want to do delivery from sales order for stock lying against inquiry.
    we are looking for a workaround solution.
    Note:
    1. Client has disagreed with Stock Movement from Inquiry to quotation using MB1B, as it becomes manual transaction.
    2. PR triggering has to be @ Inquiry, as sale order will not be created until quotation is approved.
    Looking forward for valuable inputs.
    Thanks in advance
    Best Regards,
    Chaithru

    Tien,
    Approval will not work when you have mutiple rows of data.  You would have to work with SP Transaction Notification
    There has been threads before on the forum on the same topics.
    Block the Quantity in Sales Delivery
    Approval Procedure for chaning quantity in Delivery Document
    Suda

  • Delivery date in Sales Order for Make to Order Scenario

    Hello,
    We are creating Sales order for MTO ... In that our requirement is to get the delivery date based on Production planning and not from RLT. ie we have configured RLT as 36 days, system calculates delivery date as 36 days from the date of order what ever be the order quantity but considering our plant capacity  this is not possible. In our Production planning we allocate certain numbers per week. so when we give 100 nos order it plans as per the allocation if we see through MD73 it will give clear picture but in our sales order it shows delivery possible date as 36 days from date of PO. How to correct this.. it should calculate from the date of beginning of the production process.
    Can any one help in finding solution for this
    Thanks in Advance

    Hello,
    We are creating Sales order for MTO ... In that our requirement is to get the delivery date based on Production planning and not from RLT. ie we have configured RLT as 36 days, system calculates delivery date as 36 days from the date of order what ever be the order quantity but considering our plant capacity  this is not possible. In our Production planning we allocate certain numbers per week. so when we give 100 nos order it plans as per the allocation if we see through MD73 it will give clear picture but in our sales order it shows delivery possible date as 36 days from date of PO. How to correct this.. it should calculate from the date of beginning of the production process.
    Can any one help in finding solution for this
    Thanks in Advance

  • Automatic form generation on creation transfer order for delivery note?

    Hi,
    I have to create a form that should automatically be generated on the creation of a transfer order for delivery note. How do I trigger this automatic creation of the form? And how can the transfer order number be passed to my print program?
    Thx!

    hi christophe,
    To issue the delivery output, go to transaction VL02N.
    Then go to EXTRAS-> OUTPUT->HEADER->EDIT
    In the Message output screen enter the relevant output type created for the delivery.
    Choose the relevant medium of output.
    Choose Simple Mail, in this case the field NAST-NACHA will be having a value of 7.
    Specify the Partner Function; in this case it is MA -> Mail partner address
    Select the Communication Method for the output type maintained.
    This will take you to the SAPOFFICE screen.
    Enter there the  E-Mail Address to which you want to send the delivery document as PDF.
    A mail will be sent to the e-mail address of the E-Mail Address specified, with the delivery output form as a PDF attachment.
    hope it will help u ..
    *& Report  ZZ_TEST                                                     *
    REPORT  zz_test                                 .
    INCLUDE zz_test_top.
    INCLUDE zz_test01.
          FORM entry                                                    *
    -->  RETURN_CODE                                                   *
    -->  US_SCREEN                                                     *
    FORM entry USING return_code us_screen.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing USING us_screen.
      CASE retcode.
        WHEN 0.
          return_code = 0.
        WHEN 3.
          return_code = 3.
        WHEN OTHERS.
          return_code = 1.
      ENDCASE.
    ENDFORM.                    "entry
    *&  Include           ZZ_TEST_TOP                                      *
      TABLES : nast,
               tnapr.
    TYPES : BEGIN OF t_SOUDNAMEI1.
            INCLUDE STRUCTURE SOUDNAMEI1.
    TYPES : END OF t_SOUDNAMEI1.
    Internal Table declarations
      DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
      i_tline TYPE TABLE OF tline WITH HEADER LINE,
      i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
      i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    *Objects to send mail.
      i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
      i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
      i_lips LIKE lips OCCURS 0 WITH HEADER LINE,
      i_SOUDNAMEI1 TYPE STANDARD TABLE OF t_SOUDNAMEI1.
    Work Area declarations
      DATA:w_objhead TYPE soli_tab,
      wa_control_parameters TYPE ssfctrlop,
      wa_output_options TYPE ssfcompop,
      w_return TYPE ssfcrescl,
      w_doc_chng TYPE sodocchgi1,
      w_data TYPE sodocchgi1,
      w_buffer TYPE string,"To convert from 132 to 255
      wa_SOUDNAMEI1 TYPE t_SOUDNAMEI1,
    Variables declarations
      w_form_name TYPE rs38l_fnam,
      w_len_in LIKE sood-objlen,
      w_len_out LIKE sood-objlen,
      w_len_outn TYPE i,
      w_lines_txt TYPE i,
      w_lines_bin TYPE i,
      retcode      TYPE sy-subrc,
      xscreen      TYPE c,
      w_spld TYPE usr01-spld,
      w_receiver TYPE SOXNA-FULLNAME,
      w_OBJ_RECORD TYPE OBJ_RECORD,
      w_user type sy-uname,
      w_email TYPE ad_smtpadr.
    Constants Declaration
      CONSTANTS : c_x TYPE c VALUE 'X',
                  c_atrate(1) TYPE c VALUE '@'.
    *&  Include           ZZ_TEST01                                        *
          FORM PROCESSING                                               *
    FORM processing USING proc_screen.
      SELECT * FROM lips
        INTO TABLE i_lips
        WHERE vbeln = nast-objky.
    Call Function module to Getfunction Module name Generated by Smartform
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = tnapr-sform
        IMPORTING
          fm_name            = w_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        retcode = sy-subrc.
      ENDIF.
      CLEAR : wa_control_parameters,
              wa_output_options.
      CASE nast-nacha.
        WHEN '1'.
          wa_control_parameters-device    = 'PRINTER'.
        WHEN '7'.
          DATA: l_email TYPE ad_smtpadr.
          wa_output_options-tdnoprev = c_x.
          wa_control_parameters-getotf  = c_x.
    To get the default output device maintained in the
    User profile
         SELECT SINGLE spld FROM usr01
          INTO w_spld
          WHERE bname EQ nast-usnam.
          IF sy-subrc EQ 0.
            MOVE w_spld TO  wa_output_options-tddest   .
          ENDIF.
          wa_output_options-tdnoprev = c_x.
          wa_control_parameters-getotf  = c_x.
    To get the email address maintained for the particular output
          CALL FUNCTION 'NAST_GET_MESSAGE_OBJECT_RECV'
            EXPORTING
              pi_objkey             = nast-tdname
            IMPORTING
              pe_addr               = w_receiver
            CHANGING
              pc_objhandle          = w_obj_record
            EXCEPTIONS
              maildata_not_readable = 1
              OTHERS                = 2.
          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 w_receiver NA c_atrate.
    To retrieve the E-Mail Id in case we get the User name from NAST
            CLEAR wa_soudnamei1.
            REFRESH i_soudnamei1.
            MOVE w_receiver TO wa_soudnamei1-fullname.
    To get the user name
            CALL FUNCTION 'SO_NAME_CONVERT_API1'
              EXPORTING
                name            = wa_soudnamei1
              TABLES
                names           = i_soudnamei1
              EXCEPTIONS
                user_not_exist  = 1
                parameter_error = 2
                x_error         = 3
                OTHERS          = 4.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CLEAR wa_soudnamei1.
            READ TABLE i_soudnamei1 INTO wa_soudnamei1 INDEX 1.
            MOVE wa_soudnamei1-sapname TO w_user.
    To get the e-mail Id maintained in the user profile
            CALL FUNCTION 'FTR_CORR_CHECK_EMAIL_SAP_USER'
              EXPORTING
                i_user              = w_user
              IMPORTING
                e_email_address     = l_email
              EXCEPTIONS
                mail_address        = 1
                determination_error = 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.
            MOVE l_email TO w_receiver.
          ENDIF.
          MOVE  w_receiver TO w_email.
      ENDCASE.
      wa_control_parameters-no_dialog = c_x.
      wa_control_parameters-langu     = nast-spras .
      wa_output_options-tdteleland    = nast-tland.
      wa_output_options-tdtelenum     = nast-telfx .
      wa_output_options-tdsenddate    = nast-erdat .
      wa_output_options-tdsendtime    = nast-eruhr .
      wa_output_options-tddataset     = nast-dsnam .
      wa_output_options-tdsuffix1     = nast-dsuf1 .
      wa_output_options-tdsuffix2     = nast-dsuf2 .
      wa_output_options-tdimmed       = nast-dimme .
      wa_output_options-tddelete      = nast-delet .
      wa_output_options-tdautority    = nast-tdautority.
      wa_output_options-tdcovtitle    = nast-tdcovtitle .
      wa_output_options-tdcover       = nast-tdocover .
      wa_output_options-tdreceiver    = nast-tdreceiver.
      wa_output_options-tddivision    = nast-tddivision.
      wa_output_options-tdcopies      = nast-anzal .
      wa_output_options-tdnewid       = c_x.
      wa_output_options-tdarmod       = nast-tdarmod.
      wa_output_options-tdnoarmch     = c_x.
      CALL FUNCTION w_form_name
        EXPORTING
         archive_index      = toa_dara
         archive_parameters = arc_params
          control_parameters = wa_control_parameters
          output_options     = wa_output_options
          user_settings      = ' '
        IMPORTING
          job_output_info    = w_return
        TABLES
          it_lips            = i_lips
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      IF nast-nacha EQ 7 AND sy-subrc EQ 0.
        i_otf[] = w_return-otfdata[].
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = w_len_in
          TABLES
            otf                   = i_otf
            lines                 = i_tline
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            OTHERS                = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Convert PDF from 132 to 255.
        LOOP AT i_tline.
    Replacing space by ~
          TRANSLATE i_tline USING ' ~'.
          CONCATENATE w_buffer i_tline INTO w_buffer.
        ENDLOOP.
    Replacing ~ by space
        TRANSLATE w_buffer USING '~ '.
        DO.
          i_record = w_buffer.
    Appending 255 characters as a record
          APPEND i_record.
          SHIFT w_buffer LEFT BY 255 PLACES.
          IF w_buffer IS INITIAL.
            EXIT.
          ENDIF.
        ENDDO.
        REFRESH: i_reclist,
        i_objtxt,
        i_objbin,
        i_objpack.
        CLEAR w_objhead.
    Object with PDF.
        i_objbin[] = i_record[].
        DESCRIBE TABLE i_objbin LINES w_lines_bin.
    Document information.
        w_doc_chng-obj_name = 'Smartform'.
        w_doc_chng-expiry_dat = sy-datum + 10.
        CONCATENATE 'Delivery' 'Note'
        INTO w_doc_chng-obj_descr.
    *w_doc_chng-obj_descr = 'Smart form output'.
        w_doc_chng-sensitivty = 'F'. "Functional object
        w_doc_chng-doc_size = w_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
        CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
        i_objpack-head_start = 1.
    Number of lines of an object header in object packet
        i_objpack-head_num = 0.
    Start line of object contents in an object packet
        i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
        i_objpack-body_num = w_lines_txt.
    Code for document class
        i_objpack-doc_type = 'RAW'.
        APPEND i_objpack.
    Packing as PDF.
        i_objpack-transf_bin = 'X'.
        i_objpack-head_start = 1.
        i_objpack-head_num = 1.
        i_objpack-body_start = 1.
        i_objpack-body_num = w_lines_bin.
        i_objpack-doc_type = 'PDF'.
        i_objpack-obj_name = 'Smartform'.
        CONCATENATE 'Delivery' 'Note' '.pdf'
        INTO i_objpack-obj_descr.
        i_objpack-doc_size = w_lines_bin * 255.
        APPEND i_objpack.
    Document information.
        CLEAR i_reclist.
    e-mail receivers.
        i_reclist-receiver = w_email.
        i_reclist-express = 'X'.
        i_reclist-rec_type = 'U'. "Internet address
        APPEND i_reclist.
    sending mail.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = w_doc_chng
            put_in_outbox              = 'X'
          TABLES
            packing_list               = i_objpack
            object_header              = w_objhead
            contents_bin               = i_objbin
       contents_txt               = i_objtxt
            receivers                  = i_reclist
          EXCEPTIONS
            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 <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDFORM.                    "processing

  • How to find that a sales order for which there is  delivery but no goods

    Hi
    How to find that a sales order for which there is  delivery but no goods issue has been done i.e we have an open delivery for a sales order.
    How in VBUK table can we find  out with the sales order no .
    Thanks in advance

    make use of table VBFA.
    Regards
    Peram

Maybe you are looking for

  • TO check whether import is running

    Hi how to check whether import is running or not.I am using oracle 8.1.7 in solaris 8 .I used ps -ef | grep imp in os level its showing its running i am importing the indexes only no data,When i am checking the freespace in index tablespace its not r

  • How to get rid of the old songs from iPhone that do not show up in iTunes?

    Every time I delete my entire iTunes library and sync iPhone with it, my music is still loaded with old songs but do not appear on my iTunes. And when I add new songs to my library, the new songs get mixed with old songs. How to get rid of the old so

  • Select statement having internal table in the wher clause...

    Hi, will all the entry from the internal i_crhd will be pased to the next select statement in the sample code below without looping? Thanks  a lot! REFRESH i_crhd.    SELECT objid vgwts      FROM crhd INTO CORRESPONDING FIELDS OF TABLE i_crhd      WH

  • Creating a view for a datasource with KONP

    Hi. I have the many times discussed problem with the reference field in datasources are not possible. Most provided solution was to create a view on KONP and e.g. RV13A. But if I want do this I run into an error:  Table RV13A is not transparent Could

  • Testing and automation

    This question was posted in response to the following article: http://help.adobe.com/en_US/flex/using/WS37cb61f8f3397d86-5906dd7a120892e4da7-8000.html