Debugging MIGO transaction

Hi to all,
         i am debugging standard <u><i><b>MIGO</b></i></u>. In the migo program <u><i><b>SAPLMIGO</b></i></u>
[SE38] there is a include <u><i><b>LMIGOST2</b></i></u> in that include there is a code on line 113 col 31  <u><i><b>WHEN 'OK_POST' OR 'OK_POST1'</b></i></u> <b>{ [</b> <u><i><b>OK_POST/OK_POST1</b></i></u> is the fct code for <u><i><b>SAVE</b></i></u> Button <b>] }</b>. After this code there is a method  <u><i><b>CALL METHOD LCL_MIGO_GLOBALS=>KERNEL->DOCUMENT_POST.</b></i></u>. i want to enter into this method but i am unable to enter.Can anyone tell me how?

Hi Nikhil,
You will find it here...
Include LMIGOKE1   Line 181....
Regards,
Raj

Similar Messages

  • In MIGO transaction Transfer posting user exist or BADI or Enhacements

    Hi Experts,
    Could you please help on this issue.
    My requirment is, In MIGO transaction code, Transfer Posting (i.e., Storage location) screen, in item level there is Transfer  posting tab  From and Dest two sub screens are there.
    if user enter material , plant and stoargae location in From side and that will be same maintain in Destination side.
    If any user will change in Destination level Material or Plant or Stoarage location, I need to populate the error message.
    Could you please tell me BADI or user exist or Enhacement for this requirment.
    I have serached in SDN and debug the transaction code MIGO. I didn't found user exist and enhacment.
    Thanks
    Srinu

    HI ,
    If i tried this Enhacment MB_MIGO_SC. I have put break point and it is not triggering, when i am saving/ Checking the postings in MIGO transaction code.
    Thanks
    Srinu

  • Error In MIGO Transaction

    While creating MIGO transaction against a PO I am getting this error continously
    PL Stock in transit exceeded by 12 PC : QS8X20 2100 2110 9000000010
    I dont know what to do.??
    can any one please tell me how to get rid of this error.

    Hi
    But after creating PO when i am checking ME2M for the particular material i cannot see the PO number generated at ME21N
    I still unable to understand where the problem lies
    See for a while forget about ME2M and check you PO in ME23N T-code you are getting your Po or not
    IF not then while saving PO,system giving any message to you?
    Regards
    Kailas Ugale

  • Doubt Regarding MIGO Transaction

    Hi,
    Where exactly the source code of MIGO transaction fills these two fields : BED , SED  (Note: Under the Tab Excise Invoice).
    Thanks & Regards,
    Lakshmi.

    ok

  • ABAP DUMP While doing GI Through Zmovement type in MIGO Transaction

    Hi ,
    We have migrated from FM FBS to BCS from 12.01.2015.
    And we are using 101 profile with GR and IR update.
    We received blow ABAP Dump while doing the GI through MIGO Transaction.
    Can you please help on this.
    Dump detatils
    Category               ABAP Programming Error
    Runtime Errors         MESSAGE_TYPE_X
    ABAP Program           CL_BUAVC_ENTRY================CP
    Application Component  PSM-FM-BCS-AC
    Date and Time          13.01.2015 09:10:00
    Operating system..... "AIX 1 6, AIX 1 7"                                                      |
    |                                                                                                  |
    |    Memory consumption                                                                            |
    |    Roll.... 0                                                                                    |
    |    EM...... 33518336                                                                             |
    |    Heap.... 0                                                                                    |
    |    Page.... 196608                                                                               |
    |    MM Used. 21989120                                                                             |
    |    MM Free. 3145840                                                                              |
    |User and Transaction                                                                              |
    |    Client.............. 256                                                                      |
    |    User................ "MM_BUX00_ZZ"                                                            |
    |    Language key........ "R"                                                                      |
    |    Transaction......... "MIGO_GI "                                                               |
    |    Transaction ID...... "54AEDD9E3EE60710E10080000A15C616"                                       |
    |                                                                                                  |
    |    EPP Whole Context ID.... "54B35F7088300910E10080000A15C616"                                   |
    |    EPP Connection ID....... 00000000000000000000000000000000                                     |
    |    EPP Caller Counter...... 0                                                                    |
    |                                                                                                  |
    |    Program............. "CL_BUAVC_ENTRY================CP"                                       |
    |    Screen.............. "SAPLMIGO 0001"                                                          |
    |    Screen Line......... 18                                                                       |
    |    Debugger Active..... "none"                                                                   |
    |Information on where terminated                                                                   |
    |    Termination occurred in the ABAP program "CL_BUAVC_ENTRY================CP" -                 |
    |     in "POST".                                                                                   |
    |    The main program was "SAPLMIGO ".                                                             |
    |                                                                                                  |
    |    In the source code you have the termination point in line 82                                  |
    |    of the (Include) program "CL_BUAVC_ENTRY================CM00J".                               |
    |Source Code Extract                                                                               |
    |Line |SourceCde                                                                                   |
    |   52|*--- method has provided some errors!):                                                     |
    |   53|                                                                                            |
    |   54|* Note 1499464:                                                                             |
    |   55|*      IF cl_abap_aab_utilities=>is_active( id = 'BUAVC_GROUP'                              |
    |   56|*       mode_assert_dump = 'X' ) = 'X'.                                                     |
    |   57|      MOVE 'X' TO l_flg_dump.                                                               |
    |   58|*      ENDIF.                                                                               |
    |   59|                                                                                            |
    |   60|*--- Check if the entry buffer of the AVC ledger contains data records                      |
    |   61|*--- from previous COLLECT events:                                                          |
    |   62|      IF ( l_f_avc_ledger-ref_ledger->entry_buffer_lines_count( ) > 0 ).                    |
    |   63|*--- Sorry, must dump:                                                                      |
    |   64|        ASSERT ID buavc_group                                                               |
    |   65|               FIELDS c_avc_text 'POSTING_NOT_ALLOWED'                                      |
    |   66|               CONDITION l_flg_dump <> 'X'.                                                 |
    |   67|        IF l_flg_dump = 'X'.                                                                |
    |   68|          MESSAGE x002(buavc) WITH c_avc_text space                                         |
    |   69|                                   'POSTING_NOT_ALLOWED' space.                             |
    |   70|        ENDIF.                                                                              |
    |   71|      ENDIF.                                                                                |
    |   72|    ENDIF.                                                                                  |
    |   73|*----------------------------------------------------------------------                     |
    |   74|* Note 1666556:                                                                             |
    |   75|    IF me->g_commit_before_post EQ 'X'.                                                     |
    |   76|*--- An unauthorized COMMIT WORK occurred before calling this POST                          |
    |   77|*--- method. This COMMIT WORK has refreshed the AVC entry buffer and                        |
    |   78|*--- would thus create a database inconsistency!                                            |
    |   79|      MOVE 'X' TO l_flg_dump.                                                               |
    |   80|      IF l_flg_dump = 'X'.                                                                  |
    |   81|*--- Sorry, must dump (see note 1666556):                                                   |
    |>>>>>|        MESSAGE x002(buavc) WITH c_avc_text space                                           |
    |   83|                                 'INVALID_COMMIT' space.                                    |
    |   84|      ENDIF.                                                                                |
    |   85|    ENDIF.                                                                                  |
    |   86|*----------------------------------------------------------------------                     |
    |   87|                                                                                            |
    |   88|                                                                                            |
    |   89|*--- Call the POST method of the corresponding ledger instance:                             |
    |   90|    CALL METHOD l_f_avc_ledger-ref_ledger->post                                             |
    |   91|      EXPORTING                                                                             |
    |   92|        i_ref_appl_log = me->g_ref_appl_log                                                 |
    |   93|        i_doc_ref      = i_doc_ref.                                                         |
    |   94|                                                                                            |
    |   95|  ENDLOOP.                                                                                  |
    |   96|                      
    Thanks Advance.
    SAM

    Hi Sam,
    Please check if there is any commit statement written in badi or enhancement before calling this method for posting which is leading to update termination.
    Regards,
    Prakash.

  • Custom screen using MB_MIGO_BADI  in MIGO transaction

    Using MB_MIGO_BADI i have cretaed a subscreen in MIGO transaction.WHen i select a particular item in MIGO transaction that particulra item value,i have to get into my custom code to make some validations.In which method i have to use set& get parameters.

    Hi sashi,
    Check the pbo and pai of that screen.
    Regards,
    Madhu.

  • Excise Invoice tab In MIGO transaction code

    Hello
    Could any body suggest, In Excise Invoice tab In MIGO transaction code I am getting "06  No Excise Entry" no otehr fields are coming.? All options like
    01     Capture & Post Excise Invoice
    02     Refer & Post Excise Invoice
    03     Only Capture Excise Invoice
    04     Only Refer Excise Invoice
    05     Only Part1
    Should come. Infact in my SAND Box client it is o.k but with same setting Golden Client it is not coming.?
    Thanks & Regards
    Sudhansu

    Hi,
    These options are coming from Excise Group settings.
    Go to : SPRO-Logistics General-Tax on Goods movements-India-Basic settings-Maintain Excise Groups-in 'MIGO Settings' tab, select the check boxes, accordingly you will get the options in Excise Tab of MIGO screen.
    Hope this will resolve your issue.
    Regards,
    Gopi Chand

  • How to add a new field in migo transaction (header level)

    hi guru's
    can you please tell me how to add a field in migo transaction?
    i want to add a field in header data and that too under "general" tab. i dont have data regarding that field.
    and when we enter a value for that field in migo, it has to take .
    thank you.

    Hi, My problem is allmost like the one you are discussing here....
    I have appended MKPF for my Z-fields and created a sub-screen (Design the screen). I am calling this screen in PBO_HEADER. Now i can see my newly created tab along with fields.
    Now the problem is:-
    1. How I can transfer that data entered in screen fields back to my BADI.
    2. How to update my z-fields in MKPF table along with standard fields. I have tried using FM - 'J_1IEXGM_BADI_POST_DOCUMENT' in Method - POST_DOCUMENT, but its not updating table record in MKPF for Z-Fields.
    Please advice.....
    Thanks

  • Service tax value required updating while posting GR in MIGO transaction

    Dear Friends,
    We have a following scenario where service tax value required updating while posting Goods Receipt MIGO transaction.
    1. Purchase Order created for first line item where Qty. 1 and Net Rate Rs.1000/- so total Gross value will be Rs.1000/- example Vendor XYZ
    2. Freight condition type maintained for the first line item for Rs.500/- and assigned to Transportation vendor ABC.
    3. When Goods Receipt Posted for the Material against PO first line item, the material value updates Rs.1500/- (Material value as 
        per PO + Freight Charges)
    4.  After posting GR while making Invoice verification through MIRO transaction against the PO GR/IR clearance will be done for 
        Material vendor XYZ. For transportation Vendor ABC Planned delivery cost indicator will be select and since service tax is
        applicable Service tax code will also select.
    Here the values of Service tax if the Material available in Stock it will be inventories. If stock consumed before making the Invoice verification for Transportation vendor ABC, then the Service tax values update to PRD account.
    We know that in PO, tax code can be select for first line item (Raw Material) Vendor XYZ and if transportation charge condition type maintained for same first line item and assigned to Vendor ABC and there is no provision to maintain Service tax. So the service tax will get inventories while posting Invoice Verification for the transportation vendor.
    We want the values of Service tax to update while posting Goods Receipt in MIGO transaction.
    Thanks & regards
    Dhanu

    hi,
    Please note at the time of MIGO Servecie tax value does not appear, it will appear at the tiem of Invoice only.
    Regards,
    Rama Mohan Bangaru

  • Error in FM RV_MESSAGE_UPDATE in MIGO transaction

    Hi,
    I am facing the the error in FM RV_MESSAGE_UPDATE for MIGO transaction as below:
    Report          SAPLMIGO
    Transaction     MIGO
    Error details   Class:     FPRUNX    
    Error Number:    102 - No job started
    Status : Update was terminated
    I have checked in SM13 transaction but I am not able to get the root cause for this error.
    Please advice.
    Ashish Dholi

    Maybe it's the ADSUSER issue, check this:
    http://scn.sap.com/message/8210637

  • Error in BED in MIGO transaction

    Hi Experts,
    The BED is getting populated for 1No. only. It is not getting multiplyed with the GR quantity.  We are using TAXINJ and
    please guide me how to resolve this.
    Thanks
    Ganesh

    Hi,
    Thanks for your quick reply, I have maintained tax code in PO, rate in FTXP & J1ID.  Is it required to maintain in FV11/13 for TAXINJ procedure?
    BED is coming to MIGO transaction for 1 quantity only. It is not getting muliplied by the GR quantity.
    Thanks
    Ganesh

  • Reg Dump in MIGO Transaction

    Hi all,
    When I am executing MIGO transaction in Pre-Production I am getting error as 'GETWA_NOT_ASSIGNED'. IF I check thru ST22, showing message as 'Field symbol has not yet been assigned'. Could anybody please assist in this regard.Thanks in advance.
    Thanks & Regards.
    I. Reddy Prasad

    Hi
    Pls check the following notes
    Note 496258 - MIGO: ABAP runtime error GETWA_NOT_ASSIGNED
    Note 712454 - MB1B/MIGO aborts with GETWA_NOT_ASSIGNED
    Note 979013 MIGO: Programmabbruch GETWA_NOT_ASSIGNED in LMIGOKC2
    Note 379448 GETWA_NOT_ASSIGNED for return delivery with MIGO
    Note 965675 MIGO: Termination after setting OK flag for tied empties
    Pls take opinion from SAP / Basis before implementing the note
    Regards
    Madhan

  • MIGO Transaction Error

    Dear All,
                 We are facing error in MIGO Transaction,after applying
    PATCHES In Development Server.
    The Particular Include-Program which is containing Data Variables after
    application of Notes was resetted.That Include program is not allowing
    to change also.It is giving following message.
    Carry out Modification Comparision for REPS LJ1IEXTOP First.No changes Possible.
        Please give suggestion accordingly.
    Thanks and Regards
       BalaNarasimman.M

    Hi BalaNarasimman,
    Normally after applying the patch try to do SPAU adjustment and retain the latest code (i,e If you have applied notes that is for latest package)..Else the OSS notes relevant to the package must be searched and it must be applied again. What is the error that you are getting..? What is the CIN package?
    Thank You.
    Regards,
    Uma

  • Restrict the user   based on document type on migo transaction-prepare GRN

    Hi,
    We are running ECC6.0 R/3 system.We had a requirement as follows
    In MIGO transaction , we want to restrict the user on document type i.e. we want that a particular user can  prepare GRN for document type  STO only. He cannot prepare GRN for other document type.
    We checked  SU24->maintain check indicators for transaction codes->enter migo->execute->check indicator.This returned us the authorisation objects present in Migo transaction.We checked the help of all these objects,but none of them we found suitable for above mentioned requirement.We were planning to find out the proper authorisation object to add to Profile generater.
    The following is the objects which we have checked for.
    A_B_ANLKL-->     Asset Postings: Company Code/Asset Class
    A_B_BWART-->     Asset Postings: Asset Class/Transaction Type
    B_USERSTAT-->     Status Management: Set/Delete User Status
    B_USERST_T-->     Status Management: Set/Delete User Status using Process
    C_AFKO_AWK-->     CIM: Plant for order type of order
    C_CACL_DSG-->     Interface Design
    C_DRAW_BGR-->     Authorization for authorization groups
    C_DRAW_DOK-->     Authorization for document access
    C_DRAW_TCD-->     Authorization for document activities
    C_DRAW_TCS-->     Status-Dependent Authorizations for Documents
    C_KLAH_BKP-->     Authorization for Class Maintenance
    C_STUE_BER-->     CS BOM Authorizations
    C_STUE_WRK-->     CS BOM Plant (Plant Assignments)
    C_TCLA_BKA-->     Authorization for Class Types
    C_TCLS_BER-->     Authorization for Org. Areas in Classification System
    C_TCLS_MNT-->     Authorization for Characteristics of Org. Area
    F_BKPF_BUK-->     Accounting Document: Authorization for Company Codes
    F_BKPF_BUP-->     Accounting Document: Authorization for Posting Periods
    F_BKPF_KOA-->     Accounting Document: Authorization for Account Types
    F_FICA_FOG-->     Funds Management: authorization group of fund
    F_FICA_FSG-->     Funds Management: authorization group for the funds center
    F_FICB_FKR-->     Cash Budget Management/Funds Management FM Area
    F_KNA1_APP-->     Customer: Application Authorization
    F_LFA1_APP-->     Vendor: Application Authorization
    F_SKA1_BUK-->     G/L Account: Authorization for Company Codes
    G_GLTP  -->       Spec. Purpose Ledger Database (Ledger, Record Type, 
                                   Version)
    J_1IDEP_SL-->     Authorization object for depot sale transaction
    J_1IEXC_OT-->     Authorization object for Other Excise Invoice Create
    J_1IEX_PST-->     Autorization object for posting Other Excise invoice
    J_1IGRPT1-->     Auth. for PART1 at GR
    J_1IINEX  -->            Incoming Excise Invoice
    J_1IRG23D-->     Authorisation object for Depo Transactions
    K_CCA-->                     CO-CCA:  Gen. Authorization Object for Cost Center 
                                    Accounting
    K_CSKS     -->                CO-CCA:  Cost Center Master
    K_CSKS_SET-->     CO-CCA: Cost Center Groups
    K_PCA-->                    EC-PCA: Responsibility Area, Profit Center
    L_TCODE-->                    Transaction Codes in the Warehouse Management System
    M_ANFR_BSA-->     Document Type in RFQ
    M_ANFR_EKG-->     Purchasing Group in RFQ
    M_ANFR_EKO-->     Purchasing Organization in RFQ
    M_ANFR_WRK-->     Plant in RFQ
    M_BEST_BSA-->     Document Type in Purchase Order
    M_BEST_EKG-->     Purchasing Group in Purchase Order
    M_BEST_EKO-->     Purchasing Organization in Purchase Order
    M_BEST_WRK-->     Plant in Purchase Order
    M_MATE_CHG-->     Material Master: Batches/Trading Units
    M_MATE_STA-->     Material Master: Maintenance Statuses
    M_MATE_WRK-->     Material Master: Plants
    M_MRES_BWA-->     Reservations: Movement Type
    M_MRES_WWA-->     Reservations: Plant
    M_MSEG_BMB     -->Material Documents: Movement Type
    M_MSEG_BWA-->     Goods Movements: Movement Type
    M_MSEG_BWE-->     Goods Receipt for Purchase Order: Movement Type
    M_MSEG_BWF-->     Goods Receipt for Production Order: Movement Type
    M_MSEG_LGO-->     Goods Movements: Storage Location
    M_MSEG_WMB-->     Material Documents: Plant
    M_MSEG_WWA-->     Goods Movements: Plant
    M_MSEG_WWE-->     Goods Receipt for Purchase Order: Plant
    M_MSEG_WWF-->     Goods Receipt for Production Order: Plant
    M_RAHM_BSA-->     Document Type in Outline Agreement
    M_RAHM_EKG-->     Purchasing Group in Outline Agreement
    M_RAHM_EKO-->     Purchasing Organization in Outline Agreement
    M_RAHM_WRK-->     Plant in Outline Agreement
    Q_TCODE     QM -->         Transaction Authorization
    S_ADMI_FCD-->     System Authorizations
    S_ALV_LAYO-->     ALV Standard Layout
    S_BDS_DS-->     BC-SRV-KPR-BDS: Authorizations for Document Set
    S_BTCH_ADM-->     Background Processing: Background Administrator
    S_BTCH_JOB-->     Background Processing: Operations on Background Jobs
    S_CTS_ADMI-->     Administration Functions in Change and Transport System
    S_DATASET-->     Authorization for file access
    S_DEVELOP-->     ABAP Workbench
    S_DOKU_AUT-->     SE61 Documentation Maintenance Authorization
    S_GUI-->                     Authorization for GUI activities
    S_OC_DOC-->     SAPoffice: Authorization for an Activity with Documents
    S_OC_ROLE-->     SAPoffice: Office User Attribute
    S_OC_SEND-->     Authorization Object for Sending
    S_PACKSTRU-->     Internal SAP Use: Package Structure
    S_PRO_AUTH-->     IMG: New authorizations for projects
    S_RFC-->                     Authorization Check for RFC Access
    S_SCD0     -->                Change documents
    S_SPO_DEV-->     Spool: Device authorizations
    S_TABU_DIS-->     Table Maintenance (via standard tools such as SM30)
    S_TCODE     -->                Transaction Code Check at Transaction Start
    S_TRANSLAT-->     Translation environment authorization object
    S_TRANSPRT-->     Transport Organizer
    S_WFAR_OBJ-->     ArchiveLink: Authorizations for access to documents
    V_LIKP_VST-->Delivery: Authorization for Shipping Points
    V_VBAK_AAT-->Sales Document: Authorization for Sales Document Types
    V_VBAK_VKO-->Sales Document: Authorization for Sales Areas

    Have you executed a trace while a functional user executes the transaction code for the specific parameters? (i.e. document type). The trace will then show which objects are being checked; then look at the object documentation in txn Su21 to determine if there are any ways to restrict on the particular value; in some cases, if the authorization group field is being checked, additional configuration is needed in order to implement the security (Su21 will explain in detail for the particular object).

  • Bapi for migo transaction

    i have created a bapi to upload data for MIGO transaction.. (GOODS RECEIPT-->PURCHASE ORDER)
    i am getting the error " stock posting is not possible for this material "'.
    when i create directly, it is posted.. while uploading through the program it shows the above error.
    please suggest if anyone knows....
    Thanks in advance,
    Dhivya N.

    *& Report  ZR_MIGO_UPLOAD
    *& package name : zabap
    *& transport request number : MIDK901443
    *& program to upload goods movement
    REPORT ZR_MIGO_UPLOAD.
    ***DATA DECLARATION***
    type-POOLs:  icon.
    TYPES: BEGIN OF TY_GR_PO,
            EBELN(10) TYPE c ,     "'PO NUMBEr
            EBELP(10) TYPE c,     "PO ITEM NUMBER
    *       LGOBE TYPE LGOBE,     "STORAGE LOCATION DESCRIPTION
            LGORT(10) TYPE c,     "STORAGE LOCATION
            XFELD TYPE c,     "ITEM OK
            GERNR(10) TYPE c,     "SERIALNUMBER
            END OF TY_GR_PO.
    DATA: TA_GR_PO TYPE TABLE OF TY_GR_PO,    "TABLE FOR GOODS RECEIPT PURCHASE ORDER
           WA_GR_PO TYPE TY_GR_PO.
    DATA: BLDAT TYPE BLDAT,     "DOCUMENT DATE
            BUDAT TYPE BUDAT,     "POSTING DATE
            WEVER TYPE WEVER.     "VERSION FOR PRINTING GR SLIP
    ***BAPI DECLARATION***
    DATA: BEGIN OF GM_HEAD OCCURS 0.                    "Material Document Header Data
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_01.
    DATA: END OF GM_HEAD.
    DATA: BEGIN OF GM_CODE OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_CODE.          "Assign Code to Transaction for Goods Movement
    DATA: END OF GM_CODE.
    DATA: BEGIN OF GM_RET OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_RET.       "Material Document Number/Material Document Year
    DATA: END OF GM_RET.
    DATA: BEGIN OF GM_ITEM OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE.    "Material Document Items
    DATA: END OF GM_ITEM.
    DATA: BEGIN OF GM_SER OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_SERIALNUMBER.    "Serial Number
    DATA: END OF GM_SER.
    data: BEGIN OF ta_bapireturn OCCURS 0.
            INCLUDE STRUCTURE BAPIRET2.
    data: END OF ta_bapireturn.
    ***declaration of excel file handling table***
    FIELD-SYMBOLS: <fs> type any.    "field symbol for alsm_excel
    DATA: TA_EXCEL TYPE TABLE OF ALSMEX_TABLINE,  "table to contain excel sheet values
           WA_EXCEL TYPE ALSMEX_TABLINE.
    ***declaration of other parameters***
    data:       V_brow type i VALUE    2,    "BEGIN OF ROW
                 V_bcol type i value   1,     "BEGIN OF COL
                 V_erow type i value 65536,   "END OF ROW
                 V_ecol type i value 256.     "END OF COLUMN
    DATA:  V_sear type string,
            V_INDEX TYPE i,
            V_tabix type sy-tabix,     "current line.
            v_lines type i.          "total number of records
    DATA: DATE TYPE DATS.
    ***SELECTION SCREEN***
    ***SELECTION SCREEN DESIGN***
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 3.
    PARAMETERS: zCODE(2) TYPE C MATCHCODE OBJECT H_T158G,
                 zrefdoc type REFDOC,
                 version type WEVER.
    SELECTION-SCREEN skip 5.
    PARAMETERS: p_file type ibipparms-path.
    SELECTION-SCREEN SKIP 3.
    SELECTION-SCREEN END OF BLOCK b1.
    ***SELECTION SCREEN VALUE REQUEST***
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
       CALL FUNCTION 'F4_FILENAME'                                    "f4 help for file name
         EXPORTING
           PROGRAM_NAME  = SYST-CPROG
           DYNPRO_NUMBER = SYST-DYNNR
           FIELD_NAME    = 'P_FILE'
         IMPORTING
           FILE_NAME     = P_FILE.
    ***SELECTION SCREEN EVENT***
    AT SELECTION-SCREEN.                                 "validation
       if p_file <> ''.
         V_sear = p_file.
         SEARCH V_sear for '.xls'.
         if sy-subrc <> 0.
           message 'please provide excel file. it is not valid' type 'E'.
         ENDIF.
       ENDIF.
    INITIALIZATION.
    *   DATE = '17.04.14'.
       GM_HEAD-PSTNG_DATE = SY-DATUM.
       GM_HEAD-DOC_DATE   = SY-DATUM.
       gm_head-pr_uname = sy-uname.
    ***START OF SELECTION***
    START-OF-SELECTION.
       gm_head-REF_DOC_NO = zrefdoc.
       gm_head-VER_GR_GI_SLIP = version.
       GM_CODE-GM_CODE = zCODE.
       PERFORM EXCEL_UPLOAD.
       PERFORM EXCEL_CONVERSION.
       PERFORM NO_RECORDS.
    END-OF-SELECTION.
       PERFORM BAPI_ASSIGNMENT.
       PERFORM BAPI_FM.
    *&      Form  EXCEL_UPLOAD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_UPLOAD .
       CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
         EXPORTING
           FILENAME                = P_FILE
           I_BEGIN_COL             = V_BCOL
           I_BEGIN_ROW             = V_BROW
           I_END_COL               = V_ECOL
           I_END_ROW               = V_EROW
         TABLES
           INTERN                  = TA_EXCEL
         EXCEPTIONS
           INCONSISTENT_PARAMETERS = 1
           UPLOAD_OLE              = 2
           OTHERS                  = 3.
    ENDFORM.                    " EXCEL_UPLOAD
    *&      Form  EXCEL_CONVERSION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_CONVERSION .
       if ta_excel is NOT INITIAL.
         sort ta_excel by row col.
         clear wa_excel.
         clear wa_GR_PO.
         LOOP AT ta_excel INTO wa_excel.
           move wa_excel-col to v_index.
           ASSIGN COMPONENT v_index OF STRUCTURE wa_GR_PO to <fs>.
           if sy-subrc = 0.
             move wa_excel-value to <fs>.
           ENDIF.
           at END OF row.
             append wa_GR_PO to ta_GR_PO.
             clear wa_GR_PO.
           ENDAT.
         ENDLOOP.
       else.
         MESSAGE 'no data for conversion' type 'I'.
       ENDIF.
    ENDFORM.                    " EXCEL_CONVERSION
    *&      Form  NO_RECORDS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM NO_RECORDS .
       DESCRIBE TABLE ta_GR_PO LINES v_lines.
       if v_lines = 0.
         MESSAGE 'NO RECORDS TO UPLOAD' TYPE 'E'.
       ENDIF.
    ENDFORM.                    " NO_RECORDS
    *&      Form  BAPI_ASSIGNMENT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_ASSIGNMENT .
       IF TA_GR_PO IS NOT INITIAL.
         LOOP AT TA_GR_PO INTO WA_GR_PO.
           gm_item-PO_NUMBER = wa_gr_po-ebeln.
           GM_ITEM-STGE_LOC = WA_GR_PO-LGORT.
           GM_ITEM-PO_ITEM = WA_GR_PO-EBELP.
           GM_ITEM-NO_MORE_GR = 'X'."WA_GR_PO-XFELD'.
    *      GM_SER-SERIALNO = WA_GR_PO-GERNR.
           gm_item-NO_MORE_GR =  1.
           gm_item-ENTRY_QNT = 2.
           gm_item-MOVE_TYPE = 101.
    *      gm_item-MVT_IND = 'B'.
           gm_item-plant = 'P001'.
           gm_item-move_stloc = 'FG01'.
    *      GM_ITEM-SPEC_STOCK = 'K'.
           APPEND GM_ITEM.
           APPEND GM_SER.
         ENDLOOP.
        ELSE.
          MESSAGE 'DATA IS NOT UPLOADED' TYPE 'I'.
        ENDIF.
    ENDFORM.                    " BAPI_ASSIGNMENT
    *&      Form  BAPI_FM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_FM .
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
       EXPORTING
         GOODSMVT_HEADER               = gm_head
         GOODSMVT_CODE                 = gm_code
    *   TESTRUN                       = ' '
    *   GOODSMVT_REF_EWM              =
      IMPORTING
        GOODSMVT_HEADRET              = gm_ret
    *   MATERIALDOCUMENT              =
    *   MATDOCUMENTYEAR               =
       TABLES
         GOODSMVT_ITEM                 = gm_item
        GOODSMVT_SERIALNUMBER         =  gm_ser
         RETURN                        = ta_bapireturn
    *   GOODSMVT_SERV_PART_DATA       =
    *   EXTENSIONIN                   =
    if ta_bapireturn-type = 'S'.
         write:/ icon_green_light as icon,
                 'success: Material document',gm_ret-mat_doc,  'is created for the GOODS RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ELSEIF ta_bapireturn-type = 'E'.
         write:/ icon_red_light as icon,
                 'error: Material document',gm_ret-mat_doc , 'is not created for the GOOD RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ENDIF.
    ENDFORM.                    " BAPI_FM

Maybe you are looking for

  • Printing problem on HP Deskjet 6980

    When printing from Illustrator or InDesign CS2 with text or a graphic that has been copied and pasted to a different spot in the same document page, the HP Deskjet 6980 will not print the copied version in the lower right quarter of the page. Very st

  • Screwed up installing ram

    I got a 512 stick of ram for christmas and was told i could have my 2x 256 chips in 2 of the bays and 1 512 in the other as long as they matched total amounts well i know this is horridly wrong now and for some reason my monitor has no video and my u

  • HELP! Our IT guy left & I have a small change to make in photoshop and am clueless!

    I simply have to change a number on an image that is in photoshop then post it to our web page. Have the image but no clue what to do!! I am not an IT person at all - just need a little assistance as this is time sensitive!

  • Disable automatic entries in add or remove programs

    We're deploying an app via JWS, running JWS 1.5.0_08. JWS automatically creates an entry in Windows "Add or Remove Programs" area for each jnlp we deploy. The customer doesn't want to see these entries. Is there a way to disable this feature of JWS?

  • Formula date+90 conditional question

    I have a list that takes an Open Date and adds 90 days to set a due date: =[Open Date]+90 However, many of the Open Dates are years old. I've been asked to change it so that dates created before May 31, 2014, should default to August 31, 2014. I'm th