Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Save SubScreen Data on MIGO POST to ZTABLE

husnulmoeb
Explorer
0 Kudos

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

10 REPLIES 10

Jelena
Active Contributor
0 Kudos

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.

0 Kudos

"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

Jelena
Active Contributor
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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.

0 Kudos

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"

0 Kudos

thats MB_MIGO_BADI all method

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.

0 Kudos

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".

0 Kudos

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?

husnulmoeb
Explorer
0 Kudos

Thansk All for your answer, My Problem is solved