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

RE:F module BAPI_PO_CREATE1

alex_georgek
Associate
Associate
0 Likes
493

Hi all,

I need to copy condition types from SRM to ERP.I need to create PO using BAPI_PO_CREATE1,But the condition type i am passing to FM(BAPI_PO_CREATE1) is not getting updated in the PO.So does anyone know what all data needs to be passed to pocond,pocondx and poitem so that the condion type i am passing from SRM gets updated in ERP accordingly...

Thanks in advance,

Alex.

Hi all,

I need to copy condition types from SRM to ERP.I need to create PO using BAPI_PO_CREATE1,But the condition type i am passing to FM(BAPI_PO_CREATE1) is not getting updated in the PO.So does anyone know what all data needs to be passed to pocond,pocondx and poitem so that the condion type i am passing from SRM gets updated in ERP accordingly...

Thanks in advance,

Alex.

2 REPLIES 2
Read only

Former Member
0 Likes
457

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'.

*if sy-uname 'ABAP'.

*if program = 'ZPURCHASEORDER' .

*

*raise cancelled.

*

*endif.

*endif.

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.

*LOOP AT it_final2 INTO wa_final2.

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.

*IF sy-subrc = 0.

*MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

*ENDIF.

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.

*ENDLOOP.

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.

Read only

Former Member
0 Likes
457

Hi Alex,

Did you populate the CHANGE_ID field in POCOND?