Skip to Content

Fiori app: Receive Products: extension/enhancement

Hi,

I have extended the UI of the Receive Products Fiori app to create a document for a product that is not included in any open document (see screenshots). The standard application does not handle creation of PO for products which are not listed/do not exist. Hence, I would like to enhance a badi in order to be able to create a PO for an item before posting. Has anyone done something similar and could help me out please.

Thank you in advance.

Extension Points:

BADI_RTST_RP_DOCUMENT
BADI_RTST_RP_DOCUMENT_ITEM
BADI_RTST_RP_POST_DOCUMENT
BADI_RTST_RP_POST_DOC_ITEM
BADI_RTST_RP_PRODUCT
BADI_RTST_RP_SCAN_INFORMATION

* Method for PO creation *

METHOD create.

DATA lv_type TYPE seoclsname.

DATA: lv_number TYPE ekko-ebeln,
lv_category TYPE ekko-bstyp VALUE 'F'.

DATA lt_return TYPE bapiret2_t.

CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = im_header
poheaderx= im_headerx
IMPORTING
exppurchaseorder = lv_number
TABLES
return = lt_return
poitem = im_items
poitemx= im_itemsx
poaddrdelivery = im_addr_delivery
poschedule = im_schedule
poschedulex= im_schedulex
potextheader = im_header_texts
poexpimpitem = im_ft_items
poexpimpitemx= im_ft_itemsx
poaccount= im_account
poaccountx = im_accountx
extensionin= im_extension_in.

IF lv_number IS INITIAL.
* RAISE EXCEPTION
EXPORTING
bapi_return = lt_return.
ENDIF.

IF im_commit = abap_true.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDIF.

*SELECT SINGLE bstyp FROM t161 INTO lv_category
*WHERE bsart = im_header-doc_type. "#EC *

lv_type = get_object_type(
im_pdoc_category = lv_category
im_pdoc_type = im_header-doc_type ).

CREATE OBJECT re_purchasing_document TYPE (lv_type)
EXPORTING
im_number= lv_number
im_bapi_return = lt_return.

ENDMETHOD.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers