cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for Stock posting in usage decision

vivek_gaurav
Participant
0 Kudos

Hi All,

I am doing Usage decision using BAPI " BAPI_INSPLOT_SETUSAGEDECISION" But there is no option to give input for stock posting like To unrestricted use and Return Delivery.

I am getting error : Error during quantity posting for inspection lot 010000000086, manual proc. required

I tried doing stock posting using BAPI :  BAPI_GOODSMVT_CREATE

But this gives error: Change the inspection stock of material XXX in QM only

Can any one tell me correct BAPI for creating Usage Decision with Stock posting.

Thanks in advance.

Regards

Vivek

Accepted Solutions (1)

Accepted Solutions (1)

anand_rao3
Active Contributor
0 Kudos

Perhaps its not there or I am not aware of it! Could you please try setting stock posting proposals in QS51 for the respective usage decisions? For example,

  1. If the UD code is ACC then keep proposal as To Unrestricted Use
  2. If the UD code is BLOK then keep proposal as To Block Stock
  3. If the UD code is RET then keep proposal as To Return Delivery

So that, when you set UD with above BAPI, the respective UD code will trigger automatic stock posting as per the proposals maintained. The limitation is, it posts the entire the stock and not the partial.

If you want to make partial stock posting, you might have to develop a custom program in ABAP.

Anand

vivek_gaurav
Participant
0 Kudos

Hi Anand ,

Thanks for your reply.

Now,I am able to do Usage decision based on UD and it is posting Return delivery and To Unrestricted Use.

But I am not getting any provision for quantity posting like If lot qty 50 .30 to Unrestricted Use and 20 to Return delivery

If any one has done ,kindly help..

Regards

Vivek

anand_rao3
Active Contributor
0 Kudos

Yes you are right and that is what I said in my earlier posting! There is no any input field to this BAPI for specifying and splitting the quantity. I don't know how the GUI you are developing here. Logically I think this could not be the background process as the system on its own can never come to know how much should be put in unrestricted and how much to block or returns. Am I right? It is the manual intervention where a person decides how much should be posted and in which compartment.

How and from where these quantities will come to you? How and what process you are planning to design? Possibly you can try a luck developing BDC for QA12 transaction for partial posting.

Anand

Answers (1)

Answers (1)

former_member211679
Participant
0 Kudos

Hi Vivek,

In fact I have got the same requirement while working, I have debug the tcode QA11 and got few Function Modules

1) MB_CREATE_GOODS_MOVEMENT is for creating a material Document header

2) QAMB_COLLECT_RECORD is for linking Material Document Header to Inspection Lot & Creating a Line Items

3) MB_POST_GOODS_MOVEMENT is posting the Stock

You have to called the above FM sequentially, It really worked for me, hope it works for you..

Former Member
0 Kudos

Hi sumit sharma,

Could you give example how to use these three BAPIs?


For BAPI_INSPLOT_SETUSAGEDECISION,  stock posting like If lot qty 50 .30 to Unrestricted Useand 20 to Return delivery is impossiple..



Thank you.


James

Former Member
0 Kudos

Dear Sumit sharma,

Can you please elaborate more about how to use these function modules?

I need these types of FMs to post the partial inspection lot posting.

It will be very helpful for me.

Rgds,

Parveen Verma