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

BADI for PR

Former Member
0 Likes
1,284

hi all,

my requirement is that when i make any PR against account assignement type 'F' (Order) them we have to enter the Order no. in the Account Assignment tab,

now i want to check that the Order No. the user is entering is should be the same for the plant for which he is entering the PR means if the user is entering the PR item for Plant 1100 then the Order No. should also be of the same plant i.e 1100 not of other plant.

for this i am using the BADI 'ZME_PROCESS_REQ_CUST',

i have checked in the PROCESS_ITEM Method but in this the Order no. doesnot come in the inetrnal table, but if i go for PROCESS_ACCOUNT Method in this i got the Order No. but i am not able to get the Plant of the Item no.

how can i proceed for the same is there any way out to put the check that i needed.

i hope i have cleared my query.

abhishek.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,204

Hi Abhishek,

What you can do is, <b>export</b> the plant number from PROCESS_ITEM method to memory ID and <b>import</b> the same in PROCESS_ACCOUNT method and do the required validation.

Hope it helps to resolve your issue.

Regds,

Akshay Bhagwat

7 REPLIES 7
Read only

Former Member
0 Likes
1,204

the BADI u are using for Purchase not for PR , check this ME_REQ_POSTED but i will tigger when u are trying to POST the PR.

regards

Prabhu

Read only

Former Member
0 Likes
1,205

Hi Abhishek,

What you can do is, <b>export</b> the plant number from PROCESS_ITEM method to memory ID and <b>import</b> the same in PROCESS_ACCOUNT method and do the required validation.

Hope it helps to resolve your issue.

Regds,

Akshay Bhagwat

Read only

0 Likes
1,204

Export and Import doesn't work in BADI's

Read only

0 Likes
1,204

Hi Abhishek,

You will have to use Export statement as:

method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM .

data: lv_plant type werks.

data: l_mereq_item type MEREQ_ITEM.

l_mereq_item = im_item->get_data( ).

export lv_plant from l_mereq_item-werks to memory id 'ZXX'.

..

..

endmethod.

Hope it helps.

Regds,

Akshay

Read only

Former Member
0 Likes
1,204

Hi,

ME_PROCESS_REQ_CUST is the right badi for this requirement.

In the method PROCESS_ACCOUNT get the order number and store it in a abap memory using EXPORT OPTION.

Next,

In the method POST import the order number from memory, get all the PR items from method GET_ITEMS and do the comparision.

Read only

0 Likes
1,204

Export and Import doesn't work in BADI's

Read only

Former Member
0 Likes
1,204

field symobls should work.

in the method POST, you can access the field 'AUFNR' of the main program.

use syntax:

ASSIGN '(mainprogramofPR)fieldnameofAUFNR' into <fs>.

give it a try and let us know.