UPADATE PARTNER IN BAPI SALESORDER

Hi All,
I have a doubt on BAPI SALESORDER Partner change..
As per my requirement I need to change sold to party or ship  to party for header level and item level(i.e bill to party and payer and etc).
BAPI_SALESORDER_CHANGE Used this BAPI. But Iam unable to get the result.I have read some blogs also.
Thank you
Mithuunn

Couple of things:
<u>First</u>
Message V1-383 says 'Enter a material or an item category'.
I don't know how you linked this message as related to partners.
<u>Second</u>
When you used 'BAPISDORDER_GETDETAILEDLIST', did you get the ORDER_PARTNERS_OUT records with partner function value in internal format or external format? Check your entries in ORDER_PARTNERS_OUT in debugging and see if the partner function is in internal format or external format. If it is in external format, then you need use 'SH' instead of 'WE' in your read statement.
<u>Third</u>
When you create one SD document referencing another SD document, what gets copied from source to destination document is controlled by copy control config. Are you sure your copy control allows copying all the partner functions? May be it just copies the AG(sold-to) and leaves the others to be entered.
Please post the relevant code.
Srinivas

Similar Messages

  • Partner Roles for Ship-To/Bill-To in BAPI SalesOrder

    Hi,
    I am currently developing a .NET web application that is using BO SalesOrder (e.g. BAPI Bapi_Salesorder_Simulate).
    My problem is that I need to list all defined partner roles of a customer (debitor) to give an appropriate selection for the BAPIPARTNR as a SalesOrder parameter
    e.g. (specify a Ship-To Address)
    [BAPIPARTNR].Partn_Role = "WE"
    [BAPIPARTNR].Partn_Numb = "<SAPCustomerNr>"
    In the web application I want to list all pre-definied partner roles for "WE" of the given customer to be able to set it as "<SAPCustomerNr>" in the BAPI parameter.
    This seemed like a standard requirement to me, but I could not find any BAPIs/RFCs to realize this. Does anybody have a suggestion ?
    Thanks for a short reply,
    Andreas Koschinsky

    Hi again Andreas,
    I get the hint, I have included the source together with the corrections you would need to make to get it working in your system (no warranty calls please!).
    FUNCTION CUSTOMER_PARTNERFS_GET.
    *"*"Local interface:
    *"       IMPORTING
    *"             VALUE(IV_KUNNR) LIKE  KNA1-KUNNR
    *"             VALUE(IV_VKORG) LIKE  E1KNVVM-VKORG
    *"             VALUE(IV_VTWEG) LIKE  E1KNVVM-VTWEG
    *"             VALUE(IV_SPART) LIKE  E1KNVVM-SPART
    *"       TABLES
    *"              ET_E1KNVPM STRUCTURE  E1KNVPM
      DATA  LV_ACCOUNT_GROUP               LIKE KNA1-KTOKD.
      DATA  LS_E1KNVPM                     LIKE E1KNVPM.
      DATA  LT_E1KNVPM                     LIKE E1KNVPM OCCURS 0.
      DATA  LT_KNVP                        LIKE KNVP OCCURS 0.
      DATA  LS_KNVP                        LIKE KNVP.
    >>> BW Omit this section <<<
    *     Get account group of the current customer
      SELECT SINGLE KTOKD FROM KNA1 INTO LV_ACCOUNT_GROUP
                          WHERE KUNNR = IV_KUNNR.
      IF SY-SUBRC NE 0.
    *     The customer is new so prepare to create roles.
        PERFORM CUSTOMER_CREATE_R3FUNCTIONS TABLES LT_E1KNVPM
                                            USING  IV_KUNNR
                                                   LV_ACCOUNT_GROUP.
      ELSE.
    >>> Up to here <<<
    *     The customer exists and has an account group.
    *     so read the knvp to get all available functions.
        SELECT * FROM KNVP INTO TABLE LT_KNVP
                           WHERE KUNNR = IV_KUNNR
                             AND VKORG = IV_VKORG
                             AND VTWEG = IV_VTWEG
                             AND SPART = IV_SPART.
        IF SY-SUBRC = 0.
    *     data available so read them
          LOOP AT LT_KNVP INTO LS_KNVP.
            MOVE-CORRESPONDING LS_KNVP TO LS_E1KNVPM.
            PERFORM PARTNER_NUMBER_EXTRACT(SAPLVV01) USING LS_KNVP
            CHANGING LS_E1KNVPM-KUNN2 .
            APPEND LS_E1KNVPM TO LT_E1KNVPM.
            CLEAR LS_KNVP.
          ENDLOOP.
    >>> BW Omit this section <<<
        ELSE.
    *      create new roles according to the delivered salesarea
          PERFORM CUSTOMER_CREATE_R3FUNCTIONS TABLES LT_E1KNVPM
                                              USING  IV_KUNNR
                                                     LV_ACCOUNT_GROUP.
        ENDIF.
    >>> Up to here <<<   <<< - moved this line in change
      ENDIF.
      ET_E1KNVPM[] = LT_E1KNVPM[].
    ENDFUNCTION.
    That should get you going.
    Cheers,
    Brad
    Oops! Just made a small change to ensure that the if statement was correctly closed.
    Message was edited by: Brad Williams

  • Bapi-salesorder creation error in  creating document

    hai friends..
      iam doing creation of sales order using bapi .-structures..
      but error in creating doucment ....
    can u send me some example .. abt sales order .creation ..
    once u check my code ...
    DATA: BEGIN OF HEADER OCCURS 0,
           VBELN LIKE BAPIVBELN-VBELN,
           AUART LIKE VBAK-AUART,
           VKORG LIKE VBAK-VKORG,
           VTWEG LIKE VBAK-VTWEG ,
           SPART LIKE VBAK-SPART,
           VKBUR LIKE VBAK-VKBUR,
           KUNNR LIKE BAPIPARNR-PARTN_NUMB ,"vbak-kunnr,
        END OF HEADER.
    DATA: BEGIN OF ITEM OCCURS 0,
           VBELN LIKE BAPIVBELN-VBELN,
           POSNR LIKE BAPISDITM-ITM_NUMBER ,"vbap-posnr,
           MATNR LIKE VBAP-MATNR,
          NETWR LIKE VBAP-NETWR,
           KWMENGE LIKE VBAP-KWMENG,
          WERKS LIKE VBAP-WERKS,
          NETPR LIKE VBAP-NETPR,
       END OF ITEM.
    DATA:  ORDER_HEADER_IN LIKE BAPISDHD1,
           ORDER_HEADER_INX LIKE BAPISDHD1X.
    DATA: ITAB_HEAD likE order_header_in,
          ITAB_HEADX likE ORDER_HEADER_INX.
    DATA: ITAB_ITEM  TYPE STANDARD TABLE OF  BAPISDITM WITH HEADER LINE,
          ITAB_ITEMX TYPE STANDARD TABLE OF  BAPISDITMX WITH HEADER LINE.
    DATA: KUST TYPE STANDARD TABLE OF  BAPIPARNR WITH HEADER LINE,
           RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: VNO  LIKE BAPIVBELN-VBELN,
          VCNT LIKE VBAP-POSNR.
    LOOP AT HEADER.
        VCNT = 10.
        CLEAR ITAB_HEAD.
       ORDER_HEADER_IN-REFOBJTYPE = 'OR'.
       ORDER_HEADER_IN-REFOBJKEY = 'OR'.
       ORDER_HEADER_IN-REFDOCTYPE = 'OR'.
       ORDER_HEADER_IN-DOC_TYPE = HEADER-AUART.
        ITAB_HEAD-DOC_TYPE = HEADER-AUART.
        ITAB_HEAD-SALES_ORG = HEADER-VKORG.
        ITAB_HEAD-DISTR_CHAN = HEADER-VTWEG.
        ITAB_HEAD-DIVISION = HEADER-SPART.
        ITAB_HEAD-SALES_OFF = HEADER-VKBUR.
        KUST-PARTN_NUMB = HEADER-KUNNR.
         ITAB_HEADX-DOC_TYPE = 'X'.
         ITAB_HEADX-SALES_ORG = 'X'.
        ITAB_HEADX-DISTR_CHAN = 'X'.
        ITAB_HEADX-DIVISION = 'X'.
        ITAB_HEADX-SALES_OFF = 'X'.
        LOOP AT ITEM WHERE VBELN = HEADER-VBELN.
          REFRESH RETURN.
          ITAB_ITEM-ITM_NUMBER = VCNT.
          ITAB_ITEM-MATERIAL = ITEM-MATNR.
          ITAB_ITEM-NET_WEIGHT = ITEM-KWMENGE.
          APPEND ITAB_ITEM.
          ITAB_ITEMX-ITM_NUMBER = VCNT.
          ITAB_ITEMX-MATERIAL = 'X'.
          ITAB_ITEMX-NET_WEIGHT = 'X'.
          APPEND ITAB_ITEMX.
          VCNT  = VCNT + 10 .
        ENDLOOP.
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
          EXPORTING
        SALESDOCUMENTIN               = SALESORDER
            ORDER_HEADER_IN              = ITAB_HEAD
         ORDER_HEADER_INX              = ITAB_HEADX
        SENDER                        =
        BINARY_RELATIONSHIPTYPE       =
        INT_NUMBER_ASSIGNMENT         =
        BEHAVE_WHEN_ERROR             =
        LOGIC_SWITCH                  =
        TESTRUN                       =
        CONVERT                       = ' '
         IMPORTING
           SALESDOCUMENT                 = VNO
          TABLES
           RETURN                        = RETURN
           ORDER_ITEMS_IN                = ITAB_ITEM
           ORDER_ITEMS_INX               = ITAB_ITEMX
            ORDER_PARTNERS                = KUST.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              WAIT          = 'X'.
             IMPORTING
               RETURN        = RETURN.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
    EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
    WRITE: / 'Error in creating document'.
    ELSE.
    COMMIT WORK AND WAIT.
    ENDIF.
        WRITE: / '   Sales Order NO  IS: ', VNO.
        WRITE: / SPACE.
        CLEAR VNO.
        WRITE SY-ULINE.
      ENDLOOP.
    my HEader  is    123    OR  1000 30 10 SATYA.
    ITem  2  IS     123   10  HAI   15
    once u check it ......

    Hi Satya,
    just check this
    REPORT  Z_STANDARD_SALES_ORDER no standard page heading.
    DATA DECLARATION
    CONSTANTS : C_X VALUE 'X'.
    Structures to hold Sales order header data
    DATA : HEADER LIKE BAPISDHD1," OCCURS 0 WITH HEADER LINE,
           HEADERX LIKE BAPISDHD1X." OCCURS 0 WITH HEADER LINE.
    Internal Tables to hold Sales order ITEM DATA
    DATA : ITEM LIKE BAPISDITM OCCURS 0 WITH HEADER LINE,
           ITEMX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE.
    Internal Tables to hold Partners ITEM DATA
    DATA : PART LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE.
    Internal Tables to hold Partners SCHEDULE DATA
    DATA: SCHEDULE LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE,
          SCHEDULEX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE.
    Internal table to hold messages from BAPI call
    DATA: RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA  W_MSG(150).
    *DATA: begin of wa_MESSAGE,
         message(150),
         end of wa_message.
    *DATA: itab_msg like table of wa_message with header line.
    Data: Begin of Record occurs 0,
          Control type i,
          DOC_TYPE like HEADER-DOC_TYPE,
          SALES_ORG like HEADER-SALES_ORG,
          DISTR_CHAN like HEADER-SALES_ORG,
          DIVISION like HEADER-DIVISION,
          PURCH_NO_C like HEADER-PURCH_NO_C,
          PARTN_NUMB like PART-PARTN_NUMB ,
          PARTN_ROLE like PART-PARTN_ROLE ,
          ITM_NUMBER like ITEM-ITM_NUMBER,
          MATERIAL like ITEM-MATERIAL,
         TARGET_QTY like item-TARGET_QTY,
          REQ_QTY LIKE BAPISCHDL-REQ_QTY,
          TARGET_QU like item-TARGET_QU,
          PLANT like ITEM-PLANT,
          PMNTTRMS like header-PMNTTRMS,
          End of record.
    data: itab like ALSMEX_TABLINE occurs 0,
          wa like ALSMEX_TABLINE.
    data: SO like BAPIVBELN-VBELN.
    Selection Screen
    selection-screen begin of block b1 with frame title text-001.
    PARAMETERS: P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
    selection-screen end of block b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      PERFORM GET_FILE USING P_FILE.
    Start of Selection
    start-of-selection.
      DATA: xl type string.
      xl = '*.xls'.
      IF not P_FILE CP xl.
        Message 'Wrong input file format' type 'E'.
      ENDIF.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME                      = P_FILE
          I_BEGIN_COL                   = 1
          I_BEGIN_ROW                   = 1
          I_END_COL                     = 13
          I_END_ROW                     = 3000
        TABLES
          INTERN                        = itab
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    DATA POPULATION
      loop at itab into wa.
        if wa-col = '0001'.
          record-Control = wa-value.
        elseif wa-col = '0002'.
          record-DOC_TYPE = wa-value.
        elseif wa-col = '0003'.
          record-SALES_ORG = wa-value.
        elseif wa-col = '0004'.
          record-DISTR_CHAN = wa-value.
        elseif wa-col = '0005'.
          record-DIVISION = wa-value.
        elseif wa-col = '0006'.
          record-PURCH_NO_C = wa-value.
        elseif wa-col = '0007'.
          record-PARTN_NUMB = wa-value.
        elseif wa-col = '0008'.
          record-PARTN_ROLE = wa-value.
        elseif wa-col = '0009'.
          record-PMNTTRMS = wa-value.
        elseif wa-col = '0010'.
          record-ITM_NUMBER = wa-value.
        elseif wa-col = '0011'.
          record-MATERIAL = wa-value.
        elseif wa-col = '0012'.
          record-REQ_QTY = wa-value.
        elseif wa-col = '0013'.
          record-TARGET_QU = wa-value.
        elseif wa-col = '0014'.
          record-PLANT = wa-value.
        endif.
        AT END OF row.
          APPEND record.
          CLEAR: wa, record.
        ENDAT.
      endloop.
      DATA: tot_lines type i,
            tot_po type i,
            index type i.
      describe table record lines tot_lines.
      read table record index tot_lines.
      tot_po = record-control.
      DO tot_po times.
        index = index + 1.
        clear: HEADER,HEADERX,ITEM[],ITEMX[],RETURN,RETURN[],SCHEDULE[],SCHEDULEX[], PART[],PART.
        refresh: ITEM[],ITEMX[],RETURN[],SCHEDULE[],SCHEDULEX[],PART[] .
    POPULATE HEADER FLAG.
        HEADERX-UPDATEFLAG = c_x.
        HEADERX-doc_type = c_x.
        HEADERX-SALES_ORG = c_x.
        HEADERX-DISTR_CHAN = c_x.
        HEADERX-DIVISION = c_x.
        HEADERX-PURCH_NO_C = c_X.
        HEADERX-PMNTTRMS = c_X.
        loop at record where control = index.
    POPULATE HEADER DATA FOR PO
          HEADER-DOC_TYPE = record-DOC_TYPE.
          HEADER-SALES_ORG = record-SALES_ORG.
          HEADER-DISTR_CHAN = record-DISTR_CHAN.
          HEADER-DIVISION = record-DIVISION.
          HEADER-PURCH_NO_C = record-PURCH_NO_C.
          HEADER-PMNTTRMS = record-PMNTTRMS.
    *POPULATE ITEM DATA.
          ITEM-ITM_NUMBER = record-ITM_NUMBER.
          ITEM-MATERIAL = record-material.
         ITEM-TARGET_QTY = record-TARGET_QTY.
          ITEM-TARGET_QU = record-TARGET_QU.
          ITEM-PLANT  = record-PLANT .
          APPEND ITEM.
    *POPULATE ITEM FLAG TABLE
          ITEMX-ITM_NUMBER = record-ITM_NUMBER.
          ITEMX-UPDATEFLAG = C_X.
         ITEMX-TARGET_QTY = C_X.
          ITEMX-PLANT = C_X .
          ITEMX-MATERIAL = C_X .
          ITEMX-TARGET_QU = C_X .
          APPEND ITEMX.
    *POPULATE SCHEDULE  TABLE
          SCHEDULE-ITM_NUMBER = RECORD-ITM_NUMBER.
          SCHEDULE-REQ_QTY = RECORD-REQ_QTY.
          APPEND SCHEDULE.
    *POPULATE SCHEDULE  TABLE
          SCHEDULEX-ITM_NUMBER = RECORD-ITM_NUMBER.
          SCHEDULEX-REQ_QTY = C_X.
          APPEND SCHEDULEX.
        endloop.
    *POPULATE PARTNER  TABLE
        PART-PARTN_NUMB = record-PARTN_NUMB.
        PART-PARTN_ROLE = record-PARTN_ROLE.
        APPEND PART.
    *BAPI CALL
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
              EXPORTING
               ORDER_HEADER_IN               = HEADER
               ORDER_HEADER_INX              = HEADERX
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
              IMPORTING
               SALESDOCUMENT                 = SO
              TABLES
               RETURN                        = RETURN
               ORDER_ITEMS_IN                = ITEM
               ORDER_ITEMS_INX               = ITEMX
               ORDER_PARTNERS                = PART
               ORDER_SCHEDULES_IN            = SCHEDULE
               ORDER_SCHEDULES_INX           = SCHEDULEX
      ORDER_CONDITIONS_IN           =
      ORDER_CONDITIONS_INX          =
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
      ORDER_TEXT                    =
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
        loop at return where type = 'E' and ID NE 'MEPO' and ID NE 'BAPI'.
          WRITE:/ Return-message.
        endloop.
    *Confirm the document creation by calling database COMMIT
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT = 'X'.
    *Messages
        loop at return where type = 'S' and number ne '233'.
         WRITE:/ Return-message.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              ID        = return-ID
              LANG      = SY-LANGU
              NO        = return-NUMBER
            IMPORTING
              MSG       = W_MSG
            EXCEPTIONS
              NOT_FOUND = 1
              OTHERS    = 2.
          WRITE W_MSG.
         itab_msg-message = w_msg.
         append itab_msg.
          clear: W_MSG.
        ENDLOOP.
      enddo.
         -->P_W_FILE  text
    FORM GET_FILE  USING    P_W_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = P_W_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 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.     "GET_FILE
    Regards,
    Sachin

  • Issue while changing activity partner in BAPI BAPI_ACTIVITYCRM_CHANGEMULTI

    Hi,
    I'm trying to change 'Activity Partner' for an activity using BAPI BAPI_ACTIVITYCRM_CHANGEMULTI. But the function module is giving me an error 'Document could not be saved.'. I'm already calling BAPI_ACTIVITYCRM_SAVE BAPI_TRANSACTION_COMMIT after the main BAPI.
    Can someone help me? Any help would be highly appreciated.
    Here are the parameters I'm filling for the above BAPIs.
    BAPI_ACTIVITYCRM_CHANGEMULTI
        lt_header-guid         = t_tgtact-act_guid.
        lt_header-object_id    = t_tgtact-act_no_crm.
        lt_header-mode         = 'B'. "Change
        lt_headerx-guid         = c_x.
        lt_headerx-object_id    = c_x.
        lt_header-mode          = c_x.
        lt_partner-ref_guid           = <original BP guid>
        lt_partner-ref_kind           = 'A'.
        lt_partner-ref_partner_handle = '0001'.
        lt_partner-ref_partner_fct    = '00000009'. "Act part
        lt_partner-partner_fct  = '00000009'. "Act part
        lt_partner-partner_no   = <new BP no>.
        lt_partner-no_type      = 'BP'."bus. partner no
        lt_partner-display_type = 'BP'."bus. partner no
        lt_partnerx-ref_guid           = c_x.
        lt_partnerx-ref_kind           = c_x.
        lt_partnerx-ref_partner_handle = c_x.
        lt_partnerx-ref_partner_fct    = c_x.
        lt_partnerx-partner_fct  = c_x.
        lt_partnerx-partner_no   = c_x.
        lt_partnerx-no_type      = c_x.
        lt_partnerx-display_type = c_x.
    BAPI_ACTIVITYCRM_SAVE
        lt_objtosave-guid        = <act_guid>
        lt_objtosave-OBJECT_TYPE = 'BUS2000126'.

    Hi Vivek,
    Thanks for the reply. I have made the changes. Could you please see the code below? I believe that the parter and partnerx table will only have one entry each.
    Please let me know if I'm doing something wrong here. Thanks!
    Header -
        lt_header-guid         = t_tgtact-act_guid.
        lt_header-handle       = '0001'.
        lt_header-mode         = 'B'. "Change
        lt_headerx-guid         = c_x.
        lt_headerx-handle       = c_x.
        lt_headerx-mode         = c_x.
    Reference -------------------------------*
        lt_partner-ref_guid           = t_tgtact-act_guid.
        lt_partner-ref_kind           = 'B'.
        lt_partner-ref_handle         = lt_header-handle.
        lt_partnerx-ref_guid           = c_x.
        lt_partnerx-ref_kind           = c_x.
        lt_partnerx-ref_handle         = c_x.
    Reference Partner ---------------------------*
        lt_partner-ref_partner_handle = '0002'.
        lt_partner-ref_partner_fct    = c_parfn_actbp.
        lt_partner-ref_partner_no     = t_tgtact-bpno.
        lt_partner-ref_no_type        = 'BP'.
        lt_partner-ref_display_type   = 'BP'.
        lt_partnerx-ref_partner_handle = c_x.
        lt_partnerx-ref_partner_fct    = c_x.
        lt_partnerx-ref_partner_no     = c_x.
        lt_partnerx-ref_no_type        = c_x.
        lt_partnerx-ref_display_type   = c_x.
    New Partner ---------------------------*
        lt_partner-partner_fct  = c_parfn_actbp.
        lt_partner-partner_no   = t_tgtact-tgt_bpno.
        lt_partner-no_type      = 'BP'.
        lt_partner-display_type = 'BP'.
        lt_partnerx-partner_fct  = c_x.
        lt_partnerx-partner_no   = c_x.
        lt_partnerx-no_type      = c_x.
        lt_partnerx-display_type = c_x.
    Object to Save -
        lt_objtosave-guid        = t_tgtact-act_guid.
        lt_objtosave-object_type = 'BUS2000126'.
        append: lt_header,  lt_headerx.
        append: lt_partner, lt_partnerx.
        append: lt_objtosave.

  • Problem with creating business partner via BAPI

    Hello! I have a simple File-RFC-File scenario:
    XML-file with Firstname, Lastname and PartnerCategory. I use BAPI_BUPA_CREATE_FROM_DATA to create a partner with this data.
    It works, in target file I have a number of new business partner, but I can't find new partner in the system. Like I only tested BAPI_BUPA_CREATE_FROM_DATA in "bapi" transaction without real effect.

    Hi,
    probably you didn't comit the BAPI
    RFC adapter allows to specify comit for BAPI
    add this to your RFC channel configuration and you will see the partner
    for more info read section:
    Commit Control for Single BAPI Calls
    from
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/content.htm
    Regards,
    Michal Krawczyk

  • How to determine category of business partner with BAPI?

    Hello guys,
    I want to read the partnercategory from a businesspartner using JCo to access the BAPI. I tried to use BAPI_BUPA_CENTRAL_GETDETAIL, but I cannot find a category field in the export parameters/tables. (Like the partnercategory field in the BAPI_BUPA_CREATE_FROM_DATA for example).
    How do I determine the category of a business partner (person, organization, group) ?
    Thanks

    In BUPA_CENTRAL_GET_DETAIL the exporting parameter Ev_CATEGORY holds the value.
    Its a remote enabled fm.

  • BAPI salesorder - VAT registration number

    Hi,
      for creating sales orders I use BAPI_SALESORDER_CREATEFROMDAT2 because of EXTENSIONIN.
      But I need to get VAT registration number into VBPA-STCEG by using some bapi.
      Can you suggest me something to do it ?
      Thanx.

    I don't understand yout question
    I found out bapi_salesorder_createfromdat1 uses an other structure for partner (BAPIPARTNR) like bapi_salesorder_createfromdat2 and in this structure is a field I need (VAT_REG_NO).
      But I must use bapi...dat2 because of extensionin.

  • Create Employee as a Business partner using BAPI

    Hi,
        I created a business partner using the BAPI,
    "BAPI_BUP_CREATE_FROM_DATA". I used this within a program. The business partner gets successfully created and gets reflected in the table BUT000. But I do not see it when I run the user exit "RPM_EMPDATA".Because of this I am not able to see the business partner inside cProjects. I am able to see the business partner inside the transaction BP. When I go into change mode and change the role (from Business partner role to Resource role),and when I save this business partner  I am able to see the details in the user exit RPM_EMPDATA. I am also able to assign this business partner to tasks in cProjects.
    Message was edited by:
            Sudheendra Puthuraya

    Hi sanjay,
    Thanks for ur reply.
    i just referred all the documents that you have mentioned in the previous suggestion.
    [ID 1400877.1] - This one doesnt help me and i have rehired the employee and checked but still facing the same issue in the supplier interface.
    [ID 433746.1] - This one refers to the creation supplier through forms and i have checked the same which has been mentioned in the document. Everything is fine which the front end creation too.
    But am still facing the same issue.
    Kindly suggest me the if the issue can be solved in someother ways.
    Thanks in Advance.
    Brgds
    Max

  • CUSTOMER PARTNER INTERCHANGE, BAPI, FUNCTION MODULE or LSMW ??

    Hi Guys,
    I have a requirement to replace a partner with a new partner for a customer.
    Input for the same requirement is, below mentioned data in the format of a file.
    1. Customer No.
    2. Sales Organisation.
    3. Division.
    4. Distribution Channel.
    5. Partner Function to be deleted.
    6. Partner Number to be deleted.
    7. Partner Function to be added.
    8. Partner Number to be added.
    If anyone can suggest anything, Please let me know which one will be best to do this. BAPI, Function Module or LSMW.
    Let me know ASAP.
    Regards,
    Mayank.

    use bdc to tcode vap2
    A.

  • Contact partner in bapi BAPI_SALESORDER_CREATEFROMDAT2

    Hi abapers:
    I have a problem when creating sales orders with a contact as a partner.
    Filling the internal table of Partners, I assign CP (Contact) and Contact number which is comming from table KNVK.
    When calling the bapi, the sales order is created with the contact but not the Contact assigned by me. At the end, the contact is taken, by the bapi, from the sold-to. In case of the sold-to doesn't have any contact created, no contact partner is created.
    Of course, the contact number assigned via program and the contact number of sold-to are differents.
    I don't know why SAP decides to take the contact from sold-to instead of taking the data provied by the program.
    Please, i need you help.
    Thanks in advance

    Hello Ernesto
    I called the BAPI (Login language = EN) using partner AP <customer no> and it worked.
    I assume you have to set IMPORTING parameter CONVERT = 'X' in order to ensure that the BAPI interprets the language-dependent partner role correctly.
    Documentation of this parameter CONVERT:
    FU BAPI_SALESORDER_CREATEFROMDAT2CONVERT
    Short Text
         Conversion of Partner Function + Order Type
    Description
         In previous SAP Releases, you had to specify the German abbreviation for
         the order type and partner functions. This parameter now checks whether
         your Customizing has been configured so that you can enter the
         abbreviation in your own language and it is then converted into the
         German key.
    Value range
         o   Space = Not converted
         o     X   = Converted
    Default
         Space
    Function Module
         BAPI_SALESORDER_CREATEFROMDAT2
    Regards
      Uwe

  • BAPI Salesorder

    Hi,
    I'm looking for an example for bapi BAPI_SALESORDER_CREATEFROMDAT2 of BAPI_SALESORDER_CHANGE with the configuration tables filled.
    Does anyone know how I can fill these tables:
    ORDER_CFGS_REF
    ORDER_CFGS_INST
    ORDER_CFGS_PART_OF
    ORDER_CFGS_VALUE
    ORDER_CFGS_BLOB
    ORDER_CFGS_VK
    ORDER_CFGS_REFINST
    Help will be appreciated.
    Bert

    Have a look this code
    DATA: RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: ORDER_HEADER_IN LIKE BAPISDHD1 ,
    ORDER_HEADER_INX LIKE BAPISDHD1X,
    ORDER_ITEMS_IN LIKE BAPISDITM OCCURS 0 WITH HEADER LINE,
    ORDER_ITEMS_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE,
    ORDER_SCHEDULES_IN LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE,
    ORDER_SCHEDULES_INX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE,
    ORDER_PARTNERS LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE.
    ORDER_HEADER_INX-UPDATEFLAG = 'X'..
    ORDER_HEADER_INX-DOC_TYPE = 'X'.
    ORDER_HEADER_INX-SALES_ORG = 'X'.
    ORDER_HEADER_INX-DISTR_CHAN = 'X'.
    ORDER_HEADER_INX-DIVISION = 'X'.
    ORDER_HEADER_INX-PURCH_NO_C = 'X'.
    ORDER_HEADER_INX-REF_DOC_L = 'X'.
    ORDER_ITEMS_INX-UPDATEFLAG = 'X'.
    ORDER_ITEMS_INX-ITM_NUMBER = '000010'.
    ORDER_ITEMS_INX-MATERIAL = 'X'.
    ORDER_ITEMS_INX-PLANT = 'X'.
    ORDER_ITEMS_INX-TARGET_QTY = 'X'.
    ORDER_SCHEDULES_INX-UPDATEFLAG = 'X'.
    ORDER_SCHEDULES_INX-ITM_NUMBER = ORDER_ITEMS_IN-ITM_NUMBER.
    ORDER_SCHEDULES_INX-REQ_QTY = 'X'.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN ORDER_HEADER_IN = wa_header
    ORDER_HEADER_INX * SENDER * BINARY_RELATIONSHIPTYPE * INT_NUMBER_ASSIGNMENT * BEHAVE_WHEN_ERROR * LOGIC_SWITCH * TESTRUN * CONVERT = ' '
    IMPORTING
    SALESDOCUMENT = sorder
    TABLES
    RETURN ORDER_ITEMS_IN = i_item
    ORDER_ITEMS_INX ORDER_PARTNERS = i_partner
    ORDER_SCHEDULES_IN = i_schedule
    ORDER_SCHEDULES_INX * ORDER_CONDITIONS_IN = i_cond.

  • Runtime Error Using BAPI SALESORDER CHANGE

    Hi,
    I was trying to use the BAPI_SALESORDER_CHANGE to change 'Material Group 1' field. When executing the program, it kept on failing with this runtime error 'CALL_FUNCTION_CONFLICT_LENG'. Below is my codes and also the error analysis found in ST22.
    Kindly please let me know my program errors.
    Thanks much.
    CODES :-
    DATA: l_vbeln TYPE bapivbeln-vbeln,
    l_hx LIKE bapisdhead1x,
    l_r TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,
    l_i TYPE STANDARD TABLE OF bapisditem WITH HEADER LINE,
    l_ix TYPE STANDARD TABLE OF bapisditemx WITH HEADER LINE,
    l_success(1) TYPE c VALUE 'Y'.
    l_vbeln = '0000707671'.
    l_hx-updateflag = 'U'.
    l_i-itm_number = '000010'.
    l_i-prc_group1 = 'Y'.
    APPEND l_i.
    l_ix-itm_number = '000010'.
    l_ix-updateflag = 'U'.
    l_ix-prc_group1 = 'X'.
    APPEND l_ix.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = l_vbeln
    ORDER_HEADER_IN =
    order_header_inx = l_hx
    SIMULATION =
    BEHAVE_WHEN_ERROR = ' '
    INT_NUMBER_ASSIGNMENT = ' '
    LOGIC_SWITCH =
    NO_STATUS_BUF_INIT = ' '
    TABLES
    return = l_r
    order_item_in = l_i
    order_item_inx = l_ix
    PARTNERS =
    PARTNERCHANGES =
    PARTNERADDRESSES =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CFGS_BLOB =
    ORDER_CFGS_VK =
    ORDER_CFGS_REFINST =
    SCHEDULE_LINES =
    SCHEDULE_LINESX =
    ORDER_TEXT =
    ORDER_KEYS =
    CONDITIONS_IN =
    CONDITIONS_INX =
    EXTENSIONIN =
    NFMETALLITMS =
    LOOP AT l_r.
    IF l_r-type <> 'S'.
    l_success = 'N'.
    EXIT.
    ENDIF.
    CLEAR l_r.
    ENDLOOP.
    IF l_success = 'Y'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT =
    IMPORTING
    RETURN =
    WRITE: / 'Update successful'.
    ELSE.
    WRITE: / 'Update fail'.
    ENDIF.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
    not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    The call to the function module "BAPI_SALESORDER_CHANGE" is incorrect:
    In the function module interface, you can specify only
    fields of a specific type and length under "ORDER_HEADER_INX".
    Although the currently specified field
    "L_HX" is the correct type, its length is incorrect.

    Thanks ALL. Here is the amended program that works fine :-
    DATA: l_vbeln TYPE bapivbeln-vbeln,
          l_hx TYPE bapisdh1x,
          l_r TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,
          l_i TYPE STANDARD TABLE OF bapisditm WITH HEADER LINE,
          l_ix TYPE STANDARD TABLE OF bapisditmx WITH HEADER LINE,
          l_success(1) TYPE c VALUE 'Y'.
    l_vbeln = '0000707671'.
    l_hx-updateflag = 'U'.
    l_i-itm_number = '000010'.
    l_i-prc_group1 = 'Y'.
    APPEND l_i.
    l_ix-itm_number = '000010'.
    l_ix-updateflag = 'U'.
    l_ix-prc_group1 = 'X'.
    APPEND l_ix.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = l_vbeln
      ORDER_HEADER_IN             =
        order_header_inx            = l_hx
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
      TABLES
        return                      = l_r
        order_item_in               = l_i
        order_item_inx              = l_ix
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
      NFMETALLITMS                =
    LOOP AT l_r.
      IF l_r-type <> 'S'.
        l_success = 'N'.
        EXIT.
      ENDIF.
      CLEAR l_r.
    ENDLOOP.
    IF l_success = 'Y'.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT          =
      IMPORTING
        RETURN        =
      WRITE: / 'Update successful'.
    ELSE.
      WRITE: / 'Update fail'.
    ENDIF.

  • Synchronization from vendor to business partner is not active?

    Hi there
    I am busy performing data migration of business partners and vendor accounts and have hit an issue on the last step of linking the uploaded BP to the uploaded Vendor.
    On execution of the transaction FLBPC2 (Link Vendor to Business Partner), it issues the error "CVIV_UI015 Synchronization from vendor to business partner is not active" which I believe is a product error because:
    1. I have configured BP to a new internal number range (and all other config requirements)
    2. I have configured a new Vendor account group with an external number range which is a duplicate of 1. above
    3. I have enabled BP to Vendor synchronisation in "Master Data Synchronisation" (from BP to VENDOR).
    I have tested my configuration successfully by creating a business partner via transaction BP and extending him to a vendor in a company code perfectly (works like a charm).
    My data migration process includes:
    - Creating a business partner using BAPI BUSISB990/FSCREATEFROMDATA.
    - Creating a vendor using the external number given above using a recording of FK01.
    - Linking the two using a recording of transaction FLBPC2 (Link Vendor to Business Partner).
    I am not trying to synchonise a business partner from vendor, but to synchronise the vendor via the business partner (which works using transaction BP) when the issue is received.
    Any ideas as to why I cannot do the operation manually which works via automation and why the error is not appriate?
    Regards
    Joe

    Good morning,
    I had a similar problem and solved by disabling
    the integration of the PI / XI of the PPO.
    To make sure that the PPO is working properly.
    You can check this setting by BUPA_CALL_FU transaction.
    Checks if the items are BUPA_OUTBOUND_MAIN and BUPA_OUTBOUND_REL
    integration of the disabled for PI / XI, according to the objects you need to be replicated.
    If they are uncheck them and rerun your tests.
    Use MDS_PPO2 the transaction log to check the copy of BP
    to the Vendor.
    I hope it helps, Good luck,

  • Adding and removing partner's w/ BAPI_ACTIVITYCRM_CHANGEMULTI

    I have a requirement to programatically update activities, leads and opportunities with with new partners of various partner functions based on an input file I will recieve. I am trying to use function module BAPI_ACTIVITYCRM_CHANGEMULTI in a custom ABAP program to accomplish this task. I am passing to it the tables partner, partnerx and input_fields. I am putting the delete records before the insert records in the internal tables. I have debuged transaction CRMD_BUS2000126 -Maintain activities and looked at how the data is passed into CRM_ORDER_MAINTAIN as my point of reference. I am finding that the deletes of the existing partners is not working but, the insert of the new partners is. For the deletes I am populating the internal tables as shown below. Whereever you see field symbol usage I've either obtained the data via the input file or database table reads which I have rechecked many times. Am I missing entries or making incorrect entries? Is there another way to delete the entries from the business transactions programatically? Thoroughly confused here. Thanks in advance. Tony Dagnillo
    partner-REF_GUID = <fs_delete_partners>-ref_guid.
    partner-ref_handle = 0.
    partner-ref_kind = 'A'.
    partner-ref_partner_handle = 0.
    partner-partner_no = <fs_delete_partners>-partner_number.
    partner-display_type = 'BP'.
    partner-no_type = 'BP'.
    partner-ref_partner_fct = <fs_delete_partners>-partner_fct.
    partner-ref_partner_no = <fs_delete_partners>-partner_number.
    partner-ref_display_type = 'BP'.
    partner-ref_no_type = 'BP'.
    partner-businesspartnerguid = <fs_delete_partners>-partner_guid.
    partner-mainpartner = <fs_delete_partners>-mainpartner.
    partner-relation_partner = <fs_delete_partners>-relation_partner.
    partnerx-REF_GUID = 'X'.
    partnerx-ref_handle = 'X'.
    partnerx-ref_kind = 'X'.
    partnerx-ref_partner_handle = 'X'.
    partnerx-partner_no = 'X'.
    partnerx-display_type = 'X'.
    partnerx-no_type = 'X'.
    partnerx-ref_partner_fct = 'X'.
    partnerx-ref_partner_no = 'X'.
    partnerx-ref_display_type = 'X'.
    partnerx-ref_no_type = 'X'.
    partnerx-businesspartnerguid = 'X'.
    partnerx-mainpartner = 'X'.
    partnerx-relation_partner = 'X'.
    input_fields-ref_handle = <fs_partner>-ref_partner_handle.
    input_fields-ref_guid = <fs_partner>-ref_guid.
    input_fields-ref_kind = 'A'.
    input_fields-objectname = 'PARTNER'.
    input_fields-logical_key(8) = <fs_partner>-ref_partner_fct.
    input_fields-logical_key+8(16) = <fs_partner>-ref_partner_no.
    input_fields-logical_key+24(2) = <fs_partner>-display_type.
    input_fields-logical_key+26(2) = <fs_partner>-no_type.
    input_fields-fieldname = 'PARTNER_FCT'.

    Take a look at  Issue while changing activity partner in BAPI BAPI_ACTIVITYCRM_CHANGEMULTI
    Similar sort of problem.
    Note the reference to header mode in this message.

  • BAPI/IDOC to cancel the sales order ?

    Hi folks,
    What is BAPI /IDOC to cancel the sales order in ECC via PI .
    Thanks.,
    Shiva

    Hi Shiva,
    To my thinking you can use the BAPI for canceling and updating the sales order.
    For further reference you can have a look on the below link:
    BAPI SALESORDER CHANGE
    In this link you will find the values to be filled for performing different function for the BAPI.
    Regards
    Ravi Anand

Maybe you are looking for

  • PROPAGATION STALLED WITH ERROR ORA-01405

    version 10.2.03 this is a single source single destination replication. Has been moving along fine then get error: ORA-12012: error on auto execute of job 4686 ORA-01405: fetched column value is NULL ORA-06512: at "SYS.DBMS_AQADM_SYS", line 7224 ORA-

  • TS3988 how to turn off the passcode after phone is located

    how to turn off the pass code after you have found your phone with i cloud

  • This doesn't look good.  Help would be appreciated.

    Booted up into 10.3.9 after being on OS 9.2 which is on another internal drive and got a BLACK screen with this message. etc/master password: NO SUCH file or directory Lucky enough I was able to go back to my OS 9 drive. My 10.3 is still there on the

  • Source distribution of an llb

    Hi, I have a folder with llb's. I need to source distribute the folder in such a way that the llb structure should be maintained and the dependencies should come parallel to llb. When I try to source distribute, all llb's are considered as folders an

  • PSE 12 catalog backup fails repeatedly??

    I have tried numerous times to back up the catalog and photos to an external hard drive.  All goes well until the last minute and then a message appears:  "Error encountered while writing files C:\Program Data . . . ."