MIGO BADI

I am working on this BADI for MIGO transaction for adding custom screen.... I was able to display the custom sub-screen... however it contains a pushbutton... which should trigger another screen... How would i achieve this....
Edited by: Karthik on Nov 6, 2008 3:25 AM

Any inputs....

Similar Messages

  • Stop the execution of MIGO BADI on click of a button

    Dear Experts,
    My client have a strange requirement in MIGO  BADI i.e. MB_DOCUMENT_BADI.
    He wants me to show a popup with some information and which has 3 buttons on it in the above BADI implementation.
    These 3 buttons are YES, NO & VIEW PDF.
    When the user clicks on YES, the processing of the exit will continue with some user defined logic and the document will get posted.
    And when the user clicks on NO,  the processing of the exit will continue with some other user defined logic and the document will get posted.
    But the problem comes when the user clicks on VIEW PDF button, he wants to open a new window having a pdf file in it but still have the program control on the popup only.
    To be more clear when he clicks on the VIEW PDF button, i should open a new session and show the PDF file but my popup should still be active and my user exit processing should be on hold until he selects YES or NO buttons and my document should not be posted.
    I have written the code to open the PDF file, but when the user clicks on the VIEW PDF button the program control does not stops and the document gets posted into the system.
    Can anyone help me out with this?
    Thanks,
    Praveen Bitling

    Dear Praveen,
    Kindly execute your logic for yes or no in if condition by checking sy-ucomm.
    Regards,
    Pushkar

  • MIGO BADI - Check line item after clicking on  ITEM_OK Field in MIGO

    Hi,
                I am looking for Enhanacement option for MIGO Transaction . What i found it, there is one Badi MB_MIGO_BADI at the creation of material document. When i click on ITEM_OK Field at material line item level. and click on CHECK Button, i want to check material master if that material is having QM View or not . That i can write in one of the method in badi which i found is CHECK_ITEM bt that method is having parameter called I_LINE_ID which have line item no. bt how should i get material doc. no and material no. at that line item?
    Plz try to give me solution.
    Thanks & Regards,
    Saurin Shah

    Hi,
    When you are posting a GR against PO when you check the document
    Method Line_modify of the badi MB_MIGO_BADI is gettin triggered and if you check the importing parameter cs_goitem
    it is getting populated wit the values of the lime item
    Like you said material no, po number, batch no, item no etc.
    Since you can get this details as you said you can check for the view maintained.
    Hope this help you.
    Regards,
    Ranjith N

  • MIGO BADI - Transfer Posting

    Dear forumers,
    I have a requirement as such:-
    Upon a transfer posting in the transaction MIGO, some data fields will need to be updated in RESB and another custom table based on certain conditions. This transfer posting will be for issuing / transferring a part from one location to another.
    As for the data logic, I should be able to work it out. But, I am not sure on how I can find the right BADI for this.
    Would someone have any idea on this at all?
    Please help. Many thanks in advance.

    Hi
    If you use MIGO, you can use the BADI 'MB_MIGO_BADI'. You can use too the BADI 'MB_DOCUMENT_BADI', but in this case be careful (see Note 92550 - Stock inconsistency due to customer enhancement (exit, BAdI) ). This is for custom tables. For RESB data I don't know what you want to do.
    I hope this helps you
    Regards
    Eduardo

  • Field Exit For Migo Badi

    Hi to all experts,
    I need to assign F4 help to a headertext field for MIGO tcode . I have searched all the exits but couldnt find field exit for it. What are the different options fulfilling this requirement.Please help me out

    Hi,
        The following are the enhancement/Business Add ins,  Please use the appropriate exit for your requirement
      Enhancement/ Business Add-in            Description
    Enhancement
    MB_CF001                                Customer Function Exit in the Case of Updating a Mat. Doc.
    MBCF0011                                Read from RESB and RKPF for print list in  MB26
    MBCF0010                                Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0009                                Filling the storage location field
    MBCF0007                                Customer function exit: Updating a reservation
    MBCF0006                                Customer function for WBS element
    MBCF0005                                Material document item for goods receipt/issue slip
    MBCF0002                                Customer function exit: Segment text in material doc. item
    Business Add-in
    MB_DOCUMENT_UPDATE                      BADI when updating material document: MSEG and MKPF
    MB_DOC_BADI_INTERNAL                    BAdIs During Creation of a Material Document (SAP Internal)
    MB_ME_CSGMT_BADI_SAP                    BAdI: Consignment Processing - Stock Transfer
    MB_MIGO_BADI                            BAdI in MIGO for External Detail Subscreens
    MB_MIGO_ITEM_BADI                       BAdI in MIGO for Changing Item Data
    MB_PHYSINV_INTERNAL                     Connection: Core Inventory and Retail AddOn
    MB_QUAN_CHECK_BADI                      BAdI: Item Data at Time of Quantity Check
    MB_RESERVATION_BADI                     MB21/MB22: Check and Complete Dialog Data
    MB_RESERVATION_SCR                      Screen BAdI for Retrofit DFPS
    MB_RESERVATION_UPCHD                    BAdI for Creation and Changing of Manual Reservations
    MB_RES_BAPI_CHANGE                      BAdI: Execution of Changes to Reservation Fields
    MB_RES_BAPI_CREATE1                     BAdI: Adoption of Customer's Own Fields as Reserv. Fields
    MB_RES_BAPI_DETAIL1                     BAdI: Display of Customer's Own Fields in Reservations
    MB_STOR_LOC_BADI_GTS                    BADI to Check and Change Storage Location (GTS Fct. Only)
    MB_DOCUMENT_BADI_SAP                    BADI for Creation and Changing of a Material Document
    ARC_MM_EBAN_CHECK                       BAdI: Enhancement of Archivability Check (MM_EBAN)
    ARC_MM_EBAN_PRECHECK                    BAdI: Enhancement of Archivability Check (MM_EBAN)
    ARC_MM_EBAN_WRITE                       BAdI: Enhancement of Scope of Archiving (MM_EBAN)
    ARC_MM_EINA_CHECK                       BAdI: Enhancement of Archivability Check (MM_EINA)
    ARC_MM_EINA_WRITE                       BAdI: Enhancement of Scope of Archiving (MM_EINA)
    ARC_MM_INVBEL_CHECK                     BAdI: Enhancement of Archivability Check (MM_INVBEL)
    ARC_MM_INVBEL_WRITE                     BAdI: Enhancement of Scope of Archiving (MM_INVBEL)
    ARC_MM_MATBEL_CHECK                     Prüfung ADD-ON-spezifischer Kriterien für MM_MATBEL
    ARC_MM_MATBEL_WRITE                     Check Add-On-Specific Data for MM_MATBEL
    MB_CHECK_LINE_BADI                      BAdI: Check Line Before Copying to the Blocking Tables
    MB_CIN_LMBMBU04                         posting of gr
    MB_CIN_MM07MFB7                         BAdI for India Version exit in include MM07MFB7
    MB_CIN_MM07MFB7_QTY                     Proposal of quantity from Excise invoice in GR
    MB_DOCUMENT_BADI                        BAdIs During Creation of a Material Document

  • BAPI_GOODSMVMT_CREATE IN MIGO BADI

    Hai all,
    Im using BAPI_GOODSMVMT_CREATE in  this badi 'MB_DOCUMENT_BADI'.
    While execute the Tcode MIGO its getting Dump error .
    Pls help me
    Regards,
    Ekadevi.S

    Hi,
      Pass the parameters properly to BAPI .Otherwise it will go to dump.
    Please take a look at this links for sample coding of BAPI_GOODSMVT_CREATE.
    http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
    http://www.4ap.de/abap/bapi_goodsmvt_create.php
    Regards
    Kiran Sure

  • Need MIGO BAdi to update custom table

    Hi Experts,
       I have to update a custom table after the GR is successful against PO in MIGO transaction.
    Which BADI will be suitable to this. Or is there any other way to do this?
    Thanks and regards,
    Venkat.N.

    Hi,
    You can use the badi MB_DOCUMENT_BADI and method MB_DOCUMENT_UPDATE.
    Regards,
    Nagaraj

  • MIGO BADI to predefine field values

    Hello Experts,
    I would like to ask does anyone know which BADI can be used to predefine field values for the MIGO transaction.  I would like to add source code to manually determine the BATCH number and make it default when the user runs the MIGO transaction. 
    He/She will first enter the Production Order number and the press enter, then the default fields should be populated.
    I have found the BADI MB_MIGO_ITEM_BADI, but this one can only update the Storage location and the Item text.
    Any help please?
    Thanks.

    Hi,
    My understanding is this BADI is used for modifying the value of the field itself. My requirement is to disable the field (user should not be able to edit the value). Whenever I add the LOOP AT SCREEN statement on this BADI, the screen field GOITEM-CHARG is not processed.
    I am actually looking for a BADI/user exit where this screen field can be read.
    Thanks.

  • MIGO Badi or Exit for validate Serial Numbers

    Hi frnds,
    I need a badi or exit, to validate data on EQUI by the migo, while it's making a commit, to extract information from this table, does anybody knows about them. this is very urgent, i need help from someone asap.

    Ferry :
    The issue makes a big headache as i following describe it : When the user saves a Delivery trought a reservation, i need to check if he's introducing correct series, to do this i need to compare by a badi or exit this data. but i did'nt found a solution, i already check this implementation (EXIT_SAPLIPW1_008) and it's doesnt work for my porpouses. Like the badi of MIGO checks for every line while it's saving (IS_MSEG,IS_MKPF) i need to check for every serial number.

  • MIGO BAdI or User-Exit - After Database Commit

    Hello,
    I'm looking for a BAdI or user-exit after database commit for MIGO posting. I want to create a FI document after MIGO posting.
    I already tried MB_MIGO_BADI BAdI but system gives a short dump. So I have to find a exit or BAdI after database commit.
    Thanks for helping in advance.
    Regards,
    Burak

    Hello,
    This issue solved.
    I used MB_DOCUMENT_BADI / MB_DOCUMENT_UPDATE and it solved my problem.
    FYI.
    Regards,
    Burak

  • Problem in  transporting MIGO BADI screen exit?

    Hi all,
    I have implemented MB_MIGO_BADI for screen-exit of the MIGO.
    Whem transporting I am getting an error that                                                                               
    Table ZMIGO_BADI_EX_SCREEN_FIELD could not be activated                      
    (E- Routine EXPAND (Table ZMIGO_BADI_EX_SCREEN_FIELD could not be expanded) )
    Table Type ZTY_T_EXTDATA could not be activated                              
    (E- Row type ZMIGO_BADI_EX_SCREEN_FIELD is not active or does not exist ) .    
    But this row type is in the same request number and activated also ?
    I am unable to identify the reason. Please help me to solve this problem?
    Thanks,
    Vamshi

    Hi,
    Go to se80 and display the program name which you might have given in methof IF_EX_MB_MIGO_BADI~PBO_DETAIL and activate the screen which you have created,
    Thanks,
    Shailaja Ainala.

  • Commit Work in MIGO BADI

    Hi,
    Can we use COMMIT WORK statement in BADI?  Hope its not advisable to use it.
    I am using MB_MIGO_BADI~POST_DOCUMENT  to update the GR Number in a custom table.
    Sometimes the GR number is not getting updated in the custom table.
    The modify statement given below does not updates the table sometime.
    IF WA_ZMM_GATE_ENTRY-GR_NUMBER IS INITIAL.
          WA_ZMM_GATE_ENTRY-REFERENCE = GS_EXDATA_HEADER-REFERENCE.
          WA_ZMM_GATE_ENTRY-REFWERKS  = GS_EXDATA_HEADER-WERKS.
          WA_ZMM_GATE_ENTRY-GR_NUMBER = IS_MKPF-MBLNR.
         WA_ZMM_GATE_ENTRY-GR_YEAR   = IS_MKPF-MJAHR.
         MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY .u201Dupdating the Z-table
    ELSE.
          MESSAGE E901(ZMM) WITH GS_EXDATA_HEADER-GATEENTRYNO WA_ZMM_GATE_ENTRY-GR_NUMBER.
        ENDIF.
    Is there any other option to replace the commit work in BADI?
    Plz suggest...
    Regards,
    P.S.Chitra
    Edited by: Chitra Karthik on Aug 10, 2010 11:19 AM

    Hi,
    I don't think even you do commit work it makes much difference and also Commit work also we can eliminate in the code.one more option is selecting the data from table to check whether it is updated or not.
    IF WA_ZMM_GATE_ENTRY-GR_NUMBER IS INITIAL.
          WA_ZMM_GATE_ENTRY-REFERENCE = GS_EXDATA_HEADER-REFERENCE.
          WA_ZMM_GATE_ENTRY-REFWERKS  = GS_EXDATA_HEADER-WERKS.
          WA_ZMM_GATE_ENTRY-GR_NUMBER = IS_MKPF-MBLNR.
         WA_ZMM_GATE_ENTRY-GR_YEAR   = IS_MKPF-MJAHR.
         MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY .u201Dupdating the Z-table
      IF sy-subrc eq 0.
      do.
    select gr_number from ZMM_GATE_ENTRY where reference = GS_EXDATA_HEADER-REFERENCE.
    if sy-subrc eq 0 and if gr_number is not initial. (record Found)-> means updated.
    exit.
    else.
    MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY.
    endif.
    enddo.
    endif.
    ELSE.
          MESSAGE E901(ZMM) WITH GS_EXDATA_HEADER-GATEENTRYNO WA_ZMM_GATE_ENTRY-GR_NUMBER.
        ENDIF.
    Regards,
    Nagaraj

  • Problem in Migo BAdi

    Hi All...
    I have written a BDC for MIGO for Transfer Posting (A08) , with Reference Document (R10)-Others and Movement Type 911.
    First I go into the Tcode MIGO and set these parameters and come back.
    Then I run the BDC , it runs properly.
    But once I change these parameters one or all of them, the BDC does not run properly. It says that movement type does not exist.
    While in my BDC , I have assigned the above parameters .So it should run properly for these parameters, but it still shows the error.
    Can anyone please suggest me a solution .
    Thanks in advance.
    Sangeet.

    Look at [Note 504936 - Batch input compatibility of new transactions|https://service.sap.com/sap/support/notes/504936]
    With release 4.6B, SAP has delivered new enjoy transactions. Examples
    are transactions MIGO, MEPO, VL01N, VL02N. These transactions are not
    supported for batch input processing. For details please read notes
    304122,381630 457925 and 491875.
    or [Note 304122 - MIGO: Batch input and CATT not supported|https://service.sap.com/sap/support/notes/304122]
    Reason and Prerequisites
    The new goods movement transaction MIGO is not intended for use with batch input and CATT.
    The reason for this is that batch input and CATT are based on the screen technique, the Enjoy transactions like MIGO (single screen transactions) work more and more with the control technique. Batch input and controls are not compatible.
    Solution
    There are two alternatives:
    Use the following BAPIs to post goods movements in the background:
          Object name:  GoodsMovement
          Object type:  US2017
          Method:       Cancel (cancel goods movement)
                        CreateFromData (post goods movement)
    The old goods movement transactions (MB01, MB0A, MB1A, MB1B, MB1C, MB31) are still supported. These transactions support batch input and CATT.
    (BAPI refers to function module BAPI_GOODSMVT_CREATE)
    Regards

  • MIGO Badi's in BAPI_GOODSMVT_CREATE

    Hi everybody,
    I have implemented the MB_MIGO_BADI to make some extra check in my MIGO transaction. When I use the MIGO transaction online, all works perfect well. The problem is that I need the same with backgroud execution. I use for that the BAPI_GOODSMVT_CREATE to simulate my MIGO transaction but nothing seems to be checked or changed ?
    Any idea about the problem ?
    Thanks a lot
    Durieux Jean-François

    hi every body,
            check this program this is working for me.
    *& Report  ZMM_BBP_INB_DEL_CREATE
    *&BAPI FOR INBOUND DELIVERY
    REPORT  zmm_bbp_inb_del_create NO STANDARD PAGE HEADING LINE-SIZE 300.
    TABLES: eord.
      data definition
          Batchinputdata of single transaction
    DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
          error session opened (' ' or 'X')
    DATA:   e_group_opened.
          message texts
    TABLES: t100.
    CONSTANTS: nodata VALUE space,
               ctumode VALUE 'N',
               cupdate VALUE 'S',
               smalllog VALUE space.
    *INCLUDE bdcrecx1.
    DATA: BEGIN OF i_eord OCCURS 100,
            matnr LIKE eord-matnr,
            werks LIKE eord-werks,
            erdat LIKE eord-erdat,
            lifnr LIKE eord-lifnr,
            ebeln LIKE eord-ebeln,
            ebelp LIKE eord-ebelp,
          END OF i_eord.
    DATA: BEGIN OF i_input OCCURS 100,
            sl_no(10) TYPE c,
            lifnr(10) TYPE c,
            erdat(10) TYPE c,
            matnr(18) TYPE c,
            lfimg(13) TYPE c,
            budat(10) TYPE c,
            bldat(10) TYPE c,
            delivnt(10) TYPE c,
            exdat(10) TYPE c,
          END OF i_input.
    DATA: is_inb_delivery_header LIKE bbp_inbd_l.
    DATA: BEGIN OF it_inb_delivery_detail OCCURS 100.
            INCLUDE STRUCTURE  bbp_inbd_d.
    DATA: END OF it_inb_delivery_detail.
    DATA: BEGIN OF bapireturn OCCURS 100.
            INCLUDE STRUCTURE bapireturn.
    DATA: END OF bapireturn.
    DATA: lv_file_header TYPE string.
    DATA: w_vbeln TYPE likp-vbeln,
          lv_date TYPE eord-erdat,
          lv_ref_doc_no(10),
          lv_pos_dt_ex(10),
          lv_doc_dt_ex(10),
          lv_slno(10),
          lv_exdat(10),
          lv_lifnr(10).
    DATA: lv_shed_header  TYPE rlgrap-filename.
    DATA: BEGIN OF it_lips OCCURS 100.
            INCLUDE STRUCTURE lips.
    DATA: END OF it_lips.
    DATA: goodsmvt_header  TYPE bapi2017_gm_head_01.
    DATA: BEGIN OF goodsmvt_code OCCURS 100.
            INCLUDE STRUCTURE bapi2017_gm_code.
    DATA: END OF goodsmvt_code.
    DATA: BEGIN OF goodsmvt_item OCCURS 100.
            INCLUDE STRUCTURE bapi2017_gm_item_create.
    DATA: END OF goodsmvt_item.
    DATA: BEGIN OF return OCCURS 100.
            INCLUDE STRUCTURE  bapiret2.
    DATA: END OF return.
    DATA: lv_pos_date TYPE eord-erdat,
          lv_doc_date TYPE eord-erdat.
    DATA: lv_header TYPE rlgrap-filename.
    DATA: lv_mblnr TYPE bapi2017_gm_head_ret-mat_doc,
          lv_year TYPE bapi2017_gm_head_ret-doc_year,
          flag TYPE i.
    DATA: BEGIN OF it_display OCCURS 100,
            d_slno(10) TYPE c,
            d_lifnr(10) TYPE c,
            d_vbeln LIKE likp-vbeln,
            d_mblnr LIKE mseg-mblnr,
            d_mjahr LIKE mseg-mjahr,
            docyr LIKE j_1iexchdr-docyr,
            docno LIKE j_1iexchdr-docno,
            exnum LIKE j_1iexchdr-exnum,
          END OF it_display.
    PARAMETERS: sch_agr TYPE ibipparms-path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sch_agr.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME        = SYST-CPROG
          DYNPRO_NUMBER       = SYST-DYNNR
          FIELD_NAME          = ' '
       IMPORTING
          file_name           = sch_agr.
    START-OF-SELECTION.
      PERFORM file_upload.
      PERFORM pass_value.
      PERFORM display_corr_data.
    FORM file_upload.
      lv_file_header = sch_agr.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_header              "file 1
          filetype                = 'ASC'
          has_field_separator     = 'X'
        TABLES
          data_tab                = i_input            "itab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
    ENDFORM.                    "FILE_UPLOAD
    FORM pass_value.
      SORT i_input BY lifnr sl_no.
      LOOP AT i_input.
        CLEAR: lv_date,lv_pos_date,lv_doc_date,lv_pos_dt_ex,lv_doc_dt_ex,lv_exdat, lv_lifnr.
        MOVE i_input-budat TO lv_pos_dt_ex.
        MOVE i_input-bldat TO lv_doc_dt_ex.
        MOVE i_input-lifnr TO lv_lifnr.
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
           EXPORTING
             date_external                  = i_input-budat
            ACCEPT_INITIAL_DATE            =
          IMPORTING
            date_internal                  = lv_pos_date
          EXCEPTIONS
            date_external_is_invalid       = 1
            OTHERS                         = 2
        IF sy-subrc <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
           EXPORTING
             date_external                  = i_input-bldat
            ACCEPT_INITIAL_DATE            =
          IMPORTING
            date_internal                  = lv_doc_date
          EXCEPTIONS
            date_external_is_invalid       = 1
            OTHERS                         = 2
        IF sy-subrc <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
        EXPORTING
          date_external                  = i_input-erdat
          ACCEPT_INITIAL_DATE            =
       IMPORTING
         date_internal                  = lv_date
       EXCEPTIONS
         date_external_is_invalid       = 1
         OTHERS                         = 2
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        MOVE i_input-delivnt TO lv_ref_doc_no .
        MOVE i_input-exdat TO lv_exdat.
        SELECT matnr werks lifnr ebeln ebelp
        INTO CORRESPONDING FIELDS OF TABLE i_eord
        FROM eord
       WHERE lifnr EQ i_input-lifnr
         AND matnr EQ i_input-matnr
         AND ( vdatu LE lv_date
         AND bdatu GE  lv_date )
         AND werks EQ '4210'
         AND notkz NE 'X'
         AND febel EQ 'X'.
        READ TABLE i_eord WITH KEY lifnr = i_input-lifnr.
        IF sy-subrc EQ 0.
          MOVE lv_date TO is_inb_delivery_header-deliv_date.
          MOVE i_input-matnr TO it_inb_delivery_detail-material.
          MOVE i_input-lfimg TO it_inb_delivery_detail-deliv_qty.
          MOVE i_eord-ebeln TO it_inb_delivery_detail-po_number.
          MOVE i_eord-ebelp TO it_inb_delivery_detail-po_item.
          it_inb_delivery_detail-unit = 'EA'.
          APPEND it_inb_delivery_detail.
        ENDIF.
        AT END OF  sl_no.
          CLEAR lv_slno.
          lv_slno = i_input-sl_no.
          it_display-d_slno = lv_slno.
          it_display-d_lifnr = lv_lifnr.
    *Inbound delivery creation
          PERFORM create_inb_deliv.
          IF NOT w_vbeln IS INITIAL.
            PERFORM extract.
          ELSE.
            WRITE /.
            FORMAT COLOR 2.
            WRITE:/ 'Inbound delivery is not created'.
            WRITE:/(64) sy-uline.
          ENDIF.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    "PASS_VALUE
    *inbound delivery creating
    FORM create_inb_deliv.
      CLEAR w_vbeln.
      CALL FUNCTION 'ZBBP_INB_DELIVERY_CREATE'
        EXPORTING
          is_inb_delivery_header = is_inb_delivery_header
        IMPORTING
          ef_delivery            = w_vbeln
        TABLES
          it_inb_delivery_detail = it_inb_delivery_detail
          return                 = bapireturn.
      UPDATE likp SET   xabln = lv_slno
                        WHERE vbeln = w_vbeln.
      COMMIT WORK AND WAIT.
      IF w_vbeln IS INITIAL.
        FORMAT COLOR 6.
        WRITE:/ 'Record no:' , lv_slno.
        SKIP 1.
        WRITE:/ 'INBOUND DELIVERY: ', w_vbeln.
       WRITE:/(64) sy-uline.
        FORMAT COLOR OFF.
        APPEND it_display.
        CLEAR it_display.
        LOOP AT bapireturn.
          WRITE:/ bapireturn-type , bapireturn-message.
        ENDLOOP.
      ELSE.
        FORMAT COLOR 5.
        it_display-d_vbeln = w_vbeln.
      ENDIF.
      CLEAR: it_inb_delivery_detail, bapireturn.
      REFRESH: it_inb_delivery_detail, bapireturn.
    ENDFORM.                    "CREATE_INB_DELIV
    FORM extract.
      goodsmvt_code-gm_code = '01'.
      MOVE lv_pos_date TO goodsmvt_header-pstng_date.
      MOVE lv_doc_date TO goodsmvt_header-doc_date.
    MOVE lv_ref_doc_no TO goodsmvt_header-ref_doc_no.
    goodsmvt_header-header_txt = goodsmvt_header-ref_doc_no.
      goodsmvt_header-ref_doc_no = i_input-sl_no.
      goodsmvt_header-header_txt = i_input-sl_no.
      SELECT * INTO TABLE it_lips
        FROM lips
       WHERE vbeln EQ w_vbeln.
      LOOP AT it_lips.
        MOVE it_lips-matnr TO goodsmvt_item-material.
        MOVE it_lips-werks TO goodsmvt_item-plant.
        MOVE it_lips-bwart TO goodsmvt_item-move_type.
        MOVE it_lips-lfimg TO goodsmvt_item-entry_qnt.
        goodsmvt_item-entry_uom = 'EA'.
        goodsmvt_item-mvt_ind = 'B'.
        MOVE it_lips-vbeln TO goodsmvt_item-deliv_numb_to_search.
        MOVE it_lips-posnr TO goodsmvt_item-deliv_item_to_search.
        MOVE lv_lifnr TO goodsmvt_item-item_text.
        APPEND goodsmvt_item.
      ENDLOOP.
    *GR Creation
      PERFORM create.
      IF NOT lv_mblnr IS INITIAL AND
       NOT lv_year IS INITIAL.
    *Excise Creation
        PERFORM bdc.
      ELSE.
        WRITE /.
        FORMAT COLOR 2.
        WRITE:/ 'Record no:' , i_input-sl_no.
        WRITE / 'Goods Receipt is not created'.
      ENDIF.
      REFRESH: it_lips , goodsmvt_item.
      CLEAR: it_lips, goodsmvt_header, goodsmvt_item.
    ENDFORM.                    "EXTRACT
    FORM create.
      CLEAR: lv_mblnr,lv_year.
      CALL FUNCTION 'J_1I6_STORE_EXCISE_INVOICE_NUM'
       EXPORTING
        DOCNO                 =
        DOCYR                 =
         EXNUM                 =
        EXYEAR                =
        LIFNR                 =
         exgrp                 = '42'
         regtyp                = 'A'
        STATUS                =
        SUBCON_CHALLANS       =
        GRXREF                =
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header               = goodsmvt_header
          goodsmvt_code                 = goodsmvt_code
        TESTRUN                       = ' '
        GOODSMVT_REF_EWM              =
       IMPORTING
        GOODSMVT_HEADRET              =
         materialdocument              = lv_mblnr
         matdocumentyear               = lv_year
        TABLES
          goodsmvt_item                 = goodsmvt_item
        GOODSMVT_SERIALNUMBER         =
          return                        = return
        GOODSMVT_SERV_PART_DATA       =
        EXTENSIONIN                   =
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      IF lv_mblnr IS INITIAL AND
         lv_year IS INITIAL.
        FORMAT COLOR 6.
        WRITE:/ 'Record no:' , lv_slno.
        WRITE:/ 'GOODS MOVEMENT', lv_mblnr , lv_year.
        APPEND it_display.
        CLEAR it_display.
        FORMAT COLOR OFF.
        LOOP AT return.
          WRITE:/ return-type,return-message.
        ENDLOOP.
      ELSE.
        FORMAT COLOR 5.
        it_display-d_mblnr = lv_mblnr.
        it_display-d_mjahr = lv_year.
      ENDIF.
    ENDFORM.                    "CREATE
    FORM bdc.
      WAIT UP TO 1 SECONDS.
      PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
      PERFORM bdc_field       USING 'J_1IEXDYNPRO-ACTION'
                                       'A01'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=J1IEX_OK_ACTION'.
      PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
      PERFORM bdc_field       USING 'J_1IEXDYNPRO-REFDOC'
                                       'R05'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=J1IEX_OK_REFDOC'.
      PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=J1IEX_OK_GO'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'J_1IEXDYNPRO-MAT_DOC_YEAR'.
      PERFORM bdc_field       USING 'J_1IEXDYNPRO-MAT_DOC'
                                     lv_mblnr .
      PERFORM bdc_field       USING 'J_1IEXDYNPRO-MAT_DOC_YEAR'
                                     lv_year.
      PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=OK_CENVAT'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'J_1IEXHEAD-BUDAT'.
      PERFORM bdc_field       USING 'J_1IEXHEAD-EXNUM'
                                        lv_ref_doc_no.
      PERFORM bdc_field       USING 'J_1IEXHEAD-EXDAT'
                                        lv_exdat.
      PERFORM bdc_field       USING 'J_1IEXHEAD-EXGRP'
                                       '42'.
      PERFORM bdc_field       USING 'J_1IEXHEAD-BUDAT'
                                        lv_pos_dt_ex.
      PERFORM bdc_transaction USING 'J1IEX'.
    ENDFORM.                    "bdc
           Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      IF fval <> nodata.
        CLEAR bdcdata.
        bdcdata-fnam = fnam.
        bdcdata-fval = fval.
        APPEND bdcdata.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
           Start new transaction according to parameters                 *
    FORM bdc_transaction USING tcode.
      DATA: l_mstring(480).
      DATA: l_subrc LIKE sy-subrc.
    batch input session
      REFRESH messtab.
      CALL TRANSACTION tcode USING bdcdata
                       MODE   ctumode
                       UPDATE cupdate
                       MESSAGES INTO messtab.
      l_subrc = sy-subrc.
      IF smalllog <> 'X'.
        CLEAR flag.
        READ TABLE messtab WITH KEY msgtyp = 'E' .
        IF sy-subrc = 0.
          FORMAT COLOR 6.
          APPEND it_display.
          CLEAR: it_display, flag.
        ELSE.
          FORMAT COLOR 5.
          flag = 1.
        ENDIF.
        READ TABLE messtab WITH KEY msgnr = '344'.
        IF sy-subrc = 0.
          FORMAT COLOR 6.
          APPEND it_display.
          CLEAR: it_display, flag.
        ELSE.
          FORMAT COLOR 5.
          flag = 1.
        ENDIF.
        IF flag = 1.
          it_display-exnum  = lv_ref_doc_no.
          it_display-d_slno = lv_slno.
          APPEND it_display.
          CLEAR it_display.
        ELSE.
          WRITE /.
          FORMAT COLOR 2.
          WRITE:/ 'Record no:' , lv_slno.
          FORMAT COLOR 6.
          WRITE / 'Excise creation for Part 2'.
          FORMAT COLOR OFF.
          WRITE: / 'CALL_TRANSACTION',
                   tcode,
                   'returncode:'(i05),
                   l_subrc,
                   'RECORD:',
                   sy-index.
          LOOP AT messtab.
            SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
                                      AND   arbgb = messtab-msgid
                                      AND   msgnr = messtab-msgnr.
            IF sy-subrc = 0.
              l_mstring = t100-text.
              IF l_mstring CS '&1'.
                REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
                REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
                REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
                REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
              ELSE.
                REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
                REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
                REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
                REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
              ENDIF.
              CONDENSE l_mstring.
              WRITE: / messtab-msgtyp, l_mstring(250).
            ELSE.
              WRITE: / messtab.
            ENDIF.
          ENDLOOP.
          SKIP.
        ENDIF.
      ENDIF.
    Erzeugen fehlermappe ************************************************
      REFRESH bdcdata.
    ENDFORM.                    "BDC_TRANSACTION
    *&      Form  display_corr_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_corr_data .
      WRITE:/01 sy-vline, 'SL NO' COLOR 3,
             13 sy-vline, 'Vendor' COLOR 3,
             23 sy-vline, 'INB DEL' COLOR 3,
             34 sy-vline, 'GR NUMBER' COLOR 3,
             46 sy-vline, 'EXCISE NO' COLOR 3,
             58 sy-vline, 'EXCISE YEAR' COLOR 3,
             74 sy-vline.
      WRITE:/(74) sy-uline.
      SORT it_display BY d_lifnr d_slno.
      LOOP AT it_display.
        SELECT SINGLE docno docyr
        INTO (it_display-docno,
               it_display-docyr)
        FROM j_1iexchdr
       WHERE exnum EQ it_display-exnum.
        WRITE:/01 sy-vline, it_display-d_slno,
               13 sy-vline, it_display-d_lifnr,
               23 sy-vline, it_display-d_vbeln,
               34 sy-vline, it_display-d_mblnr,
               46 sy-vline, it_display-docno,
               58 sy-vline, it_display-docyr,
               74 sy-vline.
      ENDLOOP.
      WRITE:/(74) sy-uline.
    ENDFORM.                    " display_corr_data
    this will create automatically
    1. inbound delivery
    2. GR  IR
    3. excise part1
    4. excise part 2
    regards
    Pravin kumar

  • MIGO BADI screen new fields

    Hi ,
    My requirement is that I need to add three fields on the MIGO screen and then use one of these fields to validate the item totals in MIGO if correct then move the 3 fields along with other item data to a Z table ,else give a error message .
    Can you guys please tell me ..
    1) how to put new fields on  the MIGO screen.
    2) then where to calculate the total value of the GR using every item's quantity
    3)please give what kind of coding is required in PBO and PAI
    Please help.

    Hi,
    You can use the EASY ENHANCEMENT WORKBENCH for this purpose. The
    transaction for the same is EEWB.
    You will have to create a Project here.
    It will ask you for the transaction name that you want to modify, then
    the fields that you want to add on the screen in a wizard format.
    It will generate the Screen, structures and tables for you. It will
    append the structures to the tables that are related to the
    transaction.
    It will also generate a new FM for you which will hold all the
    standard code. You can just customize this code as per your need and
    activate the Project.
    Regards,
    Ranjit Thakur.
    <b>Please Mark The Helpful Answer.</b>

Maybe you are looking for