CALL TRANSACTION MIGO
One useful tip for ABAP/MM consultants, when you make a "call transaction" statement that can be tricky when you do it for MIGO, because you as you may know for MIGO we have several modes:
A01 is for good receipts -> BES ID parameter
A04 is for displaying material documents->MBN ID parameter
So if you want to make that hotspot for the MIGO transaction in display mode in one of your reports, you can use the standard "MIGO DIALOG" MF with the following import parameters values:
I_ACTION = 'A04'
I_REFDOC = 'R02'
Here is an example of my code for this purpose, and in this case
I will always select the year of my document on the MSEG table because I don't
want to have trouble if I'm accessing consecutive document from different years
(MJA is the parameter for the year value):
ELSEIF rs_selfield-sel_tab_field = 'XXXX'
AND NOT rs_selfield-value IS INITIAL.
" - INICIO DAVID ROLA
"QUANDO EXECUTAMOS O PROGRAMA EM SEQUENCIA COM EXERCICIOS DIFERENTES PODE FICAR COM LIXO EM MEMÓRIA E O HOSTPOT NAO FUNCIONA A 100% POR ISSO VOU LER SEMPRE O EXERCICIO
DATA : YEAR LIKE MSEG-MJAHR.
DATA : doc LIKE MSEG-MBLNR.
SELECT SINGLE MJAHR FROM MSEG INTO YEAR WHERE MBLNR EQ rs_selfield-value.
IF SY-SUBRC EQ '0'.
SET PARAMETER ID 'MBN' FIELD rs_selfield-value.
SET PARAMETER ID 'MJA' FIELD YEAR.
MOVE rs_selfield-value TO doc.
CALL FUNCTION 'MIGO_DIALOG'
EXPORTING
I_ACTION = 'A04'
I_REFDOC = 'R02'
I_NOTREE = 'X'
"I_NO_AUTH_CHECK = ' '
I_DEADEND = 'X'
I_SKIP_FIRST_SCREEN = 'X'
I_OKCODE = 'OK_GO'
I_MBLNR = doc
I_MJAHR = YEAR.
"I_ZEILE = I_FINAL-ZEILE.
"CALL TRANSACTION 'MIGO'.
ENDIF.
" FIM DAVID ROLA

Comentários
Enviar um comentário