Application Development and Automation 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: 
Read only

BAPI_PO_CREATE1 - delevery date

Former Member
0 Likes
3,796

Hi All,

I am uisng BAPI bapi_po_create1 to create po.

Irrspective of data given to field delivery_date of structure

bapimeposchedul , its always creating with system date.

Can any one help on this how to update given delivery date. Also what ever category i am giving for the field DEL_DATCAT_EXT of bapimeposchedul , its always getting updated in date format.

Regards,

Priyaranjan


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,574

Hi,

Please check the SAP FM documentation. Try to do the following things in the BAPI_PO_CREATE1.

Parameter: POSCHEDULE

PO_ITEM = 00001
SCHED_LINE = 0001
DELIVERY_DATE = 03.12.2012
QUANTITY = 1.00
PO_ITEM = 00001
SCHED_LINE = 0002
DELIVERY_DATE = 04.12.2002
QUANTITY = 5.000

Parameter: POSCHEDULEX

PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0002
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X

Regards,

Tanmoy

Hi All,

I am uisng BAPI bapi_po_create1 to create po.

Irrspective of data given to field delivery_date of structure

bapimeposchedul , its always creating with system date.

Can any one help on this how to update given delivery date. Also what ever category i am giving for the field DEL_DATCAT_EXT of bapimeposchedul , its always getting updated in date format.

Regards,

Priyaranjan


9 REPLIES 9
Read only

JarosBaw
Active Participant
0 Likes
2,574

HI,

Have You fill POSCHEDULEX table properly ?

Regards,

Jarek

Read only

Former Member
0 Likes
2,574

*&---------------------------------------------------------------------*

*header details

*&---------------------------------------------------------------------*

 

wa_header-doc_type = 'ABNB'.

wa_header-creat_date = sy-datum.

wa_header-created_by = sy-uname.

wa_header-vendor = '00223400006'.

wa_header-comp_code = 'AB01'.

 

*currency in header

 

wa_header-purch_org = 'AB00'.

wa_header-pur_group = '000'.

 

 

wa_headerx-comp_code = c_x.

wa_headerx-doc_type = c_x.

wa_headerx-creat_date = c_x.

wa_headerx-created_by = c_x.

wa_headerx-vendor = c_x.

wa_headerx-purch_org = c_x.

wa_headerx-pur_group = c_x.

 

*&---------------------------------------------------------------------*

*Item details

*&---------------------------------------------------------------------*

 

wa_poitem-po_item = 10.

wa_poitem-short_text = 'Hello1'.

wa_poitem-plant = 'AB01'.

 

*item - price unit

*order unit - item

 

wa_poitem-quantity = '4.000'.

wa_poitem-po_unit = 'EA'.

wa_poitem-net_price = '100.00'.

wa_poitem-acctasscat = '1'.

wa_poitem-matl_group = '10001700'.

APPEND wa_poitem TO i_poitem .

 

wa_poitemx-po_item = 10.

wa_poitemx-po_itemx = c_x.

wa_poitemx-short_text = c_x.

wa_poitemx-plant = c_x.

wa_poitemx-quantity = c_x.

wa_poitemx-po_unit = c_x.

wa_poitemx-net_price = c_x.

wa_poitemx-acctasscat = c_x.

wa_poitemx-matl_group = c_x.

wa_poitemx-pckg_no = c_x.

APPEND wa_poitemx TO i_poitemx.

 

*&---------------------------------------------------------------------*

*Schedule details

*&---------------------------------------------------------------------*

 

DATA : l_date TYPE sy-datum.

l_date = sy-datum - 2.

wa_poitem_sch-po_item = 10.

wa_poitem_sch-delivery_date = '20140205'.

wa_poitem_sch-del_datcat_ext = 'D'.

wa_poitem_sch-SCHED_LINE = '0001'.

wa_poitem_sch-quantity = '2.00'.

 

*DELIV_TIME in schedule

 

APPEND wa_poitem_sch TO i_poitem_sch.

 

wa_poitem_schx-po_item = 10.

wa_poitem_schx-SCHED_LINE = '0001'.

wa_poitem_schx-SCHED_LINEx = 'X'.

wa_poitem_schx-po_itemx = c_x.

wa_poitem_schx-delivery_date = c_x.

wa_poitem_schx-del_datcat_ext = c_x.

wa_poitem_schx-quantity = c_x.

APPEND wa_poitem_schx TO i_poitem_schx.

 

*&---------------------------------------------------------------------*

*Accounting details

*&---------------------------------------------------------------------*

 

wa_acct-po_item = 10.

wa_acct-serial_no = '0001'.

wa_acct-gl_account = '00000220000'.

wa_acct-co_area = '9900'.

wa_acct-costcenter = 'AB00000000'.

APPEND wa_acct TO i_acct.

wa_acct_assx-po_item = 10.

wa_acct_assx-serial_no = '0001'.

wa_acct_assx-po_itemx = c_x.

wa_acct_assx-serial_nox = c_x.

wa_acct_assx-gl_account = c_x.

wa_acct_assx-co_area = c_x.

wa_acct_assx-costcenter = c_x.

APPEND wa_acct_assx TO i_acctx.

 

*&---------------------------------------------------------------------*

*Delivery address details

*&---------------------------------------------------------------------*

 

w_address-po_item = 10.

w_address-name = 'Test 1'.

w_address-country = 'VE'.

w_address-street = 'Test street'.

w_address-house_no = 'Test 14'.

APPEND w_address TO i_address.

CALL FUNCTION 'BAPI_PO_CREATE1'

EXPORTING

poheader = wa_header

poheaderx = wa_headerx

IMPORTING

exppurchaseorder = ws_po

TABLES

return = i_return

poitem = i_poitem

poitemx = i_poitemx

poaddrdelivery = i_address

poschedule = i_poitem_sch

poschedulex = i_poitem_schx

poaccount = i_acct

poaccountx = i_acctx

.

COMMIT WORK.

This is how i have passed data.

Regards,

Priyaranjan

Read only

Former Member
0 Likes
2,575

Hi,

Please check the SAP FM documentation. Try to do the following things in the BAPI_PO_CREATE1.

Parameter: POSCHEDULE

PO_ITEM = 00001
SCHED_LINE = 0001
DELIVERY_DATE = 03.12.2012
QUANTITY = 1.00
PO_ITEM = 00001
SCHED_LINE = 0002
DELIVERY_DATE = 04.12.2002
QUANTITY = 5.000

Parameter: POSCHEDULEX

PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0002
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X

Regards,

Tanmoy

Read only

0 Likes
2,574

Hey try removing this one -> wa_poitem_schx-del_datcat_ext = c_x.

Regards,

Tanmoy


Read only

P1389307362
Explorer
0 Likes
2,574

Dear Priyaranjan,

Use following code as an example to set the Delivery date in PO create.

DATA: IT_POSCHEDULE TYPE STANDARD TABLE OF BAPIMEPOSCHEDULE,

      IT_POSCHEDULEX TYPE STANDARD TABLE OF BAPIMEPOSCHEDULX,

      WA_POSCHEDULE TYPE BAPIMEPOSCHEDULE,

      WA_POSCHEDULEX TYPE BAPIMEPOSCHEDULX.

    

      WA_POSCHEDULE-PO_ITEM       = WA_ITEM-EBELP.         

      WA_POSCHEDULEX-PO_ITEM       = WA_ITEM-EBELP. 

      WA_POSCHEDULEX-PO_ITEMX = 'X'.

      WA_POSCHEDULE-DELIVERY_DATE = WA_ITEM-EINDT. "Delivery Date 

      WA_POSCHEDULEX-DELIVERY_DATE = 'X'.

   

     APPEND WA_POSCHEDULE TO IT_POSCHEDULE.

     APPEND WA_POSCHEDULEX TO IT_POSCHEDULEX.

CALL FUNCTION 'BAPI_PO_CREATE1'

    EXPORTING

      POHEADER                     = WA_POHEADER

      POHEADERX                    = WA_POHEADERX

      NO_PRICE_FROM_PO             = 'X'

   TABLES

     RETURN                       = IT_RETURN

     POITEM                       = IT_POITEM

     POITEMX                      = IT_POITEMX

     POSCHEDULE                   = IT_POSCHEDULE

     POSCHEDULEX                  = IT_POSCHEDULEX

               .

Regards,

Prasad

Read only

0 Likes
2,574

I have followed the same way as given in the doc. U can seen my sample code which i have posted earlier.

What i have seen, though i have polulated different data in delivery date field, its updated today's date only and also the delivery date in internal table is getitng changed after bapi call with today's date.

Any point on this how to pass given data and not the today's date.

Regards,

Priyaranjan

Read only

0 Likes
2,574

Hi,

Can you execute this BAPI through SE37 and check if it creates a po with todays date only.

did you try to do it through se37 , does it behave the same way ???

Read only

0 Likes
2,574

Best way would be go to the transaction and create a sample..provide a different date and check how the date is affected in the transaction.

Check with your functional for any config which determines the date or check for any user-exits/badi's which is affecting the date..

Read only

0 Likes
2,574

Thanks everyone.

Issue solved.

Passed the date in 'dd/mm/yyyy' format , than it got updated with the date which i am passing.

Regards,

Priyaranjan