Skip to Content
avatar image
Former Member

Return to stock from Delivery

Hi,

I am looking for BAPI which do the function of LT0G.That is based on delivery number,we need to return few material back to bin,which would reduce my picked quantity.I searched in Forum,but could not find it.

Thanks,

Thambi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 29, 2015 at 09:33 PM

    Can you clarify your question?

    If I understand correctly you want to do pick reversal VIA interface but you don't mention if this is SAP DWM or some other WM system...

    Add comment
    10|10000 characters needed characters exceeded

    • few more query to analyze more in detail and give you the right solution

      1) Are you looking to automate this process before PGI and after TO confirmation

      2) What will happen with the delivery document against which the TO got created

  • avatar image
    Former Member
    Sep 30, 2015 at 07:58 AM

    For my custom RF transaction ZLT0G I have used the following approach.
    I didn't give you all code but this is the core you are searching for.
    The most important is the L_TO_SET_SPECIAL and L_TO_CREATE_MULTIPLE.
    Other as you can see are enqueue, dequeue, and L_TO_RESET_SPECIAL when we finish processing.

    ...................................................................


    call function 'ENQUEUE_EVVBLKE'
         exporting
           vbeln          = ltak-vbeln
         exceptions
           foreign_lock   = 2
           system_failure = 3.


    call function 'L_TO_SET_SPECIAL'
         exporting
           i_spezi        = 'B'
           i_vbeln        = ltak-vbeln
         exceptions
           call_forbidden  = 1
           input_wrong    = 2
           others            = 3.

       if sy-subrc = 0.


         call function 'L_TO_CREATE_MULTIPLE'
         exporting
           i_lgnum                = zwh_num
           i_bwlvs                 = '999'
           i_drukz                 = '01'
           i_commit_work      = 'X'
         importing
           e_tanum                = v_tanum
         tables
           t_ltap_creat           = ltap_creat[]
         exceptions
           no_to_created                = 1
           bwlvs_wrong                  = 2
           betyp_wrong                  = 3
           benum_missing                = 4
           betyp_missing                = 5
           foreign_lock                 = 6
           vltyp_wrong                  = 7
           vlpla_wrong                  = 8
           vltyp_missing                = 9
           nltyp_wrong                  = 10
           nlpla_wrong                  = 11
           nltyp_missing                = 12
           rltyp_wrong                  = 13
           rlpla_wrong                  = 14
           rltyp_missing                = 15
           squit_forbidden              = 16
           manual_to_forbidden          = 17
           letyp_wrong                  = 18
           vlpla_missing                = 19
           nlpla_missing                = 20
           sobkz_wrong                  = 21
           sobkz_missing                = 22
           sonum_missing                = 23
           bestq_wrong                  = 24
           lgber_wrong                  = 25
           xfeld_wrong                  = 26
           date_wrong                   = 27
           drukz_wrong                  = 28
           ldest_wrong                  = 29
           update_without_commit        = 30
           no_authority                 = 31
           material_not_found           = 32
           lenum_wrong                  = 33
           matnr_missing                = 34
           werks_missing                = 35
           anfme_missing                = 36
           altme_missing                = 37
           lgort_wrong_or_missing   = 38
           others                            = 39.

         if sy-subrc eq 0.

           clear: nltyp, nlpla, nlenr, nlenr_c.
           select single nltyp nlpla nlenr into (nltyp, nlpla, nlenr)
           from ltak as k inner join ltap as p on
           k~tanum = p~tanum
           where k~lgnum = wh_pestan
           and   k~tanum = v_tanum
           and   k~kquit eq space.
           if sy-subrc = 0.
             message2 = 'SU/HU: &'.
             pack nlenr to nlenr_c.
             replace '&' in message2 with nlenr_c.
             message3 = 'ST &'.
             replace '&' in message3 with nltyp.
             message4 = 'Bin &'.
             replace '&' in message4 with nlpla.
             message6 = 'Batch: &'.
             replace '&' in message6 with lqua-charg.
             clear enable_storno.
           else.
             enable_storno = 'X'.
           endif.
         endif.
         call function 'DEQUEUE_ALL'.
       endif.

       call function 'L_TO_RESET_SPECIAL'.

       call function 'DEQUEUE_EVVBLKE'
         exporting
           vbeln = ltak-vbeln.

    ............................................................................

    Regards,
    Mihailo

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 05, 2015 at 02:06 PM

    Hi Thambi,

    If you are having an issue where you cannot use LT0G for whatever reason, it may be possible to use the workaround given in the below KBA:

    http://service.sap.com/sap/support/notes/1459764

    Kind Regards,

    Neil

    Add comment
    10|10000 characters needed characters exceeded