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: 

MB_PHYSICAL_INVENTORY buffer not cleared

Former Member
0 Kudos

Hi All,

I am developing a custom program to delete Physical Inventory Document (standard transaction MI02). I am calling Function Module MB_PHYSICAL_INVENTORY in loop to delete multiple Physical Inventory Documents. But variable EIN_BELEG is not getting cleared after the first call to the FM. How can I clear the buffer values after the first function call.

Note: I have already tried

COMMIT WORK AND WAIT.

CALL FUNCTION 'BUFFER_REFRESH_ALL'.

CALL FUNCTION 'CKML_BUFFER_REFRESH_ALL'.

CALL METHOD PO_BUFFER_REFRESH.

Regards,

Dipin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

First call FM 'MB_PHYSICAL_INVENTORY' with inv_action = 1 and then call the same FM with inv_action = 2. This will delete the physical inventory document.

inv_action,1 = Check 2 = Post the invoice document

Regards,

Dipin

2 REPLIES 2

former_member400468
Active Participant
0 Kudos

Hi!

As I see, this variable not cleared by any initialization FMs, so you can try to use construction CALL FUNCTION ... DESTINATION 'NONE' for all your function calls and then CALL FUNCTION 'RFC_DESTINATION_CLOSE' after loop step is finished. It will separate the processing into different user sessions.

Hope it's helpful.

Evgeny

Former Member
0 Kudos

First call FM 'MB_PHYSICAL_INVENTORY' with inv_action = 1 and then call the same FM with inv_action = 2. This will delete the physical inventory document.

inv_action,1 = Check 2 = Post the invoice document

Regards,

Dipin