Email Stock Transfer Order

I have this requirement to email STO to the respective recipient. I have done the following:
1. Copied form MEDRUCK to ZSTOMEDRUCK
2. Copied program SAPFM06P to ZSAPFM06P
3. Copied FMs ME_READ_PO_FOR_PRINTING to  ZME_READ_PO_FOR_PRINTING and changed all the related statements in ZSAPFM06P to call this Z FM.
4. The same thing done to FM ME_PRINT_PO.
5. Created an output type ZSTO and assign print program ZSAPFM06P and form ZSTOMEDRUCK with medium type = 1
6. Created another output type ZSTE and assign the same print program and form with medium type = 5.
Test:
I assign ZSTO & ZSTE in the message screen of ME22N for the STO, then I go to ME9F and I am able to preview the STO under output ZSTO.
My biggest problem now is when I assign ZSTE to the same STO, it will be sent to my email address (external) as a blank attachment. It means that at the email header, I can see a paperclip symbol, indicating that there is an attachment, but when I open the email. I can't find any attachement.
Please help!! Many many thanks!

Hi ,
follow the code
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,
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,
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_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.
endif.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = give ur mail id
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_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.
Feel Free to revert back.

Similar Messages

  • Urgent Condition Tab Missing In  Stock Transfer Order

    Hi All ,
                When I a m creating Stock Transfer Order from One Plant In one Company Code to  Another Plant in another Company code the Invoice and Conditions Tab Is Missing .
    How to get the Conditions tab, Do I have to do any Customization ?
    Please suggest me of how to go about .....
    Regards ,
    Sriram.

    Hi Srirama,
    Yes, if you have only one Calculation schema then there is no meaning in assigning to different Porgs.
    In that case please proceed with the following configuration.
    This is done in customizing; IMG for MM > Purchasing>Conditions>Define Price Determination Process>Define Schema Determination>Determine Schema for Stock Transport Orders
    For the combination of the Schema POrg; doc.type( UB ) and Supplying plant
    you must specify the price schema to be used.
    Hope this will solve your problem.
    Regards,
    DilliB

  • 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.

  • Routing in Stock Transfer Order

    Hi,
    We are having SAP 4.7 & we have activated Transportation Routing process.
    Routing is copied in Sales order & Delivery. But the same is not copied in the stock transfer Order. We are doing following steps.
    We are using Stock Transfer order to transfer the material from One storage location to another storage location. Supplying Plant & Receiving Plant are same in Stock transfer Order. We are entering Receiving STorage location & Shipping point in the STO.
    Is this b'coz of Supplying plant & receing plant are same in the STO ? Or i need to active something els for this.
    Kindly revert back.
    Thanks in advance.
    Samir Bhatt

    Hi,
    this is one of the problems caused by an organisation structure that is not quite matching the "real world".
    In SAP each Plant should have a unique address and the storage locations are thought of as areas within that address.
    If you have two sites that have different addresses, they should <u>ideally</u> be separate plants. You can then use all of the available functionality within SAP that you would expect.
    If you want to set up a route that goes from one address to another than this is possible, but in your case you are actually saying that you want a route for s delivery from and too the same address, not really a real world scenario.
    So if you really want to do this then each site should be a plant. I expect that it is too late to change your design but it is important for others reading this to understand the problems that are caused when Storage locations are used instead of Plants for physically separate addresses.
    Sorry if this is not much help to you but it should help you to understand why you are having a problem.
    Steve B

  • Error in stock transfer order

    Hi everyone,
    When I am doing MIGO ,In stock transfer order ,I am getting the following error,
    "Excise Invoice cannot be captured for RG1(Finished Goods) material".
    What should I do?
    Regards
    Prabudh

    Hi Prabudh,
    Can you come again with more details ?
    Are you doing STO from Manufacturing plant to selling Plant (Depot) ?
    Regards,
    Gaurav Raghav.

  • Stock Transfer Order Report

    Hi,
         How to develop a Stock Transfer Order report. I also want to track the cost of transfer from one plant to another. Plz help.

    Hi,
    First fetch the data from LTAK header table.   Based on this table you can
    get the line items from LTAP table.  You can have the list of all open TO's in this table.  Based on the Plant (Werks) you can fetch the data from EKPO for STO report.
    Reward if useful.....

  • 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

  • Table for  the PO Date and Stock Transfer Order Date of a material no

    Hello Everyone!
    I am having a requirement where I want both the Purchase Order Date and Stock Transfer Order Date of a perticular material no.
    On the basis of difference of these two dates I want to find out the period for which the material was present in supplying plant.
    I am not getting the table through which I can get these two dates for a material.
    Please help me out.
    Its urgent.

    hi,
    see these tables:
         EKKO – Purchase Order Header Table
         EKPO – Purchase Order Item  Table
         EKBE – PO History table.
    reward if its useful

  • Capture Excise Invoice w.r.t Stock Transfer Order

    Hi all,
    Can anyone explain me how to Capture Excise Invoice W.r.t Stock Transfer Orders.
    right Now i'm follwing below Steps
    1. Create STO in Issuing (sending ) plant with duty and CVD conditions.
    2. Issue Material to Receiving PLant using 351 Movement.
    3. Book the CVD Condition thru MIRO Transaction
    4. Capturing Excise Invoice w.r.t Stock Transfer Order.
    5. Receive the material in Plant( 101 Mvmt).
    I had Few Query at step 3 and 4.
    Q1. While capturing Excise Invoice w.rt STO system is not taking CVD number as reference in Commercial Invoice Field.
    Q2. It gave me the Msg Like Excise Invoice XXX does not Exist in PLant B2B ( B2B is my sending Plant).
    does that mean i have to first create the excise invoice in sending plant?
    if yes, how can i create pls provide step for this.
    this excise invoice need to be created in reference to STO or In refernce to 351 mvmt document.
    Regards,
    Sheo Anand Singh

    Hi Anand,
    Commercial Invoice number is the invoice number u have created in your Step-3, not the CVD number.
    Hope this clarifies.
    Thanks,
    Viswanath

  • Proforma invoice not created for stock transfer order

    Hi Experts
    while creating a proforma invoice for stock transfer order between the plants we are not able to create proforma invoice , the process is replenishment delivery is created and Wm is also done and the billing with reference to delivery and the item category is relevant for billing with value J, and below is the message i get whilw creating invoice
         Technical data
             Tech. data details
              Client                                
              Group Number
              Sales Document Number                
              Item Number of the SD Document         000010
              Schedule Line Number                   0001
              Counter in Control Tables              00
              Message Identification                 00
              System Message Number                  001
              Output Type                            E
              Message Variable 01
              Message Variable 02
              Message Variable 03
              Message Variable 04
              Group Type                             F
    No biliing documents generated
    Please suggest.
    Thanks

    This explanation is not in detail and hence I am not clear about your configuration settings. 
    First go to IMG Logistics-General => Tax on Goods Movements => India => Business Transactions => Outgoing Excise Invoices => Assign Billing Types to Delivery Types.
    There ensure that you have assigned the billing type JEX (assuming that you are using the standard) to your delivery type NL.
    Perhaps, you can also try with "D" for your item category in Billing Relevance field but I am not sure this will solve your issue.  Try in development client.
    thanks
    G. Lakshmipathi

  • Intercompany Stock transfer order with excise

    Hi,
    Can anyone  tell me about Intercompany Stock transfer order with excise step by step.
    hoping to replu

    Hello,
    Create Stock Transport Order - ME21N
    Create Delivery Challan (DC) - VL10B (this reduces the inventory from supplying plant)
    Create Excise Invoice refering the DC created above - J1IS - Ref document type OTHR (Excise values are transfered in this step)
    Do goods receipt against the DC (outbound delivery) - MIGO in receiving plant. Also capture and post the excise invoice cerated in J1IS.
    Regards
    Mahesh Naik

  • 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

  • Stock transfer order

    Hi Gurus,
    While doing Stock Transfer order - assigning deliverying plant
    to sales organisation : I could not assign and message is giving :
    "The sales org is part of company code Z222, Plant Z223 is part of company code Z223. Organization data for inter company billing missing in plant Z223."
    For you kind information :
    I have maintained regular enterprise structure ie everything is Z222 means comp code, plant, shipping point etc. for my memory.
    Stock transfer order step
    Step 1 I maintained another enter prise structure ie. everything is Z223 company code, plant etc.
    Step 2 Intercompany billing customer, I assignd customer no. in relevant sales org ie, Z222
    Step 3 I am assigning deliverying plant ie Z223 to sales organisation ie Z222 but I could not assign, the message has come.
    Kindly anyone help me out.
    Thanks
    rakesh

    Hello.
    Go to SPRO --> Materials Management ---> Purchasing ---> Purchase Order ---> Set Up Stock Transport Order --> Define Shipping Data for Plants. Select the ordering plant (Z223) and assign the intercompany customer, and the sales area of the deliveing plant.
    Once you maintain this try to assign the Delivering plant (Z222) to Ordering sales organisation (Z223) and Distribution channel.
    Prase

  • Stock Transfer Order IDoc

    Hello,
    I am confused with Idoc type for Stock Transfer Order & Standard PO.
    We are using ORDERS05 for both types of POs but problem is that in case of Stock Transfer Order , partner details(E1EDKA1) (LF) is blank.
    I think It should be filled with supplying plant details.
    While in case of Standard PO , partner details are filled with vendor information.
    Is there any other IDoc type for Stock Transfer POs ?  Please suggest.
    Regards,
    Jitendra

    Hi Jitendra,
    It is the same in both case but the only difference is the order type:
    NB - purchase order
    UB - Stock Transfer order
    Hope this Helps.
    Regards,
    Naveen

  • Stock transfer order between 2 plants in same company code

    Dear All,
    We have the requirement, where in the stock tranfer order (between 2 plants in same company code) instead of Material valuation price, MAP/Standard (depends on Price Control) gets picked up from supplying plant ,user should be able to enter its own price while creating stock transfer order.
    For fullfilling this requirement, I have created new condition type(where i have changed condition category from internal price "G" to "H" - Basic Price)
    Instead of using condition type- P101 in the stock transfer pricing,I have used above created new condition type, in pricing procedure then also while doing the post good issue against the outbound delivery( move type-"641", moving average is getting picked up.
    Can you please tell,where is the setting where we can make the system to consider manual given price while creating the stock transfer order instead of picking moving average price.
    Its very Important requirement ,please Provide valuable Inputs else provide some alternative.
    Thanks & Regards
    Nitin Chhabra

    Stock Transfer Order between Plants in the same Company Cpde are not relevant for pricing, as there is no billing. Billing only takes place between company codes. As same company code it would be like selling something to yourself - it doesn't make sense.  The stock value in the receiving Plant depends on the price contol there. If standard price, then you must enter the price when creating the material or use material revaluation to change it. When you transfer the material from the issuing plant, the value there will be transferred. In case of standard price any difference is posted to stock transfer differences. If using MAP then the value will be transferred from the issuing Plant in full.
    If you use costing with standard price in main plant, then it is possible that you can transfer the cost from the main plant to the second plant, by using special procurement key for costing.
    Rgds
    Richard

Maybe you are looking for

  • How do I sync an audio book in itunes with my iphone

    I downloaded an audio book from Amazon/Audible and it is currently in my itunes library.  When I try to sync with my iphone, I am unable to find my list of audiobooks for purposes of syncing.  When I am in the Sync function in itunes, I see music, vi

  • SharePoint 2013 - Refiners "Sorry, something went wrong."

    Good Afternoon, I have an issue that has had me stumped for a couple of days now. I have a number of search results pages and on one of them and only one of them I am getting an error. Whenever I add a refiners webpart and save the page everything wo

  • My spotcolors aren't displaying correctly. (Different from the swatch)

    I am having an issue that has just randomly happened where when I want to make a colour a certain spot colour from my swatch library fill a certain shape it DOESNT CHANGE the colour yet it SAYS IT IS ANOTHER COLOUR when I do a separations preview. I'

  • Crystal Report For True 64 bit Mode

    Hi, We Have a ASP.Net Web Application with .Net Framework 4.0, Build in VS2010. We are using Crystal Report for VS2010, Version :  CRforVS_13_0_5 . In our web Application, we have a Separate Project for Crystal Report. Currently, I install Crystal Re

  • .png files in IE ?

    Is there a shortcut to make .png files appearing in IE ?