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

Material document Reversal

Former Member
0 Likes
1,753

Hi,

I create a material document reversal using this BAPI "BAPI_GOODSMVT_CANCEL". I can only pass document, item number to make reversal. I want to pass additional parameters like reason for movement, additional text. Is there any other BAPI for material reversal document to solve my problem. or any other solution?

Thanks in advance.

Sajjad

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,366

Seems that this BAPI is quite limited. So here is another way to approach it. You can figure out which movement type is used to reverse the document, see table T156N with function modue = ST, like if it was created with 101, then you would use 102 to reverse it, then you can use the BAPI BAPI_GOODSMVT_CREATE, here you can give reason code.

Regards,

RIch HEilman

Read only

0 Likes
1,366

Thanks for your reply. But for reversal, If I use this functional module

BAPI_GOODSMVT_CREATE, then How can I control the line items to be reversed? because I want to reverse exactly same of original document and reset the movement type manually. for this I need to move all lines from mseg to GOODSMVT_ITEM. But GOODSMVT_ITEM has different fields, so I cant use move-corresponding. It is very hard to move to 100s of feilds from mseg to GOODSMVT_ITEM. Please suggest me any solution about it. or anyother functional module for reversal.

Thanks in advance.

Sajjad

Read only

Former Member
0 Likes
1,366

resolved.

Read only

0 Likes
1,366

Can you tell me how did u solve?

BM

Read only

0 Likes
1,366

Hi MB,

I completed this stuff in 2 steps.

1. Function module BAPI_GOODSMVT_CREATE to create reversal document.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = header

goodsmvt_code = l_gm_code-gm_code

IMPORTING

GOODSMVT_HEADRET = headret

tables

goodsmvt_item = item

return = return.

2. after that update newly created reversal document with my own parameters.

Function mdoule is MB_CHANGE_DOCUMENT

Thanks,

Read only

0 Likes
1,366

Hi Sajid,

I have got requirement like this, Goods Receipt Note Reversal with 102 movement type . which bapi i need to use. what are all the parameters i need to pass in to that bapi.

if you have sample coding please post it.

Highly appreciate if u send quick replies,

Thanks & Regards,

Vinay Kumar.