BAPI_PO_CREATE1 - Delivery date

Hi all,
I'm trying to create a PO by BAPI_PO_CREATE1.
The problem is that the PO is created with a default delivery date and no the one I passed it.
I put in the po_schedule table the delivery_Date and also I fill the po_schedulex table, but the new PO has another delivery date. Do Any one know why?
thanks,
enzo

HI Enzo,
This is just for verification...see the fields that you have used in poschedule and poschedulex
Parameter: POSCHEDULE                               
PO_ITEM              =                    00001     
SCHED_LINE           =                    0001      
DELIVERY_DATE        =                    02.12.2002
QUANTITY             =                    6.000     
Parameter: POSCHEDULEX                          
PO_ITEM              =                    00001 
SCHED_LINE           =                    0001  
PO_ITEMX             =                    X     
SCHED_LINEX          =                    X     
DELIVERY_DATE        =                    X     
QUANTITY             =                    X     
Pls ignore the reply if you did this already..
Thanks,
Renjith

Similar Messages

  • BAPI_PO_CREATE1 delivery date ignored by system

    Hi, everyone:
    I use BAPI: BAPI_PO_CREATE1 to create PO, and I specify the delivery date as following codes. But the system ignored my delivery date and give another one.
    "{Schedule line
         CLEAR POSCHEDULE.
         POSCHEDULE-PO_ITEM = EBELP.
         POSCHEDULE-SCHED_LINE = '0001'.
         POSCHEDULE-DEL_DATCAT_EXT = 'D'.
         POSCHEDULE-DELIVERY_DATE = SY-DATUM.
         POSCHEDULE-QUANTITY = IT_ITEM-MENGE.
         POSCHEDULE-STAT_DATE = SY-DATUM.
         POSCHEDULE-PO_DATE = SY-DATUM.
         APPEND POSCHEDULE.
         CLEAR POSCHEDULEX.
         POSCHEDULEX-PO_ITEM = EBELP.
         POSCHEDULEX-SCHED_LINE = '0001'.
         POSCHEDULEX-PO_ITEMX = 'X'.
         POSCHEDULEX-SCHED_LINEX = 'X'.
         POSCHEDULEX-DEL_DATCAT_EXT = 'X'.
         POSCHEDULEX-DELIVERY_DATE = 'X'.
         POSCHEDULEX-QUANTITY = 'X'.
         POSCHEDULEX-STAT_DATE = 'X'.
         POSCHEDULEX-PO_DATE = 'X'.
         APPEND POSCHEDULEX.
    What causes this problem?
    Thanks in advance.

    Hello ,
    This works fine for us :
        ls_poschedule-po_item = ls_ekpo-ebelp.
        ls_poschedule-delivery_date = id_delivery_date.
        APPEND ls_poschedule TO lt_poschedule.
        ls_poschedulex-po_item = ls_ekpo-ebelp.
        ls_poschedulex-po_itemx = 'X'.
        ls_poschedulex-delivery_date = 'X'.
        APPEND ls_poschedulex TO lt_poschedulex.
    Regards,
    Didier

  • BAPI_PO_CREATE1 - Delivery date regarding

    Hi experts.
    I am creating PO by function module above. Problem is, that delivery date of order is calculating by system, not by my own proposal.
    Is there any method, field in structure or something else to turn off that proposal ... ?
    Thanks a lot.

    POSCHEDULE structure is filled. Problem is when for example delivery date is in some other date than system wants.
    I mean when I want to create PO with long deliv.date like 1 year, system will generate warning (we can see that in ME21). I want omit that warning and create PO with my own deliv.date ...
    Thanks.

  • BAPI_PO_CREATE1 - Delivery date not changing

    Hi All,
    I ''m using BAPI_PO_CREATE1 for po creation.
    When I try to enter the po creation date using the bapi its not taking the value I enter.
    It takes from the system .
          it_shed-po_item       = git_input-ebelp.
          it_shed-sched_line    = '0001'.
          it_shed-delivery_date = '25.05.2008'.
          it_shed-stat_date = '25.05.2008'.
          it_shed-quantity      = git_input-menge.
          it_shed-DEL_DATCAT_EXT = 'D'.
          APPEND it_shed.
          it_shedx-po_item   = git_input-ebelp.
          it_shed-sched_line = '0001'.
          it_shedx-po_itemx   = 'X'.
          it_shedx-sched_linex = 'X'.
          it_shedx-delivery_date = 'X'.
          it_shedx-quantity      = git_input-menge.
          it_shedx-DEL_DATCAT_EXT = 'X'.
          it_shedx-stat_date = 'X'.
          APPEND it_shedx.
    Please let me know how to enter the date.
    Thanks

    Hi Ann,
    Currently I don´t have a system to test it myself, but can you please try the following:
    Replace '25.05.2008' by '20080525', the first is a external format and the second is the format used internally.
    I don´t know you copied the code or you have written it again, but the field sched_line in the second structure is still pointing to the first (missing x)..
    I hope this helps you!
    Good luck!

  • Problem in BAPI_PO_CREATE1 with delivery date option

    Hi Experts,
    I'm using BAPI_PO_CREATE1 for uploading user excel file to create purchase orders.
    The issue is PO is created successfully but the delivery date is not picking properly. System is picking some other delivery date.
    Can any one help me out from this?????????
    Any USEFUL INPUTS for solving this issue will be rewarded.
    Code :
    REPORT zmm_bapi_po_create.
    *                             ''~``
    *                            ( o o )
    *    +------------------.oooO--(_)--Oooo.------------------+
    *    | ZMM_BAPI_PO_CREATE -To create Purchase orders       |
    *    |                                                     |
    *    |                    .oooO                            |
    *    |                    (   )   Oooo.                    |
    *    +---------------------\ (----(   )--------------------+
    *&    Program Name     : ZMM_BAPI_PO_CREATE
    *&    Transaction Code :
    *&    Module Name      : MM
    *&    Developer        : Lakshmiraj.A
    *&    Functional       : Xavier
    *&    Transport Request:
    *&    Program Type     : Report
    *&    SAP Release      : 46C
    *&****************************REVISION LOG*****************************
    *&  Log     Date         Author              Description
    *&------------------------ TABLE USED --------------------------------*
    *&---------------------- VARIABLE DECLARATION ------------------------*
    *  For Storing file name.
    DATA  : filename1 TYPE string.
    *  Flag to identify the matching entries
    DATA  : flag(1).
    *  For Display Message
    DATA  : g_msg(80) TYPE c.
    *  Declaring that as a character with length 4096.
    TYPES truxs_t_text_data(4096) TYPE c OCCURS 0. "  Type Group : TRUXS
    *  Containing RAW Data
    DATA : it_raw TYPE truxs_t_text_data.
    *&------------------------- INTERNAL TABLE ---------------------------*
    DATA: gstest LIKE bapimepoheader.
    DATA: g_ebeln LIKE bapimepoheader-po_number.
    DATA: BEGIN OF g_bapimepoheader OCCURS 0.
            INCLUDE STRUCTURE bapimepoheader.
    DATA: END OF g_bapimepoheader.
    DATA: BEGIN OF g_bapimepoheaderx OCCURS 0.
            INCLUDE STRUCTURE bapimepoheaderx.
    DATA: END OF g_bapimepoheaderx.
    DATA: BEGIN OF g_bapimeposchedule OCCURS 0.
            INCLUDE STRUCTURE bapimeposchedule.
    DATA: END OF g_bapimeposchedule.
    DATA: BEGIN OF g_poschedulex OCCURS 0.
            INCLUDE STRUCTURE bapimeposchedulx.
    DATA: END OF g_poschedulex.
    *DATA: BEGIN OF g_bapieikp OCCURS 0.
    *        INCLUDE STRUCTURE bapieikp.
    *DATA: END OF g_bapieikp.
    DATA: BEGIN OF g_bapimepoitem OCCURS 0.
            INCLUDE STRUCTURE bapimepoitem.
    DATA: END OF g_bapimepoitem.
    DATA: BEGIN OF g_poitemx OCCURS 0.
            INCLUDE STRUCTURE bapimepoitemx.
    DATA: END OF g_poitemx.
    DATA: BEGIN OF g_bapiret2 OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF g_bapiret2.
    DATA: BEGIN OF itab OCCURS 0,
    doc_type       LIKE    bapimepoheader-doc_type,
    vendor         LIKE    bapimepoheader-vendor,
    purch_org      LIKE    bapimepoheader-purch_org,
    pur_group      LIKE    bapimepoheader-pur_group,
    comp_code      LIKE    bapimepoheader-comp_code,
    incoterms1 LIKE bapimepoheader-incoterms1,
    incoterms2 LIKE bapimepoheader-incoterms2,
    po_item        LIKE    bapimepoitem-po_item,
    material       LIKE    bapimepoitem-material,
    short_text     LIKE    bapimepoitem-short_text,
    quantity       LIKE    bapimepoitem-quantity,
    plant          LIKE    bapimepoitem-plant,
    delivery_date  LIKE    bapimeposchedule-delivery_date,
    END OF itab.
    DATA: it_itab LIKE itab OCCURS 0 WITH HEADER LINE.
    *&------------------------ SELECTION SCREEN --------------------------*
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-100.
    PARAMETERS : p_file LIKE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK blk.
    *&-----------------------AT SELECTION SCREEN -------------------------*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    * For getting input filename
      PERFORM get_filename.
    *&-----------------------START OF SELECTION---------------------------*
    START-OF-SELECTION.
    * Open the Excel file and Update with the internal table
      PERFORM update_inttable.
      PERFORM bapi_upload.
    *       FORM bapi_upload                                              *
    FORM bapi_upload.
      it_itab[] = itab[].
      SORT itab BY vendor material.
      DELETE ADJACENT DUPLICATES FROM itab COMPARING vendor.
      LOOP AT itab.
        g_bapimepoheader-comp_code = itab-comp_code.
        g_bapimepoheader-doc_type = itab-doc_type.
        g_bapimepoheader-creat_date = sy-datum.
        g_bapimepoheader-created_by = sy-uname.
        g_bapimepoheader-vendor = itab-vendor.
        g_bapimepoheader-purch_org = itab-purch_org.
        g_bapimepoheader-pur_group = itab-pur_group.
        g_bapimepoheader-incoterms1 = itab-incoterms1.
        g_bapimepoheader-incoterms2 = itab-incoterms2.
        APPEND g_bapimepoheader.
        g_bapimepoheaderx-comp_code = 'X'.
        g_bapimepoheaderx-vendor = 'X'.
        g_bapimepoheaderx-doc_type = 'X'.
        g_bapimepoheaderx-purch_org = 'X'.
        g_bapimepoheaderx-pur_group = 'X'.
        g_bapimepoheaderx-incoterms1 = 'X'.
        g_bapimepoheaderx-incoterms2 = 'X'.
        APPEND g_bapimepoheaderx.
        LOOP AT it_itab WHERE vendor = itab-vendor.
          MOVE-CORRESPONDING it_itab TO g_bapimepoitem.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
               EXPORTING
                    input  = it_itab-material
               IMPORTING
                    output = it_itab-material.
          g_bapimepoitem-material = it_itab-material.
          APPEND g_bapimepoitem.
          g_poitemx-po_item = it_itab-po_item.
          g_poitemx-po_itemx = 'X'.
          g_poitemx-item_cat = 'X'.
          g_poitemx-plant = 'X'.
          g_poitemx-stge_loc = 'X'.
          g_poitemx-net_price = 'X'.
          g_poitemx-acctasscat = 'X'.
          g_poitemx-material = 'X'.
          g_poitemx-short_text = 'X'.
          g_poitemx-matl_group = 'X'.
          g_poitemx-quantity = 'X'.
          g_poitemx-po_unit = 'X'.
          g_poitemx-orderpr_un = 'X'.
          g_poitemx-trackingno = 'X'.
          g_poitemx-delete_ind = 'X'.
          APPEND g_poitemx.
          g_bapimeposchedule-po_item = it_itab-po_item.
          g_bapimeposchedule-sched_line = '001'.
          g_bapimeposchedule-del_datcat_ext = 'X'.
          g_bapimeposchedule-delivery_date = it_itab-delivery_date.
          g_bapimeposchedule-quantity = it_itab-quantity.
          APPEND g_bapimeposchedule.
          g_poschedulex-po_item = it_itab-po_item.
          g_poschedulex-sched_line = '001'.
          g_poschedulex-po_itemx = 'X'.
          g_poschedulex-sched_linex = 'X'.
          g_poschedulex-del_datcat_ext = 'X'.
          g_poschedulex-delivery_date = 'X'.
          g_poschedulex-quantity = 'X'.
          g_poschedulex-deliv_time = 'X'.
          g_poschedulex-stat_date = 'X'.
          APPEND g_poschedulex.
        ENDLOOP.
        CALL FUNCTION 'BAPI_PO_CREATE1'
             EXPORTING
                  poheader         = g_bapimepoheader
                  poheaderx        = g_bapimepoheaderx
             IMPORTING
                  exppurchaseorder = g_ebeln
                  expheader        = gstest
             TABLES
                  return           = g_bapiret2
                  poitem           = g_bapimepoitem
                  poitemx          = g_poitemx
                  poschedule       = g_bapimeposchedule
                  poschedulex      = g_poschedulex.
        IF NOT g_ebeln IS INITIAL.
          COMMIT WORK.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
               EXPORTING
                    wait = ''.
          REFRESH : g_bapimepoitem,
                    g_bapimepoheader,
                    g_bapimepoheaderx,
                    g_bapiret2,
                    g_poitemx,
                    g_bapimeposchedule,
                    g_poschedulex.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    *       FORM GET_FILENAME                                             *
    FORM get_filename.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = sy-cprog
                dynpro_number = sy-dynnr
                field_name    = ''
           IMPORTING
                file_name     = p_file.
    ENDFORM.
    *       FORM UPDATE_INTTABLE                                          *
    FORM update_inttable.
      REFRESH : itab[] , itab.
      CLEAR : itab.
      IF NOT p_file IS INITIAL.
        CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
    *     I_FIELD_SEPERATOR         =
           i_line_header            =  'X'
           i_tab_raw_data          =  it_raw         "  WORK TABLE
           i_filename               =  p_file
         TABLES
           i_tab_converted_data     = itab[]    "  ACTUAL DATA
         EXCEPTIONS
           conversion_failed        = 1
           OTHERS                   = 2.
        IF sy-subrc NE '0'.
          PERFORM callerr USING 'File Error!'.
          STOP.
        ENDIF.
      ELSE.
        PERFORM callerr USING 'Choose the file'.
        STOP.
      ENDIF.
    ENDFORM.
    *       FORM CALLERR                                                  *
    *  -->  TEXT                                                          *
    FORM callerr USING text TYPE string.
      CALL FUNCTION 'FC_POPUP_ERR_WARN_MESSAGE'
           EXPORTING
                popup_title  = 'ZMM_BAPI_PO_CREATE'
                is_error     = 'X'
                message_text = text
                start_column = 30
                start_row    = 8.
    ENDFORM.
    Regards
    ~Lakshmiraj~

    Hi,
    1. In Which system you are trying to run this ????  Are you running in IDES or currently running system?
       The reason may be if you are running in IDES , the factory calender may not be correctly positioned.
    2. Also this error will occur at situations like....if your factory calendar will be of 2007 year....but the delievery date which you are giving is of 2008 . So error "delivery date exceeds factory calendar" occurs.
    Some useful info for you,
    Factory calander is must to run SAP. All the scheduling are calculated based on this only. You can define halidays for factory and assign to the calander. You can have 365 days calander / Sat& SU holiday calander or the holiday can be your wish.
    The T code is SCAL.  create holidays first. create holiday calendar and assign the holidays in holiday calendar. create factory calender and assign the holiday calendar in factory calendar.The Factory calendar is client specific
    Rgds,
    Lakshmiraj

  • Stock Transfer Order: Delivery date issue BAPI_PO_CREATE1

    Hi,
    I am creating STO using Inbound Delivery data from BAPI_PO_CREATE1
    inbound shipping date is 30 may 2014.
    Passing below data
    HeaderData:
    doc_type = 'UB'.     "STO
    suppl_plnt     =     '101'
    doc_date     =     inbound shipping date.
    comp_code     =     '1000'
    purch_org = '20'
    pur_group     =     '200'
    Headerx Data:
    doc_type = X
    suppl_plnt     =     X
    doc_date     =     X.
    comp_code     =    X
    purch_org = X
    pur_group     =   x
    Item Data:
    Po_item = tabix of loop
    Material = material from Inbound delivery item
    plant = '101'
    strge_loc = W.
    Qunatity = from Inbound item only.
    ItemX Data:
    Po_item = X
    Material = X
    plant = 'x
    strge_loc = X.
    Qunatity = X.
    Schedule Line Data:
    po_item = tabix of loop
    schedule_line = '001'
    delivery_date = shipping date
    del_datcat_ext = 'D'.
    Quantity     =     quantity from Inbound item.
    call function 'bapi_po_create1'.
         exporting   
              poheader = header data
              poheaderx = headerx data
          importing
              exppurchaseorder = po
          table
              return = return
              poitem = item data
              poitemx = itemx data
              poschedule = schedule data
              poschedulex = schedulex data.
    when i am creating STO with above method STO is getting created and all data in it also correct but delivery date is 20th june 2014
    instead of 30 may 2014.
    it is coming as there is planned delivery time that is 21 so it is showing 20th june 2014.
    but i need this value as 30th may 2014 only.
    please help me on that.
    thanks in advance.
    Regards,
    Gaurav

    Hello,
    You have to populate internal tables pocond and pocondx with values for itm_number,cond_st_no,cond_count,cond_value,cond_type, currency and change_id. Then call BAPI_PO_CREATE1.
    Thanks,
    Venu

  • Delivery date not getting transferred while running BAPI_PO_CREATE1

    Hi Experts,
    I am passing the delivery date item level delivery schedule to the function module
    BAPI_PO_CREATE1. But it's not taking it in.The new PO is gettinig created with blank delivery date. I implemented the OSS notes 858316 & 890901 with no luck in this matter.
    Please help.
    Regards
    Navin

    Hi JJ
    BADI BBP_DOC_CHANGE_BADI- BUS2201 . while creating PO try to validate them if you are in ecs mode
    i believe standard SAP dont recalculate delivery date while creation of PO.
    regards
    Muthu

  • Delivery Date Format in PO !!!

    Hi Friends ,
    I am uploading the delivery date from an input file to create a PO using BAPI_PO_CREATE1 . Before the BAPI call i see in t_poschedule-delivery_date = 08012006.This is the correct date which needs to be uploaded in PO . 
    But after the BAPI call the t_poschedule-delivery_date = 06/23/2006.
    Can you please advise why this is happening ??
    Thank you

    Here you go Dude...!!!
    <b>FYI</b>
    <b><u>OSS Note # 858316</u></b>
    <b>BAPI_PO_CREATE1: Incorrect delivery date</b>
    Symptom
    You create a purchase order using the BAPI_PO_CREATE1 function module or the CreateFromData1 method of the PurchaseOrder business object (BUS2012). When you do this, you transfer the delivery date and/or the statistical delivery date in the schedule lines using the internal display YYYYMMDD, where Y stands for the year, M for the month and D for the day.
    The system may issue one of the following messages during the processing of the data
    ME 039
    Delivery date is in the past
    or error message ME 078
    Delivery date outside period covered by factory calendar
    Other terms
    BUS2012, POSCHEDULE, DELIVERY_DATE, STAT_DATE, EEIND, EKET, ME078, ME039, EME078, EME039
    Reason and Prerequisites
    The problem is caused by a program error.
    Solution
    Implement the program correction.
    The following logic applies for the conversion of the delivery date:
    1. If the delivery date is transferred in the internal display (YYYYMMDD), the BAPI converts the delivery date automatically.
    2. If the delivery date is transferred with . or - or / , then there is no conversion, since these are external date formatting characters.
    3. If the delivery date is transferred in the internal display and the date category is also transferred (for example W or 2 for the week date), then the date is not converted.
    Hope this’ll give you idea!!
    <b>Pl... award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • PO Delivery date at Item level is getting modified by Delivery date in PR

    Hi Experts,
    I am using BAPI_PO_CREATE1 for creating Purchase Order. I am passing delivery date (item level) in parameter
    POSCHEDULE of the  Bapi but the on creation of the PO it does not take the value that I passed in delivery date field
    ,however it takes the delivery date from Purchase requisition (the preceding document).
    Please let me know how can I fix this issue, It should take the date that I passed in the Bapi.
    Thanks & Regards,
    Sushant Singh

    Hi,
    In the X-Structure 'POSCHEDULEX' set 'X' in 'PO_ITEMX'.                  
    Please check in your system the following data:                          
    Check that the X-fields in structure POSCHEDULEx are set Correctly and  that the key fields item number and schedule number are equal in  PoSchedule and PoScheduleX.                                                                               
    Example:                                                                 
    POSCHEDULE                                                               
    PO_ITEM  00010                                                           
    SCHED_LINE  001                                                          
    DEL_DATCAT_EXT                                                           
    DELIVERY_DATE 10/13/2010                                                
    QUANTITY  2                                                              
    DELIV_TIME                                                               
    STAT_DATE  10/13/2010                                                                               
    Structure POSCHEDULEX                                                    
    PO_ITEM  00010                                                           
    SCHED_LINE  001                                                          
    PO_ITEMX  X                                                              
    SCHED_LINEX  X                                                           
    DEL_DATCAT_EXT                                                           
    DELIVERY_DATE X                                                          
    QUANTITY  X                                                              
    DELIV_TIME                                                               
    STAT_DATE  X                                                                               
    Please also make sure that all line items of PO should have at least one delivery schedule.                           
    Regards,
    Mauro

  • Update of delivery date on purchase order line

    Hi,
    Is it possible that the delivery date in the purchase order is automatically updated. When the required delivery date changes in the sales order when there is a link between the two?
    If yes, how?

    Thank You!
    My problem is solved regarding DELIVERY_DATE but I am getting new problem .
    I am getting error message
    "Control indicators for controlling area UPS do not exist"
    when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.
    Please suggest me some solution.
    Thanks,
    Sonali.

  • Updating delivery date on Purchase order line items

    Hi,
    I am using BAPI_PO_CREATE1 to create purchase order. It is creating fine except I want the delivery date on line item to be overwritten instead of system determining from MRP view of material on each line item.
    I am passing delivery date to DELIVERY_DATE parameter of POSCHEDULE  table of the BAPI, but instead of taking the value that I passed it is calculating from material master.
    Is there any other parameter for BAPI that I need to set ?
    Please suggest me a solution.
    Thanks,
    Sonali.

    Thank You!
    My problem is solved regarding DELIVERY_DATE but I am getting new problem .
    I am getting error message
    "Control indicators for controlling area UPS do not exist"
    when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.
    Please suggest me some solution.
    Thanks,
    Sonali.

  • Can delivery date can be met? want to avoide thisWARNING in BAPI_PO_CRAETE1

    Hi Experts,
    When creating a purchase order via BAPI_PO_CREATE1, we're getting the Can delivery date be met? warning message  whatever delivery date is entered.
    I tried all the dates, But the message is received even if the delivery date is more than a week/month in the future. If I enter today I get the unrealistic date message instead with a proposed date of tomorrow in brackets but entering the 23rd still displays the message.
    Can't find any SAP notes about the message being displayed erroneously!!
    Which bit of master data am I missing that is causing this message to display so often?
    1- Still, I wanna SAVE/create the PO, So, How to handle it?
    2  - How to avoide to showup these messages from my BAPI return box?
    3- any SAP NOTES?
    4 - Any user exit?
    5- Can I delete this message from RETURN in my Z prog., where am using BAPi to create PO and then using COMMIT.?
    thanq

    Try using the following code : Check   in the schedule lines t_poschedulex-delivery_date = 'X'  .
    DATA t_bapi_pp_hdrlevel LIKE bapi_pp_hdrlevel OCCURS 0 WITH HEADER LINE.
    DATA t_detail_return LIKE bapi_coru_return OCCURS 0 WITH HEADER LINE.
    entries for BAPI_PO_CREATE
    DATA : t_po_items LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
           t_item_schedules LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE,
           t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,
           t_poschedulex LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE.
    entries for BAPI_PO_CREATE
    DATA : s_po_header LIKE bapimepoheader.
    DATA : s_poheaderx LIKE bapimepoheaderx.
    DATA w_purchaseorder LIKE  bapiekkoc-po_number.
    CLEAR w_purchaseorder.
      CLEAR s_po_header.
      REFRESH t_po_items.
      CLEAR t_po_items.
      CLEAR t_item_schedules.
      REFRESH t_item_schedules.
      CLEAR : s_poheaderx,t_poitemx,t_poschedulex.
      REFRESH : t_poitemx,t_poschedulex.
      f_error = '0'.
      c_po_item = c_po_item + 10.
    Fill the values for
    s_po_header-doc_type
    s_po_header-pur_group
      s_po_header-comp_code
      s_po_header-vendor
      s_poheaderx-vendor = 'X'.
    t_po_items-item_cat
    preparation of the function BAPI_PO_CREATE1 (for purchase order)
      IF f_error = '0'.
    header
        s_po_header-doc_date = sy-datum.
        s_po_header-purch_org = s_zcs00-ekorg.
        s_po_header-suppl_plnt = t_zcs01-werks.
        s_poheaderx-doc_date = 'X'.
        s_poheaderx-doc_type  = 'X'.
        s_poheaderx-comp_code = 'X'.
        s_poheaderx-purch_org = 'X'.
        s_poheaderx-pur_group = 'X'.
        s_poheaderx-suppl_plnt = 'X'.
    round the quantity with rounding rules
    items
        t_po_items-po_item = c_po_item.
        t_po_items-ematerial = t_zcs01-matnr.
        t_po_items-quantity = t_zcs01-gamng.
        t_po_items-po_unit = t_zcs01-meins.
        t_po_items-po_unit_iso = t_zcs01-meins.
        t_po_items-short_text = t_zcs01-comment.
        t_po_items-plant = s_zcs00-pwerk.
        APPEND t_po_items.
        t_poitemx-po_item = c_po_item.
        t_poitemx-ematerial = 'X'.
        t_poitemx-item_cat = 'X'.
        t_poitemx-plant = 'X'.
        t_poitemx-po_unit = 'X'.
        t_poitemx-po_unit_iso = 'X'.
        t_poitemx-quantity = 'X'.
        APPEND t_poitemx.
    schedule
        t_item_schedules-po_item = c_po_item.
        t_item_schedules-sched_line = '0001'.
        t_item_schedules-delivery_date = sy-datum.
        t_item_schedules-quantity = t_zcs01-gamng.
        t_item_schedules-del_datcat_ext = '1'.
        APPEND t_item_schedules.
        t_poschedulex-po_item = c_po_item.
        t_poschedulex-sched_line = '0001'.
        t_poschedulex-del_datcat_ext = 'X'.
        t_poschedulex-quantity = 'X'.
        t_poschedulex-delivery_date = 'X'.
        APPEND t_poschedulex.
    function for the creation of the purchase order
        CALL FUNCTION 'BAPI_PO_CREATE1'
             EXPORTING
                  poheader         = s_po_header
                  poheaderx        = s_poheaderx
             IMPORTING
                  exppurchaseorder = w_purchaseorder
             TABLES
                  return           = t_return
                  poitem           = t_po_items
                  poitemx          = t_poitemx
                  poschedule       = t_item_schedules
                  poschedulex      = t_poschedulex.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Edited by: RAHUL SINHA on Jun 21, 2008 12:48 PM

  • While i send the delivery date to BAPI for PO create,it still going for ATP

    Hi Friends,
    while creating PO through BAPI I am sending delivery date to "BAPI_PO_CREATE1" in the schedule lines ,but still it is picking the delivery dates from the ATP.
    I want my delivery dates to be populated in the PO rather than the ATP.
    Please suggest.
    Do we have any new BAPI i am using R/3 version 4.7.
    Thanks Regards,
    Sandipan Jena

    There seems to be lot of threads in SDN and OSS Notes( 770120)
    bapi_po_create1 - enjoy purchase orders

  • Delivery Date needs to be changed on Schedule lines

    Hi All-
    I am using BAPI_SALESORDER_CHANGE, to update the delivery date on the schedule lines...If I have 2 lines of schedule, needs to be updated the second one ETENR '0002'...
    Bapi returns message that successfully processed, when I go back and look at Sales order, I don't se any changes on schedule line..
    I am pssing into BAPI, sales doc and schedule line with the delivery date and the flag 'U'..and also I am using BAPI commit...
    But, let me know if I am missing something and also let me know is it possible to change schedule delivery date or not?
    Thanks,
    Sony

    Hi
    Please follow this process.
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data.
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

  • Table for finding delivery date

    hello all,
    i m making a report for which will display the delay in delivery per vendor wise, can anyone tell me that how can i determine the time/days delayed by vendor? i m trying to take diffrence betbeen delvery date in PO and date on which Delivery Completeed check box ticked, but i m not getting the table which stores the delivery date?
    plz help. is there any standard tcode?
    regards saurabh.

    Hi,
    see vbak table and below tables
    /BEV1/RBVBAK                     Sales Document: Header Data
    /BEV1/REWART                     Rental Items: Delivery Schedule Items

Maybe you are looking for

  • Crystal Report Templates for User-Defined Objects

    Hello Experts, I am running SAP B1 8.8 PL11. In the current patch SAP has default Crystal Reports that can be used as Layouts for Invoices, Credit Memo's so on. Is it possbile to have layouts for user defined objects ( say for instance i have a custo

  • How can I reopen an index.html saved to iDisk?

    Hi there, I created a personal site on a Powerbook laptop in iWeb a year or so ago and published it through my .mac account. It was great and I updated it on a fairly regular basis. Then my existing laptop died of old aged and I replaced it with a ne

  • Getting warning message in my webmail after upgrading to snow leopard

    Hi, After upgrading to Snow Leopard Server, I'm getting strange warning messages in my web mail, Find the warning messages below, Looking forward to your support. Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timez

  • How can I share (e-mail) NEF files shot with a Nikon d5100 in Lightroom 4.4?

    I am new to shooting RAW NEF and then sharing them in Adobe Photoshop Lightroom 4.4. How do you share (e-mail) NEF files shot with a Nikon D5100 that have been downloaded into Adobe Photoshop Lightroom 4.4.? Isn't there someway to convert to JPEG for

  • Migrating form 2005 to 2014

    What is best practice for migrating?  Should I us the wizard and on install have it update the exiting SQL or should I install a new instance and then migrate each database individually? If I make a second install and have them run side by side until