Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CREATE1 delivery date ignored by system

0 Kudos

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.

1 ACCEPTED SOLUTION

nomssi
Active Contributor
0 Kudos

As the date category is maintained in your example, the BAPI will expect a delivery date in external format (cf. OSS Note 858316).

You should clear the date category (field POSCHEDULE-DEL_DATCAT_EXT) to let the BAPI handle the internal date correctly.

regards,

JNN

7 REPLIES 7

0 Kudos

Hi,

Remove the PO Date from schedule line and then create PO.

If this doesn't work, then try passing sy-datum in  COM_DATE of schedule line.

Regards,

Shweta

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

0 Kudos

Hello didier.deschepper

I am also facing the same issue. This is worked for me

atul_mohanty
Active Contributor
0 Kudos

Hi

Can you try with only with follwing parameters -PO_ITEM, SCHED_LINE, DELIVERY_DATE, QUANTITY for the parameters - POSCHEDULE and POSCHEDULEX of  BAPI_PO_CREATE1.

Also check if any enhancement has been added in the system for PO specific to Delivery Date.

nomssi
Active Contributor
0 Kudos

As the date category is maintained in your example, the BAPI will expect a delivery date in external format (cf. OSS Note 858316).

You should clear the date category (field POSCHEDULE-DEL_DATCAT_EXT) to let the BAPI handle the internal date correctly.

regards,

JNN

0 Kudos

But the problem only occurs in PRD, DEV and QAS are the same as PRD, the codes are also same. I pass the same parameters for schedule lines in another function, and that function performs well (no such a problem).

Former Member
0 Kudos

Hi Donnie,

Looks like your coding is fine.Ensure as mentioned by Jacques POSCHEDULE-DEL_DATCAT_EXT is cleared.Also check your factory calender settings via SCAL as scheduling is based o the above setting.You can compare it with Q and see any discrepancies.

Regards,

Kannan