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*

Similar Messages

  • Vendor master data upload

    how do we upload vendor master data into SAP from legacy system.can anyone give me a detailed explination.
    regards,
    deepthi

    Deepthi,
    The steps would be (in LSMW) :
    1 Create a new Project, Subproject (if not existing). Then give a name for the Object, say VendorMaster.
    2 On the next screen, you will see several steps (radio buttons) to be performed. You should go in sequential order.
    Double click the first, I think its called Maintain Object (sorry don't have access to SAP system right now)
    3 On this screen you will see various options/methods (in the second section) for loading the data.
    You may select which ever is appropriate or most suitable in your case.
    Let's assume you want to use the very first options - Standard program for Direct Input/Batch.
    4 Pull down (F4) for the Object & select Vendor Master.
    5 Pull down again for the Method & select (I think( Standard). The program name & Type will be populated by LSMW.
    If let's say none of the programs in this list satisfies your requirement, then you may decide to go for a Recording or a BAPI (again pull down & select appropriate method) or IDoc (CREMAS).
    So now you have decided on the method you want to use for posting the Vendor Master data. Save the information & go back to the main screen of the object.
    6 Double click on the next step for maintaining the Source Structure. Give the name(s) of the Source Structure(s).
    7 Next step is to define the Source Structure(s) format (fields, attributes etc).
    8 Next you maintain the relationship between the Structure(s) - Source & Target. The Target structures depend upon the method elected by you in step 5.
    9 Next will be the most important step - ie specifying the mapping/conversion rules for each Target field. You can even write ABAP code by double clicking on the field - it will open up the editor where you can put in your ABAP code. There are also several events available - for instance at the <i>Beginning of Processing</i> or <i>Beginning of Transaction</i> etc. where again you can specify your own logic.
    10 In the Next 2 steps you will give the file name & path & also associate the file(s) to the Source structure(s).
    The develoment for the object is complete. Now you are ready to read, convert & post your Vendor Master data in SAP.
    Let me know if you need additional assistance.
    Regards,
    Homiar.

  • LSMW - Vendor Master DATA - IBAN management

    Dear SAP guru's,
    I'm trying to integrate the IBAN in vendor master data with my LSMW (batch recording techno).
    unfortunately, I do not have the IBAN information in structure BLFBK
    BLFBK Vendor Master Record Bank Data (Batch Input Structure)
    DO you know how we can integrate an IBAN by LSMW? Batch recording seems to be too risky..
    And I do not have the BBAN info, I only receive the IBAN...
    Thanks for your comments,
    Karim

    Hello,
    With batch, it is not possible to have IBAN details updated in Vendor master data. This should be done manually, when the IBAN
    number is entered system will do the validation checks as per the legal requirements using the specific Function modules for each country.
    Nevertheless, there is batch input program RFBIKR00 which is used for processing the following data:
    - Creating and changing vendor master data
    - Creating bank master data
    Please, note that the program RFBIKR00 cannot import master data which contains the usual account number and the IBAN at the same time. There has to be either an IBAN or an account number in the imported file.
    There are 2 scenarios how to get all the data imported, depending from
    the source system:
    1. If the source is also an SAP system, you can import the account numbers using the RFBIKR00 and then transport the IBANs separately using the ALE distribution (RFIBAN_ALE).
    2. If the source is a non SAP System, then file contains always two entries for a payment instruction. In the first one the account number will be imported, in the second one the IBAN. The functionality "IBAN without account number" is prerequisited and has to be active in the target system. In this scenario 2 payment instructions would be created in the vendor master(LFBK), one with the account number, another one with the IBAN.
    I hope this helps to resolve the problem.
    Thanks and regards,
    Suresh Jayanthi.

  • 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

  • Error while replicating vendor master data from R3 to SRM

    Hi,
    I am trying to replicate Vendor master data from the R3 system to SRM system(7.0) for the first time and am facing the following error :
    Organizational unit 50000004  does not exist; check entries
    Message no. BBP_BUPA034
    I  have gone through the other posts with similar issues but haven't been able to find a solution.
    Any ideas?
    Thank you.

    hi sahlini
    did you create a vendor organisation structure via PPOCV_BBP ? SINCE YOU REFER THIS NUMBER 50000004 WHAT IS THIS?
    BR
    \MUTHU

  • Vendor Master Data extraction???

    Hi,
    I need to extract Vendor Master Data from SAP into a flat file.
    The format should be similar to file input required for the Vendor Master Upload program: RFBIDE00.
    Is there any program which can be used to extract the data in the required format?
    Any help is appreciated.
    Thanks and Regards,
    Varun

    hi varun,
    check this link..
    <a href="http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/vendor-master-data-extract-from-r3-to-flat-file-944432#">VENDOR MASTER EXTRACTION</a>
    <b>dont forget to mark helpful answers..</b>
    Message was edited by: Ashok Kumar Prithiviraj

  • Vendor Master Data - General and Company Code Data

    Hi,
    We are collecting vendor master data requirements. The requirements that I have are for Vendor General Data, Company Code Data (Accounting Info, Payment Transactions, Correspondence etc.) and Purchasing Org Data. Out of these 3 groups I can only see Vendor General Data that is mapped to CREMDM04 in SAP supplied syndication maps. I am wondering if someone could tell me how much effort is involved to first create the structure in MDM for Company Code data and Purchasing Data and then map these additional fields to CREMDM04 fields?
    Why is it that Company Code data and Purchasing Data is not mapped in pre-delivered syndication maps?
    Thanks in advance,
    M

    Thanks Shruti for your reply.
    I agree with you. However, our client is really pushing for Company Code Data and Purchasing Org data along with Vendor General Data. Now, this is something that is new to me to do. I have never done this kind of customization before.
    I would really appreciate if someone from SAP could give me their recommendation and also help me answer the following questions
    1. Is this doable to map and syndicate Company Code data and Purchasing Org data along with Vendor General Data
    2. Is it possible to then extract the tables that hold Company Code data and Purchasing Org data from ECC and bring it back in MDM to update MDM tables (that we are going to create for this data)?
    3. What's the effort involved in this customization (Considering that we will be extending our repository structure, extend the syndication map, extract new tables from ECC for MDM, create import maps for these tables to import Company Code and Purchasing Org data into MDM)
    Regards,
    M

  • Vendor master data-name 1 40 or 35 characters?

    Hi,
    In vendor master data, field name1, the data element show it has 40 characters, but in LFA1, the field length is 35.
    If I key in forty chaacters, and save, it is successful, go back to see it, it really display 40 characters, but check table:LFA1, I see only 35 characters, where other 5 character store? what is the logic of this?
    Thanks.

    Message no. AM228
    Diagnosis
    The address data maintained in field NAME1 occupies 40 of 40 characters The last 5 characters of the field NAME1 can be used only with restrictions.
    System Response
    In this form the data can be saved and used up to the complete length of 40 characters.
    In some scenarios, the system only uses the first 35 characters of name fields, of the fields 'Street', 'City', 'District', as well as the first 10 characters of the field 'Search Term 1'.
    These cases are:
    ALE: the address data can only be transferred with 35 characters (search term 1 only 10 characters) in the case of some ALE message types (IDOC types) for reasons of compatibility with other releases and components. The message types in question are:
    DEBMAS
    CREMAS
    DEBCOR
    CRECOR
    The problems do not occur if the relevant address data in IDOC ADRMAS is sent in each case, together with these message types.
    EDI: the address data can only be transferred with 35 characters (search term 1 only 10 characters) with the standard UN/EDIFACT for reasons of compatibility.
    Print: addresses are formatted with only 35 characters in some print forms for standard envelope windows. If the address number is in the address output structures, you can output the address fields in full length in forms. (See OSS note 145753 for FI forms.)
    Procedure
    If you do not want the address data to be truncated in these scenarios, only use the first 35 characters of the name fields, of the fields "Street", "City", "District" or the first 10 characters of the field "Search Term 1" during maintenance, or abbreviate the texts, if necessary.
    Effects on Customizing
    You can define when this system message is to be issued in accordance with your requirements.
    You do this in Customizing as follows: Cross-Application Components -> Bank Directory -> Change Message Control.
    The application area and message number

  • Modify vendor number when replicating vendor master data from ECC to SRM

    Hi,
    Is there a way  to modify vendor number(manually input vendor number e.g. from a file) when replicating vendor master data from ECC to SRM using the vendor master data user exit (SAPMF02K)?
    Does anyone have documentation on the user exit, how do I use it??
    Thanks and Regards'
    David

    Hi David,
    Please go through the link below:
    [Enhancement SAPMF02K Vendor Master Data  - question about LIFNR;
    Regards
    Anirban

  • Error importing vendor master data from ERP

    Hi experts,
    currently we are trying to import vendor master data from ERP to SAP Sourcing 9.
    We exported the data in an XML file by using the transaction BBP_ES_MAST_DOWNLOAD.
    We already imported all the dependencies like vendor account group, purchase org, regions etc. successfully.
    However, every time we are trying to import the vendor data we receive the same result:
    Data Import:
    Trace.txt:
    Do you have any hints why this happens?
    Thanks in advance and best regards,
    Johannes

    Hello Johannes,
    This looks to come from a custom script in your system.
    Go to Setup > Script Definition and check all scripts defined on class "Supplier" (starting with those on context: Import Lifecycle Event).
    Search for a script that starts with "throw doc.createApplicationException(test..."
    Regards,
    Bogdan

  • LSMW Upload vendor master data

    I am uploading vendor master data via a batch input in LSMW (program RFBIKR00).
    I uploaded all the vendors for 1 company code.
    When I try to upload the vendors for another company code, in the step “Create Batch Input Session” I get the error: “Trans. 1 XK01 : Acct already exists; general area not being processed, ... Data in table BLFA1 cannot be processed”.
    When I try to manually create a vendor for another company code via tcode XK01, I have no problems. But when I create an existing vendor manually for another company code I don’t have to add the information which is contained in table lfa1.
    Therefore I tried to upload the vendor, which has to be created for the company code, with a “/” in the data for table lfa1. But this doesn’t work.
    Has somebody a suggestion to solve this problem?
    Thanks

    In the similar thread you said:
    "If the vendor exists in LFA1 but not LFB1, use XK02 with the structures for LFA1. Then use XK01 with the structures for LFB1."
    It is not possible to use XK02 in order to create the vendor for another company code if the vendor already exists with a certain company code. You will get the error "Vendor xxx has not been created for company code yyy".
    The problem is that LSMW requires a mapping onto structure LFA1, but when the vendor already exists for a certain company code, LSMW returns in the step "Create Batch Input Session" the error: "Trans. 1 XK01 : Acct already exists; general area not being processed, ... Data in table BLFA1 cannot be processed".

  • How to find all the Master data extract structures and Extractors

    I intend to create Master data dimensions closely similar to SAP BI in a 3rd party system. I would like to use SAP's standard extractors for populating the master data structures in SAP BI and then use a proprietary technology to create similar structures in a 3rd party database.
    Question: How to get a complete list of all Master data extract structures and corresponding extractors?
    Example: In ECC if I do SE80 and give 'Package' and 'MDX' and then press the 'display' spectacles, I get a list of structures and views under "dictionary objects" covering Material, Customer, Vendor, Plant Texts and attributes.
    How do I get the remainder of the Master data extract structures viz. Purchase Info Records, Address, Org Unit etc?
    Regards
    Sasanka

    Hi,
    try the table ROOSOURCE and search the data source with string in astrick attr  for master data and for text with text
    This will give you the list of all the master data source in the system and it contains a column which tells about the extract structure and function module used by each.
    Thanks
    Ajeet

  • Restrict access for Vendor Master Data

    Hi all.
    Our company structure is like below:
    Single instance, just one mandant.
    Company codes like 1001, 3001, 6002, 6006, etc... over the world.
    At some companies just the central administration can create vendor for the companies using the transaction XK01.
    Now we need to give access to users from one of our company from other country but we can´t give access to transaction XK01 because just the central administration can create the master data for the vendors.
    I already read about the object F_LFA1_AEN that is possible to create some field groups and give access just for the rigth groups. I also read that this authorization groups don´t have effect on the vendor master data like address.
    How can I restrict access for the vendor master data? I´m thinking to give access to transaction FK01 and MK01 and restrict access for create a new vendor, I only want that the users can create the data for a new company or new purchase organization.
    Thank you
    Darlei Friedel

    among many other authorization objects, you find following three:
    F_LFA1_GEN general data
    F_LFA1_BUK company code data
    M_LFM1_EKO purchasing org data.
    If the user does not have authorization for F_LFA1_GEN , then he cannot maintain general data.

  • 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.

  • *Journal Entries while uploading the vendor master data from legacy system*

    hi SAP Folks,
    can any one of you tell me the journal entries while uploading the vendor master data from legacy system to SAP system.
    Eg: legacy system is having 10000 vendors list, 1 reconciliation account and $ 1000000. while uploading all these data from legacy system to SAP what are the journal entries we get.
    thanks in advance.
    Edited by: ravindranath manikonda on Nov 24, 2008 1:12 PM

    Hi
    you will be having  only one entry logically
    i.e. Opening Bal. clrng A/c Dr.
           To Vendor A/c Cr.
    regards

Maybe you are looking for

  • Problem deploying related EJBs in separate JARs

    I have 2 entity EJBs, User and Address, in separate JAR files. The User bean has business methods to get and set its related address as follows: void setAddressPK(AddressPK newAddress) throws java.rmi.RemoteException; AddressPK getAddressPK() java.rm

  • ORA-22990 ( Cannot span lob... ) while using connection pooling...

    Hi all, I am maintaining a web site that has lots of requests ( about 10 requests a second ) to an Oracle table that has a BLOB field. Those requests create new blobs, updates them and reads them... My program worked fine until I started using connec

  • Desaturate and channel mixer

    Hi, I have a clip that I have made b&w by applying colour correction and dragging the saturation to 0. I was wondering if someone knows what RGB channel mix does FCE use when we do desaturate? I tried replicating the same with channel mixer and chang

  • HP Deskjet 3510 black in not printing

    Hi everyone!  My son was given this printer (new) from his cyber school.  We set it up (it came with the HP ink already) and it doesn't print in black ink.  Actually, when I first tried to print something it came out what I'm guessing is grayscale. S

  • Lwapp upgare problem

    Good Day, I am trying to upgrade an AP-1252 from autonomous to LWAPP. I downloaded file c1250-rcvk9w8-tar.124-10b.JA3 but the upgrade tool rejects it claiming that the image is not a valid one. Should I be using a different file. Is there some other