Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Inspection Lots

Former Member
0 Kudos

I need to create inspection lots using FM. I have the matnr and charg available. How to use this FM to create inspection lots?

CALL FUNCTION 'QPL1_INSPECTION_LOT_CREATE'
  EXPORTING
    qals_imp              =
    rmqed_imp             =
* IMPORTING
*   E_KZSKIPLOT           =
*   E_PRUEFLOS            =
*   E_QALS                =
*   SUBRC                 =
*   E_SKIP_TO_STOCK       =
          .

5 REPLIES 5

Former Member
0 Kudos

Please check the standard program RQAAAS10 , which is calling this function module.

And also RQBAAM20.

This coding is available in program RQMQMM00.

Former Member
0 Kudos

We have created a function which creates inspection lots based on some Z-tables we have. The FM you mention creates the inspection lot but just stores it in memory. It is necessary to update table QALS. Here's the interesting part of the code we're using:

  • LIKP data:

MOVE ztaf07-proveedor TO l_likp-lifnr.

MOVE ztaf07-cliente TO l_likp-kunnr.

MOVE ztaf07-cliente TO l_likp-kunag.

SELECT SINGLE vkorg FROM vbak

INTO l_likp-vkorg

WHERE vbeln = ztaf07-vbeln.

IF sy-subrc <> 0.

MOVE sy-subrc TO l_subrc.

EXIT.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • LIPS data:

MOVE ztaf08-matnr TO l_lips-matnr.

MOVE ztaf08-werks TO l_lips-werks.

MOVE ztaf08-c_fact TO l_lips-lgmng.

MOVE ztaf08-vrkme TO l_lips-meins.

MOVE ztaf08-charg TO l_lips-charg.

MOVE ztaf07-fecha TO l_lips-mbdat.

  • TVLK data:

MOVE '89' TO l_tvlk-qherk. "Lot creation without reference

CALL FUNCTION 'QAAT_SD_LOT_CREATION'

EXPORTING

i_kuwev = l_kuwev

i_likp = l_likp

i_lips = l_lips

i_tvlk = l_tvlk

IMPORTING

e_prueflos = l_prueflos

  • E_TEILLOS =

EXCEPTIONS

x_no_origin = 1

OTHERS = 2.

.

IF sy-subrc <> 0.

MOVE sy-subrc TO l_subrc.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

MOVE l_prueflos TO l_lipsvb-qplos.

MOVE 0 TO l_lipsvb-qtlos.

MOVE 1 TO l_lipsvb-updkz.

APPEND l_lipsvb.

CALL FUNCTION 'QAAT_SD_LOT_POSTING'

TABLES

t_lips_tab = l_lipsvb.

IF sy-subrc <> 0.

MOVE sy-subrc TO l_subrc.

ENDIF.

COMMIT WORK.

ENDIF.

Former Member
0 Kudos

Mahesh

Does that mean I need to execute this code after QPL1_INSPECTION_LOT_CREATE. What is the structure of your custom table. Could you please provide a little explanation. Thank you.

Former Member
0 Kudos

call function 'QPL1_UPDATE_MEMORY'

exporting

i_qals = l_qals.

Can this function not be used after QPL1_INSPECTION_LOT_CREATE

Former Member
0 Kudos

This is how to make the FM work.

CALL FUNCTION 'QPL1_INSPECTION_LOT_CREATE'
  EXPORTING
    qals_imp  = l_qals
    rmqed_imp = l_rmqed
  IMPORTING
    e_qals    = l_qals
    subrc     = l_subrc
  EXCEPTIONS
    OTHERS    = 1.

IF sy-subrc = 0.
  CALL FUNCTION 'QPL1_UPDATE_MEMORY'
    EXPORTING
      i_qals  = l_qals
      i_rmqed = l_rmqed.
ENDIF.

CALL FUNCTION 'QPL1_INSPECTION_LOTS_POSTING'.
COMMIT WORK AND WAIT.