08-20-2007 8:20 PM
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 =
.
08-20-2007 8:42 PM
Please check the standard program RQAAAS10 , which is calling this function module.
And also RQBAAM20.
This coding is available in program RQMQMM00.
08-20-2007 8:45 PM
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.
08-20-2007 9:02 PM
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.
08-20-2007 9:28 PM
call function 'QPL1_UPDATE_MEMORY'
exporting
i_qals = l_qals.
Can this function not be used after QPL1_INSPECTION_LOT_CREATE
08-21-2007 6:52 PM
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.