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: 

Calling MIGO From a Report

Former Member
0 Kudos

Hi all,

I've got an interesting requirement and already working on it.Any inputs on this will be very helpful.

1. A report is developed accepting the Gate Pass No., Vendor as I/P. It'll then call MIGO wherein it'll update the Gatepass no. in the Delivery Note Tab in MIGO.

There's no "PARAMETER ID" for the field Delivery note in "MIGO". So SET PARAMETER ID and calling transaction will not work.

Is there any other way wherein My I/P from the report can get populated in MIGO? Any inputs will be very helpful.

Regards

Ramakrishnan.G

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you can do a partial BDC. I'll get back with some code.

Regards,

Rich HEilman

0 Kudos

I am assuming that you need to pass the control to the user during MIGO, this is why you are not using a BAPI, right?

Here is a sample program. I don't have that particular tab in my system, so this example enters the PO number and puts some text in the "Test" field on the tab labeled "Where". This is a partial BDC. Its does some of the recording and then stops when there are no more instructions. Make sure that the MODE is set to "E".



report zrich_0004
       no standard page heading line-size 255.

data:   bdcdata like bdcdata    occurs 0 with header line.

parameters: p_ebeln type ekko-ebeln.


start-of-selection.



  perform bdc_dynpro      using 'SAPLMIGO' '0001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=OK_GO'.
  perform bdc_field       using 'GODYNPRO-ACTION'
                                'A01'.
  perform bdc_field       using 'GODYNPRO-REFDOC'
                                'R01'.
  perform bdc_field       using 'GODEFAULT_TV-BWART'
                         '101'.
  perform bdc_field       using 'BDC_CURSOR'
                                'GODYNPRO-PO_NUMBER'.
  perform bdc_field       using 'GODYNPRO-PO_NUMBER'
                         p_ebeln.

  perform bdc_dynpro      using 'SAPLMIGO' '0001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=OK_GO'.
  perform bdc_field       using 'GOITEM-SGTXT'
                       'Hi there this is text'.

  call transaction 'MIGO' using bdcdata mode 'E'.


*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
form bdc_dynpro using program dynpro.
  clear bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  append bdcdata.
endform.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
  clear bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  append bdcdata.
endform.

Regards,

Rich Heilman

0 Kudos

So has your problem been resolved. Did this code sample work for you. If you problem has been solved, please make sure to award points and mark this post as solved. Thanks.

Regards,

Rich Heilman

Former Member
0 Kudos

Why are trying to do a call transaction for MIGO(which is a enjoy transaction with controls)? Use BAPI_GOODSMVT_CREATE instead. If you have to use a transaction, then use one of the MB*(MB01, MB31, MB1A, MB1B, MB1C, MB11) transactions depending on your movement type.

Srinivas

Former Member
0 Kudos

Hi,

"SAP Guruz'" Thanks a lot for your solutions. The coding provided was very helpful. I have now populated the Delivery Note No. in MIGO through BDC recording after a lot of hiccups.Now I've got another extensive extension in this requirement.

Now I'll have to get the Gate pass no. as "Input" and from that get the lineitems entered at the gate and will have to populate only those line items in MIGO for that PO.But in MIGO it displays all the line items for a PO. Of course there's an option wherein we can see only 1 Line item if we enter the line item no. next to PO No. in MIGO. But what will happen if there are more than 1 line items? Say 2 items have been entered at the gate then how can I record MIGO since these Line Items entered at the Gate will vary dynamically.How to record MIGO in this fashion?I've been working on this but am not gettin' a perfect solution.Any Inputs on this will be very helpful.Hope I'm clear in what I've told.

Regards

Ramky.G