Attaching link to business object using SO_NEW_DOCUMENT_ATT_SEND_API1

Hi ABAP experts,
I am trying to send a SAP mail with a link.  When the user clicks on the link
they will jump to a transaction passing the parameters specified in the link.
I have created the business object and want to know how to pass the
parameters in the link.
I have done it in the past so I know it can be done.  I just can't seem to remember how....
When I click on the link it goes the transaction but I can't pass the parameters and execute the program....
Thanks for your help in advance.
Please see below code.
ldf_facility = 'DH'.
doc_chng-obj_name = 'mail_att'.
doc_chng-obj_descr = text-024. "Validate Status
*w_objtxt = text-999.
w_objtxt = '<A HREF="sap-object://YJPV_REPT ">Document Status</a>'.
*replace '&&' with ldf_facility into w_objtxt.
*append w_objtxt to t_objtxt.
*replace 'FF' with ldf_filename into w_objtxt.
append w_objtxt to t_objtxt.
w_objtxt = text-025. "Click the link above.
append w_objtxt to t_objtxt.
*Read last line.
describe table t_objtxt lines tab_lines.
read table t_objtxt into w_objtxt index tab_lines.
*Get object document size.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( w_objtxt ).
*Document entry
clear w_objpack-transf_bin.
*header start
w_objpack-head_start = 1.
w_objpack-head_num = 0.
*number of lines.
w_objpack-body_start = 1.
w_objpack-body_num = tab_lines.
w_objpack-doc_type = 'RAW'.
append w_objpack to t_objpack.
w_objbin = 'YJPV_REPT'.
append w_objbin to t_objbin.
describe table t_objbin lines tab_lines.
*Attached document text
w_objhead = text-033. "IDoc List
append w_objhead to t_objhead.
w_reclist-receiver = sy-uname.
w_reclist-rec_type = 'B'.   "'B' = R/3 user  'U' = internet mail
w_reclist-express  = 'X'.
append w_reclist to t_reclist.
*Send document
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  exporting
    document_data                    = doc_chng
    put_in_outbox                    = 'X'
IMPORTING
  SENT_TO_ALL                      =
  NEW_OBJECT_ID                    =
  tables
    packing_list                     = t_objpack
   object_header                     = t_objhead
   contents_bin                      = t_objbin
   contents_txt                      = t_objtxt
  CONTENTS_HEX                     =
  OBJECT_PARA                      =
  OBJECT_PARB                      =
    receivers                        = t_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.

Hello,
You can have the fixed width of the colums in excel (No additional spaces in the column) is you use, the seperator between the fields.
For eg : If you are displaying 3 fields in the excel file, say MATNR, WERKS and QUANTITY.
Then you need to
Concatenate  matnr
                      werks
                      quantity
into                ls_contents_bin-line
separated by lc_tab.
append ls_contents_bin to lt_contents_bin.
Here lc_tab is the tab seperator to be declared as follows : -
CONSTANTS : lc_tab         TYPE char01     VALUE  cl_abap_char_utilities=>horizontal_tab.
The internal table lt_contents_bin is then passed to the table parameters contents_bin of the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Thanks.
Regards,
Rinkesh Doshi

Similar Messages

  • Object Types--Link to business object in SBWP

    Hi All,
    In SBWP, there is an option under path Document>Create Attachment>Link to business object, in this list there is no Purchase Order,Purchase Requisition, Maintenance work order.
    Need to know how to add these business objects to this list.
    Thank You,
    Manoj

    Hi
    check the following settings
    SPRO--> cross Appl  component>Document management>Control data>Define document types-->select doc type >define  object link--->enter PORDER     Production Order
    Regards
    Sujit

  • Can we link two business objects  in workflow?

    Dear All,
    Can we link two business objects  in workflow?My problem is that I have to take a standard BO for triggering my z workflow .But later  in one step  I am using BO which is Z as I am calling a standard Sap transaction in one of the method inside Zobject.
    Please let me know how to go for it .
    Kind Regards,
    Anshu Kumar

    Hi Anshu,
    You can use the standard BO as the BO for your workflow and trigeger the workflow from its event. To pass values from the standard BO to the custom BO used in the activity step, you need to do proper binding between the std and custom BO in the activity step.
    Do proper binding between event -> workflow -> task container.
    For assistance on binding in workflows refer to the followng links:
    http://****************/Tutorials/Workflow/Workflow.htm
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/workflow%252bscenario
    /people/sapna.modi/blog/2007/02/19/workflows-for-dummies--introductionpart-i
    Hope this helps!
    Regards,
    Saumya

  • Link Between Business Object and Transaction

    <b>How is Business Object linked to transactions?</b>
    For example, how is business object BUS2032 (Sales order) linked to transaction VA01 (Create sales order)?

    Hi Ben,
    I'm not sure that you link a business object and a transaction code explicitly. Normally in the business objects methods you have coded what transaction code should be called. Therefore if you use the methods of the business objects it then knows what transaction to call.
    Conversely on the workflow side you will find that down in the depths of the coding for VA01 (as an example) it calls workflow function modules and raises events. When doing so it provides the business object id and key to the business object (i.e. the sales order number). Indirectly I guess the change documents that are raised for most things in SAP like sales documents are uniquely identified and therefore can also be translated to the business object key (e.g. sales documents will have their own change document type).
    A brief example in my 4.6c system can be found in include LIEDPF4C in the form finsta_kontoauszug_buchen with a call to function SAP_WAPI_CREATE_EVENT. You see the the parameter "object_type" has a variable passed to it "objtype_finsta". If you drill back on objtype_finsta you see that is hardcoded to the value BUS4499.
    I guess you could say the developer of the business object knows what transaction codes the business object should use and the developer of the code in the transaction code knows what business objects he should be raising events for if necessary.
    Hope this helps.
    Regards,
    Michael

  • Linking External Business objects of ECC to Case in Webclient

    Hi guys,
    i have a requirement where i need to link external business object like BUS2080(Service Order),BUS2088(Service Notification) in record of UI component CRMCMP_CMG(CRMCMP_CMG/RecordTree ).
    I have done the below  configuarions:
    1) where i have created registry entry for the external object types.Defined the element types for the external objects.
    2) then i have done " Assign Element Types and Business Object Types to a Process'.
    3)Also implemented the BADI  CRM_CMG_ADD_OBJECT to link the external  business objects.
    Now i want to see these external business objects in the wbclient component  view CRMCMP_CMG/RecordTree.
    But couldn't get the objects there  only i can find the standard record model with CRM Business objects only.
    If any one  has worked in case management in webclient to link the objects please share your inputs .Also if anybody have any idea please share.
    Regards
    Snehasish

    Hi, did you find a solution already to your problem? We are facing the same problem.
    In the backend transaction (CRM in Sapgui) it's working fine, but in the CRM_UI transaction the reference object cannot be selected from the dropdown menu...
    Please let me know if you have a solution.
    Best regards,
    Marcel

  • Creating a business object using bapi

    can some one tell me how to create a business object using a bapi and is it possible to create bapi using business object.which is dependent on which one.

    >
    jayashankar wrote:
    > can some one tell me how to create a business object using a bapi and is it possible to create bapi using business object.which is dependent on which one.
    No....
    First read [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]...

  • Business Objects used in SAP OVS

    Hi, experts.
    How do I know the Business Object used in an SAP OVS?
    Please kindly answer.
    Regards.

    Hi, Sunil Maurya,
    I am sorry that I misunderstood my problem.
    My BO has a field that uses CompanyID.OVS.
    I want the companyID of the CustomerInvoiceRequest.xbo to use as an ID for my custom BO to get some other field but CustomerInvoiceRequest only uses AccountBusinessPartnerID.OVS.
    And what I am getting with this code
    "companyId = this.BuyerParty.PartyKey.PartyID.content"
    is just account id.  What i want is a CompanyID that I can use to retrieve other field from my own BO.
    I am really sorry if my writhing is complicated and hard to understand.
    Regards.

  • Attachment list for business objects is not visible

    Dear all
    I have connected an external server to SAP.
    Created repository and created Doc types (say for ex : ZFIINV,  ZMM DRW) and created entries using tcode OAC3
    now i have assigned my doc type to corresponding Business Objects (BKPF for accounting doc,BUS2105 for purchase requisition ,MKPF for MM related docs)
    now i have created entries for my scanned docs in table TOA01.
    i can search an display these docs which are already placed  there in my content server. but i can not see these documents links entries in the attachment list of corresponding Business objects entries.
    for example in BO : BKPF  attachment list i cant see al the link entries .
    please suggest whether any BO is not published or R/3 application connection to the generic object service is not done?
    thanks sandeep

    Hi Sandeep,
    I am not totallt getting your point but can suggest following points:
    1. Check whether these object are displaying in DIR's as object links.
    2. If it is there then it shoud be displayed in document data of those objects.
    3. Check that documents are properly checked-in.
    Hope this may help.
    Regards,
    Ravindra

  • Loading documents and attaching them to business objects

    Hi,
    I am trying to load documents (Word and PDF files) into a content management server linked to a SAP CRM system. The documents need to be attached to business objects such as interaction records (BUS2000126) and service tickets (BUS2000116).
    I have experimented with FMs <b>BDS_BUSINESSDOCUMENT_CREATEF</b> and <b>ARCHIV_CONNECTION_INSERT</b> but haven't yet found the right combination of values. The best I have done is to create a link which is visible in the GUI as an icon, but when I double click on it, I get an error message saying that the document does not exist (error 404).
    The import parameters I am using in BDS_BUSINESSDOCUMENT_CREATEF are:
    LOGICAL_SYSTEM = [blank]
    CLASSNAME = ZCSIP_LTR (a value from table TOADV)
    CLASSTYPE = BO
    CLIENT = [default]
    OBJECT_KEY = [blank]
    FILES
      DOC_COUNT = 00000001
      COMP_COUNT = 00000001
      COMP_ID = [blank]
      DIRECTORY = U:\DOCUMENTS\TEST DATA\
      FILENAME = FA.PDF
      MIMETYPE = application/pdf
    SIGNATURE
      DOC_COUNT = 00000001
      PROP_NAME = BDS_CONTREP
      PROP_VALUE = ZT (my content repository name)
    The FM returns a GUID as the OBJECT_KEY ...
    Then I am using ARCHIV_CONNECTION_INSERT as follows:
    ARCHIV_ID = ZT
    ARC_DOC_ID = [GUID returned by BDS_BUSINESSDOCUMENT_CREATEF]
    AR_OBJECT = ZCSIP_LTR (a value from table TOADV - as above)
    MANDANT = [default client as above]
    OBJECT_ID = [GUID of the object I want to attach the document to]
    SAP_OBJECT = [Business object identifier] e.g. BUS2000126
    DOC_TYPE = PDF
    Can what I need to do be achieved through just using BDS_BUSINESSDOCUMENT_CREATEF? What import parameters should I use? What values should they contain?
    Many thanks in advance,
    Peter

    Hi,
        BDS classname BUS2032 and classtype BO
    but function module 'BDS_BUSINESSDOCUMENT_CREATEF' and cl_bds_document_set class method
    here is the code..
    DATA: o_document_set TYPE REF TO cl_bds_document_set,
    wa_signature LIKE bapisignat,
    i_signature LIKE bapisignat OCCURS 1,
    wa_files LIKE bapifiles,
    i_files LIKE bapifiles OCCURS 1,
    i_object_key LIKE bapibds01-objkey.
    CREATE OBJECT o_document_set.
    MOVE: '1' TO wa_signature-doc_count,
    '1' TO wa_files-doc_count,
    'c:\temp' TO wa_files-directory,
    '1.jpg' TO wa_files-filename.
    APPEND wa_signature TO i_signature.
    APPEND wa_files TO i_files.
    i_object_key = '0000261877'.
    BREAK-POINT.
    CALL METHOD o_document_set->create_with_files
    EXPORTING
    classname = 'BUS2032'
    classtype = 'BO'
    CHANGING
    object_key = i_object_key
    files = i_files
    signature = i_signature
    DATA : files LIkE BAPIFILES OCCURS 1 WITH header line.
    files-doc_count = '1'.
    files-directory = 'c:\temp\'.
    files-filename = '1.jpg'.
    APPEND files.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREATEF'
    EXPORTING
    LOGICAL_SYSTEM =
    classname = 'BUS2032'
    classtype = 'BO'
    CLIENT = SY-MANDT
    OBJECT_KEY = '0000261877'
    IMPORTING
    OBJECT_KEY =
    tables
    files = files
    SIGNATURE =
    EXCEPTIONS
    NOTHING_FOUND = 1
    PARAMETER_ERROR = 2
    NOT_ALLOWED = 3
    ERROR_KPRO = 4
    INTERNAL_ERROR = 5
    NOT_AUTHORIZED = 6
    OTHERS = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF
    And check the OSS Note 317250.
    <b>Reward points</b>
    Regards

  • Document attachment to a business object

    Hi All,
    I am trying to attach a document to a business object. Can anybody tell me what is the function module I need to use for this ?
    Please help.
    Regards,
    Jeetu

    Hi,
    If you are using a Web UI, then i suppose you can attach documents or URL's through Attachments assignment block in the transaction.
    If not, can you explain in detail, what is the requirement.
    Regards,
    Krishna

  • Linking two ODS objects using a multiprovider

    Hello Gurus,
    I need to link two ODS objects and both are having 3 common characteristics and the relationship between the two objects are one to many.
    My questions would be....
    1)When the relationship is one to many can I set it up in the multiprovider to sum it up and show in the report?
    2)I have 5 other charaterstics that I need to report(Slice and dice) on, but these are not common ones to both ODS objects. Is it possible for the user to get the report based on these charaterstics also? Or do I need to make sure that these 5 also exist in both DOS objects?
    Thank you,
    DM

    Hi Sh,
    Thank you very much for your reply. But I have few concerns.
    1)One to many relationship will not have any effect on the data linking since the multiprovider clubs the key figures on common characteristics. I tried this on the system and it worked.
    2)The problem would be not having similar characteristics on both infoproviders. So if I want to report on the chars individually it will have a problem( Will come as non assigned values)
    But the documentation says the multiprovider supports Homogenous and Heterogeneous cases. Please refer the following link.
    http://help.sap.com/saphelp_nw04/helpdata/en/52/1ddc37a3f57a07e10000009b38f889/frameset.htm
    I am not sure what I can do now....whether to get all the characteristics in both infoproviders by enhancing the them. Or is there another way?
    And lastly the scenario I am looking at is billing and cost of goods. So I might find records in cost of goods which may not have corresponding records in billing.(There can be goods in stock which need to be billed)The problem would be the way multiprovider link records(union) so it will have all the records from both sides even if they do not correspond to each other.
    Let me know what you think.
    Cheers,
    DM

  • How to Retrieve a List of Business Objects using DI Server?

    In DI Server (and DI-API) I could not find how I can get a list of business objects, for instance ServiceCall objects.
    and more - say i need the list with a filter on customer code and call status?

    ...at least not to the extent that you are looking for.
    Please check the E-learning:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d78ab1f9-0901-0010-8495-8ca0facaea2e?prtmode=navigate
    at: https://www.sdn.sap.com/irj/sdn/businessone-elearning
    ...or go the sample code for the DataBrowser (sub-)object in the "SDK Help Center"...
    ...or go to the DI API sample (no. 2 I think I remember).
    ...to find out how you can navigate between the records of the result of your SQL query; from there you could e.g. export the objects to XML...
    HTH

  • Give me any books or links in Business Objects

    Hi,
             iam sap b1 technical consultant and i know crystal reports, i plan to learn Business Objects.
    i want materials plz any one give me.
    Regards.
    Billa 2007

    Hello Sivabalan ,
    You could start at our online product documentation [here|http://help.sap.com/content/bobj/bobj/index.htm].
    Best regards
    Falk

  • DI: Update Business Object using XML

    When I try to update a Business Object I loaded from XML, I keep getting an error "1107 - Wrong Object State". Any idea, what's wrong ? I can add objects without any problem.
    Sample Code (VB.NET):
    Dim bp As SAPbobsCOM.BusinessPartners
    bp = cmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
    cmp.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
    cmp.XMLAsString = True
    Dim xmlstr As String
    bp.GetByKey("20001")
    xmlstr = bp.GetAsXML
    bp = Nothing
    Dim bp2 As SAPbobsCOM.BusinessPartners
    bp2 = cmp.GetBusinessObjectFromXML(xmlstr)
    bp2.CardForeignName = "TEST"
    Dim errNo As Integer = bp2.Update

    Hi,
    See you this post:
    Update XML
    Best Regards.

  • Business objects Links

    Hi Friends,
    I am new to the Business objects. I got one requirement on business object.
    My SAP version is ECC 5.0.
    Here is the situation:
    I am attaching customer and claim documents through OAOR transaction (Business Document Navigator) .
    Attaching files are working fine in both customer and claim objects. i mean I can able to see those attached documentsin "Business Document Navigator).
    There is a standard transaction to see claim documents. i.e WTYSE.
    and we are using custom transaction to see customer documents.
    I can able to see claim documents in WTYSE. But I am not able to see customer documents in ztransaction.
    Could you pls help me ... some where we are missing link between business objects and object key number.
    Is there any way to maintain link?
    Hope you understood my issue. pls help me .
    This is very urgent.
    Thanks in advance

    Hi
    This is not the right place for this, it should be under ABAP.
    Thanks
    Atul

Maybe you are looking for

  • More records in Purchasing Cube than in PSA.

    Dear Folks, Right now i'm working on 0PUR_C01 Cube.In Quality server, i checked the data in Cube after executing the DTP and found that records are getting increased.Records in PSA(2152),but in Cube(2359),there are some routines in the Transformation

  • IPhone pictures- Delete from phone but not mac

    How do I delete pics from my phone after they have been synced to iPhoto on my mac?  I don't understand the folder option people speak of.

  • Will symbian anna will be lost after hard reset?

    if i hard reset my n8 then symbian anna will be lost????? And it will display sym 3????

  • Re: (forte-users) Same Environment variables?

    If you will be connecting the environments in the future, then you will need to make sure that the environment names are unique. Both the Name Server Addresses and the Environment Names need to be unique in connected environments. Mark Musgrove Senio

  • Install adobe flash player

    Need some help I have mac laptop  O S X version  10.4.11 When I download latest adobe flash player I double click to install it  it won't open can't get on anything on Facebook