‎2008 Aug 08 7:50 AM
Hi,
How can I find out what r the mandatory parameters for the bapi 'bapi_po_change'.
what I know is, from documentation of bapi, one can find, there it has been not mentioned.Please tell what else is the method to find the mandatory fields.
Regards,
khadeer.
‎2008 Aug 10 6:47 AM
Hi
in se 37 , check the import and tables tab.there IF optional checkBox is not checked for any parameter , then that parameter is mandatory.
‎2008 Aug 08 7:58 AM
Hi,
For the BAPI..
BAPI_PO_CHANGE the mandatory input is PURCHASEORDER.
Regards,
Sunil Kumar Mutyala
‎2008 Aug 08 8:08 AM
HI
[Details About BAPI|http://abap.wikiprog.com/wiki/BAPI_PO_CHANGE]
Regards
Pavan
‎2008 Aug 08 8:11 AM
Hi,
refer to the link below for sample code :
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
With luck,
Pritam.
‎2008 Aug 08 8:54 AM
here is another sample code: where the deletion flag is set for a purchaseorder.
wa_item-po_item = p_ebelp.
wa_item-no_more_gr = 'X'.
APPEND wa_item TO t_item.
wa_itemx-po_item = p_ebelp.
wa_itemx-no_more_gr = 'X'.
APPEND wa_itemx TO t_itemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
no_messaging = 'X'
no_message_req = 'X'
TABLES
return = p_t_return
poitem = t_item
poitemx = t_itemx.
‎2008 Aug 08 10:26 AM
hello
check this report
DATA: exppurchaseorder LIKE bapimepoheader-po_number,
text_mess(220) TYPE c.
DATA: s_header_ind LIKE bapimepoheaderx .
DATA: i_item_ind LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: po_header LIKE bapimepoheader OCCURS 0 WITH HEADER LINE,
po_items LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: return_tab LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
data: v_qty type n.
DATA: BEGIN OF itab1 OCCURS 0,
doc_type LIKE bapimepoheader-doc_type,
item_intvl LIKE bapimepoheader-item_intvl,
vendor LIKE bapimepoheader-vendor,
purch_org LIKE bapimepoheader-purch_org,
pur_group LIKE bapimepoheader-pur_group,
currency LIKE bapimepoheader-currency,
po_item LIKE bapimepoitem-po_item,
material like bapimepoitem-material,
quantity LIKE bapimepoitem-quantity,
plant LIKE bapimepoitem-plant,
END OF itab1.
DATA: BEGIN OF itab OCCURS 0,
text TYPE string,
END OF itab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\Documents and Settings\vuser01\Desktop\BAPI.txt'
filetype = 'ASC'
has_field_separator = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
POPULATE HEADER DATA FOR PO
LOOP AT itab.
v_qty = itab1-quantity.
SPLIT itab-text AT space INTO
itab1-doc_type
itab1-item_intvl
itab1-vendor
itab1-purch_org
itab1-pur_group
itab1-currency
itab1-po_item
itab1-material
v_qty
itab1-plant.
po_header-doc_type = itab1-doc_type.
po_header-item_intvl = itab1-item_intvl.
po_header-vendor = itab1-vendor.
po_header-purch_org = itab1-purch_org.
po_header-pur_group = itab1-pur_group.
po_header-currency = itab1-currency.
s_header_ind-doc_type = 'X'.
s_header_ind-item_intvl = 'X'.
s_header_ind-vendor = 'X'.
s_header_ind-pmnttrms = 'X'.
s_header_ind-purch_org = 'X'.
s_header_ind-pur_group = 'X'.
s_header_ind-currency ='X'.
po_items-po_item = itab1-po_item.
po_items-material = itab1-material.
po_items-quantity = v_qty.
po_items-plant = itab1-plant.
APPEND po_items.
i_item_ind-po_item = '00001'.
i_item_ind-material = 'X'.
i_item_ind-plant = 'X'.
i_item_ind-quantity = 'X'.
APPEND i_item_ind.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = po_header
poheaderx = s_header_ind
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
exppurchaseorder = exppurchaseorder
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = return_tab
poitem = po_items
poitemx = i_item_ind
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
.
endloop.
Error Handling
*READ TABLE RETURN_TAB WITH KEY = 'E'.
IF sy-subrc <> 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
RETURN =
.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
LOOP AT return_tab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = return_tab-id
lang = 'E'
no = return_tab-number
v1 = return_tab-message_v1
v2 = return_tab-message_v2
v3 = return_tab-message_v3
v4 = return_tab-message_v4
IMPORTING
msg = text_mess
EXCEPTIONS
not_found = 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.
WRITE: / text_mess.
ENDLOOP.
i hope ur prob willl be solve.
regard
mukesh goyal
‎2008 Aug 08 11:59 AM
1. Open SE37, Enter BAPI_PO_CHANGE.
2. Click on EXPORT tab.
3 Look at optional field check boxes
4. Check boxes which are checked are optional and those which not, are Mandatory.
5. Export Parameters are always mandatory.
Follow same thing for CHANGING, TABLES, tab.
rgds
rajesh
‎2008 Aug 10 6:47 AM
Hi
in se 37 , check the import and tables tab.there IF optional checkBox is not checked for any parameter , then that parameter is mandatory.
‎2008 Aug 11 10:17 AM
Check this link.
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bapi_po_change-reg-314013
Regards,
Prashant