Purchase Order - save data via BADI failed

Hi all,
I have created a zfield in a new tab at item level  of the purchase order that saved data into a custom table successfully. This is via BADI.
However I like to save the zfield into ci_ekpodb which stored into EKPO.  In the function module that does the
updates,   i have for a new line item for it to insert into EKPO but it abended with error 'SAPSQL_ARRAY_INSERT_DUPREC".
This insert results in duplicate database records.
The codes are: 
data: lt_item_new  type table of zpo_trace.
'If  lt_item_new is not initial'.
    Insert EKPO from table lt_item_new.
Endif.
Have anyone experience insert new line item into EKPO via ci_ekpodb ?  Pls share any thoughts.
thanks
Joyce

Hi Joyce,
If you are using the BADI, ME_PROCESS_PO_CUST , you can used the method PROCESS_ITEM .
You have a object IM_ITEM on which the method get_data or set_data can be called to populate the data to be sent to the EKPO Table.
Example :
data : ls_ekpo TYPE mepoitem.
CALL METHOD im_item->get_data
    RECEIVING
      re_data = ls_ekpo.
Populate the values against the desired line item as per requirement in the structure ls_ekpo .
Once done, you can use the method set_data of the same instance to pass the data to the structure.
CALL METHOD im_item->set_data
        EXPORTING
          im_data = ls_ekpo.
Hope this helps.
Regards,
Sagar

Similar Messages

  • Purchase order save issue, Using through BADI  PROCESS_PO_CUST ME21n

    Hi,
    Pls  Experts ,can we have some solution for this
    Purchase order save issue,  we are Using  BADI  PROCESS_PO_CUST currently we are throwing a
    message  using MMPUR_MESSAGE_FORCED if mandatory custom fields are not entered by the User,
    When we are saving the PO we are getting a exception which is raised by us ( custom message ) .
    Pls let me know is there any way to clear the message or to make mandory custom fields to be entered by user ..
    thanks  in advance...
    PK

    Hi Arnab,
    Thanks for quick response ..
    My requirement is if user is not entering the cusome fields then  i dont want to allow him to process any other Tabstrips  in the order .. thats the reason i am throwing an error message asking to enter custom fields.. then once user enters the custom fields which are created by   me .. then i should consider those values for further process like some other tab strips values maintained by the user then when we try to Save the PO still my custom error will be creating issue its not allowing to save..
    Can i have some solution ..
    thanks in advance.
    kumar

  • Purchase order Confirmation data from SRM to MM

    Hi,
    I am trying to send Purchase order Confirmation data from SRM to MM via PI. In SRM portal i am able to see that the data has been send successfully. But i am not able to receive any data in PI nor iam able to any messages going from  SRM in SXMB_MONI.
    Please help me.
    Thanks & Regards
    Kasturika Phukan

    Hi,
      In SRM check in sxmb_moni is there any queue is blocked.
      If not then,
      Check your proxy settings.Select Go To and check connection Test.
      Go to sm59 and check H type RFC destination is maintained.
      Go to sxmb_adm check the Global setting value,
      Application system,dest://RFC destination is maintained.
      In XI,
      Go to SLD.
      Check Technical system (client with logical system) maintained.
      Check Business System maintained with role of application system,Related integration engine
      maintained.
    Regards,
    Prakasu.M

  • Change Purchase Order : Document Date

    Hi Gurus,
    I would like to change Purchase Order: Document Date due to wrong input but I found out this field has been grayed out from change (ME22/ME22N) after save.
    Can anyone tell me how to solve this problem?
    Thanks & regards,
    Loi

    Dear Gurus,
    Is there is any effect of changing the PO's Document date? What is the usage of PO's Document date, in which area?
    If no effect, can I customize the PO: Document Date field through Application transaction variant function?
    Pls adivse.
    Thanks & regards,
    Loi

  • Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD

    Greetings All,
    I've a requirement to create a custom tab in the VL01N/VL02N/VL03N header record displaying custom fields.
    I've successfully implemented BADI LE_SHP_TAB_CUST_HEAD, created a subscreen, appended my custom fields to the LIKP table via append structure, and can now view my fields in the transactions listed above.
    I'm having trouble updating the fields in the subscreen and save the values back to the LIKP table.  First question is a) do I do this via the PBO PAI modules in my subscreen, or should I be doing this in the BADI?
    Second question is, if I shuodl be doing this in the BADI, how do I do it.  A simple example is that I have created a field called ZZ_CUST_TIME in LIKP, added it to my sub-screen using data dictionary linking.
    How do I pass a value entered into this field via VL02N back to the transaction for update?
    Any suggestions would be greatfully appreciated.
    Regards,
    Steve

    Dear Abhishek,  can you explain the step..in this step screen is comming but custom fields value is not coming and also likp table is not updated
    Correct AnswerRe: Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD
    Abhisek Biswas Jan 21, 2009 7:28 AM (in response to Stephen Keam)
    Hi Stephen,
    You can do it by using PBO and PAI modules of the screen that you created. But you have to transfer the data from subscreen to the BADI method TRANSFER_DATA_FROM_SUBSCREEN and aslo from method TRANSFER_DATA_TO_SUBSCREEN to the subscreen. This will update the screen field data to LIKP.
    You can aceive this by two ways.
    1) You can use EXPORT in method TRANSFER_DATA_TO_SUBSCREEN and then IMPORT the value in the screen PBO. And You can EXPORT data from screen PAI and IMPORT data in method TRANSFER_DATA_FROM_SUBSCREEN.
    2) Anither way to do it is by using Function modules and Function Group instead of EXPORT/IMPORT.
    Create a Function group. In the global data define a structure/Work Area of type LIKP.
    DATA w_likp TYPE likp.
    Then create two Function modules, one to export data and another to import data.
    Let us assume that the export FM takes in IS_LIKP as input and the import FM outputs the value of LIKP into ES_LIKP.
    Then pass the value is_likp to the export FM in the BADI method TRANSFER_DATA_TO_SUBSCREEN and in the screen PAI pass the LIKP data to the export FM.
    In the export Function module write the following code:
    MOVE is_likp TO w_likp
    Then in the Import FM write the following code:
    MOVE w_likp TO es_likp.
    The import FM is called from method TRANSFER_DATA_FROM_SUBSCREEN and from screen PBO.
    This will solve your problem.
    Regards,
    Abhisek.
    Alert Moderator
    Like (0)
    Reply

  • Purchase Order released date field and table name

    Hi,
    Please tell me the  Purchase Order released date field and table name.
    Regards
    Deepak

    Hi,
    Table : EKKO.
    Fields : FRGKE,FRGZU.
    You can get release date of PO from CDHDR  table.
    give object value as your po number and check.dont forget to give leading zeros.
    The udate will be date field and transaction will be me29n for relaesed po.

  • Purchase order Document date in AP Downpayment invoice PLD

    Dear All,
    Is it possible to capture purchase order Document Date in AP Down payment invoice PLD.My client want like this.I have tried,but i am not able to capture this field in AP Down payment invoice PLD.please give me the solution for this,If it is possible.
    Thanks,
    Silpa.N

    hi silpa,
    Create a user defined field in row level of marketing documents.
    Apply formatted search using query
    Select $[OPOR.TaxDate]
    select auto refresh
    when changing field Document Date in header level.
    On copying purchase order to ap downpayment invoice Document date will copy to it.
    U can also bring it to PLD by creating database field with table DPO1,column U_XXX
    Hope it will solve problem.
    Jeyakanthan

  • Extracting Purchase Order condition data

    Hi All,
    I have requirement where as i need to pull the purchase order condition data, but i haven't found any datasources regarding that, can somebody guide me how to pull that data to BW.
    thanks
    Neel

    Hi Neel,
    Create view of EKKO ( Purchasing header ) and KONV  (Conditions (Transaction Data)) and link it on EKKO-KNUMV to KONV-KNUMV.
    Create Generic Extractor based on the View.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • Purchase Order Condition Data

    Hi,
    Can anybody please explain what is Purchase Order Condition Data ( KONV ).
    What is the use of it in the report.
    Thanks,
    JB

    .

  • Purchase Order release date

    Dear Experts
    Can anybody give me table & field of Purchase order release date .
    which we can see in Version tab of ME23n
    thanks
    Nayan Lad

    hi,
    please refer to the following thread:
    TAble for PO Release date
    i hope it helps.
    arjun

  • MRP and purchase order delivery date

    Hello
    Question about MRP
    we would like that the MRP run takes into account purchase order with a delivery date in the future
    Say the MRP run 10th of Oct we want that all purchase orders open with a delivery date in the future takes into account the quantity that needs to be ordered TODAY
    EXAMPLE
    Minimum stock 5
    Wse stock 0
    Purchase order delivery date D+1 10
    Lead time is 5 days
    So if you run MRP the systems proposes 5 to order today but they do not want  to order 5 because there is a coming purchase order D+1 of 10
    Does anyone knows how the pruchase order of 10 is taken into account in the MRP run ?

    Unfortunately, one of the weakness of SAP MRP is if a purchase order and/or production order is late, MRP will tell you to order it again instead of expediting.
    We have overcome this and other issues with our own economical planning enhancements. If you are interested you can contact me with your contact information

  • Purchase order Delivery date based on PO doc no and PO item no

    hi all
    we have a  requirement to bring Purchase order delivery date in to our report .
    it is in EKET Table - field EINDT.
    Is it possible to get this PO Delivery date in to our data source 2lis_02_itm which has PO Doc no(EBELN) and PO item.no (EBELP).
    In EKET Table the primary key is based on 3 fields. PO Doc no(EBELN), PO Itm.no(EBLEP) and delivery schedule line counter (ETENR).
    In EKET Table the data is like
    PO.NO/PO itm no/ schline counter/delivery date
    1000/10/1/1-1-2011
    1000/10/2/5-1-2011
    1000/20/1/2-2-2011
    1000/20/2/2-2-2011
    1000/20/3/5-2-2011
    so on...
    IF i enhance my datasource and populate the delivery date based on EBELN and EBELP we get only 1 delivery date for all the different schedule lines which is wrong.
    I know there is a separate datasource for schedule line data for purchasing BUT IS IT POSSIBLE TO GET the delivery date based on the different schedules by using some ABAP CODE, SINCE in our datasource 2lis_02_itm we dont have ETENR( SCHEDULE LINE COUNTER FIELD).
    if we use the standard data source  (2lis_02_SCL )it is not fair to pull all that data since we only need 1 field from it.
    Please suggest
    Thanks & Regards.
    Krishna

    Hi Krishna,
    Even though you plan to write some ABAP code or do any processing for a combination of PO document no. and Item no. you will always get multiple records with different schedule line items and it is really impossible to take the delivery date without knowing schedule line item no.
    And even when you said PO delivery date, it is actually means delivery date of any of the schedule line only. If you want to write some ABAP logic then you will have to decide like whether you want to display the First line item date or the last line item date etc. But which is again not a good idea.
    I think you can go for schedule line extractor.
    Regards,
    Durgesh.

  • HOW CAN I GET THE PURCHASE ORDER RELEASE DATE

    Dear All,
    HOW CAN I GET THE PURCHASE ORDER RELEASE DATE - any reprot is there?
    Thank you
    Ahmad

    Hi,
    u goto that PO and select Environment on top line .under that select header changes if u click on that u will get entire details who reased when released, date , time etc
    regards,
    Srinivas Kona

  • Date Deviates from permissible range [Purchase Order - Value Date]

    hello all,
    i want to add a Purchase Order (Services) Posting date 05/07/2008 and Delivery Date is 09/30/2008, it prompts me the Error "Date Deviates from permissible range [Purchase Order - Value Date]", now this is my question.
    what is the date range for PO posting date and delivery date that the system will allow(date difference)? can i set this one?
    Note: we need to make an advance PO for this since our BP required this time period for them to accomplished.
    Please help.
    Thanks.
    FIDEL

    FIDEL,
    All documents have 3 dates DocDate, DocDueDate, TaxDate.  The date ranges for these dates are taken from the Active Posting period definition.
    Open Administration  > System Initialization  > General Settings > Posting Periods
    Click on the Yellow link arrow next to the current posting period and check the Due Date From and To Range and expand the To date to cover 09/30/2008
    Posting Date From
    Due Date From
    Document Date From
    Suda

  • Whats the fieldname and table name for purchase order delivery date

    hi all,
        whats the fieldname and table name for purchase order delivery date
      thanks and regrads

    EKET-EINDT is the delivery date according to the schedule lines.
    for example the line item has 100 qty.
    it is sent in three schedules (40, 40, 20).
    Then EKET will have 3 records for one PO Line item.
    The final delievry data is the EKET-EINDT for the 3rd schedule line item.
    Regards,
    Ravi

Maybe you are looking for