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 regarding approve or reject or forward

Former Member
0 Kudos
289

Hi friends,

My requirement is, iam accessing the oreders remotely through mobile,

when one order is sent for either approval or rejection or deletion is there seperate bapi for each action or we need to call one bapi for all these actions? suppose in case of purchase order. plss tell me.

thnx in advance.

5 REPLIES 5

former_member156446
Active Contributor
0 Kudos
87

BAPI_ACC_PURCHASE_ORDER_CHECK Accounting: Check Purchase Order

BAPI_ACC_PURCHASE_ORDER_POST Accounting: Post Purchase Order

BAPI_PO_RELEASE Release Purchase Orders

BAPI_PO_RESET_RELEASE Cancel Release of Purchase Orders

Former Member
0 Kudos
87

BAPI to release PO is BAPI_PO_RELEASE and to reset the release is BAPI_PO_RESET_RELEASE

for reject

prepare creation of PO instance

ls_document-doc_type = 'F'.

ls_document-process = mmpur_po_process.

ls_document-trtyp = 'V'.

ls_document-doc_key(10) = lv_ponumber.

ls_document-initiator-initiator = mmpur_initiator_rel.

  • object creation and initialization

lv_ponumber = im_ebeln.

lv_ebeln = lv_ponumber.

create object lc_po.

lc_po->for_bapi = mmpur_yes.

call method lc_po->po_initialize( im_document = ls_document ).

call method lc_po->set_po_number( im_po_number = lv_ebeln ).

call method lc_po->set_state( cl_po_header_handle_mm=>c_available ).

  • read purchase order from database

call method lc_po->po_read

exporting

im_tcode = lv_tcode

im_trtyp = ls_document-trtyp

im_aktyp = ls_document-trtyp

im_po_number = lv_ebeln

im_document = ls_document.

if lc_po->if_releasable_mm~is_rejection_allowed( ) = 'X'.

call method lc_po->if_releasable_mm~reject

exporting

im_reset = space

exceptions

failed = 1

others = 2.

endif.

call method lc_po->po_post

exceptions

failure = 1

others = 2.

0 Kudos
87

Hi chennakesav,

Thanks for u r replay,

You gave me that for reject and read, please give me for delete and forward.

so what i understood from here is we need to give import parameters for which actions we need?

thnx.

0 Kudos
87

Please help me regarding this issue.

Former Member
0 Kudos
87

hi

for deletion

In BAPI_PO_CHANGE ,set the deletion indicator DELETE_IND in POITEM to 'L'.

Update POITEMX for that field and commit changes.now take a PO and delete a line item from the PO in ME22. Check the changed value of LOEKZ for that line item in EKPO table. Set the index DELET_IND to that changed value.

hope this helps

regards

Aakash Banga