Mb1b transfer posting

Hello friends,
In mb1b second screen, they are entering second line item which is called scrap(eg: M03-SCRAP).This is updated in MARD table as the scrap materials doesn't belong to any batch.
So, they are entering matnr and labst (quantity in second line item).
How to identify this particular scrap material from mard table.
I m writing query like this:-
SELECT matnr labst FROM mard
       INTO CORRESPONDING FIELDS OF TABLE it_mard
                       WHERE matnr = 'M03-SCRAP'
                       AND   werks = plant
                       AND   lgort = '2200'.
How to get this material number without hardcoding bcoz this ll be vary for different material numbers.

Hello max,
scrap field they enter like "M03-SCRAP".
They said that if first 3 letters of scrap = first 3 letters of receiving material.
then data has to pick from mard-labst and to be added to the first line item of material and mard should be updated.
please luk into my coding(function module):-
  DATA : ls_quan2 TYPE p DECIMALS 3,
         ls_quan3 TYPE p DECIMALS 3.
  DATA : it_mard LIKE mard OCCURS 0 WITH HEADER LINE.
  gmhead-pstng_date = sy-datum.
  gmhead-doc_date   = sy-datum.
  gmcode-gm_code    = '04'.       "Transfer Posting (MB1B)
  SELECT matnr clabs FROM mchb
                       INTO TABLE it_mb1b
                       WHERE werks = plant
                       AND   lgort = send_stloc
                       AND   charg = batch.
  SELECT matnr labst FROM mard
                       INTO CORRESPONDING FIELDS OF TABLE it_mard
                       WHERE matnr like '%SCRAP'
                       AND   werks = plant
                       AND   lgort = '2200'.
  LOOP AT it_mb1b INTO wa_mb1b.
    it_gmitem-move_type    = move_type.
    it_gmitem-plant        = plant.
    it_gmitem-stge_loc     = send_stloc.
    it_gmitem-move_plant   = move_plant.
    it_gmitem-move_stloc   = recv_stloc.
    it_gmitem-batch        = batch.
    it_gmitem-material     = wa_mb1b-matnr.
    ls_quan2 = quan_measure - wa_mb1b-clabs.
    IF ls_quan2 LE 0.
      ls_quan3 = wa_mb1b-clabs.
    ELSE.
      ls_quan3 = wa_mb1b-clabs + ls_quan2.
      it_mard-labst = it_mard-labst - ls_quan2.
MODIFY table it_mard TRANSPORTING labst.
    <b>MODIFY it_mard TRANSPORTING labst WHERE matnr = 'M03-SCRAP'.</b>    MODIFY mard. " FROM TABLE it_mard.
    ENDIF.
<b>" Here how we know that matnr only update in mard.</b>
    it_gmitem-entry_qnt    = ls_quan3.
    APPEND it_gmitem.
  ENDLOOP.
  CLEAR return.
  CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    EXPORTING
      goodsmvt_header             = gmhead
      goodsmvt_code               = gmcode
  TESTRUN                     = 'X'
   IMPORTING
  GOODSMVT_HEADRET            =
     materialdocument            = mat_doc
  MATDOCUMENTYEAR             =
    TABLES
      goodsmvt_item               = it_gmitem
  GOODSMVT_SERIALNUMBER       =
      return                      = return
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
  wait          = 'X'
IMPORTING
  RETURN        =

Similar Messages

  • MB1B transfer posting error "SL stock in transfer exceeded by 20 PC."

    Hi All,
    I'm doing a MB1B transfer posting for my materials from 1 storage location to another using movement type 311,
    but some of the materials I encountered this error.
    "SL stock in transfer exceeded by 20 PC : 'Material name' 'Plant' 'Stor. Loc' "
    I went to MB5T to check the materials if it's in the stock in transfer, but they are not in the list.
    I've also check in MMBE to check the stock value of these materials, it shows 100 in unrestricted use which is more than what I'm transferring.
    May I know what have i missed checking?
    Please help and thank you.

    Hi There
    Seems you are trying to do the One step Transfer between locations (311), So it is not required to look into the 313, 315 steps (Stock in trasfer, Removal and palce in transfer)
    From the Suppling location these Material and Batch is reserved for some purpose(261 or 201) and these material may under Dynamic Availability Check, In this case even if you have the stock in Location if it is hard allocated for some other purpose you cant use this qty
    Please check the above settings.
    Thanks
    Senthil P

  • Mb1b Transfer posting problem (urgent)

    hello
    i m using movement type 309.
    in the second screen they are entering batch..so based on that batch i m getting matnr and quantity in that batch.
    In my ZBAPI ..
    SELECT matnr clabs FROM mchb
                           INTO TABLE it_mb1b
                           WHERE werks = plant      
                           AND   lgort = send_stloc 
                           AND   charg = batch.    
    In the second line item..They are entering scrap material which the data has to get from MARD table. There is no batch exists for this second line item.
    i m writing query to get the data from mard like this:-
      SELECT matnr labst FROM mard
             INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr LIKE '%-SCRAP'
                           AND   werks = plant     
                           AND   lgort = '2200'. 
    So, how to fill this second line item in BAPI.
    For the first line item i m using it_gmitem-entry_qnt in the BAPI item list.  This is for the first item in second screen.
    Similarly how to fill the second line item in BAPI_GOODSMVT_CREATE.

    FUNCTION zbapi_mb1b_new.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(MOVE_TYPE) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_TYPE DEFAULT
    *"       '309'
    *"     VALUE(PLANT) LIKE  BAPI2017_GM_ITEM_CREATE-PLANT DEFAULT '2000'
    *"     VALUE(SEND_STLOC) LIKE  BAPI2017_GM_ITEM_CREATE-STGE_LOC
    *"     VALUE(RECV_STLOC) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_STLOC
    *"     VALUE(MOVE_PLANT) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_PLANT
    *"       DEFAULT '2000'
    *"     VALUE(BATCH) LIKE  BAPI2017_GM_ITEM_CREATE-BATCH
    *"     VALUE(QUAN_MEASURE) LIKE  BAPI2017_GM_ITEM_CREATE-QUANTITY
    *"  EXPORTING
    *"     VALUE(MAT_DOC) LIKE  BAPI2017_GM_HEAD_RET-MAT_DOC
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET2
      DATA : ls_quan1 TYPE p DECIMALS 3,
             ls_quan2 TYPE p DECIMALS 3,
             ls_quan3 TYPE p DECIMALS 3,
             ls_quan4 TYPE p DECIMALS 3,
             ls_quan5 TYPE p DECIMALS 3,
             ls_quan6 TYPE p DECIMALS 3.
      DATA : it_mard LIKE mard OCCURS 0 WITH HEADER LINE.
      gmhead-pstng_date = sy-datum.  "Posting date defaulted to system date
      gmhead-doc_date   = sy-datum.  "Document date defaulted to system date
      gmcode-gm_code    = '04'.       "Transfer Posting (MB1B)
      SELECT matnr clabs FROM mchb
                           INTO TABLE it_mb1b
                           WHERE werks = plant       "Plant
                           AND   lgort = send_stloc  "Storage location
                           AND   charg = batch.      "Batch Number
      SELECT matnr labst FROM mard
                           INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr LIKE '%-SCRAP'
                           AND   werks = plant      "Plant
                           AND   lgort = '2200'.    "2094 in production
      LOOP AT it_mb1b INTO wa_mb1b.
        ls_quan2 = ( 5 / 100 ) * wa_mb1b-clabs.
        ls_quan3 = wa_mb1b-clabs + ls_quan2.
        ls_quan4 = wa_mb1b-clabs - ls_quan2.
        IF ( quan_measure EQ wa_mb1b-clabs ).
          ls_quan6 = wa_mb1b-clabs.
       ELSEIF ( quan_measure > wa_mb1b-clabs AND quan_measure <= ls_quan3 ).
          ls_quan5 = quan_measure - wa_mb1b-clabs.  "difference
          READ TABLE it_mard WITH KEY matnr0(3) = wa_mb1b-matnr0(3).
          IF sy-subrc EQ 0.
            it_mard-labst = it_mard-labst - ls_quan5.
            MODIFY it_mard TRANSPORTING labst WHERE
                             matnr0(3) = wa_mb1b-matnr0(3).
          ELSE.
          ENDIF.
          MODIFY mard FROM TABLE it_mard.
          CLEAR it_mard.
          ls_quan6 = wa_mb1b-clabs + ls_quan5.
       ELSEIF ( quan_measure < wa_mb1b-clabs AND quan_measure <= ls_quan4 ).
          ls_quan5 = wa_mb1b-clabs - quan_measure.
          it_mard-labst = it_mard-labst + ls_quan5.
          MODIFY it_mard TRANSPORTING labst WHERE
                              matnr0(3) = wa_mb1b-matnr0(3).
          MODIFY mard FROM it_mard.
          ls_quan6 = wa_mb1b-clabs.
       ENDIF.
        it_gmitem-move_type    = move_type.      "Movement type
        it_gmitem-plant        = plant.          "Plant
        it_gmitem-stge_loc     = send_stloc.     "Storage Location
        it_gmitem-move_plant   = move_plant.     "Receiving Plant
        it_gmitem-move_stloc   = recv_stloc.     "Receiving storage location
        it_gmitem-batch        = batch.          "Batch Number
        it_gmitem-material     = wa_mb1b-matnr.  "Material Number
        it_gmitem-move_mat     = wa_mb1b-matnr.  "Receiving/issuing material
        it_gmitem-entry_qnt   = ls_quan6.        "Quantity in unit of entry
        APPEND it_gmitem.
      ENDLOOP.
      CLEAR return.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header             = gmhead
          goodsmvt_code               = gmcode
      TESTRUN                     = 'X'
       IMPORTING
      GOODSMVT_HEADRET            =
         materialdocument            = mat_doc
      MATDOCUMENTYEAR             =
        TABLES
          goodsmvt_item               = it_gmitem
      GOODSMVT_SERIALNUMBER       =
          return                      = return
      IF NOT mat_doc IS INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         wait          = 'X'
    IMPORTING
      RETURN        =
      ELSE.
      ENDIF.
    ENDFUNCTION.

  • MB1B: Transfer posting from material to material

    hello,
    I would like to add material validation mechanism in MB1B for transfer posting from material to material, that is we can define only particular materials can be transfer to receiving material and validate in MB1B with specified movement type, how to do this?
    Is there any thing available in standard?
    we can do this using user exit but I couldn't find any exit relevant for this scenario?
    I appreciate your earliest responses.
    regards,
    Jawed Ali

    well I have checked all these exits but none was called during the process:
                                                                                    MBCF0002            Customer function exit: Segment text in material doc. item               
    MBCF0005            Material document item for goods receipt/issue slip                      
    MBCF0006            Customer function for WBS element                                        
    MBCF0007            Customer function exit: Updating a reservation                           
    MBCF0009            Filling the storage location field                                       
    MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_CREATE1               
    MBCF0011            Read From RESB and RKPF For Print List in  MB26                          
    MBCFC003            Maintenance of batch master data for goods movements                     
    MBCFC004            Maintenance of batch specifications for goods movements                  
    regards,
    Jawed Ali

  • MB1B transfer posting doesn't copy serial number information to delivery

    Hi all,
    we have a decentral warehouse setting and use MB1B for transfer postings. MB1B automatically creates the corresponding delivery which will be transmittedt to the external warehouse.
    Unfortunately the serial number from MB1B will not be copied into the delivery.
    Is there a configuration setting that I miss, or is there a User-Exit which could be used to copy the serial number information from transaction MB1B into the delivery?
    Thanks fro your help,
    Frank

    Hi Frank,
    Use Tcode VOFM to define the Data transfer routine . Your MM consultant may help you more.
    Pole

  • MB1B transfer posting Idoc/Message type for outbound and inbound

    Hello All
    Can anyone tell me the idoc/message type for movement type 313 outbound and 315 inbound to SAP. This is for MB1B Enter Transfer Positing.
    Thanks
    Ricky

    Its WMMBXY

  • MB1B Transfer posting 311Q ( Material provided to vendor ) ......

    Hello
    Subcontracting process useing movement type (311 Q)
    in the trasaction MB1B. i wold like to fetch the components from the PO , like 541.
    error "Combination of movement type 311 Q and function selected not possible "
    please help me

    you cannot consume with 543 if you have not move any stock with 541, even you created a storage location.
    The storage location is useless for the consumption, except you use the PP subcontracting process instead of the MM subcontracting process.
    A storage location for the subcontractor is usually on created for the case that you send materials directly from subcontractor to customer. in this case you receive the finished material into that location, but for consumption in MM subcontracting process no storage location is involved. the material has to be in special stock O and is only monitored at plant level, instead of storage location the vendor is shon in stock overview MMBE.
    In PP subcontracting process, you create a production order yourself to consume the materials, only the service fee is ordered via a PO that is linked to this production order. the calculation of the finished material is made from the production order. you then have to receive twice, you do MIGO to confirm that you got the service, and you receive the quantity to the production order.

  • Transfer posting between 2 StorLoc (Non HUM managed to HUM managed), MB1B

    Hi,
    I'm trying to figure out if after MB1B transfer posting (311 movement) an inbound delivery will be created automatically for the receiving StorLoc. This is for transfer of materials from a Non HUM StorLoc to a HUM StorLoc.
    If a inbound delivery can be created automatically what costomizing steps do I have to do?
    Thanks for you help.
    Regards,
    Alexander

    Hi,
    Check following link
    can any body send HUM configuration settings
    Thanks
    Diwakar

  • Transfer Posting (MB1B): Account XYZ requires an assignment to a CO object

    Hi,
    Iam doing a Sales order to Sales order transfer using MB1B (Transfer Posting) and movement type 413 (E). However i get an error "Account 526020 requires an assignment to a CO object".
    Can someone advise as to where i need to assign the Costobject.
    Please advise.
    Thanks,
    Safi

    Do you really need to post something to a Cost Centre? If its a SO to SO transfer, what kind of cost is posting to the Cost Centre?
    I would suggest you analyse the GL Account (why it needs an assignment to a CO Object?) and consider changing the Field Status Group or assigning a GL that is not a Cost Element.
    If you really have to assign a Cost Centre, then OKB9 is your best alternative. Enter a Common CCtr that will collect the costs and maybe let you allocate the same later.
    Cheers.

  • Automatic transfer posting after Purchase order creation

    I tried searching a solution for my pbm in this forum, but could not find any and hence posting a new thread. Hope to find an answer.
    I have a requirement of doing the automatic MB1B transfer posting of the PO when the PO is created and saved using ME21n.
    I initially used the BADI ME_PURCHDOC_POSTED for this purpose, in which i am calling BAPI_GOODSMVT_CREATE.
    But when i debug and see this BAPI returns an error saying that the PO doesnot exist.
    Which means, The PO is not yet created when it reaches this BADI.
    Is there any other BADI/user exit/ehancement spots? where the PO is already created and i can do the transfer posting?

    Hello K ,
    better to have a custom program to create PO & GR at the same time, u cannt create GR at the time of PO creation or change,u may get same kind of errors , ie. PO doent exists or PO locked by USER XXXX.
    regards
    Prabhu

  • Transfer Posting Issue through MB1B

    Hi,
    We have a requirement that During Transfer Posting of Material through MB1B transaction, User should be able to transfer the Stock within SAME Material Code (From Material A to Material A, but in diff. Plant)...
    If User want to Transfer the Stock of A Material to B Material, system should not allow the same...
    Please guide...

    SAP~MM wrote:
    > But If, we want to Transfer the Stock to another Plant with same material code, then by which movement type we can do it..
    >
    > Please guide...
    MVMT type : 301 Transfer posting plant to plant in one step
    The quantity is transferred from unrestricted-use stock in the issuing plant to unrestricted-use stock in the receiving plant.
    Possible special stock indicators: O, V, W
    MVMT type : 303 Transfer posting plant to plant in two steps - removal from storage
    The quantity is transferred from unrestricted-use stock of the issuing plant to stock in transfer in the receiving plant.
    For technical reasons, you cannot carry out transfer postings from plant to plant in two steps for split-valuation materials.
    Removal from storage can be posted via an SD delivery.

  • Transfer Posting - Transaction MB1B

    Hello Friends,
    Transaction - MB1B (Enter Transfer Posting)
    Movement - 303 (Transfer posting plant to plant - remove from storage)
    As per above transaction and Movement description, it is very clear this movement being used for Plant to Plant transfer.
    Here I am having one query, in initial screen of MB1B, inputs to be given as Movement Type 303, Plant, ABC and Storage location is 001then Enter,
    In second screen, there is a Receiving Plant
    Suppose we have to enter other plant (other than ABC), but by mistake (knowningly / unknowingly) even we enter same plant (ABC), system is taking and after save material document is created.
    Suppose system should not create (allow to save) if issuing plant as well as Receiving plants are same.
    Am I correct? If correct, Please explain how to restrict this?
    If I am not correct, please explain why?
    Best Regards,
    Vijayakumar TVN

    Dear Mr.Jürgen L.
    I am having one query here, the meaning of transfer posting shall either within a plant (between storage locations) or plant to plant. In this case, when I am choosing 303 movement - Transfer posting plant to plant - remove from storage, it should be between two plants, obviously, system should not allow receiving plant is equal to issue plant.
    Could u please clarify my understanding is correct or not?
    Best Regards,
    Vijayakumar TVN

  • Transfer Posting -  MB1B 412 E

    Hi,
    While doing the transfer Posting for 412 E , I am unable to make the the Sales Order field as Optional. Kindly please guide me.
    regards,
    R.Ramakrishnaraj

    Sales Order Number is Mandatory if you USe MB1B 411 E & 412 E movement types. Because based on the Sales order number only Transferring Stock is Possible.
    Even if you change the sales Order Number is Optional without Entering sales Order Number How does System understand against Which Sales order transfer is happening also System will not allot to save you with out so no.
    Regards,
    Ashok

  • Transfer posting MIGO  vs MB1B

    Hi,
    while doing transfer posting 311 with MB1B system automatically propose issued  batch on receiving storage location. With MIGO both batch are entered manually. Is there any setup (or user parameter) with which when we enter issuing batch in MIGO automatically receiving batch will be set as same?
    Best regards,
    vuk

    This thread solved the problem  (answer from Theodor)  [automatic batch number in migo_tr with movement type 301|automatic batch number in migo_tr with movement type 301]
    For MIGO field UMCHA set to optional.
    Inventory Management and Physical Inventory->Settings for Enjoy Transactions->Settings for Goods Movements (MIGO) -> Field Selection per Mvt Type
    Best Regards,
    Nenad

  • Storage bin does not exist error when during transfer posting in MB1B

    Hello All,
    I am getting the error message "  Storage bin [WH no, Storage type] does not exist Check your entry"  during transfer posting in MB1B from one storage location  to another for ex 0007 to 0001. But i can able to do transfer posting from 0001 to 0007 without any error.
    Please provide your solutions/suggestions
    Thanks
    Benny

    Benny Sampath wrote:
    Here is the error message "Storage bin 56A 870  does not exist (check your entry)"
    >
    > Thanks
    > Benny
    I can only see 2 values instead of the expected 3.
    what is 56A ? is it bin, warehouse or storage type?
    what is 870 ? is it bin, warehouse or storage type?
    one variable that is need  to have a hit in table LAGP is missing, hence you get this error.
    you have to find out why this variable is missing.
    But there is a wide area to look. Hence you should first answer the questions, as this would limit the options where to look.

Maybe you are looking for

  • Critical Error while compiling with AIR16 (*.ipa export)

    Hey, my application crashed while compiling with AIR16. (Flex 4.13.0-AIR 16.0) With AIR15 it works well. First I thougt, the reason might be the included ANE, but it isnt. The ANE works fine with another project. In fact other projects also work with

  • IPhone3G got stuck on connect to iTunes screen while doing upgrade iOS 4.2

    Right after my iTunes 10.1 downloaded the iOS 4.2, it automatically started installing and sync-ing to my phone as usual. It restarted itself, apple logo came out and ... 1. Stuck on "connect to itunes" screen eventough it was connected for the whole

  • How Do I extract columns from Table

    Dear Everyone List the texts listed both required and recommended for ICT218 in Semester 2 2010. The first should have required with some way of distinguishing between and required and recommended. Thanks Select UnitCode, RequiredText, RecommendedRea

  • Why are my photo album names in iPhone wrong?

    If I sync my iPhone 5 with iTunes (MAC) all the album names in iPhone are not the same as in iTunes.For example, I have an album name "SAVOGNIN" but the photos in there are from "MENORCA" not from SAVOGNIN.

  • J1INCHLN problem

    Hi I am trying to do J1INCHLN for TDS Challan preparation. Invoices have been posted and payment also made for the vendor.  But while doing for the challan creation, the system is throwing the following message: No unpaid tax lines exist for the give