Open items for purchase order its very urgent

hi
my requirement is to write extract program for purchase order(me21) to extract only open items.
please provide sample code its very urgent.
thanks in advance.
points will be rewarded.
thanks
hari prasad reddy

check the below report :
REPORT ZMM_OPEN_PO_REPORT no standard page heading
                          line-size 255
                          message-id zwave.
======================================================================
Program Name : ZMM_OPEN_PO_REPORT                                    *
Description  : This report displays all Open PO Items and output     *
               would be PO Number,Material number and so on          *
Author       : Seshu                                                 *
Date         : 01/24/2007                                            *
MODIFICATION HISTORY                                                 *
DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
--|||--
01/24/07| Seshu    | DEVK921979 | Initial                            *
D A T A  D E C L A R A T I O N   P A R T                         ***
type-pools
type-pools : slis.
Tables
tables : ekko, " Purchase order Header
         ekpo, " Purchase order Item
         marc. " Material with Plant data
Internal table for output.
data : begin of i_output occurs 0,
       ebeln like ekko-ebeln,
       matnr like ekpo-matnr,
       end of i_output.
ALV Data declaration.
data : v_repid like sy-repid.
  ALV Function Module Variables
DATA: gs_layout type slis_layout_alv,
      g_exit_caused_by_caller,
      gs_exit_caused_by_user type slis_exit_by_user.
DATA: gt_fieldcat    type slis_t_fieldcat_alv,
      gs_print       type slis_print_alv,
      gt_events      type slis_t_event,
      gt_list_top_of_page type slis_t_listheader,
      g_status_set   type slis_formname value 'PF_STATUS_SET',
      g_user_command type slis_formname value 'USER_COMMAND',
      g_top_of_page  type slis_formname value 'TOP_OF_PAGE',
      g_top_of_list  type slis_formname value 'TOP_OF_LIST',
      g_end_of_list  type slis_formname value 'END_OF_LIST',
      g_variant LIKE disvariant,
      g_save(1) TYPE c,
      g_tabname_header TYPE slis_tabname,
      g_tabname_item   TYPE slis_tabname,
      g_exit(1) TYPE c,
      gx_variant LIKE disvariant.
data : gr_layout_bck type slis_layout_alv.
Ranges
ranges r_eindt for eket-eindt.
initialization.
v_repid = sy-repid.
start-of-selection.
Get the data from EKKO ,EKPO and MARC Table
perform get_data_tables.
end-of-selection.
display the data in the form of ALV
perform display_data.
*&      Form  get_data_tables
      Get the data from EKKO,EKPO and MARC Table
FORM get_data_tables.
clear : i_output.
refresh : i_output.
fill the dates in ranges
r_eindt-low = sy-datum - 7.
r_eindt-high = sy-datum + 14.
r_eindt-option = 'BT'.
r_eindt-sign = 'I'.
append r_eindt.
Get the data from EKKO,EKPO and EKET Tables
select aebeln bmatnr into table i_output
                       from ekko as a inner join
                            ekpo as b on aebeln = bebeln
                            inner join marc as c on cmatnr = bmatnr
                            inner join mara as d on dmatnr = bmatnr
                            inner join eket as e on eebeln = aebeln
                                           and   eebelp = bebelp
                            where c~beskz = 'E'
                            and   c~werks = '1000'
                            and   d~mtart = 'FERT'
                            and   b~loekz = space
                            and   b~elikz = space
                            and   e~eindt in r_eindt.
if sy-subrc ne 0.
message e000(zwave) with 'No open purchase order found'.
endif.
ENDFORM.                    " get_data_tables
*&      Form  display_data
      text
FORM display_data.
Fill the Fiedlcat
  PERFORM fieldcat_init  using gt_fieldcat[].
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
   I_INTERFACE_CHECK                 = ' '
   I_BYPASSING_BUFFER                =
   I_BUFFER_ACTIVE                   = ' '
     I_CALLBACK_PROGRAM                = v_repid
   I_CALLBACK_PF_STATUS_SET          = ' '
    I_CALLBACK_USER_COMMAND           = g_user_command
   I_CALLBACK_TOP_OF_PAGE            = ' '
   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
   I_CALLBACK_HTML_END_OF_LIST       = ' '
   I_STRUCTURE_NAME                  =
   I_BACKGROUND_ID                   = ' '
   I_GRID_TITLE                      =
   I_GRID_SETTINGS                   =
   IS_LAYOUT                         = gr_layout_bck
      IT_FIELDCAT                       = gt_fieldcat[]
   IT_EXCLUDING                      =
   IT_SPECIAL_GROUPS                 =
   IT_SORT                           =
   IT_FILTER                         =
   IS_SEL_HIDE                       =
   I_DEFAULT                         = 'X'
    I_SAVE                            = g_save
    IS_VARIANT                        =
   IT_EVENTS                         =
   IT_EVENT_EXIT                     =
   IS_PRINT                          =
   IS_REPREP_ID                      =
   I_SCREEN_START_COLUMN             = 0
   I_SCREEN_START_LINE               = 0
   I_SCREEN_END_COLUMN               = 0
   I_SCREEN_END_LINE                 = 0
   IT_ALV_GRAPHICS                   =
   IT_ADD_FIELDCAT                   =
   IT_HYPERLINK                      =
   I_HTML_HEIGHT_TOP                 =
   I_HTML_HEIGHT_END                 =
   IT_EXCEPT_QINFO                   =
IMPORTING
   E_EXIT_CAUSED_BY_CALLER           =
   ES_EXIT_CAUSED_BY_USER            =
    TABLES
      T_OUTTAB                          = i_output
   EXCEPTIONS
     PROGRAM_ERROR                     = 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.
ENDFORM.                    " display_data
*&      Form  fieldcat_init
      text
     -->P_GT_FIELDCAT[]  text
FORM fieldcat_init USING  e01_lt_fieldcat type slis_t_fieldcat_alv.
  DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Purchase order number
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'EBELN'.
  LS_FIELDCAT-ref_fieldname = 'EBELN'.
  LS_FIELDCAT-ref_tabname = 'EKKO'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  ls_fieldcat-seltext_L = 'Purchase Order'.
  ls_fieldcat-seltext_M = 'Purchase Order'.
  ls_fieldcat-seltext_S = 'Purchase Order'.
  APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material #
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'MATNR'.
  LS_FIELDCAT-ref_fieldname = 'MATNR'.
  LS_FIELDCAT-ref_tabname = 'EKPO'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  ls_fieldcat-seltext_L = 'Material'.
  ls_fieldcat-seltext_M = 'Material'.
  ls_fieldcat-seltext_S = 'Material'.
  APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM.                    " fieldcat_init

Similar Messages

  • Missing some master data for delta load( its very urgent please)

    Hi,
    I am working master data for delta load,the problem is when ever changes(SO) in r/3 RECORDS for address text,City Dstrct Nm.its not getting loaded into BW.every day some delta records are coming into BW.
    the data coming thru bw satging and bw.Please help what would be reson and where can i find the detail info,where is it missing.Please see below for example.
    Address Number/     Addr Ln 1 Txt/     City Dstrct Nm
    9025750333/                      #/               #     
    help me its very urgent

    Hi Sumanth,
    check the delta queue and the V3 job is it running correctly ,
    Have a look at OSS note :728687
    and also see the following thread
    Deltas are not available in Delta que
    Delta Queues are not cleared in R/3
    No data in RSA7 for 2lis_03_bf : HELP
    check the data may b it is in modifide status not active.
    regards,
    supriya

  • User Exit for Purchase Order Line Items.

    I have been trying to search for a User Exit for Purchase Order Line Items and have been unable to do find anything.  I need to overwrite the Net Price and Pricing Condition on a certain type of material based upon the Pricing Condition for that Line Item which is on the Sales Document.  Any direction you can point me into would be greatly appreciated.  Thanks.

    Thanks for pointing me in the right direction.  I was able to create my first BADI using the PROCESS_ITEM method.  The following link was also very helpful: Re: BADI ME_PROCESS_PO_CUST Method:PROCESS_ITEM

  • Item text for Purchase order

    Hi All,
      I Wants to pick the item text for Purchase Order. in my prog i already picked the header text by Read_text FM .i wants to used the same FM for item pickup . Can you please tell the FM parameter Value, so that i can pick proper Item text value.
    <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
    Thanks in advance
    Moni
    Edited by: Alvaro Tejada Galindo on Sep 1, 2008 5:09 PM

    Hi Moni
    We can use the same procedure to retrieve texts of any document, just that the Name, Object and ID varies.
    To find the required parameters for each object and document do as below:
    1. Open an existing document
    2. Go to the required Text
    3. Double click on the same
    4. It takes you to the editor screen.
    5. Now use menupath: Goto->Header
    6. In the popup screen you will find the required paramters.
    For item texts the Name will be (PO Number + Item Number).
    Using the details, you can pass the same to FM: READ_TEXT and retreive the texts in programs.
    Regards
    Eswar

  • Class for Purchase order item components and Production order components

    I'm looking for a some classes.   I'm very new to objects, so I could be searching for them incorrectly.
    The first class I'm looking for is a purchase order class that contains the item components.  I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM.  I couldn't find components as a part of either of the classes.
    The second one I'm looking for is not as critical.  It is for the components for a production order.   I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order.  However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
    Any help that you could give would be greatly appreciated.
    Thank you!
    Michelle

    Hello Michelle
    I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
    *& Report  ZUS_SDN_OO_READ_PO
    *& Thread: Class for Purchase order item components and Production order components
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
    "& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
    REPORT  zus_sdn_oo_read_po.
    TYPE-POOLS: abap, mmpur.
    PARAMETER:
      p_ebeln   TYPE ebeln  DEFAULT '3000000045'.
    DATA: gs_document    TYPE mepo_document,
          go_po          TYPE REF TO cl_po_header_handle_mm,
          gs_header      TYPE mepoheader,
          gd_tcode       TYPE sy-tcode,
          gd_result      TYPE mmpur_bool.
    data: gt_items       type PURCHASE_ORDER_ITEMS,
          gs_itm         type PURCHASE_ORDER_ITEM,
          gs_item        type mepoitem.
    START-OF-SELECTION.
    *  prepare creation of PO instance
      gs_document-doc_type    = 'F'.
      gs_document-process     = mmpur_po_process.
      gs_document-trtyp       = 'A'.  " anz.  => display
      gs_document-doc_key(10) = p_ebeln.
    *  object creation and initialization
    **  l_ebeln = purchaseorder.
      CREATE OBJECT go_po.
      CALL METHOD go_po->po_initialize( im_document = gs_document ).
      CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
      CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
    *  read purchase order from database
      gd_tcode = 'ME23N'.
      CALL METHOD go_po->po_read
        EXPORTING
          im_tcode     = gd_tcode
          im_trtyp     = gs_document-trtyp
          im_aktyp     = gs_document-trtyp
          im_po_number = p_ebeln
          im_document  = gs_document
        IMPORTING
          ex_result    = gd_result.
    *  there was a problem in reading the PO
      IF ( gd_result EQ mmpur_no ).
    **    l_messages = l_handler->get_list_for_bapi( ).
    **    PERFORM return TABLES l_messages return
    **                          poitem poschedule poaccount.
    **    CALL METHOD l_po->po_close( ).
      ELSE.
        gs_header = go_po->if_purchase_order_mm~get_data( ).
        WRITE: / gs_header-ebeln,
                 gs_header-bukrs,
                 gs_header-bsart,
                 gs_header-lifnr.
      ENDIF.
      gt_items = go_po->if_purchase_order_mm~get_items( ).
      LOOP AT gt_items INTO gs_itm.
        gs_item = gs_itm-item->get_data( ).
        write: / gs_item-ebelp,
                 gs_item-matnr,
                 gs_item-menge.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • No (suitable) item found for purchase order

    Dear All,
    The order is stock transfer order (STO) item category U. i saw GR is already create. GI  and also DCGR. i want to do DCIR which is invoice receipt in tcode mr01, the error "No (suitable) item found for purchase order" is coming out. What would be the cause of this situation? i check with old last PO it is same set with the one that having in problem. i also double click the item to see the detail and what i can see tick option for del completed and no tick on final del.
    no GR-based-4 or invoice receipt option to tick. means no tick option for this. but when i see previous po also same. but there is history on DCIR.
    Really need to know what should i do? is bug?
    Regards
    Aishah

    In case of out company it was SA(schudule agrement) PO we try on the Credit memo by MIRO t-code through IV
    but we met the same error message
    The problem cause of not exist delivery schedule quantiry we have put in the qty to there by manually after than this issue cleared.
                                                                       Hoil.

  • No goods receipt possible for purchase order Number and Item number.

    Hello experts,
    When I create a Goods Reciept with reference to Purchase Order using BAPI_GOODSMVT_CREATE, the following error message appears.
    No goods receipt possible for purchase order <PO number> <line item number>.
    But the GR is getting created manually using Transaction MIGO for the same PO number.
    I found some blogs to check for deletion indicator and Movement type and quantity, when I searched SDN for the same Issue.
    In my case 
    1.deletion indicator is not set for the Purchase order line items
    2.And Movement type is 101
    3.And gm_code is 01.
    Could anyone please suggest me, what else could be the reason for this error?

    Here is the code what i have written.
      f_gmvt_header-pstng_date = sy-datum.
      f_gmvt_header-doc_date   = sy-datum.
      f_gmvt_header-pr_uname   = sy-uname.
      f_gmvt_header-ref_doc_no = p_ebeln.
      f_goodsmvt_code_tmp        = '01'.
    * Looping the PO details.
      CLEAR: gf_item,f_gmvt_item.
      LOOP AT gt_item INTO gf_item.
    * fill the bapi item structure details
        f_gmvt_item-material   = gf_item-material.
        f_gmvt_item-plant      = gf_sbms-werks.
        f_gmvt_item-stge_loc   = '0001'.
        f_gmvt_item-move_type  = '101'.
        f_gmvt_item-po_number  = p_ebeln.
        f_gmvt_item-po_item    = gf_item-po_item.
        f_gmvt_item-entry_qnt  = gf_item-quantity.
        f_gmvt_item-entry_uom  = 'PC'.
        f_gmvt_item-entry_uom_iso = 'PCE'.
        f_gmvt_item-po_pr_qnt = gf_item-quantity.
        f_gmvt_item-orderpr_un = 'PC'.
        f_gmvt_item-orderpr_un_iso = 'PCE'.
        f_gmvt_item-no_more_gr = 'X'.
        f_gmvt_item-ref_doc    = p_ebeln.
        f_gmvt_item-prod_date  = sy-datum.
        f_gmvt_item-mvt_ind    = 'B'.
        f_gmvt_item-move_reas  = '101'.
        f_gmvt_item-vendor      = gf_lfm1-lifnr.
        APPEND f_gmvt_item TO t_gmvt_item.
        CLEAR f_gmvt_item.
      ENDLOOP.
    * cALL THE bapi fm FOR gr POSTING
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header               = f_gmvt_header
          goodsmvt_code                 = f_goodsmvt_code_tmp
    *     TESTRUN                       = ' '
    *     GOODSMVT_REF_EWM              =
       IMPORTING
         goodsmvt_headret              = f_gmvt_headret
    *     MATERIALDOCUMENT              =
    *     MATDOCUMENTYEAR               =
        TABLES
          goodsmvt_item                 = t_gmvt_item
    *     GOODSMVT_SERIALNUMBER         =
          return                        = t_return
    *     GOODSMVT_SERV_PART_DATA       =
    *     EXTENSIONIN                   =
      IF sy-subrc = 0.
    * For commit the changes use BAPI_TRANSACTION_COMMIT FM.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
    *      MOVE: f_GMVT_HEADRET-MAT_DOC   TO WA_DET-MBLNR,
    *            f_GMVT_HEADRET-DOC_YEAR  TO WA_DET-MJAHR,
    *            f_GMVT_HEADER-REF_DOC_NO TO WA_DET-EBELN.
    *      APPEND WA_DET TO IT_DET.
    *      CLEAR WA_DET.
      ENDIF.

  • Sp Transaction Procedure For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hello Amit,
    You don't need post identical thread twice. This SP related discussion is usually posted on main forum.
    Please close this one.
    Thanks,
    Gordon

  • Sp_Transaction Notification For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hi Amit,
    i found this on forum. Try this,
    if @object_type = N'22' and @transaction_type in (N'A', N'U')
    begin
    declare @line1 int
    declare @lin1 int
    declare @out1 int
    Set @out1 = 0
    SET @lin1 = 0
    Declare @Vend as varchar(200)
    Declare @ItemCode as varchar(200)
    Select @Vend = CardCode From OPOR Where DocEntry = @list_of_cols_val_tab_del
    Select @line1 = Max (LineNum)FROM POR1 WHERE POR1.DocEntry = @list_of_cols_val_tab_del
    While @lin1 < @line1
    Begin
         Select @ItemCode=ItemCode From POR1 Where DocEntry=@list_of_cols_val_tab_del and LineNum = @lin1
          if (SELECT COUNT(T0.DocEntry) FROM POR1 T0 inner join OPOR T1 on T0.DocEntry = T1.DocEntry
          WHERE T0.ItemCode = @ItemCode and T1.CardCode = @Vend)> 1
          Begin
               Set @Out1 = 1
               Break;
          END
               Else
               Begin
               Set @lin1 = @lin1+1
               Continue
          END
    END
    Set @lin1 = @lin1 + 1
    if @out1 = 1
    begin
          Set @error = 1
          Set @error_message = 'Item Code in line ' + CONVERT(nvarchar(4), @lin1) + N'already Exists For This Vendor!'
    End
    END
    Check this too Stored procedure in purchase order for duplicate item for a vendor
    Thanks,
    Joseph
    Edited by: Joseph Antony on Jan 11, 2011 1:37 PM

  • Urgent : Workflows for Purchase Order

    hi,
           My requirement is to make workflows for creation of Purchase Order.i,e Whenever a PO is made in the system,one mail should be sent to the concerned person for approval.I came across object type BUS2012 which is for Purchase Order but it's event list does not contain for "creation".How to approach for the same or any other solution.
    Thanks and Regards,
    Gaurav

    Hi,
    Standard Workflow for Purchase Order is WS20000075(Access it via PFTC_DIS Tcode). The business Object for Purchase order is BUS2012(access it via SWO1 Tcode).
    http://help.sap.com/saphelp_47x200/helpdata/en/75/ee153f55c811d189900000e8322d00/frameset.htm
    Regards
    Kiran Sure

  • Prb in understanding fields of VBAK(ITS VERY URGENT)

    HI,
        Can u tell me, whats the diff. bet ORDER TYPE & SALES DOC CATEGORY.
    vbtyp & auart of vbak table
    is VBTYP = 'H' only dependent on AUART = 'ZRE'
    ZRE = RMA Returns...
    Its very urgent.......
    Regards,
    Parvez.

    Hi Parwez,
                        See AUART - is the Order Type which defines that it can a standard order ,Return Order ( ZRE) ,Order without charge ,Credit Memo ,Debit Memo.
    The sales document type determines how the system processes the sales
    document. For example, depending on the sales document type, the syste
    determines which screens to present and which data to ask you for.
    While SALES DOC CATEGORY VBTYP indicates it is a conctract ,sales order ,return order ,Purchase Order ,Schedule Agreement .
    A classification for the different types of documents that you can
    process in the sales and distribution system (for example: quotations,
    sales orders, deliveries, and invoices).
    The document category determines how the system stores and keeps track
    of document data. It enables the system to provide you with status
    information about delivery processing, billing, and documents that are
    used for reference (for example, inquiries and quotations).
    A     Inquiry
    B     Quotation
    C     Order
    D     Item proposal
    E     Scheduling agreement
    F     Scheduling agreement with external service agentI     Order w/o charge
    J     Delivery
    K     Credit memo request
    L     Debit memo request
    M     Invoice
    N     Invoice cancellation
    O     Credit memo
    P     Debit memo
    Q     WMS transfer order
    R     Goods movement
    S     Credit memo cancellation
    T     Returns delivery for order
    U     Pro forma invoice
    V     Purchase order
    W     Independent reqts plan
    X     Handling unit
    0     Master contract
    1     Sales activities (CAS)
    2     External transaction
    3     Invoice list
    4     Credit memo list
    5     Intercompany invoice
    6     Intercompany credit memo
    7     Delivery/shipping notification
    8     Shipment
    a     Shipment costs
    c     Unverified delivery
    e     Allocation table
    g     Rough Goods Receipt (only IS-Retail)
    h     Cancel goods issue
    i     Goods receipt
    j     JIT call
    r     TD Transport (only IS-Oil)
    s     Load confirmation, reposting (only IS-Oil)
    t     Gain    /  loss    (only IS-Oil)
    u     Reentry into storage (only IS-Oil)
    v     2-step Goods receipt (only IS-Oil)
    w     Reservation (only IS-Oil)
    x     Load confirmation, goods receipt (only IS-Oil)
    $     (AFS)
    Please Reward if useful .

  • Vendor Line Item Upolad Without TDS Portion  -- very urgent

    Hi Peers
    I want to upload the vendor Line Items. If my Vendor is a TDS Vendor then , the system is calculating TDS even for Initial Upload. Is there anyway by which i can bypass this. Plz help. Its very urgent.
    Regards
    Rajaram

    Dear Rajaram,
    Do not upload vendor open balances with TDS master updated. System is calculating TDS coz u have first updated TDS master in vendor master with liable tick on it.
    The process should be as:
    1. First upload vendor open items thru program
    2. Then upload TDS master with liable tick .
    Doing this system will start calculating TDS on future invoices. Now go to T code MASS, select Vendors under it , & deactivate liable from each master record.And then upload the balance.
    Regards,
    Ajay Gupte

  • SMART FORM FOR PURCHASE ORDER

    Hii Experts,
    I am developing a smart form for purchase order. I am customizing the existing PO smart form according to the clients requirements. The customer needs fields Discount percentage, Excise duty and VAT/CST%... all these fields when i explored in transaction me23n come from a structure so the values come only at run time.. can anyone tell me the exact table and fields from where these comes so that i can retrieve it from there and display it in my smart form. The fields i need are discount percentage, excise duty and VAT/CST%. its urgent.

    REPORT  ZMR_PURCHASE_ORDER.
    types: BEGIN OF ty_lfa1,
              LIFNR TYPE lfa1-LIFNR,
              MCOD1 TYPE lfa1-MCOD1,
              STRAS TYPE lfa1-STRAS,
              MCOD3 TYPE lfa1-mcod3,
          END OF ty_lfa1.
    TYPES: BEGIN OF ty_ekpo,
              ebeln TYPE ekpo-ebeln,
              ebelp TYPE ekpo-ebelp,
              txz01 TYPE ekpo-txz01,
              menge TYPE ekpo-menge,
              peinh TYPE ekpo-peinh,
              brtwr TYPE ekpo-brtwr,
          END OF ty_ekpo.
    TYPES: BEGIN OF ty_ekko,
            ebeln TYPE ekko-ebeln, "purchase doc
            LIFNR TYPE ekko-LIFNR, "vendor
            MCOD1 TYPE lfa1-MCOD1, "vendor name
            STRAS TYPE lfa1-STRAS, "vendor add
            MCOD3 TYPE lfa1-MCOD3, "vendor city
            bedat TYPE ekko-bedat, "doc date
            unsez TYPE ekko-unsez, "contact person
            verkf TYPE ekko-verkf, "attn
            telf1 TYPE ekko-telf1, "tele
            ihrez TYPE ekko-ihrez, "ref
            KNUMV TYPE ekko-KNUMV, "doc condition
           ebelp TYPE ekpo-ebelp, "item
           txz01 TYPE ekpo-txz01, "message desc
           menge TYPE ekpo-menge, "qty
           peinh TYPE ekpo-peinh, "rate
           brtwr TYPE ekpo-brtwr, "gross
        END OF ty_ekko.
    TYPES: BEGIN OF ty_t685t,
            kschl TYPE t685t-KSCHL,
            vtext TYPE t685t-vtext,
          END OF ty_t685t.
    TYPES: BEGIN OF ty_line_item,
            KNUMV TYPE konv-KNUMV, "condition number
            STUNR TYPE konv-STUNR, "step
            kposn TYPE konv-kposn, "item
            KSCHL TYPE konv-KSCHL, "condition type
            vtext TYPE t685t-vtext, "condition name
            KAWRT TYPE konv-KAWRT,  "base amt
            KRECH TYPE konv-KSCHL,  "calculation type
            qty(13) TYPE n,         "qty
            kbetr TYPE konv-kbetr, "condition rate
            kwert TYPE konv-kwert, "condition value
        END OF ty_line_item.
    data: wa_ekko TYPE zms_ekko,
          wa_item TYPE zms_konv,
          wa_lfa1 TYPE ty_lfa1,
          wa_t685t TYPE ty_t685t,
          wa_ekpo TYPE ty_ekpo.
    data: it_ekko TYPE TABLE OF zms_ekko,
          it_item TYPE TABLE OF zms_konv,
          it_lfa1 type TABLE OF ty_lfa1,
          it_t685t TYPE TABLE OF ty_t685t,
          it_ekpo TYPE TABLE OF ty_ekpo.
    SELECTION-SCREEN : BEGIN OF BLOCK ss_block WITH FRAME TITLE text-001.
       PARAMETERS: pa_ver(2) TYPE c DEFAULT '0'.
        SELECT-OPTIONS: pa_pord FOR wa_ekko-ebeln,
                        pa_date for wa_ekko-bedat.
    SELECTION-SCREEN : END OF BLOCK ss_block.
    SELECT EBELN LIFNR bedat unsez verkf telf1 ihrez knumv from ekko
        into CORRESPONDING FIELDS OF TABLE it_ekko.
      if pa_pord is not INITIAL.
        DELETE it_ekko WHERE ebeln not in pa_pord.
      endif.
      if pa_date is not INITIAL.
        DELETE it_ekko WHERE bedat not IN pa_date.
      endif.
    if it_ekko is not INITIAL.
      SELECT lifnr MCOD1 STRAS MCOD3 from lfa1
        INTO CORRESPONDING FIELDS OF TABLE it_lfa1
        FOR ALL ENTRIES IN it_ekko
        WHERE LIFNR = it_ekko-LIFNR.
      SELECT ebeln ebelp txz01 menge peinh brtwr from ekpo
        INTO CORRESPONDING FIELDS OF TABLE it_ekpo
        FOR ALL ENTRIES IN it_ekko
        WHERE EBELN = it_ekko-ebeln.
      loop at it_ekko into wa_ekko.
        READ TABLE it_lfa1 into wa_lfa1 WITH KEY lifnr = wa_ekko-LIFNR.
        wa_ekko-MCOD1 = wa_lfa1-MCOD1.
        wa_ekko-stras = wa_lfa1-stras.
        wa_ekko-MCOD3 = wa_lfa1-MCOD3.
        MODIFY it_ekko FROM wa_ekko TRANSPORTING MCOD1 STRAS MCOD3 WHERE ebeln = wa_ekko-ebeln.
      ENDLOOP.
      SELECT KNUMV STUNR KPOSN KSCHL KRECH kbetr kwert KAWRT from konv
        into CORRESPONDING FIELDS OF TABLE it_item
        FOR ALL ENTRIES IN it_ekko
        WHERE KNUMV = it_ekko-KNUMV.
      SELECT kschl vtext from t685t
        INTO CORRESPONDING FIELDS OF TABLE it_t685t
        FOR ALL ENTRIES IN it_item
        WHERE spras = 'EN' and KSCHL = it_item-KSCHL.
      LOOP AT  it_item into wa_item.
        READ TABLE it_t685t into wa_t685t with key KSCHL = wa_item-KSCHL.
        wa_item-vtext = wa_t685t-vtext.
        if wa_item-kschl = 'ZBP1'.
          wa_item-qty = wa_item-KAWRT / wa_item-kbetr.
        endif.
        if wa_item-KRECH = 'A'.
         wa_item-kbetr = wa_item-kbetr / 10.
        endif.
        if wa_item-kschl = 'NAVS'.
          wa_item-vtext = 'Sales Tax'.
        endif.
        MODIFY it_item from wa_item TRANSPORTING vtext kbetr kschl qty
          WHERE stunr = wa_item-STUNR and
                kposn = wa_item-kposn.
      ENDLOOP.
      DELETE it_item WHERE kposn = '000000'.
      DELETE it_item WHERE kschl <> 'ZBP1' and kschl <> 'ZD01' and kschl <> 'ZE01'
          and kschl <> 'NAVS' and kschl <> 'ZSRV'.
      sort it_item by kposn STUNR.
    CALL FUNCTION '/1BCDWB/SF00000025'
      EXPORTING
        ARCHIVE_INDEX              =
        ARCHIVE_INDEX_TAB          =
        ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         =
        MAIL_APPL_OBJ              =
        MAIL_RECIPIENT             =
        MAIL_SENDER                =
        OUTPUT_OPTIONS             =
        USER_SETTINGS              = 'X'
      IMPORTING
        DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            =
        JOB_OUTPUT_OPTIONS         =
        TABLES
          it_ekko                    = it_ekko
          it_item                    = it_item
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endif.

  • Required BADI  for  purchase order

    Hi experts,
    Can any one please suggest me which BADI or userexit suitable in purchase order to restrict accountassignement category depend upon Doc type with the suitable method.

    Hi Ram,
              Actually my requirement is like this .
    In the me21n tcode, if doctype of purchase order is 'ZCAP' then it has to allow the accasscategory 'A' only.
    If any other accasscategory assigned then it has to display error message.
    For that i have gone for me_process_po_cust BADI. But it does not had any changing parameters to satisfy my requirements.
    Is there any alternative?
    pleae Reply me asap .
    Its very urgent...

  • Badi's on vi01. Pls Its very urgent

    Hi Experts,
          I have given the requirement below I am not aware of badi's. Pls tell me the info about  Business event 1120P. And also post the coding for this functionality . Its very urgent
    Enhancement Summary
    Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
    Business Process
    Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
    There are no screens involved in this enhancement.
    Components
    Table: ZTABLE1
    Field     Data Element     Type     Length     Description
    MANDT     MANDT     CLNT (key)     3     Client
    DISTRIBUTION     Z_DISTRIBUTION     CHAR (key)     1     Distribution
    MOT     ZZDEF_MOT     CHAR (key)     2     Mode of Transportation
    MATKL     MATKL     CHAR (key)     9     Material group
    SAKNR     SAKNR     CHAR     10     G/L Account Number
    KOSTL     KOSTL     CHAR     10     Cost Center
    This table gets updated manually by the FI team.
    Values for Distribution are:
    ‘1’  =  Primary Distribution to Refinery
    ‘2’ = Primary and Secondary– Excluding refinery
    All entries must be checked against SAP config and master tables
    User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
    Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
    There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
    Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
    Function, Rules, Exits      Description of Functionality, Rules, Exits
    BADI_SCD_ACCTG     Business Add-In for Shipment Cost Account Assignment
    Business Framework     Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
    This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
    Custom Table     A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
    Transaction code     To maintain the new table
    Append Structure     To enhance structure BSEG_SUBST with MATNR
          Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
    Logic:
    •     Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module Z_M_GET_PLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.
    •     Product Group can be determined from the Material master through Material group field MARA-MATKL.
    •     Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
    •     Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.
    •     Move ZTABLE1-SAKNR  to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
    •     The Material group must be exported to memory in BADI_SCD_ACCTG
    •     The Material group must be imported from memory in Business Event BP1120P
    •     Free Memory in Business Event BP1120P
    This is VI01 – Creation of Freight Cost Item screen

    check the reply of ur Same Post .
    regards
    prabhu

Maybe you are looking for