cancel
Showing results for 
Search instead for 
Did you mean: 

LSMW for posting Goods Receipt via MIGO Transaction

Former Member
0 Kudos

Hello Experts,

I wanted to know if we can perform GR's via LSMW (with MIGO Tcode)? Our requirement is to post GR for multiple POs (so GR is going to be standard 101 with reference to PO). Please suggest LSMW method (BAPI or IDOC).

Thanks,

Vihaan

Accepted Solutions (0)

Answers (1)

Answers (1)

JL23
Active Contributor
0 Kudos

yes this can be done with LSMW.

You can use BAPI BUS2017 with CREATEFROMDATA

or IDOC MBGMCR with MBGMCR03

or batch input 0110 with 0000

Just do not go for recording.

Former Member
0 Kudos

Hi Jurgen,

Thanks for the response.

I've created LSMW using BAPI method

Business Object BUS2017 Goods Movement

Method CREATEFROMDATA

Message Type MBGMCR

Basic Type MBGMCR03

And my source file structure is :

C(010) PO NUMBER

C(005) PO ITEM

C(002) GM CODE

C(004) PLANT

C(003) MVT TYPE

C(016) QUANTITY

C(010) BATCH

C(008) PROD DATE

C(008) SLED

But when I am executing this LSMW I am getting following error after executing last step (Start IDOC processing and create IDOC overview):

No stock posting possible for this material (message coming With status 51), My material in PO is a FG materials and has value and qty update indicator ticked in OMS2 for FERT but still getting this error. Also when I am trying to post MIGO manually it is posting it fine. Please provide your inputs why with LSMW this message is coming.

Thanks,

Vihaan

JL23
Active Contributor
0 Kudos

what other fields do you use, that are not in the source ?

e.g. I miss the posting date field.

What is GM code? if it is the movement type, why is it only 2 characters long?

what are you ddoing with the material number field?

Former Member
0 Kudos

Hi Jurgen,

Above issue got resolved, I had to put value for Movement Indicator as B - (GR against PO).

Regarding your queries:

  1. GM_CODE is a mandatory field which specify if GR in MIGO is Goods receipt against PO or GR against Production order or GI. So it is 01 for GR.

  2. As my GR is against PO I am not entering any Material number as LSMW should direclty pick it from PO.

  3. Posting date and Doc date are not in my structure but I am giving a constant value for them at step 5 (Maintain field mapping)

So considerng all above conditions my LSMW is working fine now - Thanks for your support.

But have one more issue - My requirement is to post GR against a multiple line PO so that in one material document only GR gets posted for all the PO lines. Using my file structure when I am trying it is posting multiple material document i.e. one for each line of the PO.

Please provide your inputs how to achieve one material document for all the line of PO? Do I need to mainatin two source structures i.e. one for header and one for item (like we do in case of muktline PO creation).

Note: As of now I have only one source structure defined in my LSMW with the field menitoned in prevous post.

Thanks,

Vihaan

Edited by: Vihaan on Apr 11, 2011 11:14 PM

JL23
Active Contributor
0 Kudos

it does not really matter if you split your source in header and item , or if you just use one source with each record looking equal and is a combination of header and item data (header part redundant if more than one item), because you can make use of global function onchange_transfer_record_

http://help.sap.com/saphelp_nw73/helpdata/en/3b/5b511740da11d3bc4900105a6588b2/frameset.htm

In general transfer_record will create records, first a header record, and below the header record as much items as you want. Transfer_transaction will close the material document, and next record will be in another material document

Former Member
0 Kudos

Hi Jurgen,

I am able to post a single material document for a multiline PO by splitting structure in two - i.e one for header and one for item.

PO number is my common field between these2 structures, so its working fine now.

Thanks for your respinse though.

Regards,

Vihaan