Re:me21 transaction

hi Experts,
My requirement is to create PO with item level and service . so  i have done a recording for me21 transaction
for that i have created a BDC.but in the coding, in the service table ,once 8 services will be uploaded then i have done a page down option but that service screen is varying when i execute that BDC in background (i.e screens are dynamically changing
it s not similar to what i have done in recording ).
could you please help me out to solve this issue?
Thanks & Regards,
R.Dhineshraj.

Hi,
Use BAPI_PO_CREATE1
Check this code
CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER          = BAPI_HEAD
        POHEADERX         = BAPI_HEADX
      TABLES
        RETURN            = IT_RET
        POITEM            = IT_ITEM
        POITEMX           = IT_ITEMX
        POADDRDELIVERY    = it_addrdel
        POSCHEDULE        = it_sched
        POSCHEDULEX       = it_schedx
        POACCOUNT         = IT_ACCT
        POACCOUNTX        = IT_ACCTX
        POCOND            = IT_COND
        POCONDX           = IT_CONDX
        POLIMITS          = IT_LIMITS
        POCONTRACTLIMITS  = IT_C_LIM
        POSERVICES        = IT_SERV
        POSRVACCESSVALUES = IT_SRV
        POTEXTHEADER      = IT_HTEXT
        POTEXTITEM        = IT_ITEXT.
Note : Please take care of list of things for service PO
1) Give Package No(PCKG_NO) in IT_ITEM table for each item increment it by 2 and similarly sub package also by 2 which u will be giving in IT_SERV and IT_SRV.
2)  For Reference use BAPI_PO_GETDETAIL and execute it se37.Give some existing PO no and mark X for whatever table data u require.After executing check the  PO_ITEMS,PO_ITEM_SERVICES and  PO_ITEM_SRV_VALUES table.Uwill come how it works.
Regards,
Manesh.R

Similar Messages

  • In the initial screen of  ME21 transaction i want a user exit

    In the initial screen of  ME21 transaction i want a user exit
    which can popup a message once document type is given and press enter.

    hey guys try with Function exit EXIT_SAPMM06E_006
    and implement ZXM06U36.
    thanks guys i my self found the solution

  • Where is the Memory field in EKKO table located in ME21 transaction

    Hi,
    there is a field memory in the EKKO table . What is purpose of that field . Where can i find that field in ME21N transaction.

    Hi Josephine,
       The Dataelement documentation says as follows:
    <i><b>"You can use the Hold function to store faulty or incomplete purchase
    orders in the SAP System.
    You can then continue processing or complete these POs that you have put
    "on hold" in this way at some later date.
    A PO that is on hold is not transmitted to the vendor. It is, however,
    MRP-relevant.
    The following functions are not not possible in the case of a PO that is
    on hold:
    o   Message output (printing or transmission of documents in message
        form)
    o   Posting a goods receipt
    o   Posting an invoice
    Note:
    If a PO has been saved, it cannot later be processed using the Hold
    function."</b></i>
    Regards,
    Ravi

  • Screen exit (for newTabstrip) for ME21 TRANSACTION CODE AT ITEM LEVEL

    Hi All ABAPERS,
    I had a urgent requirement that I need to provide new tabstrip in ME21 tcode at ITEM level.
    note: not in Item overview.
    So, friends could you please tell me what is the screen exit for it and if you have steps for it please give me the solution as early as possible and good points will be rewarded.

    use this enhamcement MM06E005
    go to se51 give program name SAPLXM06 and create 0111 screen and mention subscreen under attributes of screen.
    and go to layout define ur fields in the layout..
    use exit_sapmm06e_013 for getting data .
    also create ci_ekpo structrure and write the req logic to update that strucutre so that values will go and sit in stadard ekpo table.
    after creating that structure dont forget to activate ekpo thr se14.
    and go to se80 and give function group of exit_sapmm06e_013(this fm) and u will find under includes some z*top where u can declare all ur screen fields .

  • Creating PO with me21 using call transaction

    hi,
    I need some help regarding the application:
    i have to build a custom screen having fields for creating PO using me21 transaction using call transaction.
    would anybdy please guide me how to do it.
    i wd appreciate ur help

    Hi Harpreet
               For creating a custom screen you will ve to use a screen exit. For purchase order 'MM06E005' will be useful. Explore it in XN SMOD.
    Regards
    PRAFUL

  • BDC FOR ME21

    Hi ALL,
    Iam Creating BDC Program bu using ME21 for Uploading PO.
    Iam getting error at Income term2 in the Second Screen of ME21. Iam Passing this value through Excel Sheet But event then it is not picking. When i check in debugging the value of income term2 is populating.
    Let me know what are the mandotory fields for creating PO using Me21.
    Here iam also attaching the code, Please help us because it is very urgent.
    report ZPOUPLOADME21
           no standard page heading line-size 255.
    *include bdcrecx1.
    INCLUDE YMM_BDCRECX1.
    Internal Table T_BDCDATA to store BDC data
           Batchinputdata of single transaction
    DATA:   T_BDCDATA LIKE BDCDATA  OCCURS 0 WITH HEADER LINE.
    Internal Table T_BDC_MSG to store BDC messages
    DATA:   T_BDC_MSG LIKE STANDARD TABLE OF BDCMSGCOLL INITIAL
            SIZE 0 WITH HEADER LINE.
    DATA:   V_FILE LIKE RLGRAP-FILENAME ,
            V_COUNT(5) TYPE C,
            V_MESSAGE_CNT(5) TYPE C .
    DATA : BEGIN OF IT_DATA OCCURS 0,
           LIFNR LIKE EKKO-LIFNR,      " Vendor
           BSART LIKE RM06E-BSART,     " Order Type
           BEDAT(10) TYPE C,           " Date
           EKORG LIKE EKKO-EKORG,      " Purchasing Organization
           EKGRP LIKE EKKO-EKGRP,      " Purchasing Group
           WERKS LIKE RM06E-WERKS,     " Plant
           INCO2 LIKE EKKO-INCO2,      " Inco Terms
           KNTTP LIKE EKPO-KNTTP,      " A/C Assignment Category
           EMATN LIKE EKPO-EMATN,      " Material Number
           MENGE LIKE EKPO-MENGE,      " Purchase Order Quantity
           NETPR LIKE EKPO-NETPR,      " Net Price
           MWSKZ LIKE EKPO-MWSKZ,      " Tax Code
           NPLNR LIKE MSEG-NPLNR,      " Network
           VORNR LIKE PSORDER-VORNR,   " Operation
           END OF IT_DATA.
    START-OF-SELECTION.
         PERFORM OPEN_GROUP.
         PERFORM DATA_UPLOAD.
         PERFORM CALL_TRANSACTION.
         PERFORM CLOSE_GROUP.
         PERFORM WRITE_ERROR.
    *&      Form  DATA_UPLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM DATA_UPLOAD.
    *call function ws_upload to retrieve data from a flat file in the
    *presentation server into an internal table
      CALL FUNCTION 'UPLOAD'
           EXPORTING
                FILENAME                = V_FILE
                FILETYPE                = 'DAT'
           TABLES
                DATA_TAB                = IT_DATA
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                INVALID_TABLE_WIDTH     = 2
                INVALID_TYPE            = 3
                NO_BATCH                = 4
                UNKNOWN_ERROR           = 5
                GUI_REFUSE_FILETRANSFER = 6
                OTHERS                  = 7.
    if ws_upload fails then display appropriate message
      IF SY-SUBRC <> 0.
       MESSAGE E000  WITH 'Data not Uploaded into internal table'.
      ENDIF.
    ENDFORM.                    " DATA_UPLOAD
    *&      Form  CALL_TRANSACTION
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_TRANSACTION.
      DATA : V_IVDAT(10) TYPE C,
             V_AKTIV(10) TYPE  C,
             V_MESSAGE(404) TYPE C.
      REFRESH T_BDCDATA.
      CLEAR T_BDCDATA.
      V_COUNT = 0.
      V_MESSAGE_CNT = 0.
      LOOP AT IT_DATA .
        V_COUNT = V_COUNT + 1.
    *perform open_group.
    perform bdc_dynpro      using 'SAPMM06E' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM06E-WERKS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'EKKO-LIFNR'
                                  IT_DATA-LIFNR.
    perform bdc_field       using 'RM06E-BSART'
                                  IT_DATA-BSART.
    *perform bdc_field       using 'RM06E-BEDAT'
                                 '24.01.2008'.
    perform bdc_field       using 'RM06E-BEDAT'
                                  IT_DATA-BEDAT.
    perform bdc_field       using 'EKKO-EKORG'
                                  IT_DATA-EKORG.
    perform bdc_field       using 'EKKO-EKGRP'
                                  IT_DATA-EKGRP.
    *perform bdc_field       using 'RM06E-LPEIN'
                                 'T'.
    perform bdc_field       using 'RM06E-WERKS'
                                  IT_DATA-WERKS.
    perform bdc_dynpro      using 'SAPMM06E' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EKKO-INCO2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'EKKO-EKGRP'
                                 IT_DATA-EKGRP1. "'SP3'.
    *perform bdc_field       using 'EKKO-PINCR'
                                 IT_DATA-PINCR. "'10'.
    *perform bdc_field       using 'EKKO-SPRAS'
                                 IT_DATA-SPRAS. "'EN'.
    *perform bdc_field       using 'EKKO-UPINC'
                                 IT_DATA-UPINC. "'1'.
    *perform bdc_field       using 'EKKO-ZTERM'
                                 IT_DATA-ZTERM.
    *perform bdc_field       using 'EKKO-WAERS'
                                 IT_DATA-WAERS. "'INR'.
    *perform bdc_field       using 'EKKO-ZBD1T'
                                 IT_DATA-ZBD1T. "'44'.
    *perform bdc_field       using 'EKKO-WKURS'
                                 IT_DATA-WKURS. "' 1.00000'.
    *perform bdc_field       using 'EKKO-INCO1'
                                 IT_DATA-INCO1.
    perform bdc_field       using 'EKKO-INCO2'
                                  IT_DATA-INCO2.
    perform bdc_dynpro      using 'SAPMM06E' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EKPO-NETPR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'EKPO-KNTTP(01)'
                                 'N'.
    perform bdc_field       using 'EKPO-KNTTP(01)'
                                  IT_DATA-KNTTP.
    perform bdc_field       using 'EKPO-EMATN(01)'
                                  IT_DATA-EMATN.
    perform bdc_field       using 'EKPO-MENGE(01)'
                                  IT_DATA-MENGE.
    perform bdc_field       using 'EKPO-NETPR(01)'
                                  IT_DATA-NETPR.
    perform bdc_dynpro      using 'SAPMM06E' '0111'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EKPO-MWSKZ'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'EKPO-KNTTP'
                                 'N'.
    *perform bdc_field       using 'EKPO-TXZ01'
                                 'Clamps & Connector'.
    *perform bdc_field       using 'EKPO-MENGE'
                                 '4'.
    *perform bdc_field       using 'EKPO-SPINF'
                                 'A'.
    *perform bdc_field       using 'EKPO-NETPR'
                                 '100.00'.
    *perform bdc_field       using 'EKPO-PEINH'
                                 '1'.
    *perform bdc_field       using 'EKPO-BPRME'
                                 'NO'.
    *perform bdc_field       using 'EKPO-BPUMN'
                                 '1'.
    *perform bdc_field       using 'EKPO-BPUMZ'
                                 '1'.
    *perform bdc_field       using 'EKPO-PRSDR'
                                 'X'.
    *perform bdc_field       using 'RM06E-EEIND'
                                 '24.01.2008'.
    *perform bdc_field       using 'RM06E-LPEIN'
                                 'D'.
    *perform bdc_field       using 'EKPO-WEPOS'
                                 'X'.
    perform bdc_field       using 'EKPO-MWSKZ'
                                  IT_DATA-MWSKZ.
    *perform bdc_field       using 'EKPO-REPOS'
                                 'X'.
    perform bdc_dynpro      using 'SAPMM06E' '0511'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EKKN-SAKTO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    *perform bdc_field       using 'EKKN-SAKTO'
                                 '6034025'.
    *perform bdc_field       using 'DKACB-FMORE'
                                 'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'COBL-VORNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-NPLNR'
                                  IT_DATA-NPLNR.
    perform bdc_field       using 'COBL-VORNR'
                                  IT_DATA-VORNR.
    perform bdc_dynpro      using 'SAPMM06E' '0111'.
    perform bdc_dynpro      using 'SAPMM06E' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM06E-EBELP'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    *perform bdc_field       using 'RM06E-EBELP'
                                 '10'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'ME21'.
    perform close_group.
    LOOP AT T_MESSTAB WHERE REC_NO IS INITIAL.
        AT FIRST.
          V_MESSAGE_CNT = V_MESSAGE_CNT + 1.
          T_MESSTAB-REC_NO = V_COUNT.
        ENDAT.
          MODIFY T_MESSTAB TRANSPORTING REC_NO.
        ENDLOOP.
        REFRESH T_BDCDATA.
        CLEAR T_BDCDATA.
    ENDLOOP.
      SKIP.
      WRITE : /10 'Record Number ', 30 'Error Message'.
      SKIP.
    endform.
    *&      Form  WRITE_ERROR
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_ERROR.
      LOOP AT T_MESSTAB.
        WRITE : /10 T_MESSTAB-REC_NO , 30 T_MESSTAB-MESSAGE.
      ENDLOOP.
      ULINE /10(100).
      WRITE : /10 'No of Records : ' , V_COUNT.
      WRITE : /10 'No of Erroneous Records : ' , V_MESSAGE_CNT.
      ULINE /10(100).
    ENDFORM.                    " WRITE_ERROR
    *&      Form  CHECK_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM CHECK_BDC.
    DATA: L_CHECK LIKE YMMT_CHECK_BDC-YCHECK.
      SELECT SINGLE YCHECK INTO L_CHECK FROM YMMT_CHECK_BDC
                                         WHERE PROGRAMM EQ SY-REPID
                                           AND YCHECK EQ 'X'.
      IF SY-SUBRC NE 0.
        MESSAGE S000(YM) WITH 'Execution not possible'.
        STOP.
      ENDIF.
    ENDFORM.                    " CHECK_BDC
    Answers will be awarded
    Thanks
    Rahul

    It is going into the second screen but whatever the value iam passing to incoterms2 it sis not populating when i run program, but in debugging value is coming.
    Is there any possibility of user exits attached to this ME21 transaction
    please advice
    thanks
    Madhukar Reddy

  • Upload Of Transaction Data Using E-CATT

    Dear All,
          I am trying to upload purchase order Data for transaction ME21 through E-catt. But I am not able to upload multiple line item data as the Test Script allows only one item data to be uploaded because I have uploaded only one item data in my recording. So I am not able to upload multiple line item data. Can anybody help me with the steps to upload multiple line item data for ME21 transaction through E-CATT.

    Hi,
    Did you solve this problem of uploading more than 1 line item? If you have solved, please share me your solution as Im also encountering the same problem. Thanks in advance for your help!

  • ME21 and ML81n

    Dear friends,
    I am trying to do BDC for ME21 and ML81n in the same program.
    I tried this in Call transaction and Session method. As the limitation of call transaction is we can not do multiple transactions in call transactions in back ground.
    That is why i have choosen Session.
    The problem here is i have to create service entry sheet for the PO which is created in ME21. That means i need to capture the PO number from ME21 transaction, while running session.
    Is that Possible?  If you know an Solutions for this please reply.
    Thank you.

    Hi pradeep ramakrishna,
    Firstly, can u paste piece of code how are you doing ME21 and ML81 in one Program.
    If that can bone ... In ME21 for PO the Batch Input Screen field is RM06E-BSTNR and In ML81 for PO no. the Batch Input Screen field is P_BSTNR.
    so you can pass RM06E-BSTNR  in temp_po and then this PO to P_BSTNR.
    Revert me for any quiries.
    Regards,
    Suneel G

  • Message type in BDCMSGCOLL Structure in Call transaction using BDCDATA

    Hi,
    We are facing issue while capturing message in BDCMSGCOLL structure in Call transaction using bdcdata. The message which are like
    Message 'Message Text' Type 'S' Display LIke 'E' .
    This message is captured as Success on the Message structure instead of error & user are asking to update it as Error as it is looking like Error message to the end user.
    Please provide resolution to the issue.
    Regards,
    Kapil

    Hi Venkat,
    I am not doing any upload, i am just doing a replay of the transaction ME21 & in that there are many error message which encounter while creating a PO but when i have check the logic , they are basically a success message which are display like Error so when i have called ME21 transaction using below statement
    call transaction ME21 using BDCDATA
                                            into messages bdcmsgcoll.
    I am getting the message as success only since the message are of type success but as they are display like E , so user want that in msgcoll structure these messages must be shown as Error.
    Regards,
    Kapil.

  • Holding a PO in ME21

    Hi!
    Please look at the following business scenario.
    A PO is created using the transaction ME21. Now if a particular check fails for any item in the purchase order, I am supposed to put the PO on hold status/ block it somehow and update a custom table with the held PO number.
    Now here is my issue.
    After hunting around for quite a bit, I found out that  in ME21N the PO can be held using the check method of the badi ME_PROCESS_CUST by setting the ch_failed flag. However, I am supposed to use ME21 transaction and not the enjoy transaction, as it is a third party order. In case of ME21 this badi will not be triggered at all. I have looked around for quite some time and I am not able to find it.
    Can someone tell me of any user exit/ badi/ form exit for me to achieve the same? Please not that a PO number must be generated and I should not simply throw an error message to the user.

    Hi,
    Try this code..I have used memory pointers....
    In the userexit EXIT_SAPMM06E_012
    DATA lwa_ekpo LIKE bekpo.
    data lw_field(50).
    FIELD-SYMBOLS <t_xekpo> TYPE STANDARD TABLE.
    IF sy-tcode = 'ME21'.
      lw_field = '(SAPLMEPO)POT[]'.
      ASSIGN (lw_field) TO <t_xekpo>.
      if sy-subrc ne 0.
        lw_field = '(SAPMM06E)POT[]'.
        ASSIGN (lw_field) TO <t_xekpo>.
       if sy-subrc <> 0.
         message e208(00) 'Couldn't find POT'.
       endif.
      endif.
      loop at <t_xekpo> into lwa_ekpo.
    Check the conditions..
    example..
    <b>    if lwa_ekpo-menge > '100.000'.
    Block the PO line item..
          lwa_ekpo-loekz = 'S'.
          MODIFY <t_xekpo> from lwa_ekpo transporting loekz.
        endif.</b>
      endloop.
    ENDIF.
    Hope this helps..
    Thanks,
    Naren

  • BADI in ME21

    Can any one tell me what are the BADIs available in ME21 transaction?
    I need to do some screen modification in the table control in ME21 .
    Regards,
    Sujatha.

    the BADIs in ME21 are
    ME_PROCESS_REQ                          Enhancements for Processing Enjoy PReqs: Internal             
    ME_PROCESS_PO_CUST                      Enhancements for Processing Enjoy Purchase Order: Customer    
    ME_PROCESS_PO                           Enhancements for Processing Enjoy Purchase Order: Intern.     
    ME_PROCESS_COMP                         Processing of Component Default Data at Time of GR: Customer  
    ME_PO_SC_SRV                            BAdI: Service Tab Page for Subcontracting                     
    ME_HOLD_PO                              Hold Enjoy Purchase Orders: Activation/Deactivation           
    ME_GUI_PO_CUST                          Customer's Own Screens in Enjoy Purchase Order                
    ME_DEFINE_CALCTYPE                      Control of Pricing Type: Additional Fields                    
    ME_COMMTMNT_REQ_RE_C                    Check of Commitment Relevance of Purchase Requisitions        
    ME_COMMTMNT_REQ_RELE                    Check of Commitment Relevance of Purchase Requisitions        
    ME_PROCESS_REQ_CUST                     Enhancements for Processing Enjoy PReqs: Customer             
    ME_PURCHDOC_POSTED                      Purchasing Document Posted                                    
    ME_RELEASE_CREATE                       BAdI: Release Creation for Sched. Agreemnts with Rel. Docs    
    ME_REQ_OI_EXT                           Commitment Update in the Case of External Requisitions        
    ME_REQ_POSTED                           Purchase Requisition Posted                                   
    ME_TAX_FROM_ADDRESS                     Tax jurisdiction code taken from address                      
    ME_TRIGGER_ATP                          Triggers New ATP for Changes in EKKO, EKPO, EKPV              
    MM_EDI_DELFOR_OUT                       Enhancements for IDoc Output of SA Releases: Internal         
    MM_EDI_DESADV_IN                        Supplementation of Delivery Interface from Purchase Order     
    MM_EDI_ORDERS_OUT                       Enhancements for IDoc Output of Purchase Order: Internal      
    SMOD_MRFLB001                           Control Items for Contract Release Order                      
    ME_COMMTMNT_PO_REL_C                    Check for Commitment-Relevance of Purchase Orders             
    EXTENSION_US_TAXES                      Extended Tax Calculation with Additional Data                 
    MEGUI_LAYOUT                            BAdI for Enjoy Purchasing GUI                                 
    ME_ACTV_CANCEL_PO                       BAdI for Activating the Cancel Function at Header Level       
    ME_BAPI_PR_CHANGE_01                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Change)   
    ME_BAPI_PR_CHANGE_02                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Change)   
    ME_BAPI_PR_CREATE_01                    BAdI: Enjoy BAPIs for Purchase Requisitions                   
    ME_BAPI_PR_CREATE_02                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Create)   
    ME_BSART_DET                            Change document type for automatically generated POs          
    ME_CCP_ACTIVE_CHECK                     BAdI to check whether CCP process is active                   
    ME_CCP_BESWK_AUTH_CH                    BAdI for authorization checks for procuring plant             
    ME_CCP_DEL_DURATION                     Calc. of Delivery Duration in CCP Process (Not in Standard)   
    ME_CHANGE_CHARACTER                     Customer-Specific Characteristics for Product Allocation
    ME_CHECK_ALL_ITEMS                      Run Through Items Again in the Event of Changes in EKKO    
    ME_CHECK_SOURCES                        Additional Checks in Source Determination/Checking         
    ME_CIN_LEINRF2R                         BADI for CIN India - Delivery charges                      
    ME_CIN_LEINRF2V                         BADI for LEINRF03 excise_invoice_details                   
    ME_CIN_MM06EFKO                         Copy PO data for use by Country version India              
    ME_CIP_ALLOW_CHANGE                     Configuration in Purchasing: Changeability Control         
    ME_CIP_REF_CHAR                         Facilitates Reference Characteristics in Purchasing        
    ME_COMMITMENT_STO_CH                    BadI for checking if commitments for STOs are active       
    ME_COMMTMNT_PO_RELEV                    Check for Commitment-Relevance of Purchase Orders
    Hi Also please find the following code useful to find the User Exits and BADIs for a Transaction
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.

  • Technical difference between SAP enjoy transaction and Old transaction

    Can some one detail out technical differences betwwen SAP enjoy transaction ( like ME21N) and normal old transaction( like ME21). Specially I want to know the difference between user exits for two transaction .

    First the user exits will be the same, the reason is that you must get the same result whether you use the ME21 or the ME21N.   The difference is the UI, or user interface, the enjoy transaction leverages the new control framework which was introduced in 4.6.  These controls include  tree controls, alv grid controls, docking controls, picture controls, etc.  All which can be found in the ME21N.   The ME21 transaction uses the classic dynpro technology without using the control framework.
    Regards,
    Rich Heilman

  • ME21 User Exit to check/validate WEPOS field

    We want to use ME21 transaction for simple purchasing
    We want to build a small enhancement to check the GR indicator (WEPOS) based upon a threshold order value
    Does anyone know a user exit, badi or alternative that will allow us to import and export this value?
    Thanks
    Steve

    Dear Steve,
    If there's a requirement to change the indicator agains a specific condition, you can define the condition in the exit, then create a Z* program that contrain a BDC of change PO (ME22), and in the Z* program you can check to the exit condition, if its meet than the GR indicator can be unticked, cause you'll need also to check , whether GR has take place for the PO or not and other condition, so you need to things to do.
    1. add condition logic in the exit
    2. create a Z* program to change the WEPOS flag(using BDC code ME22--> its more recommend cause you use the standard SAP trx) and you can schedule the Z* program to run background.
    Regards,
    w1n

  • Restriction of PR Qty in PO

    Hi All
    Here the requirement is, PO qty Should not increase PR Qty for this message ME 06 076 has been set as Error message & it is not allowing PO Qty more than PR Qty in ME 21N transaction, but same message is not appering in ME21 Transaction & allowing PO Qty more than PR QTY  
    Also one more requirment is to restrict the user for the any changes in the description of material code in PO.
    Kindly suggest
    Thanks in advance
    Rajesh

    Set the Following Message numbers to Errors
    06 076 Materials of requisition & item & alr. ordered in full
    06 099 Materials for all purchase requisitions already ordered in full
    Like wise search similar messages numbers and set them to Error and try.

  • Authorization based on plant and Purchase order document type

    Hi
    My client has a requirement wherein a user will have authorization for transactions only in his plant. But only for Purchase order document type UB (Stock Transport Order) the user should be allowed to create for all plants.
    In short, if Purchase order document type is UB, should be allowed for all plants
                 if Purchase order document type is NB, should be allowed to only one particular plant.
    My Basis person says that such a restriction is not possible.
    Kindly suggest me on how to provide a solution to this.
    Thank U.

    Hi,
    This is possible.In this case you need to create two seperate roles.
    1)Create purchase order for all plants (This can be used in long text)
    2)Create purchase order for <plant no> plants.
    For case 1:--
    i)Populate field BSART of M_BEST_BSA with UB.
    ii)Populate field WERKS of M_BEST_WRK with '*'. SAP reccomends to fill up organizational data through organizational level tab only.So while doing this step you need to put * from organizational level tab only.
    For case 2:--
    i)Populate field BSART of M_BEST_BSA with NB.
    ii)Populate field WERKS of M_BEST_WRK with 'plant no'.
    Dont worry about the objects i mentioned those are maintained through SU24 and will be automatically pulled once you insert ME21 transaction code.
    Let me know if it helps.
    Thanks,
    Aveek

Maybe you are looking for