‎2009 May 25 9:23 AM
boys field 'doc_date' 'poheader' structure must be filled in the format of the sy-datum? or otherwise.
‎2009 May 25 9:27 AM
Hi,
Check this
{ wa_po_head-doc_type = 'ZSKK'.
wa_po_head-comp_code = lv_bukrs.
wa_po_head-vendor = p_vendor.
wa_po_head-purch_org = wa_eban-ekorg.
wa_po_head-pur_group = wa_eban-ekgrp.
wa_po_head-creat_date = sy-datum.
wa_po_head-doc_date = sy-datum.
*Start of code insertion by
else.
*Fill the STO header details.
wa_po_head-doc_type = 'ZSCT'.
wa_po_head-comp_code = lv_bukrs.
wa_po_head-vendor = p_vendor.
wa_po_head-purch_org = wa_eban-ekorg.
wa_po_head-pur_group = wa_eban-ekgrp.
wa_po_head-creat_date = sy-datum.
wa_po_head-doc_date = sy-datum.
endif.
*End of code insertion by
*Fill the udpate structure
wa_po_headx-doc_date = c_x.
wa_po_headx-comp_code = c_x.
wa_po_headx-doc_type = c_x.
wa_po_headx-suppl_plnt = c_x.
wa_po_headx-vendor = c_x.
wa_po_headx-purch_org = c_x.
wa_po_headx-pur_group = c_x.
wa_po_headx-SUPPL_PLNT = c_x.
For ,,...
call function 'BAPI_PO_CREATE1'
exporting
poheader = wa_po_head
poheaderx = wa_po_headx
importing
exppurchaseorder = gv_po_number
tables
return = gt_return
poitem = gt_poitem
poitemx = gt_poitemx
poschedule = gt_poschedule
poschedulex = gt_poschedulex
poaccount = gt_poaccount
poaccountx = gt_poaccountx
potextitem = gt_potextitem. }
Regards
MSC
‎2009 May 25 9:27 AM
Hi,
Check this
{ wa_po_head-doc_type = 'ZSKK'.
wa_po_head-comp_code = lv_bukrs.
wa_po_head-vendor = p_vendor.
wa_po_head-purch_org = wa_eban-ekorg.
wa_po_head-pur_group = wa_eban-ekgrp.
wa_po_head-creat_date = sy-datum.
wa_po_head-doc_date = sy-datum.
*Start of code insertion by
else.
*Fill the STO header details.
wa_po_head-doc_type = 'ZSCT'.
wa_po_head-comp_code = lv_bukrs.
wa_po_head-vendor = p_vendor.
wa_po_head-purch_org = wa_eban-ekorg.
wa_po_head-pur_group = wa_eban-ekgrp.
wa_po_head-creat_date = sy-datum.
wa_po_head-doc_date = sy-datum.
endif.
*End of code insertion by
*Fill the udpate structure
wa_po_headx-doc_date = c_x.
wa_po_headx-comp_code = c_x.
wa_po_headx-doc_type = c_x.
wa_po_headx-suppl_plnt = c_x.
wa_po_headx-vendor = c_x.
wa_po_headx-purch_org = c_x.
wa_po_headx-pur_group = c_x.
wa_po_headx-SUPPL_PLNT = c_x.
For ,,...
call function 'BAPI_PO_CREATE1'
exporting
poheader = wa_po_head
poheaderx = wa_po_headx
importing
exppurchaseorder = gv_po_number
tables
return = gt_return
poitem = gt_poitem
poitemx = gt_poitemx
poschedule = gt_poschedule
poschedulex = gt_poschedulex
poaccount = gt_poaccount
poaccountx = gt_poaccountx
potextitem = gt_potextitem. }
Regards
MSC
‎2009 May 25 9:37 AM
the bapi me the same error.
for the controlling area CA00 no control code.
I do not know about that act structure.
Edited by: francesco aiello on May 25, 2009 10:37 AM
‎2009 May 25 9:38 AM
null
Edited by: francesco aiello on May 25, 2009 10:38 AM
Edited by: francesco aiello on May 25, 2009 10:38 AM
‎2009 May 25 9:41 AM
REPORT ZPURCHASEORDER.
data:
header like BAPIMEPOHEADER,
headerx like BAPIMEPOHEADERX,
it_item like standard table of BAPIMEPOITEM,
it_itemx like standard table of BAPIMEPOITEMX,
return like standard table of BAPIRET2,
wa_item like BAPIMEPOITEM,
wa_itemx like BAPIMEPOITEMX,
p_int type i,
p_matnr like mara-matnr,
p_pono like ekko-ebeln.
DATA: BEGIN OF BAPIRETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF BAPIRETURN.
constants:
c_x type c value 'X'.
header-comp_code = '3000'.
header-doc_type = 'DP25'.
header-creat_date = sy-datum.
header-item_intvl = '10'.
header-vendor = 'ARAMI-00'.
header-langu = sy-langu.
header-pmnttrms = '0001'.
header-purch_org = '3000'.
header-pur_group = '010'.
header-currency = 'USD'.
headerx-comp_code = c_x.
headerx-doc_type = c_x.
headerx-creat_date = c_x.
headerx-item_intvl = c_x .
headerx-vendor = c_x.
headerx-langu = c_x.
headerx-pmnttrms = c_x .
headerx-purch_org = c_x.
headerx-pur_group = c_x.
p_int = p_int + 10.
wa_item-po_item = p_int.
p_matnr = 'T-SRM01'.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = p_matnr
IMPORTING
output = p_matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
wa_item-material = p_matnr.
wa_item-plant = '3200'.
wa_item-quantity = 100.
wa_item-conf_ctrl = 'Z01'.
wa_item-ACKN_REQD = 'X'.
WA_ITEM-ERS = ''.
APPEND wa_item TO it_item.
wa_itemx-po_item = p_int.
wa_itemx-material = c_x.
wa_itemx-plant = c_x .
wa_itemx-stge_loc = c_x .
wa_itemx-quantity = c_x .
wa_itemx-item_cat = c_x .
wa_itemx-acctasscat = c_x .
wa_itemx-conf_ctrl = 'X'.
wa_itemx-ACKN_REQD = 'X'.
WA_ITEMX-ERS = 'X'.
APPEND wa_itemx TO it_itemx.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = header
poheaderx = headerx
IMPORTING
exppurchaseorder = p_pono
TABLES
return = return
poitem = it_item
poitemx = it_itemx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
write:/ p_pono.