Quantcast
Channel: SCN: Message List - Enterprise Resource Planning (SAP ERP)
Viewing all articles
Browse latest Browse all 6103

Re: 03 inspection lots for co-products?

$
0
0

Hi Kathy,

 

I've solved this via ABAP and with a new inspection type 33 I set up. This inspection type was created with the origin 89.

 

Implement exit QPL10001, which is called when the 03 inspection lot is created by release of the production order.

 

 

i_qals to e_qals.

  e_active =
'X'.

 
check i_qals-herkunft = '03'. "only for in-process inspection

 

 

function'Z_QM_CREATE_INSP_LOT'in BACKGROUND TASK

   
exporting
i_qals = i_qals.

 

 

The Z function code is:

 

z_qm_create_insp_lot.

*"----------------------------------------------------------------------

*"*"Interface local:

*"  IMPORTING

*"     VALUE(I_QALS) TYPE  QALS

*"----------------------------------------------------------------------



 
data: ls_order_objs type bapi_pp_order_objects.

 
data: lt_comp typetableof bapi_order_component,

        ls_comp
type bapi_order_component.

 
data: l_aufnr_no_zero type aufnr.



 
data: ls_qals type qals.

 
data: ls_rmqed type rmqed.

 
data: out_subrc like sy-subrc,

         out_qals     
like qals,

          out_prueflos 
like qals-prueflos.



  ls_order_objs-
header = 'X'.

  ls_order_objs-components =
'X'.

 
callfunction'BAPI_PRODORD_GET_DETAIL'

   
exporting

     
number                 = i_qals-aufnr

      order_objects          = ls_order_objs


  
tables

    
component              = lt_comp.



 
loopat lt_comp into ls_comp where item_number ne0and movement_type eq'101'.





    ls_rmqed-dbs_steuer =
'01'.

    ls_rmqed-dbs_flag   =
'X'.

    ls_rmqed-dbs_nochg  =
'X'.

    ls_rmqed-dbs_subrc  =
'X'.



    ls_qals-mandant = sy-mandt.

    ls_qals-werk = i_qals-werk.

    ls_qals-art =
'33'.

    ls_qals-herkunft =
'89'.

    ls_qals-matnr = ls_comp-material.


    ls_qals-aufnr = i_qals-aufnr.

    ls_qals-lmengeist = ls_comp-req_quan.

    ls_qals-losmenge = ls_comp-req_quan.

    ls_qals-gesstichpr = ls_comp-req_quan.

    ls_qals-LMENGEPR = ls_comp-req_quan.



   
move i_qals-aufnr to l_aufnr_no_zero.

   
callfunction'CONVERSION_EXIT_ALPHA_OUTPUT'

     
exporting

       
input  = l_aufnr_no_zero

     
importing

       
output = l_aufnr_no_zero.




   
callfunction'QPL1_INSPECTION_LOT_CREATE'

     
exporting

        qals_imp              = ls_qals

        rmqed_imp             = ls_rmqed

    
importing

       e_prueflos            = out_prueflos

       e_qals                = out_qals

       subrc                 = out_subrc


              .

   
if out_subrc isinitial.

      out_qals-prueflos = out_prueflos.

      out_qals-lmengeist = ls_comp-req_quan.

      out_qals-losmenge = ls_comp-req_quan.

      out_qals-gesstichpr = ls_comp-req_quan.



     
callfunction'QPL1_UPDATE_MEMORY'

       
exporting

          i_qals  = out_qals

          i_updkz =
'I'

          i_rmqed = ls_rmqed.

*  I_DUMMY       =

     
callfunction'QPL1_INSPECTION_LOTS_POSTING'

       
exporting

          i_mode =
' '.



     
callfunction'BAPI_TRANSACTION_COMMIT'

       
exporting

         
wait = 'X'.



   
endif.



 
endloop.

 

 

the inspection lots for co-products are then created at the same time as the 03 inspection lot.

 

Don't forget that inspection plans must be set up for the co-products, as opposed to what happens to header material, where we create inspection operations in PP task list.

 

Best Regards,

 

DM

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 6103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>