Ricardo Ishida
Dicas ABAP / ABAP tips
Translate this blog
quarta-feira, 20 de março de 2024
Obter dias, meses e anos entre duas datas / Get days, months and years between two dates
Português
|
English
Português
Para obter a quantidade de dias, meses ou anos entre duas datas existe uma função Standard que pode resolver esta demanda: FIMA_DAYS_AND_MONTHS_AND_YEARS.
English
To get the number of days, months or years between two dates there is a Standard function that can solve this demand: FIMA_DAYS_AND_MONTHS_AND_YEARS.
segunda-feira, 8 de junho de 2020
CParser:Error in Parser-Thread
Português
|
English
Português
Se um pop up aparecer com esta frase "CParser:Error in Parser-Thread", a solução é simples: atualizar o SAP GUI ou o Patch, conforme a SAP Note
2723342
.
English
If a pop up show up with the sentence "CParser:Error in Parser-Thread", there is a simple solution: update you SAP GUI or it's Patch level, as said in SAP Note
2723342
.
segunda-feira, 17 de fevereiro de 2020
Tornar uma classe local em global - Class Builder / Turn a local class to global - Class Builder
Português
|
English
Português
As vezes desenvolvemos classes locais para agilizar o processo de desenvolvimento ou mesmo achamos que a classe em questão não será tão util para futuras reutilizações. Caso exista a necessidade de tornar uma classe local em classe global, podemos importa-la para o Class Builder, via SE24.
Para tal, acessar a transação SE24, clicar em Tipo de objeto > Importar > Classe locais do programa.
Selecione o programa que contenha a classe e informe um nome desejado. No caso, utilizei a mesma nomenclatura da utilizada na classe local do programa.
Após esse procedimento, selecione um pacote e uma Request para transporte. Lembre-se de ativar o objeto após importá-lo.
English
Some times we develop local classes in a program to speed up the development or we even think that class in question won't be reused in future programs. In case the necessity to turn a local class in a global one, we can import it to the Class Builder, through SE24.
To do this, access SE24transaction, click on Object type > Import > Local classes in program.
Select the program that contains the desired class and name it. In this example I used the same object name for local and global class.
After that, pick up a package and select a Workbench Request. Keep in mind to activate it after importing.
quarta-feira, 20 de junho de 2018
Inconsistência nos dados da BAPI_GOODSMVT_CREATE / BAPI_GOODSMVT_CREATE inconsistency
Português
|
English
Português
Com a atualização para o EHP8 em um cliente, alguns desenvolvimentos Zs começaram a apresentar problemas. Um deles foi para o módulo de MM onde era necessário executar a função BAPI_GOODSMVT_CREATE mais de uma vez. Mesmo com a chamada da BAPI_TRANSACTION_COMMIT entre as chamadas, obtia o erro M7 021 na segunda chamada da BAPI_GOODSMVT_CREATE. Após Debugar por um bom tempo, descobri que não existia um ajuste Z que estava fazendo o comportamento da função dar erro. Fui então atrás de uma SAP Note...
Em resumo, após a chamada da BAPI_GOODSMVT_CREATE é recomendado executar a função CO_ZF_DATA_RESET_COMPLETE que reseta os dados e permite uma nova chamada da BAPI_GOODSMVT_CREATE sem apresentar divergências no resultado final. Segue a SAP Note
2122706
!
English
After upgrading to EHP8 SP on a client, some Z's developments stoped working properly. One of them was from MM module where it was needed to execute the BAPI_GOODSMVT_CREATE function more than once. Even with the BAPI_TRANSACTION_COMMIT function call between them, it raised error M7 021 on the second call from BAPI_GOODSMVT_CREATE. After Debuging for a while, I discovered that there was no Z adjustment whose raised that error. So I tried my luck looking for a SAP Note ...
In summary, after calling BAPI_GOODSMVT_CREATE it is recommended to execute the CO_ZF_DATA_RESET_COMPLETE function that resets the datas and allows a new call from BAPI_GOODSMVT_CREATE without presenting differences in the final result. Here is the SAP Note
2122706
!
quarta-feira, 16 de maio de 2018
Localizar transação da View da tabela transparente / Find a Transparent Table View Transaction
Português
|
English
Português
Para localizar uma transação vinculada a uma tabela transparente (View de manutenção) acesse a tabela TSTCP via SE16 ou SE16N e coloque a instrução no campo PARAM *SM30*(nome da tabela)*. Exemplo - quero localizar a tabela ZMMTXXX e saber se ela possui uma transação para manutenção. Preencho o campo PARAM da seguinte forma na SE16N:
Contribuição de Wagner "Cabelo" da Rocha.
English
To search for a transaction bound to a transparent table (Maintenance View), access the TSTCP table via SE16 or SE16N and fill the statement in the field PARAM with *SM30*(table name)*. Example - I want to find the ZMMTXXX table and if it has a transaction for maintenance. I'll fill in the PARAM field as follows in SE16N:
Contribution of Wagner "Cabelo" da Rocha.
sexta-feira, 11 de agosto de 2017
Call Transaction abre com tema diferente para SAP GUI 7.5 / Call Transaction displayed with different theme with SAP GUI 7.5
Português
|
English
Português
Após fazer o Upgrade para o SAP GUI 7.5, alguns desenvolvimentos apresentaram diferença na visualização de suas telas. No código, ao dar um comando como CALL TRANSACTION ou LEAVE TO TRANSACTION a janela modificava para um tema diferente do que eu estava utilizando.
Tema que estava sendo utilizado (Corbu Theme), que a tela deveria apresentar:
Tema após o comando Call Transaction do programa Z:
Com o Upgrade da versão do SAP GUI, uma opção nas configurações foi modificada e, por isso, obtive este comportamento em alguns dos programas. Para solucionar, basta entrar nas opções do SAP GUI (pode ser no SAP Logon ou mesmo na janela aberta de algum ambiente), clicar na pasta Design Visual > Visualização/configs. tema e desflegar o campo "Aceitar tema visual SAP Fiori" e aceitar as modificações. Lembrando que é necessário reiniciar o SAP GUI para que as modificações sejam efetuadas.
Desmarcando a opção "Aceitar tema visual SAP Fiori" solucionará o problema:
English
After Upgrading to SAP GUI 7.5, some developments showed differences while displaying its screens. On the code, when the program used the CALL TRANSACTION or LEAVE TO TRANSACTION command the screen was displayied with a different theme, as the one it was cofigured to.
Theme that was cofigured (Corbu Theme), which should be displayed:
Theme after the Call Transaction command from the Z program:
When upgrading the SAP GUI version, an option in the settings has been modified so we get this behavior in some of the programs. To solve it, simply enter the SAP GUI options (it can be in SAP Logon or even in the open window of any environment), click in the Visual Design folder & gt; & Nbsp; Preview / Settings Theme and unroll the field "Accept SAP Fiori visual theme" and accept the modifications. Remember that you need to restart the SAP GUI for the changes to take effect.
Unchecking the "Accept SAP Fiori visual theme" will solve the problem:
terça-feira, 16 de maio de 2017
Limpar o buffer do ambiente / Refresh client's buffer
Português
|
English
Português
Se algum dia você fizer alguma modificação em uma estrutura, tabela, etc. e ela não aparecer no seu relatório em ALV ou der algum Dump, pode ser que você precise limpar o Buffer do ambiente. Para isso, digite na barra de navegação do SAP GUI
/$sync
e aperte
Enter
. Uma mensagem de confirmação será exibida.
English
If one day you change an structure, table, etc. and it doesn't update on your ALV report or turns into a Dump, it can mean you'll need to refresh the client buffer. To make it happen, type in the SAP GUI's address bar
/$sync
and
Enter
. A confirmation message will be displayed.
segunda-feira, 4 de abril de 2016
Procurar objetos no SAP / Search objects on SAP
Português
|
English
Português
As vezes precisamos achar um objeto, função, constante, palavra, etc. em algum desenvolvimento que criamos ou utilizamos, mas não temos ideia de onde ele está. Para este problema, uma das soluções existentes no SAP é a transação CODE_SCANNER! Passando alguns parâmetros você poderá localizar qualquer coisa, como implementações de Enhancements rapidamente!
English
Sometimes we need to find an object, function, constant, word, etc. in some development we created or used, but we have no idea where it is. For this problem one of the solutions available on SAP is CODE_SCANNER transaction! Filling out a few parameters you will find anything like in an Enhancement implementation quickly!
terça-feira, 8 de março de 2016
CSapEditorCtrl::GetObject: Object ## does not exist
Português
|
English
Português
Após atualizar o SAP GUI para a versão 7.4, tive que dar manutenção em um Smart Form e, ao clicar em 'Editar' recebia a seguinte mensagem: CSapEditorCtrl::GetObject: Object 15 does not exist. Tratei logo de pesquisar sobre e encontrei uma solução. Em resumo, basta ler e aplicar esta SAP Note
2221815
!
Se você não conseguir achar o arquivo para instalar o path, clique
aqui
para fazer o download!
English
After updating my SAP GUI to 7.4 version, I had to adjust a Smart Form and, after clicking on 'Edit' the following message poped up: CSapEditorCtrl::GetObject: Object 15 does not exist. Right the way I Googled it and I got the solution. In summary you'll need to read and aply this SAP Note
2221815
!
If you couldn't find the file to install the path, click
here
to download it!
terça-feira, 29 de setembro de 2015
Chamar a ajuda para pesquisa via código / Calling the Search Help via code
Português
|
English
Português
A funcionalidade da ajuda para pesquisa é sempre bem vinda, tendo em vista a integridade dos dados de um sistema. Houve uma necessidade para um desenvolvimento de chamar a ajuda para pesquisa de um campo Standard que já possuia esta funcionalidade. O problema é que a criação do campo é dinâmica, o que não permite a forma natural da chamada desta função.
No exemplo abaixo, utilizando a ajuda para pesquisa C_T001 do campo Empresa (BUKRS), implementei uma solução da seguinte forma:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DATA
:
lt_retval
TYPE
hrreturn_tab
,
ls_shlp
TYPE
shlp_descr
.
FIELD-SYMBOLS
:
<
fs_interf
>
TYPE
ddshiface
.
CALL FUNCTION
'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname
=
'C_T001'
IMPORTING
shlp
=
ls_shlp
.
READ TABLE
ls_shlp-interface
ASSIGNING
<
fs_interf
>
INDEX
1
.
IF
sy-subrc
=
0
.
<
fs_interf
>
-valfield
=
abap_true
.
CALL FUNCTION
'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp
=
ls_shlp
TABLES
return_values
=
lt_retval
.
ENDIF
.
Tela da ajuda para pesquisa:
O retorno da escolha da ajuda de pesquisa estará no campo da tabela LT_RETVAL-FIELDVAL:
English
The search help resource is pretty useful, once we have to ensure the sistem data integrity. Once in a program development I had to call an already existent search help from a Standard field. The problem was the field should be dynamically created, so I couldn't call it in an usual Standard way.
In the sample code below, using the search help C_T001 from the Company code (BUKRS), I developed a solution like this:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DATA
:
lt_retval
TYPE
hrreturn_tab
,
ls_shlp
TYPE
shlp_descr
.
FIELD-SYMBOLS
:
<
fs_interf
>
TYPE
ddshiface
.
CALL FUNCTION
'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname
=
'C_T001'
IMPORTING
shlp
=
ls_shlp
.
READ TABLE
ls_shlp-interface
ASSIGNING
<
fs_interf
>
INDEX
1
.
IF
sy-subrc
=
0
.
<
fs_interf
>
-valfield
=
abap_true
.
CALL FUNCTION
'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp
=
ls_shlp
abaixo
TABLES
return_values
=
lt_retval
.
ENDIF
.
The search help displayed:
The chosen field valeu is returned in the field from the table LT_RETVAL-FIELDVAL:
sexta-feira, 25 de setembro de 2015
Transportar dados de tabelas transparentes não Customizing / Transport data from non Customizing transparent tables
Português
|
English
Português
Em alguns casos temos a necessidade de transportar dados de uma tabela de classe de entrega que não seja do tipo Customizing. Para estes casos podemos proceder da seguinte forma:
Via transação SE09, com duplo clique, acesse a request filho desejada:
Clique no botão Modificar:
Abaixo, nas linhas que existe a possibilidade de inserir conteúdo, digite conforme o nome da coluna:
ID-Programa - R3TR
Tipo de objeto - TABU
Nome do objeto - Nome da tabela transparente
Clique no botão Objeto com chaves da linha inserida:
Adicione os registros chaves que deseja transportar ou preencha os campos chaves com asteriscos (*) para trazer todos os dados da tabela em questão (lembrando de informar o mandante que contém as informações que deseja transportar):
Desta forma, quando você transportar a request, todos registros que as chaves foram informadas e estiverem no respectivo client serão transportados também.
English
Once in a while we need to transport some data from a transparent table in which the delivery class is not set as Customizing. In this case we can proceed following this steps:
Via SE09 transaction, access the desired child request double clicking it:
Click on Change button:
Bellow the table lines, right where you can input data, type this items in its respective columns:
Program ID - R3TR
Object Type - TABU
Object Name - Transparent table name
Click on the Object with keys button on the inserted row:
Add the key datas you want to transport or fill the key fields with asterisks (*) to get and transport all data from that table (don't forget to set the mandant that contains the data you want to transport):
Therefore, when you transport the request, all records that the keys have been informed and are in the respective client will be transported as well.
terça-feira, 14 de outubro de 2014
Criar variantes para VA05 / Create variants for VA05
Português
|
English
Português
Por causa de uma solicitação de um cliente, encontrei uma dica que achei bacana e que pode ajudar funcionais e a desenvolvedores também. A ideia inicial era gerar um relatório vinculado a transação VA03 mostrando o valor líquido real, considerendo caso algum item tenha sido recusado. Como já existe a opção de Ordens no programa, precisaríamos criar uma variante pare este report, que é simplesmente a transação VA05.
Mas como fazer isso se a transação não te possibilita? Foi ai que pesquisei e encontrei uma solução. Na barra superior entre na opção Sistema > Especificações do usuário > Dados próprios e depois clique na aba Parâmetros. Adicione o ID
SD_VARIANT_MAINTAIN
com o valor
U
e salve.
Pronto! Agora é possível criar variantes para a VA05 poupando tempo e esforço!
Ref.:
http://sap.ittoolbox.com/groups/technical-functional/sap-log-sd/how-to-createchange-visualization-variant-in-va05-857151
English
Cause of a client's request, I found a nice tip that might help funcionals and developers as well. The main idea was to develop a report and link it to the VA03 transaction displaying the actual net, considering if any item has being refused. As there is an Order option in the program, we would need to create a variant for this report that is simply the VA05 transaction.
But how to make it if the transaction doesn't allow it? That's why I found this solution. In the top menu, click on System > User Profile > Own Data and then click on Parameters tab. Add the ID
SD_VARIANT_MAINTAIN
with the value
U
and save it.
That's it! Nowe it's possible to create variants for VA05 saving time and effort!
Ref.:
http://sap.ittoolbox.com/groups/technical-functional/sap-log-sd/how-to-createchange-visualization-variant-in-va05-857151
segunda-feira, 30 de dezembro de 2013
Tabela transparente com campo maior que 16 posições / Transparent table with field greater than 16 bytes length
Português
|
English
Português
Estava implementando notas em um cliente e tive um problema com relação a um campo em uma tabela transparente. No caso seu nome nos passos manuais tinha 17 posições e eu só conseguia colocar 16. O cliente está com o EHP5 e existe essa limitação quando você cria uma tabela nas versões mais antigas do SAP.
Procurei uma solução e achei a seguinte nota:
1680583 Field names for tables and views with more than 16 char.
Ref.:
http://scn.sap.com/community/abap/blog/2013/11/02/data-dictionary-supports-field-s-name-up-to-30-bytes-length
English
When I was implementing notes into a client I had a problem about a field in a transparent table. In that case, its name in the manual steps was 17 bytes lenght and I could type only 16. The client was in EHP5 release and there is this limitation when you create a table in previews versions of SAP.
I searched for a solution and I found this SAP note:
1680583 Field names for tables and views with more than 16 char.
Ref.:
http://scn.sap.com/community/abap/blog/2013/11/02/data-dictionary-supports-field-s-name-up-to-30-bytes-length
quinta-feira, 31 de outubro de 2013
Forçar chamada do PAI (Process After Input)/ Force PAI call
Português
|
English
Português
Para forçar um programa do tipo Pool de Módulos, como exemplo, a acessar do PBO (process before output) o processo PAI (process after input) programaticamente, sem ter atuação do usuário, pode-se usar esta função:
01
02
03
04
05
06
07
CALL FUNCTION
'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode
=
'='
EXCEPTIONS
function_not_supported
=
1
OTHERS
=
2
.
English
Forcing a Module Pool program, as an example, to access from PBO (process before output) to the PAI (process after input) programatically, with no user interaction, we can use this function:
01
02
03
04
05
06
07
CALL FUNCTION
'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode
=
'='
EXCEPTIONS
function_not_supported
=
1
OTHERS
=
2
.
segunda-feira, 9 de setembro de 2013
Pegar valores dos domínios / Get domain values
Português
|
English
Português
Preencher um campo de um relatório com dados de uma tabela transparênte pode ser fácil, levando em consideração que você saiba fazer um SELECT. O que complicava, no meu caso, era quando existia a necessidade de pegar os valores de um domínio. A solução que achava na epoca era colocar os valores fixos, hardcode mesmo!
Mas sempre há uma maneira de tornar a solução mais inteligente! No caso, podemos usar tanto alguns SELECTs quanto uma função Standard. As tabelas que contém informação dos domínios são DD07L (valores fixos) e DD07T (textos descritivos) e a função é a GET_DOMAIN_VALUES:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
DATA
:
t_dd07v
TYPE TABLE OF
dd07v
,
s_dd07v
TYPE
dd07v
.
CALL FUNCTION
'GET_DOMAIN_VALUES'
EXPORTING
domname
=
'J_1BMATORG'
* TEXT = 'X'
* FILL_DD07L_TAB = ' '
TABLES
values_tab
=
t_dd07v
* VALUES_DD07L =
EXCEPTIONS
no_values_found
=
1
OTHERS
=
2
.
LOOP AT
t_dd07v
INTO
s_dd07v
.
WRITE
:
s_dd07v-ddlanguage
.
"Código do idioma
WRITE
:
s_dd07v-valpos
.
"Valores fixos
WRITE
:
s_dd07v-ddtext
,
/
.
"Texto com a descrição
ENDLOOP
.
English
Fill out a report field with transparent tables can be simple, considering you know how to build a SELECT. One problem I faced many times was when I had to use values from a domain. The easy solution I first found was to use fixed values, hardcode indeed!
There's always an easy way to make things more inteligent! In this case, we can use both ways: SELECT or Standard Function. The tables that have the informations about the domains are DD07L (fixed values) and DD07T (descriptive texts) and the function is GET_DOMAIN_VALUES:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
DATA
:
t_dd07v
TYPE TABLE OF
dd07v
,
s_dd07v
TYPE
dd07v
.
CALL FUNCTION
'GET_DOMAIN_VALUES'
EXPORTING
domname
=
'J_1BMATORG'
* TEXT = 'X'
* FILL_DD07L_TAB = ' '
TABLES
values_tab
=
t_dd07v
* VALUES_DD07L =
EXCEPTIONS
no_values_found
=
1
OTHERS
=
2
.
LOOP AT
t_dd07v
INTO
s_dd07v
.
WRITE
:
s_dd07v-ddlanguage
.
"Language code
WRITE
:
s_dd07v-valpos
.
"Fixed Values
WRITE
:
s_dd07v-ddtext
,
/
.
"Descriptive texts
ENDLOOP
.
quinta-feira, 15 de agosto de 2013
Backup dos clientes do SAP Logon / Backup from SAP Logon's clients
Português
|
English
Português
Após alguns anos ou mesmo meses trabalhando como consultor, é normal acumular um bom número de clientes acessados, com seus servidores de aplicações, SAProuters, etc. O problema é quando trocamos de computador ou mesmo quando temos que formatá-lo... Como recuperar os clientes adicionados? Copiar um a um da muito trabalho...
Mas, como quase todo programa normal, existe uma forma de fazer backup!
Quando instalamos o SAP Gui, um ficheiro é adicionado nos "Meus Documentos" do usuário logado no sistema operacional. O ficheiro localiza-se na pasta oculta AppData do usuário, seguindo esta sequencia de subpastas: Roaming > SAP > Common. Os três arquivos correspondem as configurações salvas dos clientes do SAP Logon!
Contribuição de Angélica Wolfart.
English
After a few years or even months working as a consultant, it's normal to build up a good number of accessed customers with their application servers, SAProuters, etc.. The problem is when we change our computer or even when we have to format it ... How to recover the customers we added? Copy one by one is pretty annoying...
But, like almost every average program, there is a way to back up!
When we install the SAP Gui, a file is added in the "My Documents" of the logged user into the operating system. The file is located in the hidden AppData folder of the user, following this sequence of subfolders: Roaming > SAP > Common. The three files matching your saved settings for the SAP Logon clients!
Contribution of Angélica Wolfart.
Postagens mais recentes
Postagens mais antigas
Página inicial
Assinar:
Postagens (Atom)