2017 Dec 21 10:34 AM
Hi experts,
I have a problem with MIGO tx.
I was told to add a new custom field to ítems in tab additional data. My new field ZTALLA is in table MSEG and also in GOITEM. I added to dynpro SAPLZMM_MIGO 9001 as "GO_ITEM-ZTALLA".
There are 2 more custom fields in this tab created before, this fields are non-editable and calculated. This fields are included in structure ZMMMIGO so I added my new field also.
I have an implementation for badi MB_MIGO_BADI.
MEthod PBO_DETAIL:
METHOD if_ex_mb_migo_badi~pbo_detail .
DATA: gf_class_id TYPE migo_class_id,
gt_extdat TYPE ty_t_extdata,
g_no_input TYPE xfeld,
g_line_id TYPE goitem-global_counter.
* Show screen only if there is an itemCHECK i_line_id <> 0.gf_class_id = 'MIGO_BADI_IMPLEMENTATION_CIN'.
e_cprog = 'ZMIGO1_PRG'.
e_cprog = 'SAPLZMM_MIGO'.
e_dynnr = '9001'.
e_heading = 'Datos adicionales'(004).
DATA ls_extdata TYPE zmmmigo.
*Show screen only if there is an itemCHECK i_line_id <> 0.
g_line_id = i_line_id.
* Read data
READ TABLE gt_extdata INTO ls_extdata WITH TABLE KEY line_id = i_line_id.
* Export data to function group (for display on subscreen)
CALL FUNCTION 'Z_MM_MIGO_EXTDATA_OUTPUT'EXPORTING
is_migo_badi_screen_fields = ls_extdata.
ENDMETHOD.
****************************
Method PAI_DETAIL:
method IF_EX_MB_MIGO_BADI~PAI_DETAIL .
* Only if a line exists
CHECK i_line_id <> 0.
E_FORCE_CHANGE = 'X'.
endmethod.
****************************
Method LINE_MODIFY:
METHOD if_ex_mb_migo_badi~line_modify .
DATA: flag(1) TYPE c.
IF NOT cs_goitem-mblnr IS INITIAL.
flag = 'X'.
ENDIF.
DATA: ls_extdata_old TYPE zmmmigo,
ls_extdata_new TYPE zmmmigo,
l_subrc TYPE sy-subrc.
* Get external data from internal table:
READ TABLE gt_extdata INTO ls_extdata_old WITH TABLE KEY line_id = i_line_id.
l_subrc = sy-subrc.
IF l_subrc <> 0.
SELECT SINGLE zz_campo zz_recompra FROM ekpo
INTO (ls_extdata_new-zz_campo,ls_extdata_new-zz_recompra)
WHERE ebeln = cs_goitem-ebelnAND ebelp = cs_goitem-ebelp.
ls_extdata_new-line_id = i_line_id.
INSERT ls_extdata_new INTO TABLE gt_extdata.
ELSE.
CALL FUNCTION 'Z_MM_MIGO_PUT_DETAIL'IMPORTING
is_migo_badi_screen_fields = ls_extdata_new.
MODIFY TABLE gt_extdata FROM ls_extdata_new.
ENDIF.
ENDMETHOD.
****************************
But my new field is not saved to MSEG.
Is there anything I'm missing?
Thanks in advance !!!
María
2017 Dec 21 10:49 AM
Where did you change CS_GOITEM ZZ-fields in the LINE_MODIFY method?
(Also you could/should have managed the internal table to store your additional input data in the PAI_DETAIL method, so forcing change only when data actually changed)
2020 Nov 06 11:05 AM
Did you either
2023 Nov 13 10:12 AM
raymond.giuseppi , thanks a lot, this helped me today. Appending IMSEG3 also made appending other MSEG-structures obsolete, since it's included in most of them.
2017 Dec 21 11:27 AM
Hi Raymond,
I tried to do cs_goitem-zztalla = ls_extdata_new-ztalla
but I get error MIGO050
"BAdI: Field GOITEM-ZTALLA not ready to accept input (Change will not be adopted)"
2020 Nov 04 7:16 PM
2020 Nov 05 6:38 PM