2024 Oct 19 11:18 AM
fields have been picked up from LIPS table and passed into the BAPI
Facing issue when article is of MIX Quantity.
Providing some snippets of the code:
FETCHING DATA FROM LIPS table
SELECT deliverydocument, "vbeln
deliverydocumentitem, "posnr
material, "matnr
plant, "werks
actualdeliveryquantity, "lfimg
* baseunit, "meins
deliveryquantityunit, "vrkme
referencesddocument, "vgbel
referencesddocumentitem, "vgpos
goodsmovementstatus "wbsta
FROM i_deliverydocumentitem AS a "lips
FOR ALL ENTRIES IN @dlv_hdr
WHERE a~deliverydocument = @dlv_hdr-deliverydocument
INTO TABLE @DATA(dlv_item_final).
PASSING DATA INTO BAPI
LOOP AT dlv_item_final ASSIGNING <lfs_item> FROM item_indx.
IF <lfs_item>-deliverydocument NE <lfs_dlv_hdr>-deliverydocument.
EXIT.
ENDIF.
APPEND VALUE #( material = <lfs_item>-material
plant = <lfs_item>-plant
no_more_gr = abap_true
mvt_ind = movement_indicator
move_type = movement_type_gr
entry_qnt = <lfs_item>-actualdeliveryquantity
entry_uom = <lfs_item>-deliveryquantityunit
* entry_uom_iso = <lfs_item>-baseunit
po_number = <lfs_item>-referencesddocument
po_item = <lfs_item>-referencesddocumentitem+1(5)
* ref_doc = <lfs_item>-referencesddocument
ref_doc_it = <lfs_item>-referencesddocumentitem+1(5)
deliv_numb = <lfs_item>-deliverydocument
deliv_item = <lfs_item>-deliverydocumentitem
deliv_numb_to_search = <lfs_item>-deliverydocument
deliv_item_to_search = <lfs_item>-deliverydocumentitem ) TO goodsmvt_item.
ENDLOOP.
IF goodsmvt_item IS NOT INITIAL.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = goodsmvt_header
goodsmvt_code = goodsmvt_code
IMPORTING
materialdocument = materialdocument
matdocumentyear = matdocumentyear
TABLES
goodsmvt_item = goodsmvt_item
return = return.
READ TABLE return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDIF.
Facing issue when article is of MIX Quantity.
Please can someone help to resolve this issue.
i have not provided the full code, just the required part is given.
fields have been picked up from LIPS table and passed into the BAPI
Facing issue when article is of MIX Quantity.
Providing some snippets of the code:
FETCHING DATA FROM LIPS table
SELECT deliverydocument, "vbeln
deliverydocumentitem, "posnr
material, "matnr
plant, "werks
actualdeliveryquantity, "lfimg
* baseunit, "meins
deliveryquantityunit, "vrkme
referencesddocument, "vgbel
referencesddocumentitem, "vgpos
goodsmovementstatus "wbsta
FROM i_deliverydocumentitem AS a "lips
FOR ALL ENTRIES IN @dlv_hdr
WHERE a~deliverydocument = @dlv_hdr-deliverydocument
INTO TABLE @DATA(dlv_item_final).
PASSING DATA INTO BAPI
LOOP AT dlv_item_final ASSIGNING <lfs_item> FROM item_indx.
IF <lfs_item>-deliverydocument NE <lfs_dlv_hdr>-deliverydocument.
EXIT.
ENDIF.
APPEND VALUE #( material = <lfs_item>-material
plant = <lfs_item>-plant
no_more_gr = abap_true
mvt_ind = movement_indicator
move_type = movement_type_gr
entry_qnt = <lfs_item>-actualdeliveryquantity
entry_uom = <lfs_item>-deliveryquantityunit
* entry_uom_iso = <lfs_item>-baseunit
po_number = <lfs_item>-referencesddocument
po_item = <lfs_item>-referencesddocumentitem+1(5)
* ref_doc = <lfs_item>-referencesddocument
ref_doc_it = <lfs_item>-referencesddocumentitem+1(5)
deliv_numb = <lfs_item>-deliverydocument
deliv_item = <lfs_item>-deliverydocumentitem
deliv_numb_to_search = <lfs_item>-deliverydocument
deliv_item_to_search = <lfs_item>-deliverydocumentitem ) TO goodsmvt_item.
ENDLOOP.
IF goodsmvt_item IS NOT INITIAL.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = goodsmvt_header
goodsmvt_code = goodsmvt_code
IMPORTING
materialdocument = materialdocument
matdocumentyear = matdocumentyear
TABLES
goodsmvt_item = goodsmvt_item
return = return.
READ TABLE return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDIF.
Facing issue when article is of MIX Quantity.
Please can someone help to resolve this issue.
i have not provided the full code, just the required part is given.
2024 Oct 19 11:43 AM
First, ask the functional people, maybe this error would happen with MIGO.
2024 Oct 19 1:24 PM
Hi Sandra,
Functional people have confirmed there is no error when they are posting GR through standalone BAPI & MIGO
2024 Oct 19 4:33 PM
Through standalone BAPI. Did they run with SE37? If yes, just make sure that you pass exactly the same parameters, and that's it.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |