Sie sind auf Seite 1von 5

The requirement is to have UUID field in Logistics invoice verification screen (for ex: MIRO).

Follow the below mentioned steps for achieving this requirement.


STEP 1: In case the UUID is to be added to Invoice header, please add the YUUD field as
customer fields in append structures of INVFO, RBKP, RBKP_V, ACMM_VENDOR_COMP.
STEP 2: Create a Z implementation for the BAdI BADI_FDCB_SUBBAS05.

STEP3: Write the following code within the method PUT_DATA_TO_SCREEN_OBJECT


method IF_EX_BADI_FDCB_SUBBAS05~PUT_DATA_TO_SCREEN_OBJECT .
* fill interface attributes from importing paramters
me->if_ex_badi_fdcb_subbas05~invfo = im_invfo.
endmethod.
Write the following code within the method PUT_DATA_TO_SCREEN_OBJECT
method IF_EX_BADI_FDCB_SUBBAS05~GET_DATA_FROM_SCREEN_OBJECT .
* fill export parameters from interface attributes
ex_invfo = me->if_ex_badi_fdcb_subbas05~invfo.
endmethod.
STEP 4: Create a screen (for ex: 20) for the Z implementation. This screen 20 must have the
UUID field by referring to UUID field of INVFO structure added in Step 1.

STEP 5: Code the necessary logic to ensure that the YUUD field appears only for the required
tcodes.
The following logic provided is for reference only. Please add the additional logic as per your
business need.
PROCESS BEFORE OUTPUT.
MODULE receive_data.
MODULE Hide_fields.
PROCESS AFTER INPUT.
MODULE receive_actual_data.
FIELD:
INVFO-YUUD
MODULE USER_COMMAND_0100.

*&---------------------------------------------------------------------*
*& Module receive_data OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
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
no_interface_reference
no_exit_interface
data_incons_in_exit_managem
class_not_implement_interface
OTHERS

=1
=2
=3
=4
=5
= 6.

IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
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.
" RECIEVE_DATA OUTPUT

*&---------------------------------------------------------------------*
*& Module HIDE_FIELDS OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE hide_fields OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'MX'.
IF invfo-bukrs IS NOT INITIAL.
DATA: ls_t001 TYPE t001,
ls_t005 TYPE t005,
lv_nummr TYPE wt_acno,
lv_bcode TYPE bcode.
CALL FUNCTION 'FI_COMPANY_CODE_DATA'
EXPORTING
i_bukrs = invfo-bukrs
IMPORTING
e_t001 = ls_t001.

CALL FUNCTION 'FI_COUNTRY_DATA'


EXPORTING
i_land1 = ls_t001-land1
IMPORTING
e_t005 = ls_t005.
IF ls_t005-intca EQ 'MX'.
CASE sy-tcode.
WHEN 'MIRO'.
screen-input = 1.
WHEN OTHERS.
screen-input = 0.
ENDCASE.
ELSE.
screen-active = 0.
ENDIF.
ELSE.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.

" HIDE_FIELDS OUTPUT

*&---------------------------------------------------------------------*
*& Module receive_actual_data INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE receive_actual_data input.
* object created ?
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.

"

RECIEVE_ACTUAL_DATA INPUT

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 input.
CHECK NOT o_badi_fdcb_subbas05 IS INITIAL.
* put data to main screen
CALL METHOD o_badi_fdcb_subbas05->put_data_to_screen_object
EXPORTING
im_invfo = invfo.
ENDMODULE.
" USER_COMMAND_0100 INPUT

Das könnte Ihnen auch gefallen