ERP Delivery/Transfer Order u2013 CRM Billing

Hi everybody,
Iu2019m new to this forum and I hope that this is the right place to post my request.
Iu2019m currently developing a course in CRM and face a problem. We use an IDES client of the UCC and I try to accomplish a sales order in the CRM System, process the delivery/transportation in the ERP backend and after the delivery is completed, there should be a billing due list item created in the CRM System. The problem is, that there is no Billing Due Item created/transferred to the CRM System. Here is how the process works:
Transaction Code: CRMD_BUS2000115 bzw. CRMD_ORDER
1.     Transaction Type is Sales --> Sales Process (Item Category ZSAL)
2.     Type in the following data
   a.       Sold-to Party     300025 (01Megastore)
   b.       Product          HT-1000
   c.       Quantity          1
3.     Save the document.
4.     Go to the ERP System and check whether the sales order was transferred (Transaction Code: VA02)
5.     Create a Delivery Document (Transaction Code: VL01N). Shipping Point is 3800 (Denver) and date is 
        todayu2019s date + 1 week. Save the document.
6.     Create the Transfer Order use the following settings:
  a.     Warehouse number          038
  b.     Plant                            3800
  c.     Delivery                       the number of the delivery
  d.     Foreground/Backgrnd.     System Guided
  e.     Adopt Pick Quantity             2 (Include pick, quantities in delivery and post Gl)
  f.     Press Enter and save.
After I create the Transfer Order the delivery should be completed and since the Item Category of the Sales Transaction Type is ZSAL and ZSAL is set to be Delivery-Related, there should be a Billing Due Item created in the CRM System. So far the theory!
Now thatu2019s where the problems begin:
1.     There is no Billing Due Item created in the CRM System
2.     I try to create a billing due in the ERP System here I get the Error message, that the u201Cgoods issue has
        not been posted for deliveryu201D
3.     I take a look at the delivery (vl02n). Here the deliveryu2019s status is still at u201Cbeing processedu201D
4.     I try to u201Cpost good issueu201D manually.
5.     I get the error message u201CSyntax Error in substitution u2018Reg_SUBu2019, step u2018001u2019u201D
The error message long text is:
Syntax error in substitution "REG_SUB", step "001"
Message no. GB032
Diagnosis
A syntax error was found in substitution REG_SUB during the ABAP code generation.
System Response
An ABAP code is not generated for this Boolean statement and the statement is evaluated as FALSE (in ABAP include GBTWMFIC).
Procedure
Correct substitution REG_SUB using substitution maintenance.
Hopefully anybody here can help me with this problem. Thanks in advance
Taymaz

Hi Stephanie,
I just wanted to point out two things:
1. As Dinesh explained already, the first scenario is mostly used if the Logistics Execution (delivery, transportation) happens in ERP, and billing was already set up and used in ERP. But in principle you can also use CRM Billing in connection with Logisitics Execution in ERP. This means you create your sales order in CRM, your delivery and so on in ERP, and then you can bill the order or the delivery in CRM. The advantage of this is that you are able to bill e.g. sales order and service order items in one invoice.
2. In the second scenario you can upload orders to ERP (if you want to do Logistics Execution), but is is not necessary (if you don't do LE). And it is not necessary and not possible to upload billing documents to ERP. CRM transfers automatically or manually the billing document to ERP FI and creates and Accounting document. So it is fully integrated without replication and without using ERP Billing.
I hope this answers your questions.
If you are interested in an integration scenarion with CRM Order - ERP Logistics Execution and CRM Billing, please watch the following short video:
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a07ef82a-60d2-2b10-98bb-9abcbc282bec]
Best regards,
Angela Thomas

Similar Messages

  • How to get data from ECC --- Sales Order,Delivery,Transfer Order & Invoice

    Hi,
    Good day.
    I'm ABAPer and I need to get Sales Order,Delivery,Transfer Order & Invoice data from ECC.  The said data will be displayed in the custom form that I need to create.  How exactly do i get the said data above? 
    Can I get them in the tables avaialable in GTS? Where?
    Or do I get the data directly in ECC? How?
    Thank you very much!
    Best regards.
    Brando

    First of all push ECC data in to GTS server through T.code:/N/SAPSLL/MENU_LEGALR3. First click on Master data tab there enter customer/vendor number then execute.
    2-Go to document tab there enter Sales order no/PO number then execute it.
    Then go to GTS server in compliance management module you can get all the information.
    Regards
    Sitanshu Panigrahi

  • Creating a transfer order for a Billed Delivery

    Hi,
    After billing a delivery, wich already had picking confirmed, the picking field in the delivery was blanked.
    Is there a way to create a new tranfer order for this delivery, even if it is already Billed?

    Hi,
    Thanks for the answers. After some tests we find the solution!
    In this case we change the billing status of the delivery to "A", then was possible to create a new transfer order, without cancel the billing.
    In Brazil we can´t cancel the billing document after the goods to have left.
    Thanks,

  • Dynamic Bin for delivery Transfer Order

    Dear All,
    We have WM implemented in our SAP landscape. We do the picking though transfer order created with reference to outbound delivery through LT03.
    In this picking transfer order the destination storage type is 916 and bin is dymanic bin (which is the delivery number).
    I have faced a strange issue yesterday where the destination bin  is coming as $--1  or $--
    2 etc instead of the delivery number.
    This was working fine previously and even now its working fine except one day when i faced this issue.
    Any pointers on this will be highly appreciated.
    Thanks ,
    Rohit

    Hi Rohit,
    Could you please check whether you have set the field  LIPS-VGBEL
    for the requirement type correctly.
    IMG -> Logistic Execution -> Warehouse Management -> Interfaces ->
      Shipping -> Define Shipping Control ->
         Requirement Types of Delivery Documents
    regards,
    Ramana

  • Cross Delivery Transfer Order without using LT0s

    Good morning,
    I am familar with LT0s to create Cross Delivery TO's.
    Currently I am searching for ways to accomplish the same effect for the 2nd step of my 2-step picking TO's, i.e. I want to create One big TO that takes everthing from 200 (interim 2-step) to the dock (interim 9xx)
    The group created by VL10B, found in v_sa cannot be used in VL06, and the 2-step group created by LT43 cannot be used either.
    I want the beauty of LT0S in other flows, can I have that?
    Thank you for your time,
    Sandeep

    Sandeep
    You could use LT10 for Warehouse XXX and st type 200 movement type 999 and select all and create a TO in foreground and type in the st type and bin where you want it to go
    I hope that this helps
    Frenchy

  • RE: Intercompany stock transfer order process

    hi SD Experts,
    I really appreciate if anyone explain me how to execute Intercompany stock transfer order with intercompany billing scenario.
    I  used T-Code ME27, but unable to do delv and intercompany billing
    thanks in advance
    regards
    vaseem

    hi
    Material should exist in both the plants (Delivering  & Ordering),
    Internal customer should be assaigned to the ordering plant ( MM -> Purchasing -> Purchase Order -> Setup stock transport order -> assign the internal customer to the ordering plant and assign the Sales area of the internal customer.
    Assign its Sales area to the delivering plant
    Assign the document type and Delivery type  NB and NLCC
    Assign the Supplying plant --> Receiving Plant --> NB 
    Take the delivering plant and assign the sales area.
    Vendor master has to be created and assaign the supply source ( Delivering Plant).
    Create a puchase order ME21N ---> Save
    Delivery VL10 G ---> Calculation rule (appropriate) --> Assaign the purchase order number here and execute.
    Select the Delivery creation line and do the back ground process.
    Start the log display and see the delivery document number by the documents button
    Goto VL02N --> do picking and PGI --> Then do the MIGO with respect to the delivery document.
    Billing (Intercompany pricing conditions should be set).
    rewards point it helps

  • Sap Script Transfer Order Change

    Hello Gurus,
    I have a sapscript for Pick For delivery (Transfer Order pick List) once the transfer order created from the delivery is confirmed.
    In the current form, material number is being printed on the form from the transfer order table LTAP.
    Now the change need to be made is to print the delivery item number (before the material number like delivery_item_number space material_number) of the corresponding material number. I need to write a logic in order to extract the delivery item position number. do you have any idea how I can do that.
    Please help me out.
    the sapscript is closest to sap form LVSTALISTE.
    Regards,
    B
    Edited by: Balu on Aug 13, 2008 6:26 PM

    Subroutine program
    FORM CALC_NETPRICE TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    Data : w_matnr type LTAP-MATNR,
              w_posnr type LIPS-POSNR.
      READ TABLE in_tab INDEX 1.
      w_matnr = in_tab-value.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT         = w_matnr
        IMPORTING
          OUTPUT        = w_matnr.
    SELECT SINGLE POSNR FROM LIPS INTO W_POSNR WHERE MATNR EQ W_MATNR.
      READ TABLE out_tab INDEX 1.
      MOVE W_POSNR TO out_tab-value.
      MODIFY out_tab INDEX sy-tabix.
    ENDFORM.                    "CALC_NETPRICE
    Now add the Field &LIPS-POSNR& where u required.
    Just make sure that the PERFORM statement is before the fields output. i.e,  &LIPS-POSNR& ,, &LTAP-MATNR&
    Regards
    Krishna

  • Error while creating a transfer order for delivery note.

    Hi Gurus,
    I have already created an outbound delivery.  I am creating a transfer request as a basis for goods movement in the warehouse and to print the picking list. so i use the path:
    Logistics -> Sales and Distribution -> Shipping and Transportation -> Picking -> Create Transfer Order -> Single Document.
    Now here i enter the warehouse number, plant, delivery. when i press enter i get error "No items that are to be picked were found".
    I went to the following IMG path -- Enterprise Structure --> Assignment --> Logistics-Execution --> Assign Warehouse number to plant/storage location.
    Assign the warehouse to the plan and storage location.
    Still i get the same error. Could some one help me out here?
    Thanks in advance
    Amit

    Hi,
    can you check whether Warehouse number exists and transfer order creation is required or not at Delivery document under Picking tab

  • Delivery Split in Stock transfer Order

    Hello gurus,
                        In Stock transfer order process, Delivery has been split. In purchase order we have two materials, while creating delivery in VL10B System is splitting the deliveries and creating two delivery no. instead of one delivery. I checked everything but i could not reach out the solution. can you tell me what could be reason for this delivery split in Stock Transfer Order Process.
    Regards
    Soumendu

    SAP have provided a report ZLE_ANALYZE_DELIVERY_SPLIT in note 355404.
    This report tells you exactly what is causing the split by highlighting the cause in red. It does not make any change to the database on your system (i.e. no changes are made on your system). I would recommend you implement this report.
    Often, I have seen the delivery time being the cause of a delivery split. So check the values of LIKP-LFUHR for each delivery. But the above report would tell you exactly.

  • Open Qty is not copied in Delivery for Stock Transfer Order

    Hi,
    In the Stock Transfer Order process, Once the STO Order is created, I am creating delivery in the transaction VL10B or VL10G.
    When I am clicking the background button Delivery gets generated. Then when i am going in the transaction VL02N and increasing the delivery Quantity which is more than STO order quantity, the system is accepting it. But i want the system to throw an error message if the delivery quantity is more than the order qauntity. For this I have made the following settings.
    In the Transaction Code 0VLP, i have selected B in Check Over Delivery field. But still it is not throwing an error.
    The reason for the same may be, the system is not copying the Open Delivery Qty from the STO Order (Which normally happens in Sale Order to Delivery process, bcos of Copy Control). This field has 0 value. So the system is not able check for over delivery.
    If I get this value in the delivery then it should be working fine and the sytem will throw an error for over delivery.
    Can you please suggest me a way to get this open qty value in delivery for STO order or suggest me some other option to check for over delivery in STO.
    Regards
    Vijay

    Dear Friend,
    If I can understand you clearly.
    to achieve your task the best way you can sit with your abaper and configure a routine and assign the same to T-code OVLK delivery type customizing :
    In the Item requirement : Generally it is 202
    reward points if helpful,
    regards,
    Amlan

  • How to create an ERP Sales Order in CRM by referring to CRM Quotation

    Hello Experts:
    My requirement is as follows:
    I have done the replication of customers and materials between ECC and CRM. 
    I need to create a quotation in CRM and create a follow-up transaction as ERP Sales Order within CRM.
    My question is: how do i link the CRM quotation and ERP Sales Order within CRM?
    In other words, Once I save the CRM quotation, I need to be able to create an ERP Sales Order within CRM through a follow-up transaction...
    Hope I made myself and the question very clear?
    Kindly help.
    Many thanks and regards,
    VSK.
    Edited by: venkatskumar on Feb 11, 2011 6:57 PM

    Dear,
    we faced same situation in ALmansour motors comp. , but we tried to create CRM/Qoutation and replicate it to ERP
    and after that we created ERP Sales order () with refrence to our ERP/Qout., the sales order will be replicated automaically to CRM again with same no. () and linked with ERP qoutation which have the same CRM qoutation no(*).    
    (*) i think after qoutation replication you can use transc. launcher to create ERP sales order through CRM screen.
    (**) you have to handle the no ranges for Q. and sales order on both servers to be matched
    Note :
    to replicate CRM qoutation, be care this configration point,
    CRM qout. item category>> ... >> customizing at item level (Qout. Data .. Releveance for Qout.) = 3 initially a sales/service trans. 
    I hope to it would be useful
    سبحان الذي علمنا هذا

  • ConfigureCombined invoice for Delivery and Order related billing items

    Dear Guru's,
    Please tell us what settings one have to do in copy controls (like for TAS "OR to F2" & TAN "LF to F2") as to Combined invoice for Delivery and Order related billing items.
    Regards,
    Sai

    Hi Sai,
    for TAS "OR to F2"
    T-code-VTFA
    Target Billing Type --"F2"        and Source Document as "OR"
    At header level you can select .
    Copying requirements "001" Header/order related
    Tick mark copy item number
    At item Level you give
    Copy requirements "028" Order related 3rd party item
    Data VBRK/VBRP= 000
    Billing quantity="A"
    Pos/Neg quantity="+"
    Price type="G"
    and Save
    2)TAN "LF to F2
    Go to Tcode-VTFL
    Target Billing type "F2"   and source document as "LF"
    In header details you give
    Copy requirements "001" Header-order related
    detr export dta="B"
    Allocatio number="B"
    Reference number="A"
    Tick mark copy item number
    In item details you give
    Copy requirements"004" delivery related item
    Data VBRK/VBRP="003" Single invoive"
    Billing qantity="D"
    Pos/neg quant="+"
    Price type=G"
    Price source"E"
    Regards
    Seegal

  • Creating Transfer Order for Delivery with Specified Source Bin

    Hello,
    My requirement is to create a pick transfer order for an outbound delivery.
    <b>L_TO_CREATE_DN</b> works perfectly well, however, it does not let me to specify the source (fixed) bin in my warehouse.  It actually executes the bin determination routine to pick the source bin for me, which is not acceptable.
    <b>L_TO_CREATE_SINGLE</b> won't work as my destination bin is a dynamic bin, and this FM does not allow to set LTAP-NKDYN.
    So, I'm stuck.  LT03 actually allows the user to input source bin information, so I'm saving BDC as my last option, but wanted to see if anyone here has other ideas.
    Thanks in advance!
    R.D.

    Hi,
    Try this L_TO_CREATE_SINGLE
    Tks,
    Krishna

  • Creating transfer order for delivery with ABAP

    Hi Experts,
    I'm using L_TO_CREATE_DN to create a transfer order for delivery note...
    Is it possible to use this function or another one, to create a transfer order for one position of the delivery note ?
    Regards,
    David

    Hi,
    Try this L_TO_CREATE_SINGLE
    Tks,
    Krishna

  • 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

Maybe you are looking for