0% found this document useful (0 votes)
37 views

UUID For Vendor Invoices

UUID for Vendor Invoices

Uploaded by

cathya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

UUID For Vendor Invoices

UUID for Vendor Invoices

Uploaded by

cathya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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

Follow the
below mentioned steps for achieving this requirement.

IMPORTANT: You need to create a Function Group in customer namespace (for ex: ZTEST_MX
as used in the following screenshots). The screen (20 in this case) has to be created under this
function group.

STEP 1: In case the UUID is to be added to Invoice header, please add the YUUD field as
customer field in append structures of INVFO, RBKP, RBKP_V, ACMM_VENDOR_COMP.

NOTE: UUID must be of data type Char and length 36.

STEP 2: Create a Z implementation for the BAdI ‘BADI_FDCB_SUBBAS05’.

STEP 3: 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 ‘GET_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 YUUD field of INVFO structure added in Step 1. Provide the master
program associated with the function group created earlier. The same has been highlighted in
RED below.

STEP 5: Declare the following variables in the top include of the program assigned to screen
20(in this case: SAPLZTEST_MX).

STEP 6: 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 =1
no_interface_reference =2
no_exit_interface =3
data_incons_in_exit_managem = 4
class_not_implement_interface = 5
OTHERS = 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-active = 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

You might also like