2015 Feb 04 11:38 PM
Dear Experts,
I am facing an issue when I am trying to add a custom field in transaction MIRO. I am following the same steps mentioned in SAP NOTE 2075584. But the issue I am facing is that method GET_DATA_FROM_SCREEN_OBJECT is not reading the values from structure INVFO, when it is called from sub screen. And thus logic to display or hide the custom field is not working.
I have gone through all the available threads related to this topic, but its the everyone has suggested the same standard as defined in SAP NOTE. BADI implementation, subscreen and all other structures are active.
Please suggest what could be the reason for same.
Thank you.
S. Charu
2015 Feb 05 3:49 PM
Hi Charu,
The note is missing some code. Please, replace the method recive_data with the following code.
module receive_data output.
if o_badi_fdcb_subbas05 is initial.
call method cl_exithandler=>get_instance_for_subscreens
changing
instance = o_badi_fdcb_subbas05
exceptions
no_reference = 1
no_interface_reference = 2
no_exit_interface = 3
data_incons_in_exit_managem = 4
class_not_implement_interface = 5
others = 6.
call method o_badi_fdcb_subbas05->put_data_to_screen_object
exporting
im_invfo = invfo.
endif.
check not o_badi_fdcb_subbas05 is initial.
* get data from main screen
call method o_badi_fdcb_subbas05->get_data_from_screen_object
importing
ex_invfo = invfo.
endmodule. " RECEIVE_DATA OUTPUT
regards.
2015 Feb 06 6:37 PM
Hi Pete,
Your advice help me a lot....Thanks!, But now I am getting a new problem with "Document currency" field due this is taken from "Purchasing document" and when they press enter currency is not been placed in "Document currency" field then this field is blocked.
Another block of code should be missing here too?
Thanks a lot in advanced for your help.
Regards!.
2015 Feb 07 3:57 PM
Hi Mar,
I ran into the same issue.
Reason was that I created the program linked to the sub screen as a MODULE-POOL.
But it should be a FUNCTION-POOL. After changing it to a function pool it worked properly.
Regards,
Stefan
2015 Jul 02 3:41 PM
Hello,
When I changed the program into a Function Pool, INVFO was not being populated anymore when MIRO is started. Is there any step I'm missing?
Thank you very much.
Regards,
Marc
2015 Jul 08 12:53 PM
Marc,
what I had to add in addition to the code recommendation of SAP:
MODULE receive_data OUTPUT.
IF o_badi_fdcb_subbas05 IS INITIAL.
CALL METHOD cl_exithandler=>get_instance_for_subscreens
CHANGING
instance = o_badi_fdcb_subbas05
EXCEPTIONS
no_reference = 1
no_interface_reference = 2
no_exit_interface = 3
data_incons_in_exit_managem = 4
class_not_implement_interface = 5
OTHERS = 6.
CALL METHOD o_badi_fdcb_subbas05->put_data_to_screen_object
EXPORTING
im_invfo = invfo.
ENDIF.
CHECK NOT o_badi_fdcb_subbas05 IS INITIAL.
* get data from main screen
CALL METHOD o_badi_fdcb_subbas05->get_data_from_screen_object
IMPORTING
ex_invfo = invfo.
ENDMODULE. " RECEIVE_DATA OUTPUT
After that I got INVFO and the screen populated.
2015 Feb 09 12:01 PM