Associating GOS Attachments to a KEY

Hi,
I am currently using GOS to attach an object in a current transaction.  The GOS is working fine when attaching objects.  My problem is... How can I relate the attached object to a KEY.  For example, PO as a key, how can I associate those attachments under that PO number, so whenever I enter the PO i will get those attachments in the "Attachment list" and whenever I enter a different PO... different attachments will appear depending on the saved attachments under that PO.  Am i clear with my question?
ex.
PO1 has 2 attachments associated with it, att1 and att2.
PO2 has 1 attachment associated with it, att3.
When I reenter the transaction and enter PO2, i shoul get att3 and when I enter PO1 i should get att1 and att2 in the "Attachment List."
NEED HEEELP....

Hello,
Please check this links perhaps helpful.
http://help.sap.com/saphelp_nw04/helpdata/en/c4/3fe63659241157e10000009b38f889/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/be/3fe63659241157e10000009b38f889/frameset.htm
I am not sure which weblog you are referring to.
the simplest way to have GOS tool bar in custom program is to call
FM
call function 'SWU_OBJECT_PUBLISH'
exporting
objtype = 'REPORT'
objkey = sy-repid
exceptions
objtype_not_found = 1
others = 2.
object type has to be a Business object (SWO1)
just do a committ work after the function call.
if you want to programatically do this you can use FM
BDS_BUSINESSDOCUMENT_CREATEF
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0e6b0d95-0a01-0010-4696-ca0a48de5fb3
Hope it will help.
Regards,
Vasanth

Similar Messages

  • Global Object Services (GOS) Attachments Deleted from Maintenance Task List

    We use the Global Object Services (GOS) Attachments function to attach Word and Excel Documents to Maintenance Task Lists (transactions IA02, IA09). Recently we noted that more than 300+ Attachments had been deleted/removed from the GOS list visible via IA03/IA09. We are at a loss for explaining how this occurred- all Attachments appear to have been deleted at once/instantaneously. We can see the underlying tables (SGOSHIST and others) still contain entries, but we do not understand why the Attachments are no longer visible in the GOS list via Maintenance Task Lists, or how the ability to access these via GOS can be restored. This is not occurring with other PM Object Attachments - only Task Lists. Any help or suggestions appreciated.

    Is it possible that there was some authorisation change in a role associated with task lists? That would be consistent with the immediate loss - but only in the task list area. Another thought - has anyone been doing any programming in the Generic Object Services Business Add-Ins (perhaps for another module?) - They might have inadvertently clobbered your use?
    Do you use the GOS notes functionality? Does that still work?

  • Storage repository for GOS attachments outside R/3

    Greetings!
    For our requirement we have to extract and store GOS attachments in a DMS server.
    I would like to know what are all the possible soutions to store the data outside R/3 (our users will not accessing them everytime but just to have reference when needed). I do not have much knowledge about DMS so some reference link also would be of a great use.
    Please let me know if I need to eloborate on my requirement. Your help is much appreciated!
    Regards,
    Manoj

    Hi Manoj,
    You can store GOS documents in external server. Follow steps as below
    1) Link content category SOFFHTTP to the repository referring to external server.
    2) For SOFFPHIO class in table SDOKPHCL, maintain value X for CAT MAINT field
    3) Go to the transaction skpro8, maintain SOFFHTTP as new category for SOFFPHIO class,
    After making these changes, GOS documents will be stored in external server.
    Refer to the below link which gives good facts about GOS. It is very informative.
    http://wiki.sdn.sap.com/wiki/display/SI/FrequentlyaskedquestionsaboutGenericObjectServices+%28GOS%29
    Cheers
    Amit

  • Which business objects do allow searching the associated file attachments?

    Hello search experts,
    SAP Note 1249465 - TREX 7.1: Installing TREX for Embedded Search states:
    "Embedded search enables every SAP Business Suite application to search in a unified way inside its business objects (structured data) and associated file attachments (unstructured data)."
    Is there a list of business objects where the search in the associated file attachments is supported? I'm specially interested in the SAP CRM business objects. But a list for SAP ERP and the other Business Suite components would be nice too.
    Best regards
    Gregor

    Hi Ritwik,
    for the Cycle 3 of Customer Connection for SAP CRM that was started last year this idea was submitted:
    Integrate documents (attachments) into CRM embedded search
    https://cw.sdn.sap.com/cw/ideas/10637
    unfortunately this topic spans cross multiple software components. The development was started but got stuck. In the moment the status of this request is "Handed over - Already in development planning (Handed over to Product / CEI topic owner)". So let's hope we will see a standard solution sooner or later.
    Best regards
    Gregor

  • GOS Attachments Display URL in WD ABAP

    HI,
      We have to display the GOS attachments list in the the WD ABAP application. Unfortunately the class and Function module which can do that are not working in the WD ABAP application. Like CL_GOS_DOCUMENT_SERVICE...
      Any thoughts?
    Thanks
    Raghav

    hi Kumar,
    Please go through this...
    GOS and FileUpload UiElement
    Global object Services ( GOS ) in WD4A
    Attachement Details (GOS) in Web Dynpro (ABAP)
    cheers,
    Kris.

  • How to Cary Forword GOS attachments

    Dear All,
    Can any one have an idea how to forword Attachments from one GOS menu to another GOS menu
    Thanks
    Surendra

    Take a look at class [CL_BINARY_RELATION|http://help.sap.com/saphelp_nw70/helpdata/en/79/315b3a201b9c5ee10000000a114084/frameset.htm] and check methods
    - Method READ_LINKS at [READ Methods |http://help.sap.com/saphelp_nw70/helpdata/en/ee/a1653a5aa1ed49e10000000a114084/frameset.htm]
    - Method [CREATE_LINK|http://help.sap.com/saphelp_nw70/helpdata/en/b7/305b3a201b9c5ee10000000a114084/frameset.htm]
    Regards,
    Raymond

  • Attach GOS attachments with a standard send mail functionality

    Hi Folks,
    I am here after long time and need your help.
    I have a requirement where I need to attach document with a standard send mail functionality.
    Below is the details:
    From Quality notification 'Action Box', if the user select a perticular action (it is similar to web link), the system is sending a mail to an external mail id provided by the user (In a popup). This mail send is happening through a SAP standard functionality.
    Now the requirement is, I need to attach selected file from GOS (generic Object Services) and attach them to the mail. Sending mail should happen through standard functionality.
    I want to know below two points:
    1) How to get selected files from GOS attachment?
    2) How to attach them to mail? (only attach, sending will be done by standard functionality)
    Hope I am clear with the requirement.
    Please help me to get it resolved.
    thanks,
    Surajit

    1st - analyse fm SO_ATTACHMENT_LIST_READ and table SOOD
    and function groups sgos* and SOB2
    hope that helps
    Andreas

  • Restrict GOS attachments in IW32 for specific doc type

    My requirement is we would like to restrict the Services for object
    attachments for specific doc type in IW32 transaction.
    Can blocking be made on doc type level?
    In this case jpg, bmp, and gif should be allowed, but blocking dwg, doc, xls, pdf etc.
    Didn't find any option in SGOS transaction or SGOSATTR table.
    Any suggestions are welcome..

    PARAMETERS: p_key TYPE swo_typeid OBLIGATORY,
    p_type TYPE swo_objtyp OBLIGATORY,
    p_file TYPE c LENGTH 100 OBLIGATORY,
    p_desc TYPE so_obj_des OBLIGATORY.
    data wa_kan1 type kna1.
    DATA: ls_fol_id TYPE soodk,
    ls_obj_id TYPE soodk,
    ls_obj_data TYPE sood1,
    ls_folmem_k TYPE sofmk,
    ls_note TYPE borident,
    ls_object TYPE borident,
    lv_ep_note TYPE borident-objkey,
    lv_offset TYPE i.
    DATA: it_objhead TYPE STANDARD TABLE OF soli,
    it_content LIKE STANDARD TABLE OF soli,
    wa_content LIKE soli.
    ls_object-objkey = p_key.
    ls_object-objtype = p_type.
    **if objtype = kna1 then 
    HERE I CHEK CUSTOMER NO U PUT YOUR OBJ ID AND USING SELECT QUERY U CAN CHECK DOC.TYPE
    select *from kna1 into wa_kna1
    where kunnr = p_key
    if sy-subrc <> 0.
    exit.
    endif.
    TRY.
    OPEN DATASET p_file FOR INPUT IN BINARY MODE.
    WHILE sy-subrc = 0.
    READ DATASET p_file INTO wa_content.
    APPEND wa_content TO it_content.
    ENDWHILE.
    CLOSE DATASET p_file.
    CATCH cx_sy_file_access_error.
    MESSAGE 'Error reading file' TYPE 'E'.
    ENDTRY.
    CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
    EXPORTING
    it_contents_bin = it_content[]
    IMPORTING
    et_contents_bin = it_content[].
    Edited by: kk.adhvaryu on Mar 9, 2010 10:54 AM

  • Delete GOS attachments ?

    Hi friends,
    I will write my question in 2 posts due to the length limitation.
    In my program i create different attachments like this:
      CONCATENATE 'UPC' ordendpago INTO is_object-objkey
                        SEPARATED BY space.
    * Indicamos el tipo de objeto URL
      is_object-objtype  = 'FMPSO'.
      rel_doc-objkey  = document_id.
      rel_doc-objtype = 'MESSAGE'.
    * Creamos la relación entre la op y el objeto enlazado
      CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
           EXPORTING
                obj_rolea      = is_object
                obj_roleb      = rel_doc
                relationtype   = 'URL'
           EXCEPTIONS
                no_model       = 1
                internal_error = 2
                unknown        = 3
                OTHERS         = 4.

    At some point later, i want to delete some of these attachments created, and i do it like this:
      DATA: lo_list   TYPE REF TO CL_GOS_ATTACHMENT_LIST,
            lt_output TYPE TRL_BRLNK,
            ls_output TYPE SRL_BRLNK,
            lo_bor_item TYPE REF TO CL_SREL_BOR_ITEM,
            lo_bor_browser TYPE REF TO CL_SREL_BROWSER_ITEM,
            ls_bor_obj  TYPE borident,
            ls_folderid TYPE soodk,
            ls_objectid TYPE soodk.
            CONCATENATE 'UPC' i_ops-lotkz INTO lv_objkey SEPARATED BY space.
            ls_object-objkey = lv_objkey.
            ls_object-objtype = 'FMPSO'.
            create object lo_list
              exporting
                is_object        = ls_object
            IF sy-subrc <> 0.
            ENDIF.
            lt_output = lo_list->GO_LIST_VIEWER->gt_output.
    *       in lt_output i have all the attachments for this document
            LOOP AT lt_output INTO ls_output.
              lo_bor_browser = ls_output-objref.
              lo_bor_item ?= lo_bor_browser.
              ls_bor_obj  = lo_bor_item->gs_bor_object.
              ls_folderid = ls_bor_obj-objkey(17).
              ls_objectid = ls_bor_obj-objkey+17(17).
              CALL FUNCTION 'SO_OBJECT_DELETE'
               EXPORTING
                 folder_id                        = ls_folderid
    *            FORWARDER                        = ' '
    *            F_UNREAD_DELETE                  = ' '
                 object_id                        = ls_objectid
    *            OWNER                            = ' '
    *            PUT_IN_WASTEBASKET               = 'X'
    I do delete them, but my problem is that for every attachment deleted, a popup window with the attachment list is opened. Does anyone know how could I avoid that ?
    Thanks

  • Help  please,How to download GOS attachments by program

    Hi everybody:
        We created attachments in VA02,I want to download all of the SO's attachments to my PC,How to do it?
       Thank U!
    Martin
    Edited by: yan zeng on May 13, 2009 7:07 AM

    For that is the Webclient with a lot of methods to do what you want.
    http://msdn.microsoft.com/en-us/library/system.net.webclient_methods(v=vs.110).aspx
    Success
    Cor

  • Copying and remove BOR-GOS attachments from one object in other object

    As it can be realized

    I do here so
      DATA: logical_system LIKE  bapibds01-log_system ,
            all_con LIKE bdn_con OCCURS 0 WITH HEADER LINE
      CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
        IMPORTING
          own_logical_system = logical_system.
      CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'
        EXPORTING
          logical_system   = logical_system
          classname        = 'ZURKART01'
          classtype        = 'BO'
          all              = 'X'
          objkey           =  '2222222222'
          no_gos_docs      = ' '
        TABLES
    *   SIGNATURE           = my_signature
          all_connections  = all_con
      LOOP AT all_con.
        CALL FUNCTION 'BDS_BUSINESSDOCUMENT_COPY'
          EXPORTING
            logical_system        = all_con-log_system
            classname             = all_con-classname
            classtype             = all_con-classtype
            client                = all_con-client
            object_key            = all_con-objkey
            doc_id                = all_con-loio_id
            doc_ver_no            = all_con-doc_ver_no
            doc_var_id            = all_con-doc_var_id
            new_classname         = 'BUS2014'
            new_classtype         = 'BO'
            NEW_CLIENT            = SY-MANDT
            new_object_key        = '4644444444'
      ENDLOOP.
    FM ' BDS_ALL_CONNECTIONS_GET ' in the table all_con writes down some lines,
    But
    FM ' BDS_BUSINESSDOCUMENT_COPY ' gives out a mistake - ' nothing_found '
    That I do not as it is necessary

  • Identifying Key Owner without the Associated Key

    Suppose my entity Key class implements the KeyAssociation interface to create "Data Affinity":
    class MyKeyClass implements KeyAssociation {
    private String key, associated;
    public MyKeyClass ( String key, String associated ) ... // set fields
    public String getKey() { return key; }
    public String getAssociatedKey () { return associated; }
    Now I wish to get the "Key Owner", but I without knowledge of the Associated Key. I.e., I at this time I only know the "main" key:
    MyKeyClass keyClass = new MyKeyClass ("ABC123", null) // <-- pass null as the Associated key, because I don't know it yet!
    partitionedService.getKeyOwner(keyClass);
    Question - Will this work? Can Coherence provide me with the Key Owner using "ACB123" alone? Or will it try and call "getAssociatedKey()" and fail, because "null" is returned from that method.
    Reasoning - I want to avoid an extra lookup. For example, my key may be {key:ABC123, associated:XYZ789}. To find "XYZ789" I have to do a lookup in a cache, which I really do not want to do.
    Thanks.

    899446 wrote:
    Suppose my entity Key class implements the KeyAssociation interface to create "Data Affinity":
    class MyKeyClass implements KeyAssociation {
    private String key, associated;
    public MyKeyClass ( String key, String associated ) ... // set fields
    public String getKey() { return key; }
    public String getAssociatedKey () { return associated; }
    Now I wish to get the "Key Owner", but I without knowledge of the Associated Key. I.e., I at this time I only know the "main" key:
    MyKeyClass keyClass = new MyKeyClass ("ABC123", null) // <-- pass null as the Associated key, because I don't know it yet!
    partitionedService.getKeyOwner(keyClass);
    Question - Will this work? Can Coherence provide me with the Key Owner using "ACB123" alone? Or will it try and call "getAssociatedKey()" and fail, because "null" is returned from that method.
    Reasoning - I want to avoid an extra lookup. For example, my key may be {key:ABC123, associated:XYZ789}. To find "XYZ789" I have to do a lookup in a cache, which I really do not want to do.
    Thanks.Hi,
    In your example, MyKeyClass is the key for the object and the attributes {String key, String associated} must uniquely define this key. Passing "null" might it make it non-unique and also you cannot set the attributes of the objects' key later. The getAssociatedKey() leverages the attributes in your MyKeyClass to group the objects that share the same attribute. If "null" is used for the {associated} then all the keys with attribute "associated=null" will coexisit but the getAssociatedKey() call will not fail.
    Re, the lookup you will use the same key as below:
    MyKeyClass keyClass = new MyKeyClass ("ABC123", "XYZ789")
    partitionedService.getKeyOwner(keyClass);You don't have any extra hop for this lookup as you pass the keyobject and get the owner of that key.
    Hope this helps!
    Cheers,
    NJ
    Edited by: user738616 on Mar 27, 2012 11:47 AM

  • Associative Array (Object) problems

    Here is the function i'm dealing with
    i'm reading in a delimited string and using indexed arrays to
    break them up and assign the keys and values to an associative
    array in a loop.
    i'm using variables in the loop and the array loads as
    expected in the loop
    but outside the loop, the only key is the variable name and
    the value is undefined
    this is true using dot or array notation, as well as literal
    strings for the keys
    any help is appreciated
    watchSuspendData = function (id, oldval, newval):String {
    //the incoming suspendData string is delimited by the
    semicolon;
    //newval is: firstValue=Yes;captivateKey=1
    var listSuspendData:Array = newval.split(";"); // convert it
    to a list of key/value pairs
    if (listSuspendData.length > 0){
    //line 123: listSuspendData.length is: 2
    for (i=0; i < listSuspendData.length; i++){ //for each
    key/value pair
    var keyValArray:Array = new Array();
    var myNameValue:String = listSuspendData
    //line 127: listSuspendData is: firstValue=Yes
    keyValArray = myNameValue.split("="); // split 'em on the
    equal sign
    var myKey:String = keyValArray[0];
    var myVal:String = keyValArray[1];
    //keyValArray[0] is: firstValue
    //keyValArray[1] is: Yes
    // store the key and the value in associative array
    suspendDataArray.myKey = myVal;
    trace("line 134: suspendDataArray is: " +
    suspendDataArray.myKey);
    // trace is line 134: suspendDataArray is: Yes on the first
    pass and 1 on the second
    //the below loop always returns one array key: myKey and the
    value as undefined
    for(x in suspendDataArray){
    trace("x is: " + x); //x is: myKey
    trace("the val is: " + suspendDataArray.x); //the val is:
    undefined
    } //end for
    return newval;

    on lines 12-13 i assign the key=value pair to string
    variables
    then on lines 17-18 i assign those values to the associative
    array using dot notation
    the trace seems to work there
    the problem is that when the procedure exits the for loop,
    the associative array only has one key (myKey) and no value
    (undefined)
    all the documentation i've read shows using these types of
    arrays with either non-quoted property names like:
    myAssocArray.myKey = "somevalue";
    or
    myAssocArray[myKey] = "somevalue";
    i tried assigning the key/value pairs directly from the
    indexed arrays, but the result was always undefined
    like this:
    suspendDataArray.keyValArray[0] = keyValArray[1]
    or
    suspendDataArray[keyValArray[0]] = keyValArray[1]
    i even tried building a string in the loop and trying to
    assign all the pairs at once using the curly brace
    this is pretty wierd behavior for actionscript or i'm missing
    something basic here
    thanks for looking

  • How to retrieve attachments from a PDF?

    Hi All,
    how do i retrive attachments in a pdf using workbench process?
    I have used a DDX file which is :
    <?xml version="1.0" encoding="UTF-8"?>
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <FileAttachments result="attachmentInfo.xml" nameKeys="*" extract="true">
    <PDF source="inDoc"/>
    <FilenameEncoding encoding="ISO-8859-1"/>
    </FileAttachments>
    </DDX>
    Now i got the attachmentInfo.xml with the informartion of all the attachments.
    My problem is how to actually get hold of the attachments inside the PDF.
    Pls help.
    Thanks
    Abhiram

    The trick to this is in the results that the DDX returns.   When using the FileAttachments tag in a DDX the result is not just the attachments, but also an XML that describes the attachments. 
    http://livedocs.adobe.com/livecycle/8.2/ddxRef/000663.html
    The description file (identified using the “result” attribute in the DDX) goes into a Map stored in AssemblerResult.object.documents.   The extracted documents are also stored in this map. 
    By reading the description XML file you can tell the file name, content type and location (key) of the attachments. A simple loop is used to read the XML file, find the attachments (by the key in the Map) and write them to the file system.

  • Problem with PDF Attachment (from GOS)

    Hi Experts,
    Below is the code in a ZFM. We are trying to get GOS attachments and the same are to be sent to SAP Inbox through Workitem. When we executed, the attachment is being shown but couldn't be opened.  It's throwing an error as 'The file has been damaged'.
    As per my understanding, we are getting PDF file into lt_object_content_l and we are trying to convert that to binary file and send the same to SAP_WAPI_ATTACHMENT_ADD.
    FUNCTION ztest_service_atta.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IV_WORKITEMID) TYPE  SWW_WIID OPTIONAL
    *"     REFERENCE(IV_PERNR) TYPE  PERSNO
    *"     REFERENCE(IV_REINR) TYPE  REINR
    *"  EXPORTING
    *"     REFERENCE(ES_ATT_ID) TYPE  SWR_ATT_ID
    *"  EXCEPTIONS
    *"      ATTACH_FAILED
      DATA: gs_att_header TYPE swr_att_header.
      DATA: ls_lpor TYPE sibflporb,
      lt_lpor LIKE TABLE OF ls_lpor,
      ls_option TYPE obl_s_relt,
      lt_option TYPE obl_t_relt,
      ls_rol_op TYPE obl_s_rolt,
      lt_rol_op TYPE obl_t_rolt,
      ls_links TYPE obl_s_link,
      lt_links TYPE obl_t_link,
      ls_folder TYPE soodk,
      ls_object TYPE soodk,
      ls_obj_hd TYPE sood2,
      lt_object_content_l TYPE TABLE OF solisti1,
      ls_object_content_l TYPE solisti1,
      lt_obj_cont TYPE TABLE OF soli.
    * Work areas
      DATA: lwa_doc_data        LIKE sodocchgi1,
            lwa_document_data   LIKE sofolenti1,
            lv_document_id      TYPE sofolenti1-doc_id,
            lwa_links           LIKE LINE OF lt_links,
            lwa_object          TYPE borident,
            ev_binfile TYPE xstring.
      FIELD-SYMBOLS <p> TYPE x.
      ls_lpor-instid = '000011110000000123'.
      ls_lpor-typeid = 'BUS2089'.
      ls_lpor-catid = 'BO'.
      APPEND ls_lpor TO lt_lpor.
      ls_option-sign = 'I'.
      ls_option-option = 'EQ'.
      ls_option-low = 'ATTA'.
      APPEND ls_option TO lt_option.
      ls_rol_op-sign = 'I'.
      ls_rol_op-option = 'EQ'.
      ls_rol_op-low = 'GOSAPPLOBJ'.
      APPEND ls_rol_op TO lt_rol_op.
      CALL METHOD cl_binary_relation=>read_links
        EXPORTING
          is_object           = ls_lpor
          it_relation_options = lt_option
          it_role_options     = lt_rol_op
        IMPORTING
          et_links            = lt_links.
    * Process the attachment list
      LOOP AT lt_links INTO ls_links.
        lv_document_id = ls_links-instid_b.
    * Read the data
        CALL FUNCTION 'SO_DOCUMENT_READ_API1'
          EXPORTING
            document_id                = lv_document_id
          IMPORTING
            document_data              = lwa_document_data
          TABLES
            object_content             = lt_object_content_l
          EXCEPTIONS
            document_id_not_exist      = 1
            operation_no_authorization = 2
            x_error                    = 3
            OTHERS                     = 4.
      ENDLOOP.
      LOOP AT lt_object_content_l INTO ls_object_content_l.
        ASSIGN ls_object_content_l TO <p> CASTING.
        CONCATENATE ev_binfile <p> INTO ev_binfile IN BYTE MODE.
      ENDLOOP.
      IF ev_binfile IS NOT INITIAL AND iv_workitemid IS NOT INITIAL.
        gs_att_header-file_type       = 'B'.
        gs_att_header-file_extension  = 'PDF'.
        gs_att_header-language        = 'EN'.
        gs_att_header-file_name       = 'Scanned Atta.PDF'.
        CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'
          EXPORTING
            workitem_id = iv_workitemid
            att_header  = gs_att_header
            att_bin     = ev_binfile
            do_commit   = 'X'
          IMPORTING
            att_id      = es_att_id.
        IF es_att_id IS INITIAL.
          RAISE attach_failed.
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    Can somebody please tell me if I went somewhere wrong. What I feel is, it's because of the PDF file being 255 chars. As I have got the PDF file but not OTF, how can I convert that ot be of 132 chars. Whatever, is the problem due to this reason only?
    Can somebody please tell me where I have gone wrong. Your help is highly appreciable.
    Thanks

    Solved. Instead of converting object_content, I got contents_hex also and converted that as below:
    CALL FUNCTION 'SO_DOCUMENT_READ_API1'
          EXPORTING
            document_id                = lv_document_id
          IMPORTING
            document_data              = lwa_document_data
          TABLES
            object_content             = lt_object_content_l
            contents_hex               = lt_hex_cont
          EXCEPTIONS
            document_id_not_exist      = 1
            operation_no_authorization = 2
            x_error                    = 3
            OTHERS                     = 4.
      LOOP AT lt_hex_cont INTO ls_hex_cont.
        ASSIGN ls_hex_cont TO <p> CASTING.
        CONCATENATE ev_binfile <p> INTO ev_binfile IN BYTE MODE.
      ENDLOOP.

Maybe you are looking for