FM for atttaching document in CRMD_ORDER transaction in background.

concatenate  c_filename sy-datum  '_' sy-uzeit '.html' into :" downloading file in the common path
                                                         gi_filename1.
          concatenate c_dir gi_filename1  into gi_filename.
          open dataset gi_filename for output in text mode encoding
                                   default  message gi_msg_text.
          if sy-subrc = 0.
         LOOP AT t_data INTO wa_data.
            transfer wa_mail_details-email_content to gi_filename.
         ENDLOOP.
          else.
            gv_act_flag = c_flag .
            fault_data-fault_text   = gi_msg_text.
            fault_data-fault_url    = c_url.
            fault_details-severity  = c_severity.
            fault_details-text      = gi_msg_text.
            fault_details-id        = c_id.
            fault_details-url       = c_detailsurl.
            append fault_details to fault_data-fault_detail.
          endif.
          close dataset gi_filename.
*Using the below Method to link the file in the attachment tab " Attaching as a attachment
          call method cl_crm_documents=>create_with_file
            exporting
              file_name       = gi_filename1
              directory       = c_dir
              business_object = gi_bus_obj
            importing
              loio            = gi_loio
              phio            = gi_phio
              error           = gi_error.
          if sy-subrc is  initial.
            commit work.
          else.
            gv_act_flag = c_flag .
            fault_data-fault_text   = c_text1.
            fault_data-fault_url    = c_url.
            fault_details-severity  = c_severity.
            fault_details-text      = c_text1.
            fault_details-id        = c_id.
            fault_details-url       = c_detailsurl.
            append fault_details to fault_data-fault_detail.
          endif.
pls find the above code for attaching the attachment as file.
this works fine in foreground. but its not working in background.
pls tell me whether i need to change any FM to link file in background.
thanks.
Edited by: Shantha Sheela on Jan 16, 2009 6:50 AM

Thanks PePe for your answer. Meanwhile I have found a solution my self.
ls_bor-instid = i_guid.
  ls_bor-typeid = 'BUS2000116'.                             "#EC NOTEXT
  ls_bor-catid  = 'BO'.                                     "#EC NOTEXT
  cl_crm_documents=>get_info( EXPORTING business_object       = ls_bor
                              IMPORTING ios_properties_result = ct_order_links
                                        phios                 = lt_phios
                                        loios                 = lt_loios
                                        phioloios             = lt_lpios ).
For result datatypes check the method exporting paremeter.
The parameter
i_guid
is the guid of the business transaction.

Similar Messages

  • Help required:Spool Creation for posted document in FB03 transaction

    Hi Experts,
    The requirement is like I have to send the PDF document to the user by mail once the document gets posted in SAP ECC. The posting is taking place by IDOC.
    The problem is how do i get the spool request for the document which is posted in ECC. It can be seen by entering document number in FB03 transaction but there is no smart form or SAP script or any Output type. The document is posted by IDOC.The client wants the PDF document excatly as seen from FB03 transaction. Please help as this is typical requirement i have never come across.
    Do let me know some of the user exits where in just after the posting i can write my code for spool creation. The idoc is using the BAPI_ACC_DOCUMENT_POST.

    HI
    In test mode i am able to view the document no. but not the reference document no and when double click on the document no i am not able to view the journal entry.
    Thanks.

  • Windows for Mac documents are scrambled, so is background pic

    I don't like Firefox 4, it scrambles my Word for Mac documents and the background on my desktop Using Mac Osx Snow Leopard OS

    You might try looking/posting here.
    Microsoft Support – Office for Mac
    Microsoft Support – Office for Mac (2)

  • Mass Change for Parked documents in FBL1N

    Hi Friends,
    Please help me on the following client requirement...
    When the user wants to do the mass change (eg..payment block remove) for parked documents in FBL1N transaction, he is getting the error "Unable to change every document".
    System Response
    The items from the documents not changed are marked in red.
    Procedure
    You can display a change error log for each of these items (function in application toolbar). In the individual document change procedure you can check which fields are changeable and change the documents individually if necessary.
    Kindly respond.
    Best regards...

    The error message is self explanatory.
    You are trying to change fields which are not changeable. You view the change error log. Rectify the errors and try again.
    Else you can try FBV2 to view list of documents and change individually.
    Rgds
    Harmees

  • Error -maintain archiving parameters for outgoing documents in archive link

    Hi,
    I am trying to archive an outgoing document from SAP i.e. an invoice to a content repository using archive link and getting the below error:
    Maintain archiving parameter(s) for output type RD00 (appl. V3)
    Message no. VN096
    Diagnosis
    At the time of output determination, the archiving parameters for output type RD00 (application V3) were incorrectly maintained in Customizing.
    Additional information:
    SAP object:
    Archiving object:
    Procedure
    Maintain the archiving parameters and repeat output determination for the required document.
    Kindly help as to from which transaction I can maintain archiving parameters for this transaction ???
    With Regards
    Neha

    Hi,
    Which storage device are you using? I can only speculate the problem. Ok. So output type is configured properly. Can you check the object type for your document type in Transaction code OAC3. Check it should be VBRK. If it is not then change it to VBRK. Now go to transcation code OAD5 and check every thing is configured there or not. If it is all done then it should work. I presume that all basic customization is done in your system.
    Regards
    Sirfraz

  • Creation of new numbering interval for FI documents - FBN1 transaction

    Dear Experts, good day!
    When trying to create new numbering intervals for FI documents (FBN1 transaction), inserting the needed entries to a  customizing request (only those new entries, related to future years) and release it to the Quality environment, we have noted the new entries didn't get into the destination system.
    Have someone seen this before? Would you know why does that happen? How can we transfer the NRIV table contents to the other environments (Quality and Production)?
    Thanks a lot,
    Daniel.

    To copy number ranges to a new year you do with the transaction OBH2.
    When you want to transport number ranges you ask for problems. Only for a new implementation you can do it but not when there are existing number ranges with postings for that company

  • Need BAPI to update posting date for parked documents in transaction FBV2?

    Hi All,
    I am retrieving records from table VBKPF and I have to update the posting date for parked documents in transaction FBV2.
    I am doing it with BDC , working fine in foreground, but it is not workung fine in back ground.I want to do this with bapi.
    Can any one suggest me corrct BAPI?
    TYPES : BEGIN OF It_vbkpf,
             bukrs LIKE vbkpf-bukrs,            "Company Code
             belnr LIKE vbkpf-belnr,            "document number
             gjahr LIKE vbkpf-gjahr ,           "Fiscal year
             budat LIKE vbkpf-budat,            "Posting date
             bldat LIKE vbkpf-bldat,            "Document date
             blart LIKE vbkpf-blart,            "Document type
             xblnr LIKE vbkpf-xblnr,            "Reference
             tcode LIKE vbkpf-tcode,            "Transaction Code
             bktxt LIKE vbkpf-bktxt,            "Document header text
             usnam LIKE vbkpf-usnam,            "User Name
             xwffr LIKE vbkpf-xwffr,            "Release necessary
             xprfg LIKE vbkpf-xprfg,            "Document complete
             xfrge LIKE vbkpf-xfrge,            "Release takes place
            END  OF it_vbkpf.
    Thanks,
    Suresh.

    Hi ,
    Thanks for your response.
    PRELIMINARY_POSTING_UPDATE seems working good,But my requirement here , to update the posting date with last working day . how can i do this?
    thanks,
    Suresh.

  • Cannot change Transaction Type (COBL-RMVCT) for posted documents. (FB02)

    Hi guys,
    I'm encountering some problems with Document Change Rules. I already configured in SPRO the line item change rules for Transaction Type (COBL-RMVCT).  I already set it to "Field can be changed" but the system still does not allow changes. I also set it for all account types and company code, but still no luck. I hope somebody can assist me since we require that the transaction type be editable for posted documents. Thanks!

    Hi
    I am not sure about the reason for why the "changing" is not working.
    However, thought I should give my experience and opinion on this.
    I have not seen a system that allows "Transaction type" to be changed. If allowed, in my opinon it is similar to allowing the cost assignment field such as cost centre, profit centre or an order being allowed to changed. Thus should not be changed once posted. Further is these are allowed to be changed the imact to the prevous reported data will have to be estimated. E.g. if the transaction types are used for consolidation what is the impact of changing previous month data.

  • Number range for document created through transaction MR11

    Hi All
    I am using transaction MR11(Maintain GR/IR clearing account).I want to know where we configure the number range for the document which gets created on posting through transaction MR11.

    HI,
    SPRO --> MM -->LIV --> Clearing Account Mainteance --> Maintain Number assignment for Account Maintenance Document --> Maintain Number Range for Account Maintenance Document - Tcode - OMRJ or check in OMR4
    Regards
    KK
    Edited by: Kishore Kumar Galla on Mar 24, 2010 3:30 PM

  • Table name for Reason field in Details tab in CRMD_ORDER transaction

    hi ,
    kindly pls suggest me the table name for field Reason in Details tab of CRMD_ORDER transaction.
    thanks

    Hi,
    You need to go via these four tables:
    CRMD_ORDERADM_H
    CRMD_LINK
    CRMD_SRV_OSSET
    CRMD_SRV_SUBJECT
    /Anders

  • Authorization sales documents varrying per transaction for same user.

    Dear Gurus,
    I have a query in defining the transaction authorizations for a user on the transaction level.
    Requirement is as follows.
    I want to give the transaction code VA01 to a user to create 2 sales orders say OR,  RE so while authorizing document types i will allow both the document types only to that user to create.
    But at the same time for the same user i want to allow the transaction code VA02 also with some more document types say OR, RE, CR, FD.  means I want to allow the change mode of 4 documents but 2 documents for create transaction.
    there fore the user can never create the CR and FD sales order but can make changes for all 4 documents OR, RE, CR and FD.
    Please tell me while defining the role and authorizations for a user how can I fulfill the above requirement?
    Anyhow I have to fulfill the above requirement. So Please suggest me all the possible solutions.  by any possible way to complete the authorization.
    Please reply me soon guurs.
    regards,
    Sanjay

    Hi Sanjay
    As you are asking for all possible way I am suggesting you two ways:
    1. Take help of BASIS team
    2. Use user exits: Create a Z table for all the users you want such authorization and code the following code in user exit USEREXIT_SALESORDER_SAVE under MV45AFZZ.
    Z table structure:
    1. User id
    2. Tcode
    3. Order type
    Code for user exit:
    If tcode = VA01 and ordertype = OR, RE.
       Check Z table.
           If entry not found.
               Exit without saving.
            end if
    endif.
    If tcode = VA02 and ordertype = OR, RE,CR, FD.
       Check Z table.
           If entry not found.
               Exit without saving.
            end if
    endif.
    try and revert

  • Is there any BAPI exists for parking document (FBV1 transaction)

    Hi experts,
    Is there any BAPI for parking document (FBV1 transaction).
    Thanks in advance,
    Viven

    Hi,
    <b>BAPI_INCOMINGINVOICE_PARK</b>...is one of the BAPI for parking the incoming invoice.
    Sushil.

  • Authority Check or BADI for deleting a document in SOLAR02 transaction

    Hi All,
    Could anyone tell me whether there is any authorization object or BADI to do the check before deleting any document from
    SOLAR02 transaction in Project Documentation Tab or General Documentation Tab
    Thanks a lot in Advance.

    Hi Jonathan,
    Appreciate your reply. As you know the validations kick in based on your input on the screen, kind of mostly part of PAI of the screen (0750 in this case). But my requirement is to prevent this change in the first place, not validating the user's input after a change option is given to the user.
    If you know if and how we can achieve this, please share your thoughts.
    Thanks & Regards,
    Venu

  • BADI for CRMD_ORDER transaction

    HI all,
    i am currently working in CRM 2007, i have requirement when ever i create a sales order in the WEB UI the header requested delivery date should be automaticlly filled with sy-datum.
    i suppose there should be a BADI which gets triggered when we create a sales order.
    could you please suggest me the BADI?
    And also the item level date should also be pre-filled, so will the same BADI be triggered when we enter a product in the items.
    Thanks
    Tanveer

    Hi tanveer,
       Go to SE24 transaction. Give the class name as 'CL_EXITHANDLER'.
    In this class select method 'GET_INSTANCE'. Put a break point after this FM '  CALL METHOD cl_exithandler=>get_class_name_by_interface' (at 'CASE sy-subrc.' statement). 
    when you go into crmd_order transaction control will come into this class . click on exit_name , this field will give you the list of BADI's that were getting triggered in CRMD_ORDER transaction.
    Regards,
    Lakshmi.Y

  • To change a field to edit ,which is in customer fields tab of an item in crmd_order transaction.

    Hi All,
    My requirement is to change a "field to edit" which is in "customer fields tab" of an item in "crmd_order" transaction.
    Please find the screen shot.
    Please help me with this issue

    Use easy enhancement workbench
    The Easy Enhancement Workbench is a development tool with which SAP applications (called Business Objects in the following document) can be extended in a simple manner.
    Customer enhancements to a Business Object are defined via wizards. The Workbench then does all development work for the user; databank tables, screens and application logic are created automatically. Finally the customer enhancement is included in the SAP standard.
    This also allows users without ABAP knowledge the simple possibility of extending the SAP standard.
    An extension created using the Easy Enhancement Workbench does not differ technically from one created manually. In both cases transportable ABAP objects are created and the same Customer Exits, Business Transaction Events or BAdIs are implemented
    You need to use EEWB feature to achieve the same.
    Tutorial
    http://www.scribd.com/doc/6755615/Eewb-Steps
    http://help.sap.com/saphelp_crm50/helpdata/en/9f/a19c921f0911d6b1d500508b6b8b11/frameset.htm
    In addtion check this note
    Note 484597 - Customer enhancement of CRM applications
    a guide is attached to it for telling u steps
    Hope query is solved
    Regards
    Prakhar

Maybe you are looking for

  • How do you add/use typekit fonts that are not edge web fonts?

    I am just trying out the new Muse CC 2014.1 (August) release and was keen to try the new font facilities.  As far as I can see that while I can now add other fonts for which I have downloaded web font files via the Self Hosted Web Fonts function, Typ

  • Text problems on X40 Access Connection​s and Power Manager

    Recently, and possibly in conjunction with a recent Lenovo update, Access Connections and Power Manager (at the least, there may be other programs that have problems too, but I have not checked all) display all text as little boxes.  The functionalit

  • Re: PHP Form - Required Fields

    Change this section of code: if(!count($Errors)) { $SendTo = "[email protected]"; $Subject = "New Contact Form"; $FromString = "From: ".$_POST['eaddress']."\r\n"; $Indhold = "Dave, Someone filled out the contact form on the web site. Here is the info

  • Can't rename iPhoto movies

    In Front Row, the name given to my movies recorded on a digital photo camera stays the same even if I change the name in iPhoto. For instance, say I want to rename a short clip from H348602 which the camera saves it as, to "Test". . . I do so in iPho

  • Can i use word in ipad?

    Hi I have a friend that wants to buy the ipad, however he wants to know if you can use MS Word in ipad?