PO from SO via DI API:Base document card and target document card do not ..

HI All,
I am trying to create Purchase Order from Sales Order. This is possible by GUI (on Sales Order on logistics tabs Click On Purcase Orders CheckBox.
I got the error message: -5002-Base document card and target document card do not match.
The message itself can be understandable, because the Customer and Supplier has a different CardCode.
I am sure I am using a correct code
oPo.Lines.BaseType = BoObjectTypes.oOrders
oPo.Lines.BaseEntry = sDocEntry
oPo.Lines.BaseLine = iLineNum
Where oPo is a Purchase Order document.
sDocEntry is a Sales Order docentry and iLineNum is a Line number of Sales Order
For other A/R to A/R and A/P to A/P documents are working fine.
Has anybody found this error or has anybody created application like this?
I am using sbo2007PL46
Regards,
J.

Hi guys,
this is still on the suggestion page:
Link existing Purchase Orders to (Sales) Orders via DI API : View Idea
I tryed with 9.1 PL 4 and it didn't work.

Similar Messages

  • Please help! -5002,Base document card and target document card do not match

    Hi
    When I try to save an invoice with a payment thro' the DI API I get the following error :
    <b>-5002,Base document card and target document card do not match</b>
    Why am I getting this error and how can I solce it?
    Thanks

    Hi,
    For the sake of anyone else who has this problem:
    After much searching for the answer to why I was getting this message I found that the internal validation must be case sensitive and so 'C00417' on the receipt was not matching 'c00417' on the invoice.

  • Base document card and target document card do not match

    I ran into this error "Base document card and target document card do not match" while uploading Outgoing Payments too AP Invoices.
    The CardCode of the Invoice matches the CardCode of the Payment so it's not that issue. I can't seem to fix this error.
    Any input would be helpful.
    Here's screenshots too
    OVPM - Payments
    VPM1 - Payments_Checks
    VPM2 - Payments_Invoices

    Hi,
    For the sake of anyone else who has this problem:
    After much searching for the answer to why I was getting this message I found that the internal validation must be case sensitive and so 'C00417' on the receipt was not matching 'c00417' on the invoice.

  • Base Document and Target Document Menu for User Defined Forms

    Hi Experts,
    I am facing a problem regarding enabling the menu "Base Document" Menu UID="5898" and "Target Document" Menu UID="5899" . Both of these menu Items are not enabled for User Defined Form .Actually I have developed a user Defined form for Purchase Requisition that targets Purchase Order . User can Copy Line Items From Purchase Requisition to Purchase Order and I am tracking the DocEntry and LineId of PR into PO Item's using UDS . I want to Open this PR Document upon Click of BaseDocument Menu .I have tried all the options. I have used Form.enableMenu() method also . But none of those options work for this menu . I ahve also searched about this problem i this forum also but there is no soultion so far posted regarding this.
    I really want to confirm whether it is possible or not using SDK for User Defined Forms . Is there any possiblity of implementing any WorkArounds and Having this feature implemented .
    I am Expecting a true solutions as this Forum has so many Experienced Experts .
    Thanks and Regards,
    Pooja Singh.

    Hello Poja,
    It is not possible, because the requested menus are depending on the forms, and the are not exists,
    WorkAround:
    add the menus to the User Defined forms, and use right click to activate them:
    oForm.Menu.Add("5898", "Base Document", BoMenuType.mt_STRING, oForm.Menu.Count)
    oForm.EnableMenu("5898", True)
    And hanle the menu event when you clicked them and the form is your custom form.
    Regards,
    János

  • Broken Link between Base and Target document in 'Copy To' option

    Hi Folks,
    One of our client has been facing a peculiar issue. When the 'Copy To'  function is used to Copy document from Sales Order to Delivery and recently one instance of 'Copy To' from Delivery to A/R Invoice ,the base document got copied to the target document in each case but there was no trace of any Base Ref. left in the Target document( either in row level or Remarks), thereby the link between the Base and Target document got broken.The Base document remains with status as open.The same base document when tried again to 'Copy To', it creates the link between Base and new Target document.
    This instance had occurred recently 3- 4 times in a span of 3 months or so. In normal circumstance this never happens. The client is pretty sure they have used 'Copy To' option to copy the document from Base to Target.
    Any hints or possible reasons if one can highlight would be appreciable.
    The current version used is SAP B1 8.82 PL11 and it was upgraded more than a year back.
    Regards,
    Bharath

    Hi,
    All the data in Sales Order and Delivery are matching one to one in terms of row details,
    and Document header level.
    The missing data was Base Ref. data and Del.Date didn't get copied from base to target as shown in screen shot.
    Also i have checked it earlier regarding change of target document row details like changing item, but this will only remove the link of that particular row and remaining row link remains intact, but in this case there are many items and it doesn't seem user will have changed in all the rows.
    Regards,
    Bharath

  • Question about base and target document

    Dear All,
    Does anyone know which table maintain the relationship between base and target document.
    For instance, user clicks the base document in the form of AR invoice and return the base sales order.
    From Samson

    Hi,
    In each and every document table the base docs and the target docs information is stored.
    Just take a look at the REF DB help file in which u can see the fields and their relations.
    For AR Invoice in the lines table INV1 there are 3 fields BaseRef,BaseType,BaseEntry these fields help u in knowing the base doc details, and for the target doc details the following fileds will help, TargetType,TrgetEntry.
    U can find the reference file at the following location. C:\Program Files\SAP\SAP Business One SDK\Help\REFDB.chm
    Vasu Natari.

  • Linking Base and Target document

    Hello Experts,
                                   How to Link 2 user defined forms as Base and Target document. Like it is done for Sales Order and Sales Invoice.
    Quick Reply will be very helpful
    Please Suggest

    Hello Manish
    Basically it is not possible by default, but you can code the logic behid.
    I am recommend to use linkedbuttons for drill down, and when the linked button is pressed, you can stop the event, and open your user defined form.
    here is a sample code for itemevent. I have a matrix, where i have used linkedbuttons in columns. On Col4 i have my object defined, so when the matrix link pressed i am opening my form.
    Now You can define some Base and Target Document types and keys stored in the database, and you can open your documents by this.
    Please note: Base and Target documents menus (in toolbar) will not work, because you cannot enable/disable them from SDK.
    Case SAPbouiCOM.BoEventTypes.et_MATRIX_LINK_PRESSED
                    If (pval.BeforeAction = False) Then
                        oMatrix = otmpform.Items.Item("3").Specific
                        oMatrix.GetLineData(pval.Row)
                        Select Case pval.ColUID
                            Case "COL4"
                                sCode = otmpform.DataSources.UserDataSources.Item("COL4").Value
                                Call StoragePlacesEX.CreateoStoragePlaceForm(otmpform)
                                Call StoragePlacesEX.GetData(otmpform, sCode)
                        End Select
                    End If
    Regards
    J

  • From which tables i would find the delivery and billing document field..??

    I need to create an ALV report which displays the following details in the output.
    Order No  Item No     Material     Order Qty     Item Category     Plant     Delivery     Billing Document     Sales Org     Dist Channel     Division     Created By     Created On      Changed On
    For(Order No  Item No     Material     Order Qty     Item Category     Plant) i took the fields from vbap and
    for(Sales Org     Dist Channel     Division     Created By     Created On      Changed On)i took the fields from vbak..
    From which tables i would find the delivery and billing document field related to sales document.??
    need help...
    Moderator message : Requirements dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Mar 6, 2012 2:53 PM

    i am new to abap...so i dont have idea about sd table relationship.
    so please reply how to add delivery and billing doc in my coding below..
    *& Report  ZINAA_SD
    REPORT  zinaa_sd.
    TABLES: vbap, vbak, vbfa.
    TYPE-POOLS: slis.
    CONSTANTS: c_x TYPE char1 VALUE 'X'.
    TYPES:
            BEGIN OF st_vbap,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
            END OF st_vbap,
            BEGIN OF st_vbak,
              vbeln TYPE vbak-vbeln,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              vkorg TYPE vbak-vkorg,
              vtweg TYPE vbak-vtweg,
              spart TYPE vbak-spart,
              aedat TYPE vbak-aedat,
            END OF st_vbak, 
           BEGIN OF st_final,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
             erdat TYPE vbak-erdat,
             ernam TYPE vbak-ernam,
             vkorg TYPE vbak-vkorg,
             vtweg TYPE vbak-vtweg,
             spart TYPE vbak-spart,
             aedat TYPE vbak-aedat,
           END OF st_final.
    DATA:
          lt_vbap TYPE TABLE OF st_vbap,
          ls_vbap TYPE st_vbap,
          lt_vbak TYPE TABLE OF st_vbak,
          ls_vbak TYPE st_vbak,
          lt_final TYPE TABLE OF st_final,
          ls_final TYPE st_final,
          lt_fieldcat TYPE slis_t_fieldcat_alv,
          ls_fieldcat TYPE slis_fieldcat_alv,
          layout TYPE slis_layout_alv,
          lt_sort TYPE slis_t_sortinfo_alv,
          ls_sort TYPE slis_sortinfo_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbap-vbeln,
                    s_erdat FOR vbap-erdat.
    SELECTION-SCREEN END OF BLOCK b1.
    PERFORM select_data.
    PERFORM loop_final.
    PERFORM sort.
    PERFORM a USING:
          'VBELN' TEXT-002,
          'POSNR' TEXT-003,
          'MATNR' TEXT-004,
          'KWMENG' TEXT-005,
          'PSTYV' TEXT-006,
          'WERKS' TEXT-007,
          'VKORG' TEXT-008,
          'VTWEG' TEXT-009,
          'SPART' TEXT-010,
          'ERNAM' TEXT-011,
          'ERDAT' TEXT-012,
          'AEDAT' TEXT-013.
    PERFORM display.
    *&      Form  SELECT_DATA
          text
    FORM select_data.
      SELECT
       vbeln
       vkorg
       vtweg
       spart
       ernam
       erdat
       aedat
       INTO CORRESPONDING FIELDS OF TABLE lt_vbak
       FROM vbak
       WHERE vbeln IN s_vbeln AND erdat IN s_erdat.
      IF sy-subrc = 0.
        SORT lt_vbak by vbeln.
      ENDIF.
      SELECT
       vbeln
       posnr
       matnr
       kwmeng
       pstyv
       werks
       INTO CORRESPONDING FIELDS OF TABLE lt_vbap
       FROM vbap
       FOR ALL ENTRIES IN lt_vbak
       WHERE vbeln = lt_vbak-vbeln.
      IF sy-subrc = 0.
        SORT lt_vbap by vbeln.
      ENDIF.
    ENDFORM.                    "SELECT_DATA
    *&      Form  LOOP_FINAL
          text
    FORM loop_final.
      LOOP AT lt_vbap INTO ls_vbap.
        ls_final-vbeln = ls_vbap-vbeln.
        ls_final-posnr = ls_vbap-posnr.
        ls_final-matnr = ls_vbap-matnr.
        ls_final-kwmeng = ls_vbap-kwmeng.
        ls_final-pstyv = ls_vbap-pstyv.
        ls_final-werks = ls_vbap-werks.
        READ TABLE lt_vbak INTO ls_vbak WITH KEY vbeln = ls_vbap-vbeln BINARY SEARCH.
        ls_final-vkorg = ls_vbak-vkorg.
        ls_final-vtweg = ls_vbak-vtweg.
        ls_final-spart = ls_vbak-spart.
        ls_final-ernam = ls_vbak-ernam.
        ls_final-erdat = ls_vbak-erdat.
        ls_final-aedat = ls_vbak-aedat.
        APPEND ls_final TO lt_final.
        CLEAR ls_final.
      ENDLOOP.
      ENDFORM.                    "LOOP_FINAL
    *&      Form  SORT
          text
    FORM sort.
      ls_sort-spos = '01' .
      ls_sort-fieldname = 'VBELN'.
      ls_sort-tabname = 'LT_FINAL'.
      ls_sort-up = c_x.
      ls_sort-subtot = c_x.
      APPEND ls_sort TO lt_sort .
    ENDFORM.                    "SORT
    *&      Form  A
          text
         -->FNAME      text
         -->SELTEXT    text
         -->EMPHA      text
    FORM a USING fname TYPE string seltext TYPE string.
      IF fname = 'KWMENG'.
        ls_fieldcat-do_sum =  c_x.
      ENDIF.
      ls_fieldcat-fieldname = fname.
      ls_fieldcat-seltext_m = seltext.
      APPEND ls_fieldcat TO lt_fieldcat.
      CLEAR ls_fieldcat.
    ENDFORM.                    "A
    *&      Form  ALV
          text
    FORM display.
      layout-zebra = c_x.
      layout-colwidth_optimize = c_x.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
        is_layout                         = layout
        it_fieldcat                       = lt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        it_sort                           = lt_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = C_X
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
        t_outtab                          = lt_final
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "ALV

  • Can I enable menu for base document and target document for user forms

    Hello friends
    I want to add Base and target document functionality for our addon
    but when i do this
    oform.EnableMenu("5899", True)   ' 5899 is menu uid for target document
    i got this exception
    Menu - Not found [66000-27]
    Is there another way around
    Thanks in advance ....
    Atul

    Atul try adding this to ur form Xml schema and specify the userdatasrc(bold text) for the form as well..
    <item uid="10000329" type="113" left="475" tab_order="0" width="90" top="481" height="19" visible="1" enabled="0" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                  <AutoManagedAttribute />
                  <specific AffectsFormMode="1" TabOrder="0">
                    <ValidValues>
                      <action type="add">
                        <ValidValue value="A/R Credit Memos" description="14" />
                      </action>
                    </ValidValues>
                    <b><databind databound="1" table="" alias="SYS_312" /></b>
                  </specific>
                </item>
                <item uid="10000330" type="113" left="380" tab_order="0" width="90" top="481" height="19" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                  <AutoManagedAttribute />
                  <specific AffectsFormMode="1" TabOrder="0">
                    <ValidValues>
                      <action type="add">
                        <ValidValue value="Sales Quotations" description="23" />
                        <ValidValue value="Sales Orders" description="17" />
                        <ValidValue value="Deliveries" description="15" />
                      </action>
                    </ValidValues>
                    <b><databind databound="1" table="" alias="SYS_313" /></b>
                  </specific>
                </item>

  • Reconnect base and target document if duplicate marketing document

    How can you reconnect the links between the base and target documents when you duplicate marketing documents? 
    For example,  an error was made during the entry of the GR PO and we performed the Goods Return.  However, when you create a Goods Receipt PO and then a Goods Return, the original PO is now closed.  How can you re-open the original PO or else link a new target document to it?
    Thank you.

    Thats right.  You can create a new business process for Exceptions and exceptions have to handled as a one off situation.
    I would suggest you take measures to minimize the error by putting business rules in place and for these one off situations simply type in the PO / SO number in the remarks.
    Creating all document is a big efforts.
    Suda

  • Activate Base and Target Document menu's

    Hi all,
    i am facing a problem, i have added a new form and know i want want to activate Base Document and Target Document menu's of system for my form but when i am doing
               <b>oForm.EnableMenu("5898",True)</b>
    the system throws an exception that menu not found.
    can any body please tell me that is there any way to enable these menu's for user forms
    Thanks..

    Hi Manu,
    In B1, only when target and base documents arre present for a particular Sales/Purchase document, the menu target doc and base doc menus are enabled. otherwise it will not be enabled. Since this is disabled by the system, when you try to activate the system disabled menu it throws an error.
    Hope this helps.
    Amudha M.

  • Hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    Experiment. No harm in trying.
    If you are just starting to use Pages you need to make your own assessment given current events whether committing your work to a format and software given this support is a wise move.
    You also need to look at what will produce workable results. Particularly if your large posters are to be commercially printed and contain large bitmap (photographic) images.
    Always work backwards from your output. Ask your printer what they require to do their job.
    Peter

  • Material document number and financial document number

    Hai Friends,
    How can i link material document number and financial document number

    Hi,
    I did below for my requirement to get payment document number. It will useful to you
    FORM GET_PAY_DOC .
      data: wa_bkpf TYPE bkpf.
      data: wa_obj_key TYPE bkpf-AWKEY,
            wa_AUGBL TYPE bsak-AUGBL.
    SELECT SINGLE belnr GJAHR from ekbe into (it_table-belnr, it_table-GJAHR)
              where ebeln eq it_table-ebeln AND
                    ebelp eq it_table-ebelp AND
                    BEWTP eq 'Q' AND
                    XBLNR eq it_table-tknum.
    CHECK sy-subrc eq 0.
    CONCATENATE it_table-belnr it_table-GJAHR INTO wa_obj_key.
    SELECT SINGLE bukrs belnr GJAHR from bkpf into CORRESPONDING FIELDS OF wa_bkpf
      where awtyp = 'RMRP' AND
            awkey = wa_obj_key.
      CHECK sy-subrc eq 0.
      SELECT SINGLE AUGBL from bsak into wa_AUGBL
        where bukrs eq wa_bkpf-bukrs AND
              lifnr eq it_table-tdlnr AND
              belnr eq wa_bkpf-belnr AND
              GJAHR eq wa_bkpf-GJAHR.
    CHECK sy-subrc eq 0.
      SELECT SINGLE belnr budat from bsak into (it_table-belnr1, it_table-Budat)
        where bukrs eq wa_bkpf-bukrs AND
              lifnr eq it_table-tdlnr AND
              AUGBL eq wa_AUGBL AND
              GJAHR eq wa_bkpf-GJAHR AND
              blart eq 'KZ' and
              belnr ne wa_bkpf-belnr AND
              SHKZG eq 'S'.
    ENDFORM.                    " GET_PAY_DOC

  • I upgraded from mountain lion to the OS X Mavericks and my EndNote X5 can not open.I re-installed but cannot open. I keep on getting the message "Unable to load EndNote X5: Applications/EndNote X5/EndNote X5.app/Contents/Encore.bundle" can anyone help?

    I upgraded from mountain lion to the OS X Mavericks and my EndNote X5 can not open.I re-installed it but cannot open. I keep on getting the message "Unable to load EndNote X5: Applications/EndNote X5/EndNote X5.app/Contents/Encore.bundle" can anyone help?

    Please take each of the following steps that you haven't already tried. Test after each one. Back up all data before making any changes.
    1. Make sure that the right volume is selected in the Startup Disk preference pane.
    2. Disconnect all wired peripherals except those needed to start up. If there's no change, reconnect them
    3. Reset the System Management Controller.
    4. Reset the PRAM.
    5. Start up in safe mode, then restart as usual. If you can't start in safe mode—for instance, if FileVault is active—then triple-click anywhere in the line below on this page to select it:
    /var/folders
    Right-click or control-click the highlighted line and select
              Services ▹ Reveal
    from the contextual menu. A Finder window should open with an item named "folders" selected. Move the selected item to the Trash. You'll be prompted for your administrator password. Restart and empty the Trash.

  • Relation accounting document number and clearing document number

    Hi everyone,
    What is the relation between accounting document number and clearing document number.

    For every accounting document when it is posted it should be available in BKPF Doc header table.. Once that document is closed or cleared..there is any entry made to BSAK for Vendors (Cleared Items) or BSAD for Customers (Cleared Items).
    Eg: When a invoice is generated for a PO it gets created and is still not cleared or is not closed , it makes an entry in BSIK. Once it is closed it is available in BSAK.
    Same is the case with Sales order..

Maybe you are looking for