BAPI_POEC_CREATE

Would anybody be kind enough to give me some example code for calling BAPI_POEC_CREATE !? I have used BAPI_POEC_GETDETAIL with existing POs to have a good look at what the data should look like. But despite all sorts of combinations of parameters and data I can't get it to post a new PO . I think I probably need to call some other SRM functions to extract the correct parameters before my call to BAPI_POEC_CREATE !?
My ultimate requirement is to load some legacy POs into SRM/ECC.

Hi Raghu,
1) Can I used this for Non SAP system?
You can call this bapi from a non sap system as a RFC Remote Function Call
2) Can we add customer fileds to this and how?
Yes you can. There are  structure "Extentionin" that contains customer fields.
3) If you have any links on documentation can you please send me?
Unfortunally I'm new to srm,  so I haven't got  examples of documentation for this bapi.
Bye
enzo

Similar Messages

  • 'BAPI_POEC_CREATE' function doesn't work with extended classic scenario

    Hi everybody.
    Antecedents:
    We are working in an extended classic scenario.
    When we create a Purchase Order via ITS in SRM, the system works ok, the PO is replicated in the ERP system.
    But when we execute “BAPI_POEC_CREATE” function module in order to create a PO in SRM, no message are available in the application monitor, but the PO is not replicated in the ERP system.
    Both exampled were created with exactly same data (partners, items, categories, accounts, …)
    Moreover when we modify the second PO created via ITS, the systems doesn’t show any error message, we can order our PO again without error, but the PO isn’t replicate in the ERP system.
    1. We executed “BAPI_POEC_GETDETAIL” function module, and there is only a difference between POs, E_PO_STATUS table.
    PO created by transaction has 8 entries:
           I1009 X
           I1015 X
           I1021
           I1038
           I1039 X
           I1043
           I1080 X
           I1180
    And PO created by BAPI has 5 entries:
           I1015 X
           I1021
           I1038
           I1043
           I1180
    2. We run “BBP_PD” transaction, and there is only a difference.
    PO created by transaction mode shows:
    - Message: W BBP_PD 830 Default values have been taken from Vendor PRUEBA10/purchasing organization Área Global Compras (org. compras)
    And PO created by BAPI
    - Message: No Messages
    Could anyone help me with the problem?
    Thanks in advance.
    Raúl.

    Hi Raúl,
    this is exact, BAPI_POEC_CREATE is designed to create local PO.
    If you want to replicate it to R/3, then you have to change it to an ECS PO.
    In BADI BBP_DOC_CHANGE_BADI, called at the real beginning of BBP_PD_PO_CREATE, you will have to change some data to enable the ECS scenario:
    - change header subtype to EP
    - change header log system to SRM (keep FI LS as is)
    - determine a backend purch group & org
    - complete BE fields (be_object_id, be_object_type, don't change be_log_system because it will be determined during the transfer, be_pur_org and be_pur_group will also be determined during the transfer)
    - ... and maybe other R/3 relevant fields
    Compare both PO one by one, and adapt the gaps.
    Rgds
    Christophe
    PS: please reward points for helpfull answers

  • Bapi BAPI_POEC_CREATE I_PO_LIMIT problem

    Hi all,
    I have the problem with creation of BAPI_POEC_CREATE and limit position.
    If I create the Purchase Order without Limit Position the badi work correctly, if I create the Purchase Order with limit position and I the structure I_PO_LIMIT is valued, the badi doesn't work and generate the below message:
    BBP_PD 386 For purchase orders with limit, a limit must be specified (and only here)
    Any suggestion?
    Thanks.
    Kindly regard.
    Salvatore

    Hi Atul,
    Thanks for your help.
    Now I post my code, this is an example program for create PO from Contract, may be copy and past in abap editor on SRM 5.5 system.
    Also, I have checked the new notes posted, but not work.
    program ztest02.
    DATA: event        TYPE REF TO cl_htmlb_event,
      head_ctr     type BBP_PDS_ctr_HEADER_D,
      org_data     type HRS_OBJEC,
      ctr_org      type BBPT_PDS_ORG,
      wa_ctr_org   type BBP_PDS_ORG,
      wa_obj       type CRMD_ORDERADM_H-OBJECT_ID,
      bapi_head_po type BAPI_PO_HEADER_C,
         ret          type table of BAPIRET2,
      lt_item_ctr  type table of BBP_PDS_CTR_ITEM_D,
      wa_item_ctr  type BBP_PDS_CTR_ITEM_D,
      lt_item_po   type table of BAPI_PO_ITEM_C,
      wa_item_po   type BAPI_PO_ITEM_C,
      lt_part_ctr  type table of BBP_PDS_PARTNER,
      wa_part_ctr  type BBP_PDS_PARTNER,
      lt_part_po   type table of BAPI_BUP_C,
      wa_part_po   type BAPI_BUP_C,
      lt_org_ctr   type table of BBP_PDS_ORG,
      wa_org_ctr   type BBP_PDS_ORG,
      lt_org_po    type table of BAPI_ORG_C,
      wa_org_po    type BAPI_ORG_C,
      lv_item_number     TYPE bbp_item_no,
      lt_text      type BBPT_PDS_LONGTEXT,
      wa_text      type BBP_PDS_LONGTEXT,
      lt_po_text   type TABLE OF BAPI_TEXT_I,
      wa_po_text   type BAPI_TEXT_I,
      lt_att_ctr   TYPE BBPT_PDS_ATT_T,
      wa_att_ctr   type BBP_PDS_ATT_T,
      lt_att_po    type TABLE OF BAPI_ATT_C,
      wa_att_po    type BAPI_ATT_C,
      lt_limit     type table of BAPI_LIMIT_C,
      ls_limit     type BAPI_LIMIT_C,
    e_bapi_hpo type BAPI_PO_HEADER_D,
    e_item_po type table of BAPI_PO_ITEM_D,
    ewa_item_po type BAPI_PO_ITEM_D,
    *event = cl_htmlb_manager=>get_event( runtime->server->request ) .
    *DATA: event        TYPE REF TO cl_htmlb_event,
         head_ctr     type BBP_PDS_ctr_HEADER_D,
         org_data     type HRS_OBJEC,
         ctr_org      type BBPT_PDS_ORG,
         wa_ctr_org   type BBP_PDS_ORG,
         wa_obj       type CRMD_ORDERADM_H-OBJECT_ID,
         bapi_head_po type BAPI_PO_HEADER_C,
         ret          type table of BAPIRET2,
         lt_item_ctr  type table of BBP_PDS_CTR_ITEM_D,
         wa_item_ctr  type BBP_PDS_CTR_ITEM_D,
         lt_item_po   type table of BAPI_PO_ITEM_C,
         wa_item_po   type BAPI_PO_ITEM_C,
         lt_part_ctr  type table of BBP_PDS_PARTNER,
         wa_part_ctr  type BBP_PDS_PARTNER,
         lt_part_po   type table of BAPI_BUP_C,
         wa_part_po   type BAPI_BUP_C,
         lt_org_ctr   type table of BBP_PDS_ORG,
         wa_org_ctr   type BBP_PDS_ORG,
         lt_org_po    type table of BAPI_ORG_C,
         wa_org_po    type BAPI_ORG_C,
      ret          type table of bapiret2.
    data : msg type table of BBP_PDS_MESSAGES,
           wa_msg type bapiret2.
    *wa_obj = '4400001124'.
    if 1 eq 1.
      wa_obj = '4400001220'.
      CALL FUNCTION 'BBP_PD_CTR_GETDETAIL'
       EXPORTING
         I_OBJECT_ID               = wa_obj
       IMPORTING
         E_HEADER                  = head_ctr
         ET_ATTACH                 = lt_att_ctr
      ET_CONDITIONS             =
    TABLES
       E_ITEM                    = lt_item_ctr
       E_PARTNER                 = lt_part_ctr
       E_LONGTEXT                = lt_text
       E_ORGDATA                 = lt_org_ctr
      E_MESSAGES                =
      E_HCF                     =
      E_ICF                     =
      E_ACTVAL                  =
      E_ACC_ACTVAL              =
      E_HEADER_REL              =
      E_ITMLIM_REL              =
      E_TOL                     =
      E_DIS                     =
      E_STATUS                  =
      E_VERSION                 =
    *controllare che l'Organizzazione acquisti dell'utente che crea ordine sia nel contratto
      CALL FUNCTION 'BBP_OM_STRUC_GET_ORG_FROM_USER'
        EXPORTING
          USER                    = sy-uname
        IMPORTING
          ORGUNIT                 = org_data
        EXCEPTIONS
          PATH_NOT_FOUND          = 1
          ERROR_READING_STRUCTURE = 2
          NO_ROOTS                = 3
          INVALID_ROOTS           = 4
          INTERNAL_ERROR          = 5
          USER_NOT_ASSIGNED       = 6
          OTHERS                  = 7.
      read TABLE lt_org_ctr into wa_org_ctr index 1.
    if wa_ctr_org-PROC_ORG_OT ne org_data-OTYPE or
        wa_ctr_org-PROC_ORG_ID ne org_data-OBJID.
       message = 'L\''utente non ha i permessi adeguati per la creazione dell\''ordine'.
    endif.
      if 1 eq 1.
        MOVE-CORRESPONDING head_ctr to bapi_head_po.
        bapi_head_po-process_type = 'ECPO'.
        bapi_head_po-LOGSYS_FI = 'SV4CLNT100'.
        bapi_head_po-EXT_DEM_LOGSYS = 'SV5_100'.
        bapi_head_po-gr_ind = 'X'.
        bapi_head_po-CO_CODE = 'Z001'.
        bapi_head_po-BUSINESSPROCESS = head_ctr-guid.
        clear lv_item_number.
        loop at lt_item_ctr into wa_item_ctr.
          lv_item_number             = lv_item_number + 1.
          MOVE-CORRESPONDING wa_item_ctr to wa_item_po.
          wa_item_po-ITEM_GUID = wa_item_ctr-guid.
          wa_item_po-ITEM_NUMBER = lv_item_number.
          wa_item_po-category_guid = wa_item_ctr-category.
          wa_item_po-PRODUCT_SRC_SYS = wa_item_ctr-LOGSYS_FI.
          wa_item_po-CTR_NUMBER = head_ctr-object_id.
          wa_item_po-CTR_GUID = head_ctr-GUID.
          wa_item_po-CTR_ITEM_NUMBER = wa_item_ctr-NUMBER_INT.
         wa_item_po-subtype = 'EP'.
          wa_item_po-PRODUCT_SRC_SYS = 'SV5_100'.
          append wa_item_po to lt_item_po.
          MOVE-CORRESPONDING wa_item_po to ls_limit.
          ls_limit-PARENT_GUID = wa_item_ctr-guid.
         ls_limit-LIM_REF_H_GUID = wa_item_ctr-guid.
          ls_limit-LIMIT = wa_item_ctr-PRICE.
          ls_limit-EXP_VALUE = wa_item_ctr-PRICE * 50.
          ls_limit-LIM_REF_LOG_SYS = 'SV4CLNT100'.
         ls_limit-lim_type = 'G'.
          ls_limit-unlimited = 'X'.
           ls_limit-LIM_REF_H_ID = bapi_head_po-DOC_NUMBER.
           ls_limit-LIM_REF_I_ID = wa_item_po-ITEM_NUMBER.
           ls_limit-LIM_REF_H_GUID = head_ctr-guid.
           ls_limit-LIM_REF_I_GUID = wa_item_po-ITEM_GUID.
          append ls_limit to lt_limit.
        endloop.
        loop at lt_part_ctr into wa_part_ctr.
          if wa_part_ctr-PARTNER_FCT ne 51 and
             wa_part_ctr-PARTNER_FCT ne 38 and
             wa_part_ctr-PARTNER_FCT ne 26.
            MOVE-CORRESPONDING wa_part_ctr to wa_part_po.
            wa_part_po-PARTNER_guid = wa_part_ctr-PARTNER_NO.
            append wa_part_po to lt_part_po.
          endif.
          if wa_part_ctr-PARTNER_FCT eq 26.
            MOVE-CORRESPONDING wa_part_ctr to wa_part_po.
            wa_part_po-PARTNER_guid = wa_part_ctr-PARTNER_NO.
            move '00000016' to wa_part_po-PARTNER_FCT.
            append wa_part_po to lt_part_po.
          endif.
          clear : wa_part_ctr,wa_part_po.
        endloop.
        loop at lt_org_ctr into wa_org_ctr.
          MOVE-CORRESPONDING wa_org_ctr to wa_org_po.
          wa_org_po-parent_guid = head_ctr-guid.
          append wa_org_po to lt_org_po.
        endloop.
       tabelle testi
        loop at lt_text into wa_text.
          wa_po_text-PARENT_GUID = wa_text-GUID.
          wa_po_text-TEXT_ID = wa_text-TDID.
          wa_po_text-TEXT_LINE = wa_text-TDLINE.
         wa_po_text-LANGU_ISO = wa_text-TDSPRAS.
          append wa_po_text to lt_po_text.
        endloop.
       tabella allegati
        loop at lt_att_ctr into wa_att_ctr
           where p_guid eq head_ctr-guid.
          MOVE-CORRESPONDING wa_att_ctr to wa_att_po.
          wa_att_po-PARENT_GUID = wa_att_ctr-P_GUID.
          wa_att_po-url = wa_att_ctr-DISP_URL.
         wa_att_po-classname = wa_att_ctr-phio_class.
          wa_att_po-doc_id = wa_att_ctr-phio_objid.
          append wa_att_po to lt_att_po.
        endloop.
        CALL FUNCTION 'BAPI_POEC_CREATE'
          EXPORTING
            I_PO_HEADER            = bapi_head_po
        I_PO_HEADER_CUST       =
        I_TESTRUN              = 'X'
          IMPORTING
            E_PO_HEADER            = e_bapi_hpo
        E_PO_HEADER_CUST       =
          TABLES
            I_PO_ITEMS             = lt_item_po
        I_PO_ITEMS_CUST        =
        I_PO_ACCASS            =
        I_PO_ACCASS_CUST       =
           I_PO_PARTNER           = lt_part_po
           I_PO_TEXT              = lt_po_text
          I_PO_ATTACH            = lt_att_po
          I_PO_ORGDATA           = lt_org_po
        I_PO_LIMIT             = lt_limit
        I_PO_SDLN              =
         E_PO_ITEMS             = e_item_po
        E_PO_ITEMS_CUST        =
        E_PO_ACCASS            =
        E_PO_ACCASS_CUST       =
        E_PO_PARTNER           =
        E_PO_ORGDATA           =
        E_PO_LIMIT             =
        E_PO_SDLN              =
        E_PO_TEXT              =
        E_PO_STATUS            =
        E_PO_ATTACH            =
           RETURN                 = ret
        commit work AND WAIT.
      endif.
    endif.
    Regards.

  • ALE interface generation from BAPI_POEC_CREATE

    Hi,
    I want to generate an ALE interface from BAPI_POEC_CREATE (object type BUS2201).
    FUNCTION BAPI_POEC_CREATE.
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(I_PO_HEADER) LIKE  BAPI_PO_HEADER_C STRUCTURE
    *"        BAPI_PO_HEADER_C
    *"     VALUE(I_PO_HEADER_CUST) LIKE  BAPI_PO_HEADER_CUST_C STRUCTURE
    *"        BAPI_PO_HEADER_CUST_C OPTIONAL
    *"     VALUE(I_TESTRUN) TYPE  BBPS_BAPI2091-TESTRUN DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(E_PO_HEADER) TYPE  BAPI_PO_HEADER_D
    *"     VALUE(E_PO_HEADER_CUST) TYPE  BAPI_PO_HEADER_CUST_D
    *"  TABLES
    *"      I_PO_ITEMS STRUCTURE  BAPI_PO_ITEM_C OPTIONAL
    *"      I_PO_ITEMS_CUST STRUCTURE  BAPI_PO_ITEM_CUST_C OPTIONAL
    *"      I_PO_ACCASS STRUCTURE  BAPI_ACC_C OPTIONAL
    *"      I_PO_ACCASS_CUST STRUCTURE  BAPI_ACC_CUST_C OPTIONAL
    *"      I_PO_PARTNER STRUCTURE  BAPI_BUP_C OPTIONAL
    *"      I_PO_TEXT STRUCTURE  BAPI_TEXT_I OPTIONAL
    *"      I_PO_ATTACH STRUCTURE  BAPI_ATT_C OPTIONAL
    *"      I_PO_ORGDATA STRUCTURE  BAPI_ORG_C OPTIONAL
    *"      I_PO_LIMIT STRUCTURE  BAPI_LIMIT_C OPTIONAL
    *"      I_PO_SDLN STRUCTURE  BAPI_SDLN_C OPTIONAL
    *"      E_PO_ITEMS STRUCTURE  BAPI_PO_ITEM_D OPTIONAL
    *"      E_PO_ITEMS_CUST STRUCTURE  BAPI_PO_ITEM_CUST_D OPTIONAL
    *"      E_PO_ACCASS STRUCTURE  BAPI_ACC_D OPTIONAL
    *"      E_PO_ACCASS_CUST STRUCTURE  BAPI_ACC_CUST_D OPTIONAL
    *"      E_PO_PARTNER STRUCTURE  BAPI_BUP_D OPTIONAL
    *"      E_PO_ORGDATA STRUCTURE  BAPI_ORG_D OPTIONAL
    *"      E_PO_LIMIT STRUCTURE  BAPI_LIMIT_D OPTIONAL
    *"      E_PO_SDLN STRUCTURE  BAPI_SDLN_D OPTIONAL
    *"      E_PO_TEXT STRUCTURE  BAPI_TEXT_I OPTIONAL
    *"      E_PO_STATUS STRUCTURE  BAPI_BBP_STATUS OPTIONAL
    *"      E_PO_ATTACH STRUCTURE  BAPI_ATT_D OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
    1) I encoutered a first problem : as you can see, these are two parameters with the same type BAPI_TEXT_I. So it gives an error message during generation in BDBG. I can bypass this error by deleting the second parameter (E_PO_TEXT) in debug. But I don't like this method of course...
    2) I have a second problem : the three parameters I_PO_HEADER_CUST, I_PO_ITEMS_CUST, I_PO_ACCASS_CUST are not taken in account in the generated FM (ZIDOC_INPUT_ZPURCHASEORDEREC_C), even if corresponding EDI segments are generated. I needed to add them manually (at the end of the following code) :
    FUNCTION zidoc_input_zpurchaseorderec_c.
    *"*"Interface locale :
    *"  IMPORTING
    *"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
    *"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR
    *"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"  TABLES
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"  EXCEPTIONS
    *"      WRONG_FUNCTION_CALLED
    *  this function module is generated                                   *
    *          never change it manually, please!        10.06.2008         *
      DATA:
          z1zpurchaseorderec_create LIKE z1zpurchaseorderec_create,
          z1bp_po_header_c LIKE z1bp_po_header_c,
          z1bp_po_item_c LIKE z1bp_po_item_c,
          z1bp_acc_c LIKE z1bp_acc_c,
          z1bp_bup_c LIKE z1bp_bup_c,
          z1bp_bup_c1 LIKE z1bp_bup_c1,
          z1bp_bup_c2 LIKE z1bp_bup_c2,
          z1bp_text_i LIKE z1bp_text_i,
          z1bp_att_c LIKE z1bp_att_c,
          z1bp_org_c LIKE z1bp_org_c,
          z1bp_limit_c LIKE z1bp_limit_c,
          z1bp_po_item_d LIKE z1bp_po_item_d,
          z1bp_po_item_d1 LIKE z1bp_po_item_d1,
          z1bp_acc_d LIKE z1bp_acc_d,
          z1bp_bup_d LIKE z1bp_bup_d,
          z1bp_bup_d1 LIKE z1bp_bup_d1,
          z1bp_bup_d2 LIKE z1bp_bup_d2,
          z1bp_org_d LIKE z1bp_org_d,
          z1bp_limit_d LIKE z1bp_limit_d,
          z1bp_bbp_status LIKE z1bp_bbp_status,
          z1bp_att_d LIKE z1bp_att_d,
    * go through all IDocs                                                 *
      LOOP AT idoc_contrl.
    *   select segments belonging to one IDoc                              *
        REFRESH t_edidd.
        LOOP AT idoc_data WHERE docnum = idoc_contrl-docnum.
          APPEND idoc_data TO t_edidd.
        ENDLOOP.
    *   through all segments of this IDoc                                  *
        CLEAR error_flag.
        REFRESH bapi_retn_info.
        CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.
          LOOP AT t_edidd INTO idoc_data.
            CASE idoc_data-segnam.
              WHEN 'Z1ZPURCHASEORDEREC_CREATE'.
                z1zpurchaseorderec_create = idoc_data-sdata.
                MOVE z1zpurchaseorderec_create-i_testrun
                  TO i_testrun.
              WHEN 'Z1BP_PO_HEADER_C'.
                z1bp_po_header_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_header_c
                   TO i_po_header.                              "#EC ENHOK
                IF z1bp_po_header_c-doc_date
                   IS INITIAL.
                  CLEAR i_po_header-doc_date.
                ENDIF.
                IF z1bp_po_header_c-pcdat_to
                   IS INITIAL.
                  CLEAR i_po_header-pcdat_to.
                ENDIF.
                IF z1bp_po_header_c-vper_start
                   IS INITIAL.
                  CLEAR i_po_header-vper_start.
                ENDIF.
                IF z1bp_po_header_c-vper_end
                   IS INITIAL.
                  CLEAR i_po_header-vper_end.
                ENDIF.
              WHEN 'Z1BP_PO_ITEM_C'.
                z1bp_po_item_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_item_c
                   TO i_po_items.                               "#EC ENHOK
                IF z1bp_po_item_c-deliv_date
                   IS INITIAL.
                  CLEAR i_po_items-deliv_date.
                ENDIF.
                APPEND i_po_items.
              WHEN 'Z1BP_ACC_C'.
                z1bp_acc_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_acc_c
                   TO i_po_accass.                              "#EC ENHOK
                APPEND i_po_accass.
              WHEN 'Z1BP_BUP_C'.
                z1bp_bup_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_c
                   TO i_po_partner.                             "#EC ENHOK
                READ TABLE t_edidd TRANSPORTING NO FIELDS WITH KEY
                             segnam = 'Z1BP_BUP_C1'.
                IF sy-subrc <> 0.
                  APPEND i_po_partner.
                ENDIF.
              WHEN 'Z1BP_BUP_C1'.
                z1bp_bup_c1 = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_c1
                   TO i_po_partner.                             "#EC ENHOK
                READ TABLE t_edidd TRANSPORTING NO FIELDS WITH KEY
                             segnam = 'Z1BP_BUP_C2'.
                IF sy-subrc <> 0.
                  APPEND i_po_partner.
                ENDIF.
              WHEN 'Z1BP_BUP_C2'.
                z1bp_bup_c2 = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_c2
                   TO i_po_partner.                             "#EC ENHOK
                APPEND i_po_partner.
              WHEN 'Z1BP_TEXT_I'.
                z1bp_text_i = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_text_i
                   TO e_po_text.                                "#EC ENHOK
                APPEND e_po_text.
              WHEN 'Z1BP_ATT_C'.
                z1bp_att_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_att_c
                   TO i_po_attach.                              "#EC ENHOK
                APPEND i_po_attach.
              WHEN 'Z1BP_ORG_C'.
                z1bp_org_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_org_c
                   TO i_po_orgdata.                             "#EC ENHOK
                APPEND i_po_orgdata.
              WHEN 'Z1BP_LIMIT_C'.
                z1bp_limit_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_limit_c
                   TO i_po_limit.                               "#EC ENHOK
                APPEND i_po_limit.
              WHEN 'Z1BP_PO_ITEM_D'.
                z1bp_po_item_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_item_d
                   TO e_po_items.                               "#EC ENHOK
                IF z1bp_po_item_d-deliv_date
                   IS INITIAL.
                  CLEAR e_po_items-deliv_date.
                ENDIF.
                READ TABLE t_edidd TRANSPORTING NO FIELDS WITH KEY
                             segnam = 'Z1BP_PO_ITEM_D1'.
                IF sy-subrc <> 0.
                  APPEND e_po_items.
                ENDIF.
              WHEN 'Z1BP_PO_ITEM_D1'.
                z1bp_po_item_d1 = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_item_d1
                   TO e_po_items.                               "#EC ENHOK
                APPEND e_po_items.
              WHEN 'Z1BP_ACC_D'.
                z1bp_acc_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_acc_d
                   TO e_po_accass.                              "#EC ENHOK
                APPEND e_po_accass.
              WHEN 'Z1BP_BUP_D'.
                z1bp_bup_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_d
                   TO e_po_partner.                             "#EC ENHOK
                READ TABLE t_edidd TRANSPORTING NO FIELDS WITH KEY
                             segnam = 'Z1BP_BUP_D1'.
                IF sy-subrc <> 0.
                  APPEND e_po_partner.
                ENDIF.
              WHEN 'Z1BP_BUP_D1'.
                z1bp_bup_d1 = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_d1
                   TO e_po_partner.                             "#EC ENHOK
                READ TABLE t_edidd TRANSPORTING NO FIELDS WITH KEY
                             segnam = 'Z1BP_BUP_D2'.
                IF sy-subrc <> 0.
                  APPEND e_po_partner.
                ENDIF.
              WHEN 'Z1BP_BUP_D2'.
                z1bp_bup_d2 = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bup_d2
                   TO e_po_partner.                             "#EC ENHOK
                APPEND e_po_partner.
              WHEN 'Z1BP_ORG_D'.
                z1bp_org_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_org_d
                   TO e_po_orgdata.                             "#EC ENHOK
                APPEND e_po_orgdata.
              WHEN 'Z1BP_LIMIT_D'.
                z1bp_limit_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_limit_d
                   TO e_po_limit.                               "#EC ENHOK
                APPEND e_po_limit.
              WHEN 'Z1BP_BBP_STATUS'.
                z1bp_bbp_status = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_bbp_status
                   TO e_po_status.                              "#EC ENHOK
                APPEND e_po_status.
              WHEN 'Z1BP_ATT_D'.
                z1bp_att_d = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_att_d
                   TO e_po_attach.                              "#EC ENHOK
                APPEND e_po_attach.
    *** JSE 12/06/08 segments "forgotten" by BDBG
              WHEN 'Z1BP_PO_HEADER_CUST_C'.
                z1bp_po_header_cust_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_header_cust_c
                  TO i_po_header_cust_c.
              WHEN 'Z1BP_PO_ITEM_CUST_C'.
                z1bp_po_item_cust_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_po_item_cust_c
                   TO s_po_items_cust.                          "#EC ENHOK
                APPEND s_po_items_cust TO i_po_items_cust.
              WHEN 'Z1BP_ACC_CUST_C'.
                z1bp_acc_cust_c = idoc_data-sdata.
                MOVE-CORRESPONDING z1bp_acc_cust_c
                   TO s_po_accass_cust.                         "#EC ENHOK
                APPEND s_po_accass_cust TO i_po_accass_cust.
    *** JSE 12/06/08
            ENDCASE.
          ENDLOOP.
        ENDCATCH.
    As for first point, I don't like this method, because it modifies a generated FM. Is there a way to force generation of this 3 parameters by BDBG ?
    3) Considering the risk of overwriting modications in the generated FM, I have these questions : when are regenerated interfaces created by BDBG ? Are they regenerated always manually ? Or are they regenerated during transport for example ?
    Thanks a lot for your help.
    Julien.

    Hi,
    Pls see this very useful thread:
    Re: 'BAPI_POEC_CREATE' function doesn't work with extended classic scenario
    BR,
    Disha.
    Do reward points for useful answers.

  • Error message for BAPI BAPI_POEC_CREATE

    Hi All,
    I am using this function module BAPI_POEC_CREATE to create purchase order in srm system.
    I have executed this bapi i am getting below error messages...
    I   BBP_PD               184 Purchase order 0000000068-  has been created
    E  BBP_UI_PO            045 Output: No details for medium Printer in supplier master record
    E  BS                   013 System status INCM is active (Purchase Order 68)
    I am not able to see the PO 68 which is created above in SRM system.Neighter it is shown in BBP_PD.
    also it is asking for output details for supplier. I have maintained in Maintain bussiness partner the output medium for the vendor in contact Tab.where else i need to maintain these values.
    also the error message mentioning INCM is active, i am not getting what it means
    Any body worked on this BAPI befor pls. help me.
    Abdul Raheem

    Hi,
    System Status INCM is active implies that your document is "Incomplete". There is an error and hence you cannot validate it, only park it.
    System status prevents you from ordering/submitting/validating the document until you correct the error.
    So could you please check the error message in RZ20?
    Regards,
    Nikhil

  • Create PO with attachement using BAPI_POEC_CREATE

    I'm using bapi BAPI_POEC_CREATE to create a PO in SRM but i also need to add an attachment.
    The bapi has parameter I_PO_ATTACH but i need an URL for the attachment, what do i need to do in order to upload the attachment and get the URL?
    Thank you in advance.
    Regards,
    Pedro.

    anyone?

  • Upload Open Purchase orders

    Hi All,
    Our client is implementing SRM and the conversion is  from non-sap legacy system. Is there a way to upload all the Open PO's without manually keying it in.
    Thanks,
    Reena

    Hi,
    As per my knowledge, there is no any automation tool ..
    You have to develop the program  using BAPI_POEC_CREATE  in SRM system
    Thanks
    Prasad s

  • Error while creation of PUrchase order by using BAPI.

    Hi All,
       We are creating a purchase order thru BAPI ("BAPI_POEC_CREATE") and we are passing the following parameters ( I_PO_HEADER , I_PO_ITEMS , I_PO_ACCASS , I_PO_PARTNER and I_PO_ORGDATA)  to the bapi and after processing  we are getting the following error and Abend messages.
    Messages:
    1) Enter at least one item or one limit ( we have added line items in I_PO_ITEMS structure).
    2) Incorrect interface data for set 78 in method C.
    3) Interface data contains errors.
    Can anyone help me in fixing these errors inorder to proceed further.
    Regards
    Dharmaraju

    Hi there,
    Did you manage to sort this problem ?
    If not let me know
    I am using the same and know how to overcome
    Thanks
    Turlock
    T

  • Conversion of Open PO's

    Hi All,
    Our client is implementing SRM and the conversion is from non-sap legacy system. Is there a way to upload all the Open PO's without manually keying it in.
    Thanks,
    Reena

    Hi,
    I suppose you should create a load program, there you can use BAPI_POEC_CREATE.
    I hope this help
    Jorge

  • Multiple processing of Open PO's & PR's

    Good morning All,
    How to Process Multiple Open TR's which I found in LB10
    Also Multiple Open TO's in LT22.
    Any configuration setting is required.
    Please help me out .
    Thanks & Regards,
    Olet Malla

    Hi,
    I suppose you should create a load program, there you can use BAPI_POEC_CREATE.
    I hope this help
    Jorge

  • PO Creation with external PO number

    Hi All,
    We have SRM and some other legacy system. We will receive the PO information from the legacy system with the Legacy PO number. Now we have to create a PO with external number only.
    So for PO creation we are using the BAPI BAPI_POEC_CREATE.  this is working fine if you dont pass any external PO number.
    But If you pass external PO number I am facing some problem. BAPI_POEC_CREATE is giving the informaiton that PO with XXXXXXX number is created, but when we call BAPI_TRANSACTION_COMMIT it is throing some error like.
    Buffer table not up to date
    Message no. BBP_PD001
    Diagnosis
    In LOOP OBJ_RELATIONS_UPDATE (function group SAPLBBP_PDH_OR) an inconsistent status was discovered.
    Procedure
    Start the transaction again. If the error occurs again, create an OSS message.
    To analyze the error, you can set a breakpoint in the function module 'BBP_PD_ABORT' and look at the call-up hierarchy in debugging mode.
    Is this the number range problem? please tell me what is missing.
    Thanks & Regards,
    Raghu

    Raghavender,
    I think that maybe the external number is not the problem.
    Sometimes the explicit <b>COMMIT</b> causes this error cuz some processes or BADI's  are accessing the table at memory level, so if you use this explicit bapi_transaction_commit maybe it will raise that error...
    Have your tried to remove that function call?
    Please acknowledge if it worked...
    Regards,
    Gerardo.

  • Mandatory fields to create vendor and PO

    Hi all,
    I am migrating data from legacy system to ECC and to SRM. I found mandatory fields in ECC and I am not sure what are the mandatory fields for SRM. I need for Vendor creation(Foreign vendors also) and open PO. Please reply.
    Regards,
    Balaji

    Hi
    <b>Use the function module BBP_VENDOR_GET_NON_BAPI to create a vendor directly in SRM.</b>
    <u>Function module - BBP_VENDOR_GET_NON_BAPI</u>
    <u>Program</u> - <b>BBP_VENDOR_GET_DATA</b>
    <u>BAPI</u> - <b>META_BUSINESS_PARTNER_CREATE</b>
    <u>Also look at Function module - BBP_UPDATE_ATTRIBUTES.</u>
    <b><u>Did you created any PO using that "bapi_poec_create"..? Don't forgot to add a commit work in your program.</u></b>
    You will have to develop your own XML mapping to create a PO in SRM.
    You can use BAPI_POEC_CREATE (read SE37 documentation about GUIDs).
    This one also uses internal functions BBP_PD_PO_CREATE, UPDATE & SAVE.
    You don't have to take care of GUIDs. This function will generate them for you. You can pass the PO number as PO header GUID, and PO items as PO item GUIDs. This will make the links as well.
    <u>Please go through this as well -></u>
    Re: Upload PO from XML file in SRM
    Creating a PO with ME_CREATE_PO_ITEM
    Re: Function Module/BAPI to create vendors in PPOMV_BBP
    Re: BBP_PD_PO_CREATE
    Create PO
    <u>Hope this will definitely help. Do let me know.</u>
    Regards
    - Atul

  • Automatic PO Creation SRM

    Hi,
    we are trying to create PO with BAPI: BBP_PD_PO_CREATE and BAPI_POEC_CREATE, but no success at all, to many erros and problems with GUID´s, anyone as some example on how we can we use correctly this bapi´s?
    Best Regards,
    HT

    Hello Ashutosh,
    thank you very much for that idea!
    I would have the following question w.r.t. to such configuration:
    If i configure that the PO creation for complete SC should happen for a certain purchasing group, would it be somehow possible to arrange that when a Catalog item is put into the shopping cart, that only that certain purchasing group gets defaultet? (the idea behind this is, to leave the free text shopping carts to already known purchasing groups and to keep the purchase requisition as the backend object for this configuration. And additionally to create new purchasing groups, that should be linked to the catalog purchases and to POs as the backend objects).
    Thanks again for the help!

  • Upload PO data into SRM system from flat file

    Hi all,
    I need to create conversion program to upload Open Purchase order data from flat file to System.
    I am trying to create po using bapi BAPI_POEC_CREATE. but getting error .
    should any one give the details of parameter need to  pass the bapi .
    Thanks in advance
    Sharad

    Sharad,
    Not the very best piece of code, but should be helpful.
    REPORT  zkb_po_create.
    DATA: ls_po_header   TYPE bapi_po_header_c.
    DATA: ls_e_po_header TYPE bapi_po_header_d.
    DATA: ls_po_items    TYPE bapi_po_item_c.
    DATA: ls_po_accass   TYPE bapi_acc_c.
    DATA: ls_po_partner  TYPE bapi_bup_c.
    DATA: ls_po_orgdata  TYPE bapi_org_c.
    DATA: ls_return      TYPE bapiret2.
    DATA: lt_po_items   TYPE TABLE OF bapi_po_item_c.
    DATA: lt_po_accass  TYPE TABLE OF bapi_acc_c.
    DATA: lt_po_partner TYPE TABLE OF bapi_bup_c.
    DATA: lt_po_orgdata TYPE TABLE OF bapi_org_c.
    DATA: lt_return     TYPE TABLE OF bapiret2.
    * Header Details
    ls_po_header-businessprocess = 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_header-businessprocess
      IMPORTING
        output = ls_po_header-businessprocess.
    ls_po_header-process_type = 'EC'.
    ls_po_header-doc_date = sy-datum.
    ls_po_header-description = 'Test for BAPI_POEC_CREATE'.
    ls_po_header-logsys_fi = 'Backend'.
    ls_po_header-co_code = '1000'.
    ls_po_header-currency = 'GBP'.
    * Item Details
    ls_po_items-item_guid    = 2.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_items-item_guid
      IMPORTING
        output = ls_po_items-item_guid.
    ls_po_items-parent        = ls_po_header-businessprocess.
    ls_po_items-product_guid  = '4678E74FFFC380AD000000000A8E035B'.
    ls_po_items-product_id    = '400030'.
    ls_po_items-product_type  = '01'.
    ls_po_items-category_guid = '4627B461073F40FC000000000A8E035B'.
    ls_po_items-category_id   = '1.04.0500'.
    ls_po_items-quantity      = 10.
    ls_po_items-deliv_date   = sy-datum + 10.
    ls_po_items-price = '25'.
    APPEND ls_po_items TO lt_po_items.
    * Account Assignment
    ls_po_accass-guid = 3.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_accass-guid
      IMPORTING
        output = ls_po_accass-guid.
    ls_po_accass-parent_guid = ls_po_items-item_guid.
    ls_po_accass-distr_perc  = 100.
    ls_po_accass-g_l_acct    = '<gl acc>'.
    ls_po_accass-cost_ctr    = '<cost centre>'.
    ls_po_accass-co_area     = '<Ctrl area>'.
    APPEND ls_po_accass TO lt_po_accass.
    * Partner Functions
    ls_po_partner-partner_fct  = '00000019'.
    ls_po_partner-partner      = 'Vendor'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000016'.
    ls_po_partner-partner      = 'Requester'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000020'.
    ls_po_partner-partner      = 'Receipient'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000075'.
    ls_po_partner-partner      = 'Location'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_orgdata-proc_org_ot = 'O'.
    ls_po_orgdata-proc_org_id = 'Pur Org'.
    ls_po_orgdata-proc_group_ot = 'O'.
    ls_po_orgdata-proc_group_id = 'Pur Group'.
    ls_po_orgdata-parent_guid = ls_po_items-item_guid.
    APPEND ls_po_orgdata TO lt_po_orgdata.
    CALL FUNCTION 'BAPI_POEC_CREATE'
      EXPORTING
        i_po_header  = ls_po_header
      IMPORTING
        e_po_header  = ls_e_po_header
      TABLES
        i_po_items   = lt_po_items
        i_po_accass  = lt_po_accass
        i_po_partner = lt_po_partner
        i_po_orgdata = lt_po_orgdata
        return       = lt_return.
    READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
    IF sy-subrc NE 0.
      COMMIT WORK AND WAIT.
      WRITE:/ ls_e_po_header-doc_number, ': created successfully'.
    ELSE.
      WRITE:/ 'The below errors occurs during PO creation.'.
      LOOP AT lt_return INTO ls_return.
        WRITE:/ ls_return-message.
      ENDLOOP.
    ENDIF.
    Regards, Kathirvel

  • BAPI's in SAP SRM Module

    Hi SAP Gurus,
         Please provide me the list of BAPI's with its descriptions for SAP SRM module.
    regards,
    George.

    Hi,
    Which BAPIs are you looking for ? What's your detailed requirement ?
    Using SE37 Transaction, you cand find the BAPI Function modules.
    Search using BAPI* or META* to get all the existing SRM BAPIs.
    Meta function are generic call to external system. Depending on system kind and release, the function to call is different. The bapi that the Meta will effectly call in a backend is defined in table bbp_function_map.
    Some sample BAPIs in SRM ->
    Re: get vendor number BAPI or functional module
    Standard BAPI to pull out data from SRM 5.5
    BAPI_POEC_CREATE
    bapi_srm_doc_getlist
    BBP_VENDOR_GET_NON_BAPI
    BAPI_PCA_MASTER_CREATE
    BAPI_ORGMASTER_REPLICATE
    PCA_MASTER_CREATE
    BAPI_ORGMASTER_SAVE_ORIG_MULT
    BAPI_ORGMASTER_SAVE_REPL_MULT
    BBP_BAPI_CONF_CREATE_IN
    BBP_BAPI_CONF_RESPONSE_CRT
    BBP_BAPI_INV_RESPONSE_CRT
    BBP_BAPI_INV_SEND
    BBP_BAPI_IV_CREATE_IN
    BBP_BAPI_PCO_CREATE_IN
    BBP_BAPI_PO_SEND
    ALE_ORGMASTER_SAVE_REPL_MULT
    IDOC_INPUT_ORGMASTER
    RSO_GET_MASTER_DATA
    RSSEM_UPB_MASTER_DATA
    UPDATE_MASTER
    MASTERIDOC_CREATE_REQ_ADRMAS
    MASTERIDOC_CREATE_SMD_ADRMAS
    UPC_MASTER_DATA_MAINTAIN
    RSDPW_MASTERDATA_UPLOAD
    UPC_BW_MASTER_DATA_MAINTAIN
    UPSDL_MASTER_IDOC_CREATE
    MASTER_IDOC_CREATE_UPSMAS
    MASTER_IDOC_CREATE_UPSRCP
    BR,
    Disha.
    Do reward points for  useful answers.

Maybe you are looking for