How to create a document with SRM BAPIS

10-11  Source: Network gathering  Views:3 

Advertisement
Dear colleagues,
I have a problem with SRM BAPIs. I need to insert a pdf document into a record using SAP BAPIs, This document is already in a table in a binary format
I am trying with these BAPIs:
    1.
          CALL FUNCTION 'BAPI_SRM_DOC_CREATE'
              EXPORTING
                rms_id                  = rms_id
                sps_id                  = sps_id
                documentid              = documentid
                description             = 'DESCRIPTION'
                do_commit               = 'X'
                documentid_check_unique = 'X'
              IMPORTING
                return                  = return
                objectid                = objectid
                documentclass           = documentclass
              TABLES
                required_properties     = required_properties.
          This BAPI is working as expected. It returns objectid for the new document.
     2. Now I'm using BAPI_RECORD_ADDELEMENT:
             ls_doc_id-objectid = objectid.
            CLEAR: ls_sp_poid. " clear weg und ls_sp_poid clearen
            ls_sp_poid-name  = 'DOC_ID'.
            ls_sp_poid-value = ls_doc_id.
            APPEND ls_sp_poid TO lt_sp_poid.
            CLEAR: ls_doc_id.
            ls_sp_poid-name  = 'VARIANT'.
            ls_sp_poid-value = '0'.
            APPEND ls_sp_poid TO lt_sp_poid.
            CLEAR: ls_doc_id.
            ls_sp_poid-name  = 'VERSION'.
            ls_sp_poid-value = '0'.
            APPEND ls_sp_poid TO lt_sp_poid.
            ls_insertion_by_anchor-anchor = 'DECRET'.
            ls_insertion_by_anchor-parent_node_id = '5'.
            ls_insertion_by_anchor-parent_node_attr_name = 'DECRETAT'.
            ls_insertion_by_anchor-parent_node_attr_value = '40'.
          CALL FUNCTION 'BAPI_RECORD_ADDELEMENT'
              EXPORTING
                objectid                    = zrm_attcab_scr-phio_id
                documentclass               = documentclass
                sps_id                      = 'ZRM_SPS_DOCVAR'
                anchor                      = 'DECRETS'
                description                 = 'Descripcion'
                store_as_new_version        = 'X' "Si X se crea vacio
*               STACKED                     = ''
*               DOC_CONTEXT                 =
                element_type                = 'I'
*                 insertion_by_anchor         = ls_insertion_by_anchor
*                insertion_by_modelid        = insertion_by_modelid
*               INSERTION_BY_REFERENCE_NODE =
*              ALL_SAME_NAME_ANCHOR        = 'X'
*               SET_ELEM_DESCR_HARD         = ' '
*                omit_authority_check        = 'X'
              IMPORTING
                return                      = ls_return
              TABLES
                element_sp_poid             = lt_sp_poid.
*             ELEMENT_PROPERTIES                =
*             ELEMENT_VISIBILITY                =
         This BAPI returns an internal error
Am I following the correct steps or am I skipping anything?
Could anyone help me?
Thanks in advance!!
I have the same problem!!!
Anyone knows?
Thanks!
Related articles
  • How to create a document with SRM BAPIS 10-11

    Dear colleagues, I have a problem with SRM BAPIs. I need to insert a pdf document into a record using SAP BAPIs, This document is already in a table in a binary format I am trying with these BAPIs:     1.           CALL FUNCTION 'BAPI_SRM_DOC_CREATE'

  • How to create shipment document with out inbound delivery document 10-11

    Dear Friends How to create shipment document with out outbound/inbound delivery document. In my client scenario, there is no inbound delivery for normal purchases. Just there are raising the PO to vendor, then they are doing MIGO for goods receipt. C

  • How to create an uwl with a BAPI 10-11

    Hi Experts!!! I need someone that say me, how to create a task in the uwl with a bapi or program. Thanks in advanced, Regards,Hi Carlos, Do you have the javadocs?  It contains information in regards to the UWL API. http://help.sap.com/javadocs/NW04S/

  • How to creat a document with a file 10-11

    i'm coding a texteditor-like programme. I did use a Jtable instead of a JtextComponent's subclass to display & edit text. however, i want to realize some function just like a texteditor such as undo & redo. Shoud i must creat a document to realize

  • How to creat pdf documents with printing restrictions in Aperture 11-30

    Hi, I wondered if it is possible to create a pdf document made up of 9-12 image per page contact sheets, to send to clients that restricts the client to open and view only i.e no printing allowed. Photoshop allows this, however i would like to create

  • How to create a document with sections that differ in margin and layout 10-11

    I'm trying to add a pages document 'B' into my new pages document 'A'. A and B have two entirely different layouts and different document margins. So whenever i copy B into A, B's margins become A's margins and thus B's layout turns into a mess. I tr

  • How to create matreial document for ten line items (10 documents) by BAPI 11-30

    Hi how to create matreial document for ten line items (10 documents) by BAPI_goodsmvt_create i created but it gives error as "no ites were transferre and i need code also. thanks in advancePrabhu Peram wrote:> > > Gareth @ Atos Origin UK wro

  • How to create a complaint with pre-decessor document Inovice? 10-11

    Hello experts, I need create a complaint with reference to a pre-decessor document type Invoice (apart from other types such as sales order and service order). Can someone enlighten me 1) how to create an invoice in IC Web Client and backend? 2) how

  • Help! How do I create a document with an imported PDF in 300dpi using a FOGRA27 colour profile? 10-11

    I am a new Indesign user and I have been working with GIMP for the last year creating single colour print-ready PDFs. But now I need to create a document with a FOGRA27 CMYK colour profile and a resolution of at least How do I create a document with

  • Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST. 11-30

    Hi Guys, I am Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST.First I am post financial document with BAPI BAPI_ACC_DOCUMENT_POST and Same Document. i am Reversal  with same BAPI 'BAPI_ACC_DOCUMENT_POST'. New reversal docment is created. b

  • CREATE SD document with characteristics - BAPICUVAL / E1CUVAL problem 11-30

    Hello there, I am trying to create SD document with material characteristic. I can create single value characteristic, but when I am trying to post interval characteristic, just lower interval is saved and upper one is ignored. I use BAPI_SALESORDER_

  • How to create a document folder using ListData.svc 10-11

    Hi All, I've recently been put on a project where I need to use the REST services (ListData.svc) to retrieve and add documents to the document library. It all has been smooth sailing until I hit the point where I want to save a document in a path tha

  • How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)? 10-11

    Hi, The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:- http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-mo

  • Intercompany stock transfer: IV billing documents creates FI document with 10-11

    Hi, Intercompany stock transfer: IV billing documents creates FI document with wrong vendor. How can I make sure that the correct vendor is posted in the selling company code? Best regards, Eric.Hi Jürgen, I also tried this option but then the follow

  • How to create the sales order using BAPI's ....? 10-11

    Hi Guru's, could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:) th

  • Create custom document with wrong size 10-11

    Hi, I have a problem (on Sun Solaris 5.8) when I create custom document with more than 10MB size. I've created an agent which detects the events on a custom data type MYDOCUMENT (extension .mydoc). When I put a new document test1.mydoc (size of 10MB

  • How to create FI Document in Idoc..... 11-30

    Hi Abapers, I hve small doubt that how to create FI Document in Idoc.....?????s I was new to the Idoc creation ....... can u give me step by step process.............. Thanks & Regard Ravi SarmaHi Rahul, As per my understanding you are loking for cre

  • How to create pdf files with text field data 11-30

    how to create pdf files with text field dataThat looks like it should work, but it doesn't. I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict edit

  • How to create a node with attributes at runtime in webdynpro for ABAP? 10-11

    Hi Experts,          How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code. I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But t

  • How to create excise invoice with reference thorugh credit memo 10-11

    Hi All, Please provide any solution for the following qurey: How to create excise invoice with reference thorugh credit memoHi murali, i am unable to understand your requirement i think there is no like this scenario requirement for any client if any