A custom field added in BAPI_PO_CREATE and BAPI_PO_CREATE1

Hi,
  I am trying to create a Service Purchase Order Single Account Assignment.
A Custom field ZZEXPTYPE(Expense Type) is added in BAPI_PO_CREATE and passed the value '9015', The PO Is created Successfully but when I add same Custom Field ZZEXPTYPE(Expense Type) in BAPI_PO_CREATE1 whose value is '9015' ,It throws an Error Message as " Please enter a valid (SBU Specific) expense type!" . 
  The functional consultant says that Expense Type '9015' is correct. please Let me know what must be done.
Regards,
Deepthi.

Extension to add Expense Type only
      IF NOT  w_src-zzexptype IS INITIAL.
        w_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
        w_extensionin-valuepart1+10(4) = w_src-zzexptype.
        APPEND w_extensionin TO i_extensionin.
        CLEAR w_extensionin.
        w_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
        w_extensionin-valuepart1+10(4) = 'X'.
        APPEND w_extensionin TO i_extensionin.
        CLEAR w_extensionin.
      ENDIF.
Call BAPI
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader          = w_poheader
          poheaderx         = w_poheaderx
        IMPORTING
          exppurchaseorder  = gv_ebeln
        TABLES
         return            = i_return
         poitem            = i_poitem[]
         poitemx           = i_poitemx[]
         extensionin       = i_extensionin[].
Commit the Transaction
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         WAIT          = 'X'.

Similar Messages

  • Mass maintenance and BDC Recodring of custom fields added in PO header.

    Hello Experts,
    I have created a custom fields in PO header and used  Structure for BADI implementation to update the header with values enterd in custom table.
    My requirement is for some selected PO i want to fix the value of one of my custom field at header level.
    I have tried both the options Mass maintenance and BDC recording but the issue i'm facing is when i go for mass maintenance it is giving me the ERROR and it seems that we can only do the mass maintenance for sap-standard fields only.
    When i go for BDC recording i'm facing the issue that when i do SHDB and start recording  for ME22N my custom field is coming  grayed out and i'm not able to input the desired value in custom field and complete my recording.
    Let me know your valuable inputs .
    Thanks,
    Naveen

    Hello,
    Instead of BDC i'm doing it through the BAPI   "BAPI_PO_CHANGE" by populating the structure extensionin but here i'm facing the error as below:-
    W     ME     887     Error transferring ExtensionIn data for enhancement CI_EKKODB
    E     BAPI     003     Instance 4500001544 of object type PurchaseOrder could not be changed
    below is my code:-
    ls_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
        ls_extensionin-valuepart1+0(10) = wa_po-ebeln.
        ls_extensionin-valuepart1+14(3) = no.
        append ls_extensionin to lt_extensionin.
        clear:ls_bapi_te_bg,ls_extensionin.
        ls_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
        ls_extensionin-valuepart1+0(10) = wa_po-ebeln.
        ls_extensionin-valuepart1+10(1) = 'X'.
        append ls_extensionin to lt_extensionin.
        clear:ls_bapi_te_bg,ls_extensionin.
        call function 'BAPI_PO_CHANGE'
            exporting
              purchaseorder                = wa_po-ebeln
            tables
              return                       = it_bapireturn
              extensionin                  = lt_extensionin
        if it_bapireturn[] is initial.
          call function 'BAPI_TRANSACTION_COMMIT'
            exporting
              wait   = ' '
            importing
              return = it_bapireturn.
        endif.
        refresh lt_extensionin[].
      endloop.
    Please let me know if there is any way to achieve this.
    Thanks,
    naveen

  • How to handle Custom field added in BP : Role Bill Account

    Hi Friends,
    I am working on an interface which creates Bill Account role for a BP but the problem is there are about 15 Custom fields added to standard BP transaction in BA role.
    As I am using BAPI_BUPA_FS_CREATE_FROM_DATA2 for creating the BP and
    BAPI_BUPA_CENTRAL_CHANGE for changing the BP role Bill Account?
    Can anyone tell me how to handle those custom fields in the existing BAPIs or there is some other way of doing it?
    Thanks in advance,
    Pradeep
    Note : Helpful answers will be rewarded.

    Hi,
    I have seen these BAPIs but are they used with normal BAPIs for BP creation and change.
    For example : I create the BP using BAPI_BUPA_FS_CREATE_FROM_DATA2 and for the Custom fields I should use these BAPIs as suggested by you alongwith the create BAPI.
    And will it work for Changing the BP also.
    Kindly clarify.
    Regards,
    Pradeep

  • Defaulting a customer field (added through EEW) while bus. obj creation.

    Hi All,
    There a customer field added through EEW.
    Now suppose when we are creating an object (BUS2000170, in my case) this customer filed value should be set the a default value. Under GENIL_MODEL_BROWSER i can see this filed in 'BTitemcustext'.
    I am trying to do it through EVENTS (by calling a FM after AFTER_CREATE event) but i could not find 'BTitemcustext' in the table type CRMT_EXTENSION_COMT.
    Now i dont know where to set this value.
    Can anyobe please help on how we can set default value for fields developed through EEW.
    Thanx,
    Abhi.
    Edited by: abhishek ranjan on Jan 7, 2011 10:11 AM

    Hi Rajni,
    This BADI will only be called when i will save the order.
    I want to set the default value the moment the object is created. Thats why i wanted to do it through events(CRMV_EVENT).
    The reason being suppose the order is not saved , till then this default value will not be visible in the UI side(Even after the object creation).
    Also where i can set this default value??
    I mean this field is available under the model 'BTITEMCUSTEXT'. Also the filed is not visible in the table type for extensions (CRMT_EXTENSION_COMT).
    Please let me know i am wrong.

  • Need help on BAPI_PO_CREATE and BAPI_PO_CREATE1

    Hi,
    Trying to create simple PO using BAPI_PO_CREATE.
    Filling up all necessary details about header , item and delivery schedule.
    In return message is shown as
    'In case of ERS procedure, please enter terms of payment'.
    I couldn't find what to do with ZTERM through bapi_po_create.
    Can any one give sample code to create PO using
    BAPI_PO_CREATE
    and BAPI_PO_CREATE1
    Madhura Nadgauda

    *& Report  ZBAPI_CREATE_PO                                             *
    *& Program demonstrates the BAPI call to create Purchase Order         *
    *& Minimum required parameters are used are as per the current         *
    *& system configuration                                                *
    REPORT  ZBAPI_CREATE_PO                         .
    *DATA DECLARATION
    CONSTANTS : C_X VALUE 'X'.
    *Structures to hold PO header data
    DATA : HEADER LIKE  BAPIMEPOHEADER   ,
           HEADERX LIKE  BAPIMEPOHEADERX .
    *Internal Tables to hold PO ITEM DATA
    DATA : ITEM   LIKE BAPIMEPOITEM  OCCURS 0 WITH HEADER LINE,
           ITEMX  LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
    *Internal table to hold messages from BAPI call
           RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    data : w_header(40) value 'PO Header'.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code  default '2700'      ,
                 doctyp  like HEADER-DOC_TYPE   default 'NB'        ,
                 cdate   like HEADER-CREAT_DATE default sy-datum    ,
                 vendor  like HEADER-VENDOR     default '0010000023',
                 pur_org like HEADER-PURCH_ORG  default '2700'      ,
                 pur_grp like HEADER-PUR_GROUP  default '001'       .
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like ITEM-PO_ITEM  default '00001',
                 material like ITEM-MATERIAL default 'CRANE'   ,
                 plant    like ITEM-PLANT    default '2700' ,
                 quantity like ITEM-QUANTITY default 100.
    selection-screen end of block b2.
    START-OF-SELECTION.
    *DATA POPULATION
    ws_langu = sy-langu.   "Language variable
    *POPULATE HEADER DATA FOR PO
    HEADER-COMP_CODE  = company    .
    HEADER-DOC_TYPE   = doctyp     .
    HEADER-CREAT_DATE = cdate      .
    HEADER-VENDOR     = vendor     .
    HEADER-LANGU      = ws_langu   .
    HEADER-PURCH_ORG  = pur_org    .
    HEADER-PUR_GROUP  = pur_grp    .
    *POPULATE HEADER FLAG.
    HEADERX-comp_code  = c_x.
    HEADERX-doc_type   = c_x.
    HEADERX-creat_date = c_x.
    HEADERX-vendor     = c_x.
    HEADERX-langu      = c_x.
    HEADERX-purch_org  = c_x.
    HEADERX-pur_group  = c_x.
    HEADERX-doc_date   = c_x.
    *POPULATE ITEM DATA.
    ITEM-PO_ITEM  = item_num.
    ITEM-MATERIAL = material.
    ITEM-PLANT    = plant.
    ITEM-QUANTITY = quantity.
    APPEND ITEM.
    *POPULATE ITEM FLAG TABLE
    ITEMX-PO_ITEM    = item_num.
    ITEMX-MATERIAL   = C_X.
    ITEMX-PLANT      = C_X .
    ITEMX-STGE_LOC   = C_X .
    ITEMX-QUANTITY   = C_X .
    ITEMX-TAX_CODE   = C_X .
    ITEMX-ITEM_CAT   = C_X .
    ITEMX-ACCTASSCAT = C_X .
    APPEND ITEMX.
    *BAPI CALL
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER                     = HEADER
        POHEADERX                    = HEADERX
      POADDRVENDOR                 =
      TESTRUN                      =
    IMPORTING
      EXPPURCHASEORDER             =
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = RETURN
       POITEM                       = ITEM
       POITEMX                      = ITEMX.
    *Confirm the document creation by calling database COMMIT
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    IMPORTING
      RETURN        =
    end-of-selection.
    *Output the messages returned from BAPI call
    LOOP AT RETURN.
    WRITE / RETURN-MESSAGE.
    ENDLOOP.
    <b> Create a purchase order with configuration using the BAPI</b>
    This took some time to figure out how to setup. It may be useful.
    call function 'BAPI_CFG_CREATE'
      exporting
        object_id     = 'MYMATCODE'
        root_type     = 'MARA'
        root_name     = 'MYMATCODE'
        plant         = 'MYPLANT'
      importing
        cfg_handle    = l_handle
        root_instance = l_instance
      exceptions
        error         = 1
        others        = 2.
    l_characts_vals-atnam = 'WIDTH'.
    l_characts_vals-atwtb = '500'.
    append l_characts_vals to it_characts_vals.
    call function 'BAPI_CFGINST_CHARCS_VALS_SET'
      exporting
        object_id         = 'MYMATCODE'
        instance          = l_instance
      tables
        characts_vals     = it_characts_vals
        characts_vals_err = it_characts_vals_err.
    call function 'CE_C_SET_CBASE'.
    l_poitem-int_obj_no = l_handle.
    call function 'BAPI_PO_CREATE1'
       exporting
        poheader  = l_poheader
        poheaderx = l_poheaderx
       importing
        expheader = l_expheader
        exppurchaseorder = l_exppurchaseorder
       tables
        poitem      = lt_poitem
        poitemx     = lt_poitemx
                poschedule  = lt_poschedule
                poschedulex = lt_poschedulex
        return      = lt_return.
    call function 'BAPI_TRANSACTION_COMMIT'.
    also
    <a href="http://www.erpgenie.com/phpBB2/viewtopic.php?p=15525&sid=ea0812d14d0cbffb804e18d34040d521">refer</a>
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Adding Custom Field to Shopping Cart and PO, Classic Scenario

    We are running SRM 7.0 with ECC 6.0 as the backend and using the Classic scenario. I want to add a custom field to the shopping cart and have the data transfer over to a custom field (of the same name) on the purchase order to the ECC side. I have already added the field to the shopping cart and have the data saving successfully there on the SRM side. What I am having trouble with is getting the data from the custom field to go over to ECC on the purchase order.
    I have extended the Shopping Cart and Purchase Order item structures through configuration on SRM. This has added the fields to the INCL_EEW_PD_ITEM_CSF_SC and INCL_EEW_PD_ITEM_CSF_PO structures, as described in note 672960 (do i need to extend the PO structure on SRM if using the Classic scenario?). I have also extended the CI_EKPODB and CI_EKPODBX structures on ECC as described in note 458591. So the placeholders are there.
    I feel like there must be something I am missing. The OSS note 458591 suggests that just adding the fields to the needed structures will cause the data to transfer, but this does not appear to be the case.
    I have an implementation of BBP_CREATE_BE_PO_NEW that I can use, but do not see where to add the data in the output parameters of that BADI. Is there a BADI I need to implement on the ECC side?
    Any help in this issue would be greatly appreciated.

    Dug around a little bit more and stumbled onto this article which solved it for me: [How to transfer custom fields from SRM to ECC|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20b36c12-685f-2c10-4fb4-ba2e0b969c27?quicklink=index&overridelayout=true]
    In BADI BBP_CREATE_BE_PO_NEW I had to add some code to fill in the CS_PO1_DOCUMENT-EXTENSIONIN parameter table with the structure for the BAPI_TE_MEPOITEM structure on the ECC side. The tricky part is creating a string representation of that structure with the correct offset. And it isn't as easy as just counting up the number of characters in SE12. For example, looking at my BAPI_TE_MEPOITEM structure in SE12, my custom field appears to start on character 157, but in reality, I had to offset the writing of my value to character 143. I guess it depends on what types are in there.
    But once that gets figured out, it works well. As long as the custom field is added correctly to the CI_EKPODB append structure (which is appended to BAPI_TE_MEPOITEM), the data gets tranferred over in the ExtensionIn table, and SAP automatically knows what to do with the data as long as you have everything in ExtensionIn aligned correctly.
    Thanks for the help everyone!

  • Custom fields added on PO header and PO item in ME21n

    hi everybody
    I have added 2 fields on PO header and PO item level in ME21N screen, everything is working fine
    but the issue is that if the Customer Data tab page is not opened at the Header Level, the additional fields in Customer Data tab page at Item Level are not displayed as well
    Does anybody knws why this happens?

    May be i wrongly explained, all the data are getting populated on the screen and in the database tables.
    Its just that if the Customer tab on PO header is not opened, the fields in the Customer tab in PO item level are not getting displayed
    As such, the data are being saved in the tables.
    Its only if the customer tab on header is not opened, the fields in Customer tab in PO item are not displayed.
    Otherwise if PO header customer tab is opened, everything is ok

  • 0CO_OM_OPA_6: Custom fields added, Data - available in RSA3, but not in PSA

    Hi Friends,
    I have added some custom fields to the 0CO_OM_OPA_6 data source. Following are the details.
    1) Custom fields: ZZEBELN (Purchasing Doc), ZZUSNAM (Username)
    2) Code populated in SE19 (BADI for this Datasource)
    3) RSA3: Test extraction pulls the records for both the custom fields correctly.
    4) RSA5, and RSA6 - Fields are unchecked for hidden and field only. They are made available.
    5) Extract Structure replicated into BW and its pulled over from extract structure into Transfer structure.
    6) Mapped to corresponding fields in BW update rule and transfer rules. (No routines or formulas exist)/
    7) When load extracted into BW, data is blank for both the fields in PSA itself.
    Our BW is 7.3 but we still use this datasource as 3.x transfer rules and datasource. In BW, it is connected to the Cube 0OPA_C11 via update rules and 3.x transfer rules only.
    Is there any reason for the data being populated into the RSA3, where as not into PSA. Please consider the above points, and let me know if I have done or missing anything here in my steps. I have gone thru several forums and havent got any specific replies for such issues. Have you come across such issues, please share your thoughts and views.
    Any of your replies will definitely help. Really appreciate your inputs.
    Thanks!!
    Prasith

    Hi Prasith ,
    After reading all the answers , what i feel we are  missing a major step ie  Re-initialization of the cube .
    As you changed the extract structure and added new fields and for this Data source i assume that deltas were  running already  , the BW  system cannot pull these new fields directly from ECC unless you have not done a  re-INit again .
    The Re-init is pretty simple and not as complex as LO.
    I would advise you to re-init for 01.2014 till 016.9999  , run full load and then delatas  will flow in later on . Check during the full load if you are able to see these fields in BW in (PSA/ Cube) .
    But be careful you need to do Re-init only on week ends when there are no transactions happening else you might end up in duplicate data .
    Hope this helps !
    Let me know how it goes .
    Regards
    Zeenath

  • SRM 7.0 New custom fields added to view do not appear in the component conf

    Hi
    I added two custom fields to the view V_QTE_DOFC_I_DESC of the WD componenet /SAPSRM/WDC_DODC_QTE_I_DS. This view gets called when bidder is trying to create a bid and clicks on add Substitute Item in the Item tab. This view is simply a popup window where we can enter ther substitute item.
    I added two custom fields to the context of the above view and placed on the layout of the view as input fields. Then I tried to modify the component configuration /SAPSRM/WDCC_DODC_QTE_I_DS_SUB. When I look in t he web dynrpo built-in for the view V_QTE_DOFC_I_DESC, I don't see the custom fields that I just added. As a result, these custom fields are not displayed when I try to substitute an item. Could anyone tell me how to brining in these two custom fields into the component configuration.
    Any help is greatly appreciated.

    Hi Prasuna,
    Sorry ..You are right..I was looking at some other WDC related to contract data..It you map the CUFs to /SAPSRM/S_CLL_CTR_ITEM which has the include structure INCL_EEW_PD_ITEM_CSF_CTR then it should work fine.
    If you do this, are you able to view the new fields on the screen?
    you mentioned that you are not able to save the data to the table.
    Include your fields in INCL_EEW_PD_ITEM_CSF as well because if you add CUF to any of those doc types, you also have to add those CUF to the global structure for CUF documents.
    Also Check if you fields are there in structures BBPS_CTR_CUF_ITEM,BBPS_CTR_UI_ITEM and BBPS_CTR_ITEM.
    Check whether you have implemented the BADI's like BBP_DOC_CHECK_BADI ,BBP_DOC_CHANGE_BADI and BBP_DOC_SAVE_BADI . check out the structures (whether they having the CUFS) used in those if you have implemented any of them .
    Regards
    Lavanya
    Edited by: LAVANYA CHAVA on Aug 25, 2010 10:10 AM

  • Problem in posting Custom fields in Purchase Order using BAPI_PO_CREATE1

    Hi friends,
    Did any body tried populating custom fields using BAPI_PO_CREATE1?
    I am trying to populate custom fields in Header.
    I am populating EXTENSIONIN-STRUCTURE with 'BAPI_TE_MEPOHEADER' and EXTENSIONIN-VALUEPART1 with respective values of fields using the code below.
    T_CUSTDATA_IN-PROJECT_ID_NUM = '543211'.
    T_CUSTDATA_INX-PROJECT_ID_NUM = 'X'.
    MOVE 'BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-STRUCTURE.
    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.
    MOVE-CORRESPONDING T_CUSTDATA_IN TO T_BAPI_TE_MEPOHEADER.
    MOVE 'T_BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-VALUEPART1.
    APPEND T_EXTENSIONIN.
    MOVE 'BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-STRUCTURE.
    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.
    MOVE-CORRESPONDING T_CUSTDATA_INX TO T_BAPI_TE_MEPOHEADERX.
    MOVE 'T_BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-VALUEPART1.
    APPEND T_EXTENSIONIN.
    But still it is not populating the custom fields.
    Can some body help me on this?
    Thanks & Regards,
    Ramesh Kodavati

    Hi,
    You require to implement the Badi ME_BAPI_PO_CUST
                                               Method MAP2I_EXTENSIONIN or INBOUND
    for changing the parameter CH_EXTENSIONIN in method INBOUND
                                       or  CH_STRUC in method MAP2I_EXTENSIONIN.
    in addition to passing the extensionin parameters in bapi.
    implement the above said bapi and put a break point in both of the methods (exactly i don't remember)
    and check values are populating in the CH_STRUC structure.
    Regards,
    Dwaraka.S

  • Search help for custom fields added through BADI_FDCB_SUBBAS04

    Hi guys
    I have two cutom fields on basic data screen that i have added using an implementation of the BADI
    BADI_FDCB_SUBBAS04
    I want to use the value entered in one of the fields as a import parameter in another fiields search help.  On value request the structure INVFO contains the other data entered on screen in the basic data screen however my custom fields appear empty. 
    However if i press enter and request values again the search help will pop up correctly.  Is there a way i can avoid having to press enter before i can get my values??
    regards
    Isaac Prince

    Hi guys
    I have not found any notes/texts regarding my issue however i think with some user training/re-orientation the small issue will go away.
    regards
    Isaac Prince

  • How to change the Tab name for a custom field added in IC Winclient

    I have successfully added a field using eewb and it is appearing on my transaction in CIC0 but it is on a tab that says Customer Fields.  In EEWB a BADI called ZEEW_CUSTOMER_H01 was generated and it has a methods called  CRM_CUSTOMER_H_SET_TITLE.  It indicates you should be able to use this to rename the tab but the method is empty.  Anyone have an example of the code you pass in to rename the tab screen.  Thanks, Lisa

    >>and how will it effect in the report?
    You wouldn't see any direct effect on the Report.. But if you transport the report to QA & leave the Message class in Dev, it might result in syntax issues & you will not be able to execute the report. Just ensure that both of them get transported to QA & you will be fine.
    ~Suresh

  • FM for CUSTOM FIELDS added in BP transaction

    Hi all,
      We have added few custom fields in the BP transaction.
      Now the thing is we need to update those using Function module.
      Could any one please help me like in which Function Module can i found those
      fields once i add in the BP transaction?
    Thanks and Regards,
    Gopinath A

    Hi Gopi,
    Have you used EEW to add these fields?
    There should be a function module(s) generated for this new fields which you can use to update this fields?  Probably something  like
    'BUPA_CENTRAL_CI_CHANGE'
    Hope this helps.
    Surendar

  • Problem in delta management for custom fields added in standard Table

    Hi developers,
    we have a problem, when a sales order is modified in a field custom, added in tables (VBAP-VBAK), the delta BW doesn't recognize the modifications. The data type of these fields haven't the flag (Change document) setted in
    view Definition.
    If this flag is setted, Can the delta BW recognize the modifications of the custom fields?
    Best regards
    Domenico

    You cannot get delta by just appending fields to extract structure & writing the user exit coding as this user exit code is run by the extractor after the X- and Y- tables are compared to create the before & after images.
    You have to do this procedure by enhancing  LIS comm structures like MCVBAP (for example).
    Please refer to OSS note 576886 for complete details.
    Kumar Gudiseva.

  • Add custom fields on selection screen  and ouput in Transaction QM11

    Hi All,
       i have the requirement to enhance the transaction qm11( Report : RQMELL10) to add the custom fields on the report selection screen and in the report output.
      i tried to add the fields on selection screen by copy the standard program RQMELL10 to custom one. and tried to add the fields above to the coding tab but i am not able to display the text for those fields of select-options. can any one help me is it the right way to copy the standard program to custom program and adding the custom fields and how to get the text element for the custom fields which we are going to add it. i tried to add the text element in program text elements but it is not appering on the report.
    please requeting the help asap if it is possible.

    Have a glance in below thread.
    Enhancing transaction QM10
    Also, there are some more threads available in enhancing the QM10 / QM11. Please search those as well.

Maybe you are looking for