08-31-2017 8:49 AM
Hi,
I have add custom tab screen in migo using exit MB_MIGO_BADI,
i want to save Data Timbang subscreen data into ztable when post MIGO, any suggest to do it?
Thanks
08-31-2017 10:42 PM
No idea what "Data Timbang" is but isn't there a method in the BADI that is triggered when the document is posted? If memory serves, this BADI actually had some documentation as well as samples... Not to mention Google -> MIGO save in Z table site:sap.com -> 409 hits.
09-01-2017 4:12 AM
"Data Timbang" is ms access data, yes there is a method "POST Document" in MB_MIGO_BADI, if use textfield i have success save the data to ztable, but when i use table control i can't do it
09-01-2017 6:26 PM
I don't see a table control in the screenshot, it looks like an ALV grid. Either way - have you tried to look at all in Google with the keywords I mentioned? There are also quite a few posts in general on BADI implementation with a subscreen.
09-01-2017 6:55 AM
Did you create the customer subscreen in some customer function group?
If yes create an (update task) FM in this group that save/update the internal table data from your table control to your database table. Trigger this FM in POST_DOCUMENT methid (you could also manage it in HOLD_DATA_SAVE/LOAD/DELETE if required) or call it thru a PERFORM ON COMMIT.
09-01-2017 8:48 AM
i create subscreen in MB_MIGO_BADI,
in my case, when post goods resceipt purchase order in migo i will assign data on subscreen (alv grid) item level (tick checkbox in alv grid), after post processing that will be create material document, i want to save material document, line item id, and the data has been choose on alv subscreen "Data Timbang"
09-01-2017 8:52 AM
09-01-2017 10:08 AM
In your BAdI implementation you didn't 'create' the subscreen, you 'registered' the subscreen and exchange data with its main program/function group. So now ask it to save data in the save/post required methods.
" call subscreen
METHOD if_ex_mb_migo_badi~pbo_detail.
" register subscreen
e_cprog = 'SAPLZSAMPLE'.
e_dynnr = '0001'.
e_heading = 'My sample'(001).
" pass required data to dynpro main progam
CALL FUNCTION 'Z_SAMPLE_PUT_DATA'
exporting
class_id = i_class_id
mydata = ls_myowndata.
ENDMETHOD.
" post document
METHOD if_ex_mb_migo_badi~post_document.
" ask main program to save data
call function 'Z_SAMPLE_COMMIT_DATA'.
ENDMETHOD.
" Save data
FUNCTION z_sample_save_data.
CALL FUNCTION 'Z_SAMPLE_WRITE_DATA' IN UPDATE TASK
TABLES
xdata = gt_xdata
ydata = gt_ydata.
ENDFUNCTION.
You could also always send the whole data back in the PAI method, so trigger the save from the BAdI itself. Use your own prefered logic.
09-01-2017 2:58 PM
I have implementation subcreen, subscreen is "Data Timbang". I don't have problem about subscreen implementation.
but my problem is on GR Purchase Order process in MIGO, before POST processing I will choose(tick checkbox in alv grid) the data in subscreen "Data Timbang" (item level),
ex : I have Purchase Order with 2 item, in item 10 I tick 2 data in alv grid "Data Timbang" subscreen and 3 data in item 20. Then in my ZTable data will be store Material Document, Item, and data in alv grid in subscreen "Data Timbang".
09-01-2017 6:25 PM
Not sure what any of this has to do with the initial question. It seems that Raymond is trying to explain that a subscreen and BADI implementation are two separate "entities" and you need to write the ABAP code so that they could exchange data.
I'm quite confused what exactly is a technical challenge at this point. Raymond already explained how it works. Which part is not clear yet?
09-03-2017 9:25 AM