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: 

Need FM to Reject a Purchase Requistion

Former Member
0 Kudos

Hi Dudes,

In my customized program I am displaying a list of PR with checkboxes for all line items, and Reject button in Application Bar.

When user selects PR and press the Reject button there should be rejected as is like in ME52.

So could please let me know how to do this and can tell the FM to reject the selected PR.

Regards,

Suneel G

15 REPLIES 15

Former Member
0 Kudos

Use these FMs

ME_UPDATE_REQUISITION

ME_UPDATE_REQUISITION_CHNGDOC

0 Kudos

Hi Gayathri,

Thanks for the FM's given, Could you please let me know what is field and in which table we can differentiate, whether this PR and Rejected PR.

Regards,

Suneel G

Former Member
0 Kudos

Hello,

At the click of the BUtoon you can send the control to transaction ME52 by:


SET PARAMETER ID 'abc' FIELD V_FIELD1.
CALL TRANSACTION 'ME52' .

0 Kudos

Hi SAPUSER,

The control should not go to ME52 it have to Reject when I click my customized button itself.

Regards,

Suneel G

former_member183990
Active Contributor
0 Kudos

hi these are the FM available for purchase requisition

i guess u can use MASS_CHANGE_PURCHASE_REQ Change Purchasing requests

for this purpose

but i am afraid if you delete this or not.

can u pls tell me where u find the reject button in ME52

i.e., exactly inw hich screen

so that we can debug that

ACC4 FI/CO: BAPIs for UPDATE

ALE_ACC_PURCHASE_REQUI_POST

BAPI_ACC_PURCHASE_REQUI_CHECK Accounting: Check Purchase Requisition

BAPI_ACC_PURCHASE_REQUI_POST Accounting: Post Purchase Requisition

IDOC_INPUT_ACC_PURCHASE_REQUI

BBPU

BBP_ACC_PURCHASE_REQUI_CHECK

CIFT

CATT_CIF_PURCHASEREQ_CHECK

CKEX2

CKEX2_REPORT_PURCHASE_REQ

CNM2

CNM2_PURCHASE_REQ

CO2O

CO2O_ACT_SET_PURCHASE_REQ

MASSPURCHREQ Mass Maintenance of Purchasing requests

MASS_CHANGE_PURCHASE_REQ Change Purchasing requests

WLB3

WLB3_SELECT_PURCHASE_REQ

cheers

s.janagar

0 Kudos

Hi Janagar Sundaramoorthy Nadar,

Thanks for reply, In ME52 once your are into change mode of a particular PR, in Menu bar .. Edit -> Release -> Reject.

And if I want to debug the Reject button is grayed out.

As I am working on R/3 4.0 version, I am not sure whether I have this all FM's.

I check them first...

Regards,

Suneel G

0 Kudos

hi

i consulted my Functional he said that

there is no way to reject purchase requisition

but b4 which u need to check for approval of the requistion

and we can reject the approval through work flow

this is for upto my knowledge

cheers

s.janagar

0 Kudos

Hi s.janagar,

Thanks for the reply, let me tell the process how we are doing it... when its is rejected from approval using workflow that PR will be in our Inbox, then we double click it and then it will go to ME52 and then we need to goto Edit->Release-> and then reject it this is proceess happeing now with user but the requirement is now that process should happend when they click Reject button in my Customized prg.

Regards,

Suneel G.

0 Kudos

Hi Suneel,

As you said the program should not call ME52n,

but you can still use 'BAPI_PR_CHANGE' FM to update the status I think so,

Here is a sample code you can check out.

DATA: I_AC LIKE BAPIMEREQACCOUNT OCCURS 0 WITH HEADER LINE,

I_ACX LIKE BAPIMEREQACCOUNTX OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF I_EBAN,

BANFN LIKE EBAN-BANFN,

BNFPO LIKE EBAN-BNFPO,

WEMPF LIKE EBKN-WEMPF,

END OF I_EBAN.

I_EBAN-BANFN = '0010008176'.

I_EBAN-BNFPO = '00040'.

I_EBAN-WEMPF = 'KYSH'.

I_AC-PREQ_ITEM = I_EBAN-BNFPO.

I_AC-SERIAL_NO = '01'.

I_AC-GR_RCPT = I_EBAN-WEMPF.

APPEND I_AC. CLEAR I_AC.

I_ACX-PREQ_ITEM = I_EBAN-BNFPO.

I_ACX-SERIAL_NO = '01'.

I_ACX-PREQ_ITEMX = 'X'.

I_ACX-SERIAL_NOX = 'X'.

I_ACX-GR_RCPT = 'X'.

APPEND I_ACX. CLEAR I_ACX.

CALL FUNCTION 'BAPI_PR_CHANGE'

EXPORTING

PRNUMBER = I_EBAN-BANFN

TABLES

RETURN = I_RET2

PRACCOUNT = I_AC

PRACCOUNTX = I_ACX.

IF SY-SUBRC = 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

ENDIF.

Also Do check the two Tutorial Programs about PO/PR release strategies in SAP Technical Tutorials Business Workflow.

Thanks & regrads,

Dileep .C

Former Member
0 Kudos


DATA: container like table of swr_cont with header line,
xeban like table of  ueban with header line,
xebkn like table of uebkn with header line,
yeban like table of  ueban with header line,
yebkn like table of  uebkn with header line,
object_key type swr_struct-object_key,
item_numc type numc05.

select * into corresponding fields of table xeban
from eban where banfn = number
and bnfpo = item.

select * into corresponding fields of table xebkn
from ebkn where banfn = number and bnfpo = item.

yeban = xeban.
yebkn = xebkn.

read table xeban index 1.
xeban-kz = 'U'.
xeban-banpr = '08'.
modify xeban index 1.

CALL FUNCTION 'ME_UPDATE_REQUISITION'
TABLES
xeban = xeban
xebkn = xebkn
yeban = yeban
yebkn = yebkn.

CALL FUNCTION 'ME_UPDATE_REQUISITION_CHNGDOC'
TABLES
xeban = xeban
xebkn = xebkn
yeban = yeban
yebkn = yebkn.

container-element = 'RELEASECODE'.
container-value = REL_CODE.
append container.
item_numc = item.
concatenate number item_numc into object_key.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS2009'
object_key = object_key
event = 'REJECTED'
TABLES
input_container = container
message_lines = message_lines
message_struct = message_struct.
ENDFUNCTION.

0 Kudos

Hi Gayathri,

In your code I could not find

read table xeban index 1.

xeban-kz = 'U'. " what is KZ field there no field

xeban-banpr = '08'. " And process status here is Release Refused.

modify xeban index 1.

and I am still with blank mind.

Regards,

Suneel G

0 Kudos

Hi Gayathri,

As I am working on R/3 4.0 there is no field BANPR in UEBAN Structure and EBAN Table too.

But there is 'ME_UPDATE_REQUISITION' FM in R/3 4.0

So what we need to do now ??? Could you please let me know is there any other field.

Any idea abt EBAN table fields in SAP R/3 4.0.

Regards,

Suneel G

Former Member
0 Kudos

you try these FMs,

ME_UPDATE_REQUISITION

ME_UPDATE_REQUISITION_CHNGDOC

Regards,

Joan

0 Kudos

Hi Joan Jesudasan,

As I am working on SAP R/3 4.0, I need to reject the PR using ME_UPDATE_REQUISITION FM, but

problem with this FM as we are passing UEBAN there is no field called BANPR in 4.0.

So need help regarding.

Regards,

Suneel G