¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Como adicionar parâmetros adicionais de código de empresa no SAP com ABAP Enhancement Framework

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 15 Vistas
0
Cargando...
Company code is the basic organizational unit in SAP from which many of the settings depend. Besides all of the possible standard customizing there will be always a question coming if something can be made default per company – like MIRO document type. If there is no suitable standard customizing you look for alternatives and you find an userexit/ BADI / BTE or any other option available in ABAP enhancement framework.

Time to think about the design now – certainly you would like to avoid hardcoding entries so it should be flexible enough to add an entry pro company.

Here normally the thinking drifts towards a custom table – either existing one for customer-specific parameters or a new one. That is one feasible solution but how about settings which you can make without any new table/ maintenance of custom tables?

Parâmetros adicionais do código da empresa


In company code parameters (transaction OBY6 ) there is a button with ‘additional data’:



Clicking on it brings you to list of parameters that can be maintained with either meaningful values (like local Tax Number in Germany) or just activation of functions (like Detail Tax Entry with MIRO).



What if you could maintain the entries here – that would also make it possible to keep all the defaults or simple company-dependent customizing parameters in one place.

Como adicionar seu próprio parâmetro


Fortunately there is a simple way to do archive that. Start table maintenance transaction SM30 and choose view V_T001I (it is also available in couple of IMG points):



Voila – you can now define new parameter and even make it country dependent.

Let’s say that we want to maintain the parameter for default document type for MIRO and also a second one with Polish Local Tax Number – that one should be only available for companies from Poland.



Save the settings now and that is it – you can now see the parameters in OBY6.

German company in OBY6:



Polish company:



So the entries work as desired and are limited to country where it is needed.

Como usar no código personalizado


Now the specification to developer – how can you can access the parameter in ABAP. All the values maintained are stored in table T001Z:



To access the data (single or multilple entries) best option will be to use FM READ_ADD_COMPANY_CODE_INFO with parameters like below:
DATA: l_s_company_parameter_value TYPE t001z.
  DATA: l_v_company_code TYPE bukrs.
  DATA: l_v_parameter_id TYPE party.

  CALL FUNCTION 'READ_ADD_COMPANY_CODE_INFO'
    EXPORTING
      ic_bukrs  = l_v_company_code "here your company code
      ic_party  = l_v_parameter_id "parameter id same which was customized in V_T001I
    IMPORTING
      es_t001z  = l_s_company_parameter_value "parameter value is returned in field PAVAL
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.
  IF sy-subrc NE 0.

  ENDIF.
    
            
Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

Sin respuestas

No hay respuestas para mostrar No hay respuestas para mostrar Se el primero en responder

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?