08-04-2017 8:34 PM
We have implemented the bapi BAPI_PR_CREATE to replace the old bapi BAPI_REQUISITION_CREATE, but the problem is that the field EBAN-ERNAM is not allow to modify, so as creator of PR is communication user (COMM_USER).
Is posible to change field CREATED_BY from bapi BAPI_PR_CREATE?
I try to use the badi me_process_req_cust~process_item with this code:
CALL METHOD im_item->get_data
RECEIVING
re_data = r_pos_solped.
r_pos_solped-ernam = 'SAPOSS'.
CALL METHOD im_item->set_data
EXPORTING
im_data = r_pos_solped.
but this code dosent work.
08-04-2017 9:37 PM
see OSS note 1765860 - PReq created by RFC user
it has source code for a BAdI to have a different CREATED_BY
08-04-2017 9:37 PM
see OSS note 1765860 - PReq created by RFC user
it has source code for a BAdI to have a different CREATED_BY
08-07-2017 2:52 PM
Thanks Jürgen L,
I have tried with the instruction of note 1765860 - PReq created by RFC user but the code does not work 😞
Any other idea?
Regards
08-08-2017 3:11 PM
Thank Jürgen L,
Your solution is ok, i have a problem because i make an update in item method insted header method.
The solution was:
lt_items = im_header->get_items( ).
LOOP AT lt_items REFERENCE INTO lr_item.
ls_item = lr_item->item->get_data( ).
ls_itemx = lr_item->item->get_datax( ).
IF ls_item-ernam NE 'USERX'.
ls_item-ernam = 'USERX'.
ls_itemx-ernam = abap_true.
lr_item->item->set_data( ls_item ).
lr_item->item->set_datax( ls_itemx ).
ENDIF.
ENDLOOP.
06-28-2018 7:40 PM
Hi Jürgen L,
I have the same problem with EBAN-CREATED_BY field but with BAPI_PO_CREATE1 and EKKO-CREATED_BY. I need to change RFCUSER filled by default. Any idea?
Thanks a lot and best regards.
Marce.