Vendor master data - Single material with multiple price

Hi Gurus,
Per our set-up, we have 1 purchasing organization to handle the central procurement function for purchases to various countries/destination.  As such, whenever we seek for quotation from a single vendor, the vendor will provide their price for a single/same material, e.g. ABC, with various price by locations. for example:
1. Material: ABC
- Price: $83 (EXW)
- Price: $85 (FOB, Tianjin)
- Price: $100 (CFR Port Klang)
- Price: $120 (CFR Mumbai)
- Price: $160 (CFR Jabel Ali)
Is there a way I can use any of the vendor master records (e.g. outline agreement / info records) to capture a single material having multiple price?  At the same time, this infomation is available during our PO creation (e.g. via ME57).
Thanks in advance.

Dear
For Condition Type PB00, SAP has some standard requirements in Pricing Schema.For one material different location one requirement is there.But as per your requirements you need to put logic through ABAP and it will definetely work.The exact requiremnt i'm not remembering.
Just go through all the requiremnt and respect to PB00, put the requiremnt and put the logic.
Revert me for the result.
Thanks & Regards
PKB

Similar Messages

  • Vendor Master Creation through IDoc with Multiple Company Codes

    I am trying to create vendor masters sent from a 3rd party into SAP using CREMAS05 IDoc.  I have the requirement that the vendor should be created in each of 3 company codes and the vendor number is internally assigned in SAP.
    I create my IDoc with the general data E1LFA1M and multiple E1LFB1M & E1LFB5M Children.  When I post the IDoc using IDOC_INPUT_CREMAS which uses Call Transaction, the vendor gets created for the first company code, but the IDoc errors on the vendor extension XK01 for the next company code with the error: "Fill all required fields SAPMF02K 0111 ADDR1_DATA-NAME1". 
    In debugging through this, it appears that the vendor number that gets created in the first XK01 transaction does not get passed into the data for the second XK01 call and SAP tries to create a new vendor instead of extending the newly created one.
    If I force the value in during debug after the initial call transaction into the variable h_lifnr, it works fine (Vendor created with multiple company codes.
    Any help would be greatly appreciated.
    -Larry

    I cannot give you exact solution, but can guess why this is happening, below is what I believe.
    I think Synchronous update is not happening in call transaction, second transaction is getting processed before the first one is saved, debugging it works fine, because we give system enough time to save while processing.
    Generally in call transaction we have MODE, if we pass S - then synchronous update happens, in your case, you need to find the way to incorporate this.
    Hope it helps.
    Regards,
    Ravi Kishore.

  • What are the T-codes that contain the master data for material and vendor?

    what are the T-codes that contain the master data for material and vendor?

    hi ,
    - Display Material  tcodes...
    MM01 - Create Material
    MM02 - Change Material
    MM03 - Display Material
    MM50 - List Extendable Materials
    MMBE - Stock Overview
    MMI1 - Create Operating Supplies
    MMN1 - Create Non-Stock Material
    MMS1 - Create Service
    MMU1 - Create Non-Valuated Material
    ME51N - Create Purchase Requisition
    ME52N - Change Purchase Requisition
    ME53N - Display Purchase Requisition
    ME5A - Purchase Requisitions: List Display
    ME5J - Purchase Requisitions for Project
    ME5K - Requisitions by Account Assignment
    MELB - Purch. Transactions by Tracking No.
    ME56 - Assign Source to Purch. Requisition
    ME57 - Assign and Process Requisitions
    ME58 - Ordering: Assigned Requisitions
    ME59 - Automatic Generation of POs
    ME54 - Release Purchase Requisition
    ME55 - Collective Release of Purchase Reqs.
    ME5F - Release Reminder: Purch. Requisition
    MB21 - Create Reservation
    MB22 - Change Reservation
    MB23 - Display Reservation
    MB24 - Reservations by Material
    MB25 - Reservations by Account Assignment
    MB1C - Other Goods Receipts
    MB90 - Output Processing for Mat. Documents
    MB21 - Create Reservation
    MB22 - Change Reservation
    MB23 - Display Reservation
    MB24 - Reservations by Material
    MB25 - Reservations by Account Assignment
    MBRL - Return Delivery per Mat. Document
    MB1C - Other Goods Receipts
    MB90 - Output Processing for Mat. Documents
    MB1B - Transfer Posting
    MIBC - ABC Analysis for Cycle Counting
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI21 - Print physical inventory document
    MI04 - Enter Inventory Count with Document
    MI05 - Change Inventory Count
    MI06 - Display Inventory Count
    MI09 - Enter Inventory Count w/o Document
    MI34 - Batch Input: Enter Count
    MI35 - Batch Input: Post Zero Stock Balance
    MI38 - Batch Input: Count and Differences
    MI39 - Batch Input: Document and Count
    MI40 - Batch Input: Doc., Count and Diff.
    MI08 - Create List of Differences with Doc.
    MI10 - Create List of Differences w/o Doc.
    MI20 - Print List of Differences
    MI11 - Physical Inventory Document Recount
    MI07 - Process List of Differences
    MI37 - Batch Input: Post Differences
    for vendor..
    XKN1  Display Number Ranges (Vendor)
    XK01  Create vendor (centrally)
    XK02  Change vendor (centrally)
    XK03  Display vendor (centrally)
    XK04  Vendor Changes (Centrally)
    XK05  Block Vendor (Centrally)
    XK06 Mark vendor for deletion (centrally
    XK07  Change vendor account group
    XK11  Create Condition
    XK12  Change Condition
    XK13  Display Condition
    XK14  Create with cond. ref. (cond. list)
    XK15  Create Conditions (background job)
    reward points if useful,
    venkat.

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts,
    How to Restrict Single Delivery Date for PO with Multiple Line Items.
    System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode.
    Can we achive this by Some Enhancement in SAP or Not ???
    If so how to do it.
    Any Inputs is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi Selvakumar,
    we can resrict the PO to have a single delivery date in all the line items by means of giving a error message or overwiting the delivery date keyed/determined in the line item.
    You can use the BADI -> ME_PROCESS_PO_CUST. In which you need to implement the method PROCESS_SCHEDULE.
    (for technical aid - This method will be called for each and every PO line item, From the imporing parameter im_schedule we can get all the details of current PO line, even we can change the data in the current PO line. )
    Regards,
    Madhu.

  • Bank detials Maintained in Vendor master data with out Sort code / Bank Key

    Hi
    We have a Requirement of creating Japanese bank details in Vendor Master Record. But No Bank key / sort code is available.
    Even for Russian Bank accounts we donu2019t have any bank key / sort code available from client.
    System does not allow to create vendor bank details with out providing Sort code/ Bank key details.
    Is there is any way of creating bank details in Vendor master data with out giving Bank key details.
    Regards,
    Karunakar.

    Hi,
    I assume you fill in Sort Code in bank number field.
    In my company, our bank number is set not to duplicate bank key.
    So bank key is simply a reference.  And our bank number field is not mandatory.
    If you follow these settings, you can create an abitrary bank key for your vendor bank account.

  • Multiple communication methods in vendor master data

    Hi,
    We are implementing ECC 6 for our client in denmark. Client wants to send purchase order conformations and invoices should be faxed to vendor and payment advices should be sent through  E-Mail ID. I have maintained standard communication in vendor master data as Fax and inputed Fax numer also and maintained E-mail ID in other communication of vendor, But system is not picking up fax number to send the purchase order and invoice details. Instead system is picking up E-mail ID and sending the data. It is not picking up standard communication method FAX. Payment advices are sent through E-mail, that was working fine.
    Give your valuable inputs
    Regards
    Srinivas
    Edited by: srinivas konakalla on Jun 16, 2010 3:26 PM

    Hi Srinivas,
    Check the vendor master other communications
    Check whether did you activate  the dont use communication number check box.
    If it is,deselect check box and check once again
    Regards
    Surya

  • Issue with Vendor Master Data-field notes ID  (Table ADRT-REMARK)

    Hello,
    I have a issue related to Vendor Master Data maintenance.
    The client wants to maintain the u201CNotesu201D field in vendor master data. The field gets populated from the field u201CADTR-REMARKu201D table ADRT.
    Now client wants to maintain some alphabet to distinguish some of vendors (i.e. 1250) out of 5000 vendors. We tried to develop LSMW, however it is not getting generated as this field is not getting recorded as the field is inside the tab (next to e-mail id field) which requires click. It seems BDC also is also not working as it is not populating these fields except e-mail id.
    The table ADRT contains filed ADDRNUMBER which is the same field in LFA1, and it is ADRNR (Address number).
    Also please note that CATT/e CATT is not permitted at all the client level.
    Can any body suggest the way to change the master data through some way.
    Regards,
    Chepan

    Hi,
    Did you heard about SAP GUI Scripting? There is SAP functionality - seems to Excel Macros. You are able to record SAP  like macros, then after small code modifcation (code is in Visual Basic), and special excel origin (there could be excel prepared like for CATT) upload data to VMD.
    If you have any questions I try to help you?
    Best regards,
    Piotr
    Edited by: Piotr Wieczerzak on Jan 26, 2010 9:35 PM

  • Linking personnel number with vendor master data

    Hello,
    When i am created vendor master data,that time Personnel number field is showing "No values found"
    What does it mean?
    Thanks.

    Hi Pari,
    It appears that you are treating employee as vendor. You have not maintajned the personnel number of employees (in HR Module). The personnel number is the only feature within a client which is unique to an employee. You have to enter a personnel number before you can display and maintain an employee's master data and time data.
    Thank You.

  • Vendor master data file structure

    Hello Guys,
    I want to knw the flat file strucute of vendor master data (specially vendor with multiple banks)
    pls let me knw tht
    thnks
    sunny

    IT CAN BE SINGLE FLAT FILE OR IT CAN BE CSV SEPARATED BY COMMA
    OR IT CAN BE TWO
    IN ORDER TO UPLOAD SUCH A FILE YOU HAVE TO USE BDC TABLE CONTROL
    HERE IS THE SAMPLE CODE WITH 2 FLAT FILES
    report ZABVENDOR_UPLOAD1
           no standard page heading line-size 255.
    types :begin of ty_ven,
    i1 TYPE c,
    lifnr LIKE rf02k-lifnr,
    bukrs LIKE rf02k-bukrs,
    ekorg LIKE rf02k-ekorg,
    ktokk LIKE rf02k-ktokk,
    anred LIKE lfa1-anred,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    land1 LIKE lfa1-land1,
    akont LIKE lfb1-akont,
    fdgrv LIKE lfb1-fdgrv,
    waers LIKE lfm1-waers,
    end of ty_ven.
    data: it_ven type table of ty_ven,
          wa_ven like line of it_ven.
    types: begin  of ty_bank,
             j1 type c,
             banks LIKE lfbk-banks,"BANK COUNTRY KEY
             bankl LIKE lfbk-bankl,"BANK KEYS
             bankn LIKE lfbk-bankn,"CONTROL KEY
             koinh LIKE lfbk-koinh,"aacount name
             BANKA LIKE BNKA-BANKA,
         end of ty_bank.
    data:it_bank type table of ty_BANK,
          wa_bank like line of it_BANK.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    *DATA : c TYPE i.
    include bdcrecx1.
    start-of-selection.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\VN1.TXT'
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      TABLES
        DATA_TAB                      = IT_VEN.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\BANK.TXT'
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
    TABLES
        DATA_TAB                      = IT_BANK.
    *ENDLOOP.
    LOOP AT IT_VEN INTO WA_VEN.
    SPLIT WA_VEN AT '*' INTO WA_VEN-I1
                             WA_VEN-LIFNR
                             WA_VEN-bukrs
                             WA_VEN-ekorg
                             WA_VEN-ktokk
                             WA_VEN-anred
                             WA_VEN-name1
                             WA_VEN-sortl
                             WA_VEN-land1
                             WA_VEN-akont
                             WA_VEN-fdgrv
                             WA_VEN-waers.
    perform open_group.
    perform bdc_dynpro      using 'SAPMF02K' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  WA_VEN-LIFNR.
    perform bdc_field       using 'RF02K-BUKRS'
                                  WA_VEN-bukrs.
    perform bdc_field       using 'RF02K-EKORG'
                                  WA_VEN-ekorg.
    perform bdc_field       using 'RF02K-KTOKK'
                                  WA_VEN-ktokk.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-LAND1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-ANRED'
                                  WA_VEN-anred.
    perform bdc_field       using 'LFA1-NAME1'
                                  WA_VEN-name1.
    perform bdc_field       using 'LFA1-SORTL'
                                  WA_VEN-sortl.
    perform bdc_field       using 'LFA1-LAND1'
                                  WA_VEN-land1.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-KOINH(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    CNT = 0.
    LOOP AT IT_BANK INTO WA_BANK WHERE J1 EQ WA_VEN-I1.
    SPLIT WA_BANK AT '*' INTO WA_BANK-J1
                              WA_BANK-BANKS
                              WA_BANK-bankl
                              WA_BANK-bankn
                              WA_BANK-koinh
                              WA_BANK-BANKA.
    CNT = CNT + 1.
    CONCATENATE 'LFBK-BANKS( ' CNT ' )' INTO FDT.
    perform bdc_field       using FDT
                                  WA_BANK-BANKS.
    CONCATENATE 'LFBK-BANKL( ' CNT ' )' INTO FDT.
    perform bdc_field       using FDT
                                  WA_BANK-BANKL.
    CONCATENATE 'LFBK-BANKN( ' CNT ' )' INTO FDT.
    perform bdc_field       using FDT
                                  WA_BANK-BANKN.
    CONCATENATE 'LFBK-KOINH( ' CNT ' )' INTO FDT.
    perform bdc_field       using FDT
                                  WA_BANK-KOINH.
    IF cnt = 5.
    cnt = 0.
    perform bdc_dynpro      using 'SAPLBANK' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BNKA-BANKA'.
    *CONCATENATE 'BNKA-BANKA( ' CNT ' )' INTO FDT.
    *perform bdc_field     using FDT
                                 WA_BANK-BANKA.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'BNKA-BANKA'
                                  'BANK OF INDIA'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                 '=ENTR'.
    ENDIF.
    ENDLOOP.
    perform bdc_dynpro      using 'SAPMF02K' '0210'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-FDGRV'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFB1-AKONT'
                                  WA_VEN-akont.
    perform bdc_field       using 'LFB1-FDGRV'
                                  WA_VEN-fdgrv.
    perform bdc_dynpro      using 'SAPMF02K' '0215'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-ZTERM'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0220'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB5-MAHNA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                   WA_VEN-waers.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'XK01'.
    ENDLOOP.
    SOME SAMPLE DATA(JUST FOR LEARNING)
    VENDOR DETAILS
    13010000100010001COMPANY1IDES1SAP1DE31000A2INR*   
    13190000100010001COMPANY1SATYAM1CONSULTING1IN31000A2INR*
    24090100000010001MR.AMBANI1RELIANCE1IN31000A2INR*      
    BANK DETAILS FLAT TYPE
    1DE234206630493TSYSTEM1BANK OF MELBOURNE*
    1IN2305866307039TCS1BANK OF ARMENIA*
    1DE453886630765TOSHIBA1BANK OF BERLIN*
    1AU893206639785SHELL1AXIS BANK*
    1CA366373940643YASHODA1BANK OF TORONTO*
    2PK7802374902393CARE1ISLAMIC CONVENTORY BANK*
    2NZ400297494393LG1WELLINGTON NATIONAL BANK*

  • Vendor Master Data LSMW problem

    Hi,
    I have vendor master data in XLS file. Created project in LSMW with standard batch input object 004 (Vendor Master Data), Method (0001 standard) and Program name RFBIKR00.
    Other constant data:
    BLF00-TCODE = 'XK01'
    BLF00-LIFNR = 'FOX1220' ... 'FOX1221' etc
    BLF00-BUKRS = '3800'
    BLF00-EKORG = '2000'
    BLF00-KTOKK = "LIEF'
    other all data like (Bank detail, purchasing data, accounting data, dunning data) are coming from that single XLS file.
    Problem while creating Batch Input Session: <b>"Vendor FOX1221: data retention at plant level not allowed"</b>
    Why??? Reading and converting data is fine.. but still problem terminates the BDC.
    Please help me out
    Thanks,
    Chetan Shah

    Hey it is solved, just making WERKR (Data retaintion at Plant Level) = 'X'
    Thanks,
    Chetan Shah

  • Vendor Bank details in vendor master data

    Hi
    There are two tabs in vendor master data:
    1. Payment Transaction tab
    2. Payment Transaction accounting tab.
    Now i have 100 different vendors with all vendors having account in 20-25 banks. Even if the bank is same, these vendors have account in different branches.
    Now in SAP will i have to create so many bank keys for 100 different vendors?
    In payment transaction tab, there is only one field for our house bank for making payment through APP. What if i need to pay to different banks? Where i will maintain multiple house bank in such cases.
    Please reply for above two queries.

    Hi  Deepak,
    Please understand that there is a total disconnect between the House banks(internal Banks) that you create in FBZP and between the vendor bank Accounts. For Vendor banks you don't need to create House Banks..but YES, you will have to create bank Keys as many as required to maintain Vendor bank details in XK02..Payment transactions tab.
    If you have more than one Bank from which you want to pay.. then maintain all those Banks in FBZP and link it to Payment Methods and when you run APP, you can choose which Bank you want to pay from..
    Secondly, while posting Invoice also if you are sure about the Bank that you want to use.. enter house Bank while posting..
    Thirdly, if you are sure about the Vendor that he gets paid through a particular bank only.. maintain that particular bank in the vendor master data.. and if you are not sure about the Bank.. keep it blank..and decide in APP variant which bank you want to pay from..
    Vendor master bank details of the vendors are used to send to Bank,.. so that the money can be directly credited in the vendor Bank account..
    Hope this helps..
    Regards,
    SAPFICO

  • Standard method to archive/delete all vendor master data

    Hi every abap expert
    Does anyone know how to archive all vendor master data
    in a client?
    If use T-code : SARA . The vendor master data is required to mark deletion flag before archiving.
    Any standard T-code can set all vendor master data with  marked deletion flag ?

    Hi Boris!
    Give XK99 a try. With XK06 a single change is possible and in FI also FK06 is available.
    When XK99 has problems with field LFA1-LOEVM, then you can make easily a CATT for XK06.
    Regards,
    Christian

  • AR/AP Vendor Master Data

    Hi Gurus,
    When  creating vendor master data, is there any possibility of defaulting some fields by vendor group so that creation can be simplified/eased?
    please advice.
    many thanks
    cecile

    Hi Cecile,
    If you want to create a Vendor/Customer master Manually then you can create Customer with reference . While creating customer you can give the existing customer number .
    Point to consider while creating with reference ..
    -->If you only enter the customer number in the reference section, the system will only copy the general data into the new customer master record. If you also enter data on the sales area, the sales and distribution data will also be copied. Only data, which can be identical for both master records, is copied. For example, address and unloading points are not copied, while country, language and account group are. but You can change all copied data.
    If you want to create multiple record then use LSMW with help of BDC recording OR use BAPI - BAPI_CUSTOMER_CREATEFROMDATA1 or as suggested other BAPIs.
    please go through below link ,,if you are creating first time master data ..
    Master Data Upload - First Time, Then Must Read
    Regards
    Atul

  • Get PO from vendor master data

    Hi,
    Those any body knows a BAPI or FM that would get the PO that was created in the IDOC from vendor master data?
    Please help...
    thank you...
    regards,
    mae

    Hi Mae,
    hope this may be of some help.
    REPORT zpo_bapi_purchord_tej.
    DATA DECLARATIONS *
    TYPE-POOLS slis.
    TYPES: BEGIN OF ty_table,
    v_legacy(8),
    vendor TYPE bapimepoheader-vendor,
    purch_org TYPE bapimepoheader-purch_org,
    pur_group TYPE bapimepoheader-pur_group,
    material TYPE bapimepoitem-material,
    quantity(13),
    delivery_date TYPE bapimeposchedule-delivery_date,
    net_price(23),
    plant TYPE bapimepoitem-plant,
    END OF ty_table.
    TYPES: BEGIN OF ty_alv,
    v_legs(8),
    success(10),
    v_legf(8),
    END OF ty_alv.
    TYPES: BEGIN OF ty_alv1,
    v_legf1(8),
    v_msg(500),
    END OF ty_alv1.
    *-----Work area declarations.
    DATA: x_table TYPE ty_table,
    x_header TYPE bapimepoheader,
    x_headerx TYPE bapimepoheaderx,
    x_item TYPE bapimepoitem,
    x_itemx TYPE bapimepoitemx,
    x_sched TYPE bapimeposchedule,
    x_schedx TYPE bapimeposchedulx,
    x_commatable(255),
    x_alv TYPE ty_alv,
    x_alv1 TYPE ty_alv1,
    x_alv2 TYPE ty_alv1.
    *-----Internal table declarations.
    DATA: it_table TYPE TABLE OF ty_table,
    it_commatable LIKE TABLE OF x_commatable,
    it_item TYPE TABLE OF bapimepoitem,
    it_itemx TYPE TABLE OF bapimepoitemx,
    it_sched TYPE TABLE OF bapimeposchedule,
    it_schedx TYPE TABLE OF bapimeposchedulx,
    it_alv TYPE TABLE OF ty_alv,
    it_alv1 TYPE TABLE OF ty_alv1,
    it_alv2 TYPE TABLE OF ty_alv1.
    DATA: po_number TYPE bapimepoheader-po_number,
    x_return TYPE bapiret2,
    it_return TYPE TABLE OF bapiret2,
    v_file TYPE string,
    v_temp(8),
    v_succsount TYPE i VALUE 0,
    v_failcount TYPE i VALUE 0,
    v_total TYPE i.
    DATA: v_temp1(5) TYPE n VALUE 0.
    DATA: x_event TYPE slis_t_event,
    x_fieldcat TYPE slis_t_fieldcat_alv,
    x_list_header TYPE slis_t_listheader,
    x_event1 LIKE LINE OF x_event,
    x_layout1 TYPE slis_layout_alv,
    x_variant1 TYPE disvariant,
    x_repid2 LIKE sy-repid.
    DATA : it_fieldcat TYPE TABLE OF slis_t_fieldcat_alv.
    SELECTION-SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK v_b1 WITH FRAME.
    *-----To fetch the flat file.
    PARAMETERS: p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK v_b1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN.
    IF p_file IS INITIAL.
    MESSAGE text-001 TYPE 'E'.
    ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    *-----To use F4 help to find file path.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_file.
    v_file = p_file.
    START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM gui_upload.
    LOOP AT it_table INTO x_table.
    PERFORM header_details.
    v_temp = x_table-v_legacy.
    LOOP AT it_table INTO x_table WHERE v_legacy = v_temp.
    PERFORM lineitem.
    PERFORM schedule.
    ENDLOOP.
    DELETE it_table WHERE v_legacy = v_temp.
    PERFORM bapicall.
    MOVE po_number TO x_alv-success.
    APPEND x_alv TO it_alv.
    CLEAR x_alv.
    *-----To clear the item details in internal table after the operation for a header.
    REFRESH: it_item,
    it_itemx,
    it_sched,
    it_schedx.
    CLEAR: v_temp1.
    ENDLOOP.
    v_total = v_succsount + v_failcount.
    PERFORM display_alv.
    FORM GUI_UPLOAD *
    FORM gui_upload .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = v_file
    filetype = 'ASC'
    TABLES
    data_tab = it_commatable
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17
    IF sy-subrc = 0.
    *-----To fetch the comma seperated flat file into an internal table.
    LOOP AT it_commatable INTO x_commatable.
    IF x_commatable IS NOT INITIAL.
    SPLIT x_commatable AT ',' INTO
    x_table-v_legacy
    x_table-vendor
    x_table-purch_org
    x_table-pur_group
    x_table-material
    x_table-quantity
    x_table-delivery_date
    x_table-net_price
    x_table-plant.
    APPEND x_table TO it_table.
    ENDIF.
    CLEAR x_table.
    ENDLOOP.
    ENDIF.
    ENDFORM. " gui_upload
    FORM HEADER_DETAILS *
    FORM header_details .
    MOVE 'NB' TO x_header-doc_type.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-vendor
    IMPORTING
    output = x_table-vendor
    MOVE x_table-vendor TO x_header-vendor.
    MOVE x_table-purch_org TO x_header-purch_org.
    MOVE x_table-pur_group TO x_header-pur_group.
    x_headerx-doc_type = 'X'.
    x_headerx-vendor = 'X'.
    x_headerx-purch_org = 'X'.
    x_headerx-pur_group = 'X'.
    ENDFORM. " header_details
    FORM LINEITEM *
    FORM lineitem .
    v_temp1 = v_temp1 + 10.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = v_temp1
    IMPORTING
    output = v_temp1.
    MOVE v_temp1 TO x_item-po_item.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-material
    IMPORTING
    output = x_table-material.
    MOVE x_table-material TO x_item-material.
    MOVE x_table-quantity TO x_item-quantity.
    MOVE x_table-net_price TO x_item-net_price.
    MOVE x_table-plant TO x_item-plant.
    x_itemx-po_item = v_temp1.
    x_itemx-material = 'X'.
    x_itemx-quantity = 'X'.
    x_itemx-net_price = 'X'.
    x_itemx-plant = 'X'.
    APPEND x_item TO it_item.
    APPEND x_itemx TO it_itemx.
    CLEAR: x_item, x_itemx.
    ENDFORM. " lineitem1
    FORM SCHEDULE *
    FORM schedule .
    MOVE x_table-delivery_date TO x_sched-delivery_date.
    MOVE v_temp1 TO x_sched-po_item.
    x_schedx-delivery_date = 'X'.
    x_schedx-po_item = v_temp1.
    APPEND x_sched TO it_sched.
    APPEND x_schedx TO it_schedx.
    CLEAR: x_sched, x_schedx.
    ENDFORM. " schedule
    FORM BAPICALL *
    FORM bapicall .
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    poheader = x_header
    poheaderx = x_headerx
    IMPORTING
    exppurchaseorder = po_number
    TABLES
    return = it_return
    poitem = it_item
    poitemx = it_itemx
    poschedule = it_sched
    poschedulex = it_schedx.
    IF po_number IS NOT INITIAL.
    v_succsount = v_succsount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legs.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ELSE.
    v_failcount = v_failcount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legf.
    MOVE x_table-v_legacy TO x_alv1-v_legf1.
    LOOP AT it_return INTO x_return.
    IF x_alv1-v_msg IS INITIAL.
    MOVE x_return-message TO x_alv1-v_msg.
    ELSE.
    CONCATENATE x_alv1-v_msg x_return-message INTO x_alv1-v_msg SEPARATED BY space.
    ENDIF.
    ENDLOOP.
    APPEND x_alv1 TO it_alv1.
    CLEAR x_alv1.
    ENDIF.
    ENDFORM. " bapicall
    FORM DISPLAY_ALV *
    FORM display_alv .
    PERFORM x_list_header.
    PERFORM build_fieldcat CHANGING x_fieldcat.
    x_repid2 = sy-repid.
    x_event1-name = 'TOP_OF_PAGE'.
    x_event1-form = 'TOP_OF_PAGE'.
    APPEND x_event1 TO x_event.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = x_fieldcat
    i_callback_user_command = 'USER_COMMAND'
    i_callback_top_of_page = 'TOP_OF_PAGE'
    i_save = 'A'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv
    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_master_data
    FORM USER_COMMAND *
    FORM user_command USING ucomm LIKE sy-ucomm selfield
    TYPE slis_selfield.
    READ TABLE it_alv INTO x_alv INDEX selfield-tabindex.
    CLEAR : x_alv2,it_alv2[].
    LOOP AT it_alv1 INTO x_alv1 WHERE v_legf1 = x_alv-v_legf.
    x_alv2 = x_alv1.
    APPEND x_alv2 TO it_alv2 .
    ENDLOOP.
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv.
    DATA : x3_fieldcat LIKE LINE OF it_fieldcat.
    CLEAR : x3_fieldcat,it_fieldcat[].
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_LEGF1'.
    x3_fieldcat-reptext_ddic = text-111.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_MSG'.
    x3_fieldcat-reptext_ddic = text-112.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    x_layout1-colwidth_optimize = 'X'.
    x_layout1-zebra = 'X'.
    IF it_alv2[] IS NOT INITIAL.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = it_fieldcat
    i_save = 'A'
    i_callback_top_of_page = 'TOP'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv2
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDIF.
    ENDFORM.
    FORM USER_COMMAND *
    FORM top.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = 'Commentry'.
    ENDFORM.
    FORM BUILD_FIELDCAT *
    FORM build_fieldcat CHANGING et_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: x1_fieldcat TYPE slis_fieldcat_alv.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '1'.
    x1_fieldcat-fieldname = 'V_LEGS'.
    x1_fieldcat-reptext_ddic = text-108.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '2'.
    x1_fieldcat-fieldname = 'SUCCESS'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-109.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '3'.
    x1_fieldcat-fieldname = 'V_LEGF'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-110.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    ENDFORM. " build_fieldcat
    FORM BUILD_LIST_HEADER *
    FORM x_list_header.
    DATA: x_list_header1 TYPE slis_listheader.
    *-----List Header: type H
    CLEAR x_list_header1 .
    x_list_header1-typ = 'H'.
    x_list_header1-info = text-105.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: type S
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-106.
    x_list_header1-info = v_total.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: Type S
    CLEAR x_list_header1 .
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-107.
    x_list_header1-info = v_succsount.
    APPEND x_list_header1 TO x_list_header.
    ENDFORM. " build_list_header
    FORM TOP_OF_PAGE *
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = x_list_header.
    ENDFORM. " TOP_OF_PAGE
    cheers,
    Hema.

  • Archiving of Vendor Master Data,

    Hi All,
    I want to Archive Vendor Master data .
    For this purpose , I used two Archiving Objects - FI_DOCUMNT and FI_ACCPAYB so that I can archive data from tables LFA1 and LFB1.
    After archiving using FI_DOCUMNT , I tried archiving(write) using FI_ACCPAYB.The job did not pick up even a single record with an eror - transaction figures exist.
    Hence to remove  transaction figure I used Archiving Object FI_MONTHLY. After Archiving using FI_MONTHLY,
    when I again tried archiving FI_ACCPAYB,I faced another error - "cleared items still exist".
    I found out 3 tables related to cleared Items.
    BSE_CLR
    BSAK
    BSAS
    I got cleared Items cleared form BSE_CLR through FI_DOCUMNT,but those cleared items still exist in rest two tables.For all these three tables archiving object is same i.e. FI_DOCUMNT. I don't know why it did not delete data from rest two tables.
    Please clear my following doubts-
    1. what is the proper data dependency and archiving Object to archive Vendor master data.
    2. In DB15 -When we search tables for a particular   archiving Object, does it mean that that particular Archiving object will archive data from all tables listed for that OBJECT.

    Hi Deepti,
    Archiving object FI_ACCPAYB is dependent on various other archiving objects such as FI_DOCUMNT, MM_EKKO and so on which means that before archiving FI_ACCPAYB, first we have to archive dependent AO if we want to keep track on all the transaction data for this Vendor.
    You can directly archive VMR with FI_ACCPAYB with out considering dependent archiving object also, Prerequisites for this are:
    1. There should be no open items for this vendor
    2. It should be marked for archiving at company code level and Purchase organization level.
    3. Deletion indicator should be marked through Preprocessing program
    If a VMR have all the above criteria then you can archive the vendor.
    2 Question:
    When we archive then write program picks up the data from the table that is mentioned in the DB15 transaction under the particular archiving objects.
    Reward if it is benifits.
    -Thanks,
    Ajay

Maybe you are looking for

  • CRM_ORDER_MAINTAIN probability problem

    i  use CRM_ORDER_MAINTAIN to create order. In this order I have several partners, items etc. in opport_i use following code: ls_opport_h-ref_handle = 1. ls_opport_h-curr_phase = lv_curr_phase. ls_opport_h-expect_end = lv_expect_end. ls_opport_h-proba

  • Ipod also locked

    My Ipod all of a sudden stopped working. I tried reseting it and it just has a briefcase on it with an exclamation mark. Then instead of being color, its in black and white like it degreased into a first generation ipod.....I have tried contacting ap

  • Question: Securing Communications in Web Services: A Tutorial

    Hi all, I have been following this tutorial: http://developers.sun.com/prodtech/identserver/reference/techart/secure-ws.html And it was a pissed-off experience. I have only spent 5 mins on it and I am already stuck. Anyway, when I try to deploy the S

  • Managing patches with Sun Update Connection

    I have just started using updatemanager to download and install my patches and found some issues I would like to discuss. First, the patch that updates the software to version 1.0.3 (121119-03) was not available on updatemanager itself. I found it on

  • Freezing of Picture/Tech Service Failed To Show Up On 3 Separate Repair Calls

    Have had U-verse TV over one year without problems.  Four days ago, picture freezing started with wireless receiver only.  Wired receiver in other location works fine.  Did all troubleshooting procedures, ie.reboots, etc. as recommended to no avail.