Problem with attaching file to Sales Order

Hello,
In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
These files are added by the GUI user, this works fine.
Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
I found a helpful link ( /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background )
This program creates URL links with no problem, but the file generation is not implemented yet.
I tried to add the file functions to his sample report but still have one problem. The file is uploaded, but not reported as a PDF file in sap. If I select the created attachment SAP allows only the saving of the attachment. After saving the created file is a good PDF file, it opens with PDF-viewers.
Why does SAP not know this is a PDF file and report it as such (and open the pdf viewer when selected).
Thanks, Frank.
source-code:
REPORT  zzfb_brc                                .
* Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
* Written By : Ram Manohar Tiwari
* Function   : We need to maintain links between Business Object and
*              the attachment.Attachment document is basiclally a
*              business object of type 'MESSAGE'.In order to maintain
*              links, first the attachment will be crated as Business
*              Object of type 'MESSAGE' using Message.Create method.
*              Need to check if we can also use FM
*              'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
*              than using Message.Create method.
* I took this program and removed all the parts for adding URL's and
* notes.
* Include for BO macros
INCLUDE : <cntn01>.
* Load class.
CLASS cl_binary_relation DEFINITION LOAD.
CLASS cl_obl_object      DEFINITION LOAD.
PARAMETERS:
*  Object_a
   p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032',    "SO
   p_bo_id  LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
*  Object_b
   p_docty  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
   p_msgtyp LIKE sofm-doctp        DEFAULT 'EXT'     NO-DISPLAY,
*  Relationship
   p_reltyp  LIKE mdoblrel-reltype DEFAULT 'ATTA'.
TYPES: BEGIN OF ty_message_key,
        foltp     TYPE so_fol_tp,
        folyr     TYPE so_fol_yr,
        folno     TYPE so_fol_no,
        doctp     TYPE so_doc_tp,
        docyr     TYPE so_doc_yr,
        docno     TYPE so_doc_no,
        fortp     TYPE so_for_tp,
        foryr     TYPE so_for_yr,
        forno     TYPE so_for_no,
       END OF ty_message_key.
DATA : lv_message_key TYPE ty_message_key.
DATA : lo_message TYPE swc_object.
DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
       ls_doc_content TYPE soli-line.
* Create an initial instance of BO 'MESSAGE' - to call the
* instance-independent method 'Create'.
swc_create_object lo_message 'MESSAGE' lv_message_key.
* Upload the pdf file, for now from the frontend, in the future from
* the server.
DATA:
*  dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
l_lines TYPE i. "filelenght
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename   = 'c:t1.pdf'
    filetype   = 'BIN'
  IMPORTING
    filelength = l_lines
  TABLES
    data_tab   = lt_doc_content.
* no exceptions, the file is there in this example
break brouwersf.
** the coding for the server input, for later
*OPEN DATASET dsn FOR INPUT IN BINARY MODE.
*IF sy-subrc <> 0.
*  EXIT.
*ENDIF.
*READ DATASET dsn INTO ls_doc_content.
*WHILE sy-subrc EQ 0.
*  APPEND ls_doc_content TO lt_doc_content.
*  READ DATASET dsn INTO ls_doc_content.
*ENDWHILE.
*CLEAR ls_doc_content.
*CLOSE DATASET dsn.
* define container to pass the parameter values to the method call
* in next step.
swc_container lt_message_container.
* Populate container with parameters for method
swc_set_element lt_message_container 'DOCUMENTTITLE' 'Title'.
swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
swc_set_element lt_message_container 'NO_DIALOG'     'X'.
swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
swc_set_element lt_message_container 'DocumentSize'    l_lines.
swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
swc_call_method lo_message 'CREATE' lt_message_container.
* Refresh to get the reference of create 'MESSAGE' object for attachment
swc_refresh_object lo_message.
* Get Key of new object
swc_get_object_key lo_message lv_message_key.
* Now we have attachment as a business object instance. We can now
* attach it to our main business object instance.
* Create main BO object_a
DATA: lo_is_object_a TYPE sibflporb.
lo_is_object_a-instid = p_bo_id.
lo_is_object_a-typeid = p_botype.
lo_is_object_a-catid  = 'BO'.
* Create attachment BO object_b
DATA: lo_is_object_b TYPE sibflporb.
lo_is_object_b-instid = lv_message_key.
lo_is_object_b-typeid = p_docty.
lo_is_object_b-catid  = 'BO'.
*TRY.
CALL METHOD cl_binary_relation=>create_link
  EXPORTING
    is_object_a = lo_is_object_a
    is_object_b = lo_is_object_b
    ip_reltype  = p_reltyp.
* Check if everything OK...who cares!!
COMMIT WORK.

Hi,
Welcome to the SDN Forums!!!
You need to supply the PC file extension in the container element 'DOCUMENTTYPE'.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
In your case change the above statement as below:
swc_set_element lt_message_container 'DOCUMENTTYPE' 'pdf'.
<b>OR</b> change the default value of p_msgtyp to 'PDF'.
Cheers,
Ramki Maley.
Please reward points if the answer is helpful.
For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
Message was edited by: Ramki Maley

Similar Messages

  • Problem with batchNumber Allocated in Sales Order

    Hello,
    Today we have seen a strange problem for one of our customers.
    In fact, here is the problem:
    My customer does a sales order normally like this:
    Customer1
           - Item1 1500 unit --> No Batchnumber allocated
           - Item2 3000 unit --> BatchNumber "AA" allocated for 3000 unit
    Some days later, they change the sale order like that:
    Customer1
           - Item2 4500 unit --> BatchNumber "AA" allocated for 4500 unit
    The same day, the customer does the invoice for the 4500 unit of Item2
    But the problem: when I go in the "Batchnumbers transactions reports" I see that:
    - OR 1 --> Allocated 3000
    - OR 1 --> Allocated 4500
    - IN 2 --> Qty -4500 and Allocated -4500
    So 3000 units of Item2 stay allocated in a sales order which is closed.
    That is a problem to allocated this batchNumber in an other sales order.
    Can you help me about this? How I can canceled the allocation?
    Thank you.
    best Regards
    Séverine

    Appears to me as a system issue.  But could you please confirm that you are actually changing the quantity of the same item on the same row.
    The reason I am asking this is in business one the Base Document reference is maintaining with 4 reference values.
    DocType
    DocNum
    DocEntry
    LineNum
    Even a user deleting the row and adding a new row of the same item could cause SAP to think that it is a new line.
    Please check this and if everything is as you originally described please post this to SAP Support through a Support Message and they would be able to look into it
    Suda

  • Problem with attaching files to mail message

    Hello,
    I have problem with my mail app. I'm using spaces for better organization. When I wanna add some file to mail message I usually go to different desktop (space), where I have the file I wanna attach. I grab it move to right up corner to activate spaces, than move to desktop (space) with mail.app and press spacebar (it activates the desktop immediately). At that time it also start random app, which is in my dock.
    You can see it in my youtube video.
    How can avoid this strange thing happen?
    http://www.youtube.com/watch?v=KUypUnPHZvc
    I'm using MacBook Pro 15'', Snow Leopard - latest updates. I've reinstalled my mac two days ago, so no garbage should be in.

    Thanks for quick reply.
    I don't have selected "always..." so I also tried it with selected "always...".
    Now I discovered that it has nothing to do with the mail. I've tried just move some file from one of spaces (desktop) to another using the spacebar for faster switching and it did the same. It opens random app from Dock.
    So now this topic is in wrong discussion. I will post it to correct discussion...

  • View attached files for Sales Order in Approbation.

    Hi,
    I have attached a file in a Sales Order. My Sales Order then goes to approbation. Can my approbator open the attached file WITHOUT having to open the Sales Order.
    Thank you !

    Hi Thanh,
    There is no such option to open the attached file without opening the sales order the approver has to open the order to check the attachment.
    Regards,
    Suresh

  • Problem with MB1C while creating sales order stock

    Hi all,
    I am working  in MTO scenario. I have taken the requirements type as "KE" & assigned the requirements class "ABC". This "ABC" is copied from requirements class "40".
    I have created a sales order with 1 line item and in MB1C when i create the stock, the system creates the stock for the sales order.
    <b>Problem:</b> I start with creating the inquiry - quotation on the basis of inquiry - sales order on the basis of quotation. Now when i go to MB1C to create the sales order, I get the following error:
    <b>"Account assignment cannot be carried out because of different origin no."</b>
    Message no. <b>V1134</b>
    <b>Diagnosis</b>
    The sales document to which you want to refer is based on sales document 108 and item 000010. Therefore, the settlement and possibly inventory management are carried out using the number of the preceding document.
    <b>System Response</b>
    This entry is not allowed.
    <b>Procedure</b>
    Enter the document and the item number of the preceding sales document.
    Also if for the same sales order i run the <b>MRP</b> using <b>MD50</b>, then in the transaction code <b>MD04</b> - the system shows the reference of the <b>"inquiry document number"</b> for the production order. The production order should take the reference of the sales order number.
    For the requirements class in the fields <b>"Acct Assgt Cat"</b> & <b>"Valuation"</b> i have selected <b>"M"</b>
    Regards,
    Allabaqsh G. Patil
    Message was edited by:
            allabaqsh patil

    Hello Allabaqsh,
    How did you solve the problem?
    I am facing the same problem.

  • Problem with document_lines in the sales order object

    Hey all,
    i have a question refering to the document lines object from a sales order, or an invoice! When i add a line to the document, is there a possibility to get information if the line is correct or not? now its only possible, when posting the sales order or invoice, but that is to late! when i now post a sales order i get for example the error that the item number is missing! but i have add the correct line with itemCode etc.
    thanx for your help:)
    Maggie

    Hi Maggie,
    Unfortunately there is no way of getting information about the correctness of the line until you add the sales order.
    If you create the sales order object one line is always present, so for the first line you must NOT do an add, only before the next lines.
    Regards
    Ad

  • Sending Mail with attachment and preserving the order of attachment

    Hi Everyone!!!!!!
    My requirement is to send Email with attachment in the same order as they were attached by Sender while composing the mail. I want to preserve order of attachment in the mail and when receiver open a mail, the attached files should be reflected in same order as it was on sender side. In my application,the documents being upload are already in my database. So, user just requires to mark the corresponding check box and enter the Sequence number for each attachment. When he clicks on "SEND" button, the Source file is first written from database to OS level and then files are attached from source available on OS . The attached file name could be anything. Based on the Sequence number file should be attached and send. My current code works fine,but problem it is that the Sequence number is not preserved in my attachment . However, when I traced the output of FOR Loop by inserting it in a table " temp_trace" I found that the Sequence is preserved in the order that I want. So, I think that uploaded files are written on the Operating system in same order but they are not attached in same order. Below is the sample code that is I am using to attach file in email. Here, the user_sequence is the sequence number entered by user.
    for i in (select case when user_sequence is not null
    then trim(to_char(user_sequence ,'09'))||'_'||file_name||'.pdf'
    else ||'_'||file_name||'.pdf' end file_name ,
    file_src,length(file_src) len,cd.doc_id,PRIORITY from
    MIM_CLIENT_DOCS CD,(select DOC_ID ,user_sequence from table P_DOC_AND_user_sequence ) TEMP_TAB
    WHERE CD.DOC_ID = TEMP_TAB.DOC_ID order by case when user_sequence is null then 1 else 0 end, file_name)
    loop
    insert into temp_trace values(i.file_name);
    L_OUT := UTL_FILE.FOPEN(v_oracle_dir,i.file_name,'wb',32760);
    end loop;
    I want my output as
    1_first attachment.txt
    2_second_attachment.docx
    3_abc.sql
    _xxx.txt  ------------------ When sequence is not assigned by user That is null at last.
    Unfortunately, I am not getting attachment in mail in this sequence. Can anyone give me suggestion.
    Sorry for stuff essay and thanks in advance!!!!!!!!!!!

    >
    Please update your forum profile with a real handle instead of "974850".
    My requirement is to send Email with attachment in the same order as they were attached by Sender while composing the mail. I want to preserve order of attachment in the mail and when receiver open a mail, the attached files should be reflected in same order as it was on sender side. In my application,the documents being upload are already in my database. So, user just requires to mark the corresponding check box and enter the Sequence number for each attachment. When he clicks on "SEND" button, the Source file is first written from database to OS level and then files are attached from source available on OS . The attached file name could be anything. Based on the Sequence number file should be attached and send. My current code works fine,but problem it is that the Sequence number is not preserved in my attachment . However, when I traced the output of FOR Loop by inserting it in a table " temp_trace" I found that the Sequence is preserved in the order that I want. So, I think that uploaded files are written on the Operating system in same order but they are not attached in same order. Below is the sample code that is I am using to attach file in email. Here, the user_sequence is the sequence number entered by user.Always post code using <tt>\...\</tt> tags as described in the FAQ.
    for i in (select case when  user_sequence is not null
    then trim(to_char(user_sequence ,'09'))||'_'||file_name||'.pdf'
    else  ||'_'||file_name||'.pdf' end file_name ,
    file_src,length(file_src) len,cd.doc_id,PRIORITY from
    MIM_CLIENT_DOCS CD,(select DOC_ID ,user_sequence from table P_DOC_AND_user_sequence ) TEMP_TAB
    WHERE CD.DOC_ID = TEMP_TAB.DOC_ID order by case when user_sequence is null then 1 else 0 end, file_name)                               
    loop
    insert into temp_trace values(i.file_name);
    L_OUT := UTL_FILE.FOPEN(v_oracle_dir,i.file_name,'wb',32760);
    end loop;I want my output as
    1_first attachment.txt
    2_second_attachment.docx
    3_abc.sql
    _xxx.txt  ------------------ When sequence is not assigned by user That is null at last.
    Unfortunately, I am not getting attachment in mail in this sequence. Can anyone give me suggestion.I see no code that attaches anything to email messages. What code is used to do this? Why are the files being written to the file system?

  • Attached documents in sales order disappears in Invoice

    Hi All,
    I attach some documents in change mode of sales order and when i see the Invoice it disappears. Can someone help me what settings or which object if activated can carry the attached documents from sales order to Invoice.
    Thanks.....

    Hi,
    Please refer to this link. A similar situation has been discussed in this link.
    File to copied from one tcode to another tcode
    Let me know if you are still having issues with this.
    Regards,
    Rohan Gudavalli

  • How to create a Contract with reference to a Sales-Order(VA01) with a BAPI

    Hi,
    my name is Wadim and i need help.
    My problem:
    I am creating a sales-order(VA01) with the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.
    After that i have to create a contract(VA41) with reference to this order. I found the BAPI "BAPI_CONTRACT_CREATEFROMDATA" and it has the same interfaceparameters like the salesorder-bapi. but there are no parameters to get a connection to the sales-order.
    Is it even possible to get a connection to a sales-order with a bapi???
    thanks for help
    regards mark
    Edited by: Krapp Wadim on May 20, 2010 9:19 PM

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

  • Purchase requisition with reference to blocked sales order

    Hello,
    we are creating purchase requisitions (PR) manually with reference to a sales order (account assignment Z). When this sales order is blocked, we still can issue the purchase requistion.
    What can we do to avoid this? I think in 2 solutions:
    - use enhancement MEREQ001 to show error message when SO is blocked, so PR is not created. Is this possible?
    - create a release strategy for PR created in that plant (tr. OME6). The problem is that release strategy refers to an amount in the PO, and not to other factor, like SO blocked. Maybe in the former enhancement we can set the field EBAN-GSFRG to 'X'?
    Thanks for your help.

    Many thanks for your answer. It help me to solve the issue.
    So applying note 738171, with transaction OVB5 (or VOFM, requirements->subsequent functions->Purch.requisitions) we create one new requirement, ie RV07A900, and then we apply the rule that if we have delivery or billing block, that is, VBAK-LIFSK or VBAK-FAKSK not empty, then we set an error with a code similar to this:
                da_sy-msgid = 'Z1'.    (message class)
                da_sy-msgno = '001'.  (message number)
                error_exception = true.
    and then the PR is not created.
    Regards.

  • What is the exact problem with this file?

    Hi all,
    There is an old form , which was not in use from many days.
    Now when we tried to run the form, i got the error saying "FRM-40734:Internal Error:Pl/SQL error occured.", in the login form.
    When i tried to open the fmb file in Oracle Forms Builder 6i, i got the following error:
    FRM-10102: Cannot attach PL/SQL library d2kwutil. This library attachment will be lost if the module is saved., but the fmb file got open.
    The login button has the following code:
    DECLARE
      UNAME VARCHAR2(30);
      --USER_ID PARAMLIST;
      V_USER APUSERMA.USER_NAME%TYPE;
      V_PASSWED APUSERMA.USER_PASSWD%TYPE;
    BEGIN
    select user_CD INTO :GLOBAL.USER_ID from apuserma 
    where user_CD = :TI_USER_NAME AND user_PASSWD = :IT_USER_PASSWD
    AND SYSDATE BETWEEN USER_VALID_FRM AND USER_VALID_TO;
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    :global.compname := :compname;
    compnm(:compname);
    --USER_ID := CREATE_PARAMETER_LIST('USER_id_NAME');
    call_form('Forms\MAIN_SCREEN',hide,DO_REPLACE);
    exception
      when no_data_found then
      MESSAGE('Incorrect Username or Password.  Please Re-Enter');
      message(' ');
      RAISE FORM_TRIGGER_FAILURE;
    END;
    EXIT_FORM;
    When i tried to compile, i got error saying ,
    Error 201 at line 10, column 28
    identifier 'WIN_API_ENVIRONMENT.READ_REGISTRY' must be declared.
    I am not getting to know What is the exact problem with this file?
    Help me with this please.
    Thank You.
    Oracle forms builder 6i.
    Oracle 9i.

    Vijetha wrote:
    I also want to know what is the use of  win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername') ??
    What does it do??
    If i comment the following line , will it be a problem??
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    Because i commented the above line & compiled, so it is not giving any error now.
    So please tell me what win_api_environment.read_registry does??
    it's read windows registry value. So, no problem if you comment it.
    Thanks

  • Issue with attachment file name

    Hi All,
    This is about an issue with attachment file name:
    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    Regards
    kiran

    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    - <SAP:Payload xlink:href="cid:payload-4CED452F17C601BDE10080000A492050---sap.com">
      <SAP:Name>1 .Header1.txt</SAP:Name>
    Error we are getting is
    Cannot cast 'Header' to boolean] in class com.sap.aii.mappingtool.flib7.NodeFunctions method createIf[Header, com.sap.aii.mappingtool.tf7.rt.Context---27a73bfa]
    So we have to change the File name Header1.txt to something which we can cast to creatif....(we cannot tell the sendr to change the file name as its is set already)
    Thanks for interste and assisting
    Regards
    Kiran

  • Convert Screen(spool) to PDF file sending mail with attach file

    Hi :
    I'd like convert spool list to pdf and sending file...
    so, I read thread about spool convert to PDF before,
    and know how to convert Spool to PDF file and send mail with attach file.
    but I have a problem.
    my solution as:
    step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
    step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
    then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
    I want to showing word is wider that 255.
    and then I find a manual method as:
    After program finished.
    Function Menu -> system -> List -> Send
    use Prog: "Create Document and Send"
    I use this prog sending mail and attached file ,
    PDF file do <b>NOT</b> have 255 word limit !
    finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
    which Function I have to use?...
    Please help me, Thanks!

    Hi,
    Check this sample code of sending spool as attachment to an email address..
    Parameters.
    PARAMETERS: p_email(50) LOWER CASE.
    PARAMETERS: p_spool LIKE tsp01-rqident.
    Data declarations.
    DATA: plist         LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: document_data LIKE sodocchgi1.
    DATA: so_ali        LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA: real_type     LIKE soodk-objtp.
    DATA: sp_lang       LIKE tst01-dlang.
    DATA: line_size     TYPE i VALUE 255.
    DATA: v_name        LIKE soextreci1-receiver.
    DATA rec_tab        LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    Get the spool data.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
         EXPORTING
              rqident              = p_spool
              first_line           = 1
              last_line            = 0
              desired_type         = '   '
         IMPORTING
              real_type            = real_type
              sp_lang              = sp_lang
         TABLES
              buffer               = so_ali
         EXCEPTIONS
              no_such_job          = 1
              job_contains_no_data = 2
              selection_empty      = 3
              no_permission        = 4
              can_not_access       = 5
              read_error           = 6
              type_no_match        = 7
              OTHERS               = 8.
    IF sy-subrc <> 0.
      MESSAGE s208(00) WITH 'Error'.
      LEAVE LIST-PROCESSING.
    ENDIF.
    Prepare the data.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 0.
    plist-body_num = 0.
    plist-doc_type = 'RAW'.
    plist-obj_descr = 'Test ALV'.
    APPEND plist.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 1.
    DESCRIBE TABLE so_ali LINES plist-body_num.
    plist-doc_type = real_type.
    Get the size.
    READ TABLE so_ali INDEX plist-body_num.
    plist-doc_size = ( plist-body_num - 1 ) * line_size
                     + STRLEN( so_ali ).
    APPEND plist.
    Move the receiver address.
    MOVE: p_email  TO rec_tab-receiver,
          'U'      TO rec_tab-rec_type.
    APPEND rec_tab.
    IF NOT sp_lang IS INITIAL.
      document_data-obj_langu = sp_lang.
    ELSE.
      document_data-obj_langu = sy-langu.
    ENDIF.
    v_name = sy-uname.
    Send the email.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = document_data
              sender_address             = v_name
              sender_address_type        = 'B'
         TABLES
              packing_list               = plist
              contents_bin               = so_ali
              receivers                  = rec_tab
         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 e208(00) WITH 'Error'.
    ENDIF.
    COMMIT WORK.
    Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    Thanks,
    Naren

  • Regarding mail with attached file

    hi experts,
              i am doing on a report where mail with attached file should fire everyday at 9am. when i am doing it in background,mail is sent to everyone with attached file but when i schedule it in background,mail is firing but attached file is missing.how can i solve this problem?
    thanks.

    try to place ur file onn application server when u run BC.
    Thanks
    Kiran

  • WES element is disable with billing plan in sales order?

    Hi experts,
    I have problem, when I create a sales order with item category billing plan, then the WBS element in this line become disable,so I can't input the WBS, How can I solve this issue?
    Thanks
    Best regards
    Lance

    done

Maybe you are looking for

  • Capture Excise Invoice for material document created against a PGR

    Hi SD Gurus, We have a scenario of reverse subcontracting where we have to receive raw material from vendor, process it and then dispatch the finished goods to the vendor or the vendor's customer. For receiving the raw materials, i have created a doc

  • NO Authorization error when accessing Functional module RH_CUT_OBJECT

    Hi, I am getting NO AUTHORIZATIOn error when I am executing SE37-->FUNCTIONAL OBJECT-RH_CUT_OBJECT. I also checked SU53 screenshot which says AUTHORIZATION CHECK SUCCESSFUL and there are no errors or missing authorizations highlighted in SU53. I swit

  • Win XP will not install on K9N4 Ultra based system, please help!

    Hello, i was hoping some1 could help me with a problem ive been trying to sort out for the past week or so.  After buying and building a new system i havent been able to get Windows XP to install, the setup formats and copies the initial files correc

  • Printing help please

    compiler gives error in not recognizing variable A4, can anyone explain this, or point to a manner in which to print information extracted out of a database? thanks, tony package Hotel; import java.awt.event.*; import java.awt.*; import javax.swing.*

  • Windows XP will not start up on HP Pavilion a350n.

    Hp Pavilion a350n desktop Windows XP No Error Message I have installed new ram and a new video card, but all was fine for many months/ possibly even a year after install. Hi, any help that anyone can give me would be greatly appreciated. My computer,