2 weeks ago
Hi all,
my requirement is to set PO header field UNSEZ to a specific value when PO is saved.
Sounds easy but even after trying several suggestions from different posts I have no working solution.
I tried BAdI ME_PROCESS_PO_CUST, but Methods PROCESS_HEADER and PROCESS_ITEM are only triggered when a header or item field is manually changed, and that is not always the case in my scenario.
I also tried Methods POST and CHECK, but I am not able to get changes saved on the database.
From different posts I use following code:
data: lr_po_handle type ref to cl_po_header_handle_mm.
data: ls_header type mepoheader.
* Disable firwall
lr_po_handle ?= im_header.
lr_po_handle->my_cust_firewall_on = mmpur_yes.
* Get header data
ls_header = im_header->get_data( ).
* Set value
ls_header-unsez = text-100.
* Set header data
im_header->set_data( ls_header ).
im_header->set_changed( ).
* Enable firewall
lr_po_handle->my_cust_firewall_on = mmpur_no.
This code will change the field UNSEZ on Dynpro, but will not persist change on database.
Are there any solution to this issue.
Thanks E. Hasse
If you actually want a constant value, try to add your code in methods OPEN to initialize value) and PROCESS_HEADER (cancel user input)
NB: POST method shouldn't change data, CHECK is the last one allowed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to prevent infinite loop, change your code to something such as
* Get header data
ls_header = im_header->get_data( ).
* Prevent infinite loop
if ls_header-unsez ne text-100.
* Set value
ls_header-unsez = text-100.
* Set header data
im_header->set_data( ls_header ).
im_header->set_changed( ).
endif.
User | Count |
---|---|
80 | |
10 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.