2009 Mar 13 6:18 AM
Hello Friends,
I have used mb_migo_badi to add custom fields at item level and its working fine for creation and calncelation process but after doing migo when i check the created mat doc in display mode my custom fields are showing null values and its showing correct values in cancellation mode.
By analysing the code i came to knw in display mode its not triggering line_modify method.
pls suggest what can be the reason.
Regards,
Sunny
2009 Mar 13 7:19 AM
Hi Sunny,
There is another method PUBLISH_MATERIAL_ITEM
This is to check and display the data that has been modified by LINE_MODIFY method previously.
If this method is getting called I guess it would display the details. You may need to implement this method also. Please check.
Line_modify is for Add/Change line item( see the documentation for this )
Regds,
Gaurav
Edited by: Gaurav P Fadnis on Mar 13, 2009 8:19 AM
2009 Mar 13 7:40 AM
Hi,
Add new Tab to MIGO...Create a BADI implementation for MB_MIGO_BADI ..
Create a program with the screen type sub-screen in SE80 and design the layout for the custom fields.
Declare the custom fields in a Z**TOP include.
Under the PBO method declare the program name and screen number ....
Under PAI method declare the field to u2018Xu2019.
Under the line modify method declare a flag and set to u2018Xu2019 checking for material document number by which we can set the fields to be in display mode when we open MIGO for display of material document created after doing goods receipt
Under the POST_DOCUMENT method write the code for appending the value to Z table along with the values of the line item (In this case production order number, material, u2026u2026.). For these values to be available here in this method use the memory concept u201CExport to memory idu201D in the method LINE_MODIFY.
In order to do any validations to the custom fields, go to transaction SE80 and mention the program Name created and in PROCESS ON VALUE_REQUEST create a module and provide the validations required for those custom Fields.
In order to make the fields to be in display mode during the display of material document, create a module under PBO and import the flag value and the production order number details in the method LINE_MODIFY and if that flag = u2018Xu2019, use
loop at screen.
if screen name = ' '.
screen-input = '0'.
modify screen.
endif.
endloop.
Edited by: Shailaja Ainala on Mar 13, 2009 8:41 AM
2009 Mar 19 12:59 PM
2009 Apr 22 7:28 AM
Can you please tell me, how did you get solution. Even I am facing the same problem. I can post data from migo customised tab into Z table while saving MIGO.But while displaying I am not able to display data in customised tab(subscreen). To fetch data from my z table I am not getting material doc.no. which is key field in my z table.
2009 Apr 22 7:30 AM
Can you please tell me, how did you get solution. Even I am facing the same problem. I can post data from migo customised tab into Z table while saving MIGO.But while displaying I am not able to display data in customised tab(subscreen). To fetch data from my z table I am not getting material doc.no. which is key field in my z table.
2009 Apr 22 8:28 AM
just check this method in ur badi
METHOD IF_EX_MB_MIGO_BADI~STATUS_AND_HEADER .
In case of 'Display Material document' select external header data
IF NOT g_no_input IS INITIAL.
SELECT SINGLE * FROM migo_badi_examp2 INTO gs_exdata_header
WHERE mblnr = is_gohead-mblnr
AND mjahr = is_gohead-mjahr.
ENDIF.
ENDMETHOD.
u might have commented this lines of code...
2009 Oct 01 6:07 AM
Hi Sunny
I too have same problem i am creating and tab and a input field in migo_tr transaction in my case the data is getting saved in MSEG table but when i display the material document the zfield whcihc ihave created is not getting displayed. please help me.
Thanks
2010 Oct 11 10:52 PM
Try this in PBO_DETAIL Method:
METHOD if_ex_mb_migo_badi~pbo_detail.
DATA: ls_extdata TYPE zstr_23_badi_val_fob,
ls_z23_val_fob_migo TYPE z23_val_fob_migo,
ls_goitem TYPE goitem,
v_campo TYPE string.
FIELD-SYMBOLS <fs> TYPE goitem.
This check is obligatory, otherwise the program flow is incorrect
(If there would be more than one implementation of BAdI MB_MIGO_BADI,
only one subscreen would be displayed).
CHECK i_class_id = gf_class_id.
Show screen only if there is an item
CHECK i_line_id <> 0.
External subscreen:
The content of global field G_NO_INPUT (set in method MODE_SET) will
influence the number of external subsreen:
IF g_no_input IS INITIAL.
e_cprog = 'SAPLZMM_VALOR_FOB_MIGO'.
e_dynnr = '0001'. "External fields: Input
e_heading = 'Valor FOB'.
ELSE.
e_cprog = 'SAPLZMM_VALOR_FOB_MIGO'.
e_dynnr = '0002'. "External fields: Display
e_heading = 'Valor FOB'.
----
Se cargan los datos externos para el display *
----
v_campo = '(SAPLMIGO)GOITEM'.
ASSIGN (v_campo) TO <fs>.
ls_goitem = <fs>.
READ TABLE gt_extdata INTO ls_extdata
WITH TABLE KEY line_id = i_line_id.
IF sy-subrc <> 0.
IF NOT ls_goitem-mblnr IS INITIAL AND
NOT ls_goitem-mjahr IS INITIAL AND
NOT ls_goitem-zeile IS INITIAL.
SELECT SINGLE * FROM z23_val_fob_migo INTO ls_z23_val_fob_migo
WHERE mblnr = ls_goitem-mblnr
AND mjahr = ls_goitem-mjahr
AND zeile = ls_goitem-zeile.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_z23_val_fob_migo TO ls_extdata.
ls_extdata-line_id = i_line_id.
INSERT ls_extdata INTO TABLE gt_extdata.
ENDIF.
ENDIF.
ENDIF.
----
ENDIF.
Set G_LINE_ID (= line_id of item displayed on detail-tabstrip)
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_VAL_FOB_BADI_02'
EXPORTING
data_screen_fields = ls_extdata.
ENDMETHOD. "IF_EX_MB_MIGO_BADI~PBO_DETAIL