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

ME_PROCESS_PO_CUST, endless loop at set_conditions method

Former Member
0 Likes
3,844

Hi all,

Im curently trying to update PO price with my own calculation's price via ME_PROCESS_PO_CUST , method set_conditions .

It ends up making the PO's loops endlessly, any advice? or is there anything that i missed?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,288

Hi,

where is that method set_conditions, it is not in the BADI. from where you are calling that method, is it your own method.

Regards

vijay

14 REPLIES 14
Read only

Former Member
0 Likes
3,289

Hi,

where is that method set_conditions, it is not in the BADI. from where you are calling that method, is it your own method.

Regards

vijay

Read only

0 Likes
3,288

Hi Vijay,

its in class IF_PURCHASE_ORDER_ITEM_MM

the path is: from se18-PROCESS_ITEM-double click on associated type IF_PURCHASE_ORDER_ITEM_MM then u can see set_conditions

Read only

0 Likes
3,288

Ester,

can you please post the associated code that you have written for this instance method .. ?

Cheers

Nishanth

Read only

0 Likes
3,288

Hi Nishanth,

Pls refer to the above coding

Read only

0 Likes
3,288

Hi Nisanth,

i have put the breakpoint at set_conditions and system keeps calling the method again n again

Read only

0 Likes
3,288

Ester,

Seems like you have to do some debugging here.Once the break-point reaches the call method statement check for the contents of tcond.There is no visible problem here except for the data being passed.So try this one and hope u find something useful.

Cheers

Nishanth

Read only

0 Likes
3,288

Hi all,

I have debugged the method, and it stays still at item '10' , that's the particular item im changing.

If i put extra coding :

leave screen.

the looping will quit set_conditions and the price updated

Read only

0 Likes
3,288

Hi all,

i have solved the problem.

here's the coding

LOOP AT tcond INTO vcond.

IF vcond-kschl = 'PB00' OR vcond-kschl = 'PBXX'

and vcond-kbetr ne '9000'.

vcond-kbetr = '9000'.

MODIFY tcond FROM vcond TRANSPORTING kbetr.

CALL METHOD im_item->set_conditions

EXPORTING

im_conditions = tcond

.

ENDIF.

ENDLOOP.

so upon getting the correct price, it wont do the pricing update.

Read only

0 Likes
3,288

Ester,

Nice to see that you solved the problem.Please reward helpful answers and close this thread.

Cheers

Nishanth

Read only

Former Member
0 Likes
3,288

Could you please post the code of the implementation where u are updating the PO price.

Read only

0 Likes
3,288

Hi Sharath: this is the coding

METHOD if_ex_me_process_po_cust~process_item .

DATA: ls_mepoitem TYPE mepoitem,

ls_customer TYPE mepo_badi_exampl,

ls_tbsg TYPE tbsg.

DATA: tcond TYPE mmpur_tkomv,

vcond LIKE LINE OF tcond.

INCLUDE mm_messages_mac. "useful macros for message handling

----


  • here we check customers data

----


ls_mepoitem = im_item->get_data( ).

IF ls_mepoitem-loekz EQ 'D'.

ENDIF.

CALL METHOD im_item->get_conditions

IMPORTING

ex_conditions = tcond.

LOOP AT tcond INTO vcond.

IF vcond-kschl = 'PB00' OR vcond-kschl = 'PBXX'.

vcond-kbetr = '9000'.

MODIFY tcond FROM vcond TRANSPORTING kbetr.

ENDIF.

ENDLOOP.

CALL METHOD im_item->set_conditions

EXPORTING

im_conditions = tcond

.

ENDMETHOD.

when i try to change the po , it stops endlessly at set_conditions

Read only

0 Likes
3,288

Ester,

Please put a break-point at the call statement.This is just to ensure that the problem is indeed with the call to the method set_conditions and not because of the preceeding LOOP .. ENDLOOP before it.

Cheers

Nishanth

Read only

nishanthbhandar
Contributor
0 Likes
3,288

Ester,

Please check the documentation of the BADI ME_PROCESS_PO_CUST.There is no method by the name set_conditions in the BADI.If you are coding inside a method and calling your own method then please check the code that you have written.As far as my knowledge goes the PO pricing part definitely does not end in any endless loop.Check your code or maybe provide a more descriptive definition of ur problem so that we can help.

Cheers

Nishanth

Read only

Former Member
0 Likes
3,288

Can you check the number of entries VCOND each time the break-point is reached. Is it increasing by any chance?