Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Badi FI_HEADER_SUB_1300 Only for Brazil?

leonardo_pavia
Participant
0 Kudos

Hi friends, I Need to add some extra fields to fi document header and show them on screen (i.e. fb01). I found screen enhancement on Badi FI_HEADER_SUB_1300. I activate the implementation example FI_HEADER_SUB_1300IM, after some debug I found this validation previous to badi execution:

(Program: MF05AF00_D0100_PRE_APPL_SUB_2)

FORM d0100_pre_appl_sub_pbo .

  • temp solution II: process BADI only in case of country = BR

if not bkpf-bukrs is initial.

CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'

EXPORTING

bukrs = bkpf-bukrs

component = 'BR'

EXCEPTIONS

component_not_active = 1

OTHERS = 2.

endif.

check sy-subrc = 0

and bkpf-bukrs <> space.

IF NOT cl_appl_sub IS BOUND.

  • Das BAdI-Interface initialisieren.

.....................

I did change the sy-subrc value to 0 in debug mode (I'm not in Brazil), and it works perfectly showing extra field (BSEG-PRCTR).

This Badi only works for country = 'BR'?.

Another solution similar to this? for people like my outside brazil?

Thanks a lot!!!

Leonardo P.

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello Leonardo

On a SAP system of release<b> 6.20</b> (<b>SAP_APPL</b> = 4.70, support package <b>0021</b> SAPKH47021 => package FBAS belongs to SAP_APPL) the routine looks like this:

*&---------------------------------------------------------------------*
*&      Form  d0100_pre_appl_sub_pbo
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM d0100_pre_appl_sub_pbo .
  IF NOT cl_appl_sub IS BOUND.
* Das BAdI-Interface initialisieren.
    CALL METHOD cl_exithandler=>get_instance
      EXPORTING
        exit_name                     = exit_name_sub_1300
        null_instance_accepted        = char_x
      IMPORTING
        act_imp_existing              = g_appl_sub_active
      CHANGING
        instance                      = cl_appl_sub
      EXCEPTIONS
        no_reference                  = 1
        no_interface_reference        = 2
        no_exit_interface             = 3
        class_not_implement_interface = 4
        single_exit_multiply_active   = 5
        cast_error                    = 6
        exit_not_existing             = 7
        data_incons_in_exit_managem   = 8
        OTHERS                        = 9.
    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.
  IF g_appl_sub_active = char_x.
    CALL METHOD cl_appl_sub->put_data_to_screen_pbo
      EXPORTING
        im_bkpf       = bkpf
        im_x_no_input = g_appl_sub_disable.
  ENDIF.
ENDFORM.                    " d0100_pre_appl_sub_pbo

Regards

Uwe

leonardo_pavia
Participant
0 Kudos

Uwe, My system is 6.4 SAP_APPL 500 SP SAPKH50012.

I don't understand this kind of "hard coded" validations.....

Thank you very much...

0 Kudos

Hello Leonardo

On our ECC 5.0 (SAP release 6.40, SAP_APPL 500, SP SAPKH50004) the routine looks like yours:

*&---------------------------------------------------------------------*
*&      Form  d0100_pre_appl_sub_pbo
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  CALL BADI for Branch Calendar functionallity (BR)
*----------------------------------------------------------------------*
FORM d0100_pre_appl_sub_pbo .
* temp solution II:  process BADI only in case of country = BR
  if not bkpf-bukrs is initial.
    CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'
      EXPORTING
        bukrs                = bkpf-bukrs
        component            = 'BR'
      EXCEPTIONS
        component_not_active = 1
        OTHERS               = 2.
  endif.
  check sy-subrc = 0
  and bkpf-bukrs <> space.
  IF NOT cl_appl_sub IS BOUND.
* Das BAdI-Interface initialisieren.
    CALL METHOD cl_exithandler=>get_instance
      EXPORTING
        exit_name                     = exit_name_sub_1300
        null_instance_accepted        = char_x
      IMPORTING
        act_imp_existing              = g_appl_sub_active
      CHANGING
        instance                      = cl_appl_sub
      EXCEPTIONS
        no_reference                  = 1
        no_interface_reference        = 2
        no_exit_interface             = 3
        class_not_implement_interface = 4
        single_exit_multiply_active   = 5
        cast_error                    = 6
        exit_not_existing             = 7
        data_incons_in_exit_managem   = 8
        OTHERS                        = 9.
    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.
  IF g_appl_sub_active = char_x.
    CALL METHOD cl_appl_sub->put_data_to_screen_pbo
      EXPORTING
        im_bkpf       = bkpf
        im_x_no_input = g_appl_sub_disable.
  ENDIF.
ENDFORM.                    " d0100_pre_appl_sub_pbo

Here is an explanation of the abbreviation and number:

- 6.40: SAP release of the basis (SAP_BASIS) and ABAP system (SAP_ABA), basically the "core" of any SAP system

- SAP_APPL: software component for "Logistics and Accounting"

Improvements and corrections smaller than an entire release are delivered as support packages. In your SAP system SP 0012 is the most current package.

On our most up-to-date system (ECC 6.0, SAP_APPL 600, SP SAPKH60006) the routine has changed again:

*&---------------------------------------------------------------------*
*&      Form  d0100_pre_appl_sub_pbo
*&---------------------------------------------------------------------*
*  ERP05 filter value INTCA is used to improve performance eg. call
*  only necessary for FS in country BR/CA
*----------------------------------------------------------------------*
FORM d0100_pre_appl_sub_pbo .
  check not bkpf-bukrs is initial.
* check valid set/get parameter for 'BUK'
  call function 'FI_COMPANY_CODE_DATA'                      "n934967
    EXPORTING                                               "n934967
      i_bukrs       = bkpf-bukrs                            "n934967
    IMPORTING                                               "n934967
      e_t001        = t001                                  "n934967
    EXCEPTIONS                                              "n934967
      error_message = 01.                                   "n934967
  check sy-subrc = 0.                                       "n934967

  IF NOT cl_appl_sub IS BOUND.
* Das BAdI-Interface initialisieren.
    CALL METHOD cl_exithandler=>get_instance
      EXPORTING
        exit_name                     = exit_name_sub_1300
        null_instance_accepted        = char_x
      IMPORTING
        act_imp_existing              = g_appl_sub_active
      CHANGING
        instance                      = cl_appl_sub
      EXCEPTIONS
        no_reference                  = 1
        no_interface_reference        = 2
        no_exit_interface             = 3
        class_not_implement_interface = 4
        single_exit_multiply_active   = 5
        cast_error                    = 6
        exit_not_existing             = 7
        data_incons_in_exit_managem   = 8
        OTHERS                        = 9.
    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.
  IF g_appl_sub_active = char_x.
*   read comp. code information to provide filter value
    perform buchungskreis_lesen(SAPFF001) using bkpf-bukrs. "ERP05
    CALL METHOD cl_appl_sub->put_data_to_screen_pbo
      EXPORTING
        im_bkpf       = bkpf
        im_x_no_input = g_appl_sub_disable
        flt_val       = t005-intca.                         "ERP05
  ENDIF.
ENDFORM.                    " d0100_pre_appl_sub_pbo

Conclusion: if you are lucky the changed coding will be delivered with one of the following support packages (SAPKH50013 or higher). You could search the SAP service market place for notes regarding this routine and BAdI:

<a href="http://service.sap.com/notes">SAP Notes</a>

Regards

Uwe

Former Member
0 Kudos

Hi leonardo ,

this is Nilima From India . I want some certification help. Can u send me TAW12 & TAW10 on my email ID .neelima.nimkar@gmail.com

I will be very thankfull if you will send me material.

Regards ,

Nilima