How To handle complex Flat File in BDC( V.V. Urgent)

Hi All,
Anybody help in these case.
I have to write the BDC for a complex File.
Here is the Scenario
I An recording for Tcode CN21.
1network -> many activities
1 Activity ->many components
Any body Help ifor this case,
Points will be awarded.
Regards,
Jayasimha

Hi Jayasimha
Can u explain what is the problem that u are facing? we will be able to help u if u let u know what is the problem.
as far as what u have mentioned, first do a recording in SHDB for the transaction CN21 and then in the program get all the data from the flat file into an internal table. then build a BDC.
Cheers

Similar Messages

  • How to handle reference Flat File for Dimentions in Tabular model

    I have 2 flat files, which are needed in creating one Country dimention.  
    In SSAS OLAP cube, I would import these 2 files to 2 staging table. I would ETL to one DimCountry table on DW.
    How to do with Tabular model?
    Should both Files imported to Tabular model and then Insert new Columns and DAX to create needed relationships?
    Kenny_I

    Hi Kenny_I,
    According to your description, you want to know how to import flat files into SQL Server Analysis Services tabular model, right?
    In your description, you said that "you can import these 2 files to 2 staging table, then ETL to one DimCountry table on DW in OLAP cube." Based on my research, the flat files are not supported as the datasource of SSAS tabular model. So you can import
    these 2 files to 2 staging table, and import the tables into SSAS tabular model.
    Reference
    http://msdn.microsoft.com/en-in/library/gg492165.aspx
    http://msdn.microsoft.com/en-us/library/hh230968.aspx
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How IE works for  flat file

    Hi all:
         As we all know that, when IE gets a idoc's service name from SLD, then use it with idoc's message type and Idoc type to do receiver determniation, what about flat file ? how can we know its Service name and interface name  if there is only a flat file on FTP?  how IE works for Flat file ?
         Couldn't thank you more

    Hi,
    For any idoc scenarious, you would use business systems rather than business service which is stored in SLD. So the IE would fetch it from SLD at runtime.
    For file based scenarious also, you can create business system as type third party and use the same.
    Is that answer your question?
    Regards
    Krish

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • How to upload a Flat file into sap database if the file is in Appl'n Server

    Hello Sap Experts , Can you tel me
    " How to upload a Flat file into sap database if the file is in Application Server.
    what is Path for that ?
    Plz Tel Me its Urgent
    Thanks for all

    Hi,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    * Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • How to create a flat files and how i used this

    hi Guys and gals,
    I am david. I want to know how to create a flat files. I don't know about it also. pls explain it and also pls help me to create a flat files. If u have any program for creating pls send me.
    I want to know about retrive the datas from flat files and also insert a record into it.
    pls guide me
    i need this immediately
    david

    void newMethod() throws Exception {
         // Reading from a flat file
         String data;     
         BufferedReader br = new BufferedReader(new FileReader("c:\filename1.txt"));
         while ((data = br.readLine()) != null) {
              System.out.println(data);
         // Writing to a flat file
         BufferedWriter bw = new BufferedWriter(new FileWriter("c:\filename2.txt"));
         bw.write("sample data");
         // After writing the data close the file
         bw.close();
    }

  • How to upload a excel file using BDC

    how should i upload a file using BDC
    i have downloaded a excel file containing the values of  table A006 a X server.
    now i hav to upload it into new server Y server using BDC , how do i do it?
    wat all things one shud consider ?

    Hi,
    This is very simple, follow the below mention steps to do so:
    1.Declare an internal table having same structure as db table, but take all the fields type as 'C' and length same as defined in the table.
    TYPES:BEGIN OF it,
      key(20) TYPE c,
      indicator(20) TYPE c,
      bldat(20) TYPE c,"bkpf-bldat
      budat(20) TYPE c,"bkpf-budat
      END OF it.
    DATA: itab TYPE STANDARD TABLE OF it,
          wa TYPE it.
    2.Include TRUX as type pool and declare a variable of type trux_t_text_data to be passed in the FM that actually reads data from excel sheet into above declared intrenal table.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    3. Call the FM 'TEXT_CONVERT_XLS_TO_SAP' and pass the file name and the internal table name into the parameter
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *    I_FIELD_SEPERATOR          = 'X'
         i_line_header              = 'X'
          i_tab_raw_data             = it_raw
          i_filename                 = p_file "name of the excel file
        TABLES
          i_tab_converted_data       = itab[] "internal table where data will be stored
       EXCEPTIONS
         conversion_failed          = 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.
    4. loop at internal table and modify the ztable/dbtable where data to be upload .
    Hope this solve your problem.
    Pooja

  • How to query the flat files?

    Hi
    How to query the flat files that are used in Etl From EBS source.

    That can be done in OBIEE. Save the flat file as .csv format. Then go to ODBC Administrator on windows machine where you BI server is running, and create an System DSN and select "Microsft Access Text Driver (*.txt, *.csv)" as driver type.
    Next, import tables in RPD using this ODBC connection. Rest of the steps as same as building model from a table source.
    Hope this helps.

  • How we create a flat file on the application server

    hi,
    how we create a flat file on the application servere,this file have the header data and corresponding item data also.
    i.e. how we use the AT NEW and ATEND. statement in this file creation.
    pls send me some code related to this.
    thanks,
    vipin

    Hi Grafl,
    Chk this link
    Folder creation in AL11 using ABAP program
    try this code.This works on UNIX servers
    data: unixcom like   rlgrap-filename.
    data: begin of tabl occurs 500,       
            line(400),    
          end of tabl.
    dir = unixcom = 'mkdir mydir'. "command to create dir
    "to execute the unix command 
    call 'SYSTEM' id 'COMMAND' field unixcom
                      id 'TAB' field tabl[].
    <b>Reward Points if Useful</b>
    Regards
    Gokul

  • How to capture errors records in flat file in BDC

    hi ,
        i would like to know how to capture error records while  uploading a flat file to screen through BDC .
    appreciatable solutions are rewarded.
    thanks,
    shan

    Hi shan,
    write this code, it will solve your problem.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA : I_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF I_ERR OCCURS 0,
              MATNR(18),
              FLAG(1),
              MSG(100),
           END OF I_ERR.
    DATA :V_LINES TYPE I.
    LOOP AT ITAB.
    REFRESH BDCTAB.
    PERFORM SCREEN USING: 'SAPLMGMM' '0060'.
    PERFORM FIELD USING: 'RMMG1-MATNR'  ITAB-MATNR,
                          'RMMG1-MBRSH' ITAB-MBRSH ,
                          'RMMG1-MTART' ITAB-MTART,
                          'BDC_OKCODE' '/00'.
    PERFORM SCREEN USING: 'SAPLMGMM' '0070'.
    PERFORM FIELD USING: 'MSICHTAUSW-KZSEL(01)' 'X' ,
                         'MSICHTAUSW-KZSEL(02)' 'X' ,
                         'MSICHTAUSW-KZSEL(09)' 'X' ,
                         'BDC_OKCODE' '=ENTR'.
    PERFORM SCREEN USING: 'SAPLMGMM' '0080'.
    PERFORM FIELD USING: 'RMMG1-WERKS' ITAB-WERKS,
                         'BDC_OKCODE' '=ENTR'.
    PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
    PERFORM FIELD USING:  'MAKT-MAKTX' ITAB-MAKTX,
                          'MARA-MEINS' 'EA' ,
                          'MARA-MATKL' '001',
                          'BDC_OKCODE' '/00'.
    PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
    PERFORM FIELD USING:  'BDC_OKCODE' '/00'.
    PERFORM SCREEN USING: 'SAPLMGMM' '4000'.
    PERFORM FIELD USING:  'MAKT-MAKTX' ITAB-MAKTX,
                          'MARA-MEINS' 'EA',
                          'MARC-EKGRP' '001',
                          'MARA-MATKL' '001',
                          'BDC_OKCODE' '=BU'.
    CALL TRANSACTION 'MM01' USING BDCTAB
                            MODE 'A'
                            MESSAGES INTO I_MSG.
    FINDING LAST MESSAGE IN THE I_MSG TABLE*****
    DESCRIBE TABLE I_MSG LINES V_LINES.
    ACCORDING TO THE V_LINES NUMBER TABLE WILL BE READ****
    READ TABLE I_MSG INDEX V_LINES.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = I_MSG-MSGID
       LANG            = '-D'
       NO              = I_MSG-MSGNR
       V1              = I_MSG-MSGV1
       V2              = I_MSG-MSGV2
       V3              = I_MSG-MSGV3
       V4              = I_MSG-MSGV4
    IMPORTING
       MSG             = I_ERR-MSG
    EXCEPTIONS
       NOT_FOUND       = 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.
    IF I_MSG-MSGID EQ 'M3' AND I_MSG-MSGNR EQ '800'.
    I_ERR-FLAG = 'S'.
    ELSE.
    I_ERR-FLAG = 'E'.
    ENDIF.
    I_ERR-MATNR = ITAB-MATNR.
    APPEND I_ERR.
    CLEAR I_ERR.
    ENDLOOP.
    WRITE:/ 'SUCCESS RECORDS' COLOR COL_POSITIVE.
    SKIP.
    WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
    LOOP AT I_ERR WHERE FLAG EQ 'S'.
    WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
    ENDLOOP.
    SKIP 2.
    WRITE:/ 'ERROR RECORDS' COLOR COL_NEGATIVE.
    SKIP.
    WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
    LOOP AT I_ERR WHERE FLAG EQ 'E'.
    WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
    ENDLOOP.
    *&      Form  SCREEN
         SCREEN
    form SCREEN  using P_PROG P_SCREEN.
    BDCTAB-PROGRAM = P_PROG.
    BDCTAB-DYNPRO = P_SCREEN.
    BDCTAB-DYNBEGIN = 'X'.
    APPEND BDCTAB.
    CLEAR  BDCTAB.
    endform.                    " SCREEN
    *&      Form  FIELD
       FIELD
    form FIELD  using  FNAME FVAL .
    BDCTAB-FNAM = FNAME.
    BDCTAB-FVAL = FVAL.
    APPEND BDCTAB.
    CLEAR BDCTAB.
    endform.                    " FIELD
    Thanks,
    Murali

  • Processing complex flat file

    I have a requirement to load complex (hierarchical) flat file to Oracle database. The flat file has multiple (different) records. Each record is fixed positional.Here is an example
    1 123455 6777888
    2566773 4444 test
    466666 7844 tyeww
    477777 7844 tyeww
    5213
    Records are identified by the first character in the line. (In this example we have record type 1, record type 2, record type 4 and record type 5). Also the records are hierarchical.
    Record Type 1
    ---Record Type 2 *
    ------Record Type 4 *
    ---Record Type 5
    When the data is loaded to database it should be normalized. That means I have to take some value from Record Type 1, Record Type 2 and Record Type 4.
    Can ODI handle this? do I have to write some script? If so How?

    OK,
    The following technique will help you:
    1) Create a database sequence
    2) create a interface to load a temp table (I named MY_TEMP_TABLE) with 1 "varchar' column so long as the biggest record (I named col_record), 1 column to store the sequence (I named col_seq) and 1 column to storage the parent line (that one should accept null values) (I named col_parent)
    3) Map the record to col_record at source
    4) Map the sequence to the col_seq at staging area
    5) at col_parent column, put the following code and map it to staging area:
    case when substr(src.col_record, 1,1) 1
    then (select max(col_sequence)
    from MY_TEMP_TABLE mtt
    where substr(mtt.col_record, 1,1) &lt; substr(src.col_record, 1,1)
    else
    null
    end
    PS: src.col_record is the column from your text file
    This code will create the right hierarchy to the file.
    after that, you can you the first technique that I told you, dragging and drooping this MY_TEMP_TABLE so many time as records types at a new interface, each one with the right filter, and create the joins.
    You could even, add one more column to load the record type and work with it instead the "substr" command in the above select and at filter in the new interface.
    Did I miss something? Does it solve the problem?

  • How to handle fixed lenth files in OSB

    Hi all,
    I will get a fixed length file as below
    length 1 to 512
    ISA00 00 086120930000 090162840692000 1012081221U003060000010710P>
    GS PO6120930000 016284069 1012081221000001071X 003060
    I want to convert these file to xml so that i can perform some transformation in it .
    The challenge is we cant achieve this with MFL reason GS is optional you wont know you will get it or not .like that you have many elements optional non-option complex elements we are not able to achieve this . We raised a SR with oracle support they said it is not possible with MFL .
    I can do this with NXSD but this fixed length file i will get it in JMS queue and OSB doesn't support JMS Adapter .So how will convert this fixed lenth file to xml in OSB.
    Thanks
    Phani

    Hi atheek,
    Thanks for the response .
    Can you share me u r mail ID i will share the flat file and optional and non - optional elements and input . if possible create a MFL and share with me .
    i am trying with MFL its not working .Its urgent.
    Thanks
    Phani

  • Problem in handling complex CSV file

    Hi,
    I am facing a strange problem in handling a complex CSV file.
    The content of the file is as follows. It is getting executed through an XSD and the target is a table.
    First time when the interface is executed ( for e.g session id - 19001) it is getting completed successfully.
    Now when making changes in the CSV file suppose adding ( for e.g.-
    DEPT,D05,Books,ABC Store
    CUST,C01,Sayantan,[email protected]
    CUST,C02,Shubham,[email protected])
    or deleting ( for e.g.-
    CUST,C02,Sarbajit,[email protected])
    and running the interface I am not getting the added D05 in the target table nor my C02 data is getting removed i.e.- the updated data in CSV file is not getting fetched and I am getting the same records as i got when i ran interface of session id 19001.
    I am not getting why it is happening??
    The CSV file used in session id -19001 is:
    DEPT,D01,Retail,World Mart
    CUST,C01,Anindya,[email protected]
    CUST,C02,Rashni,[email protected]
    DEPT,D02,Food,Food Bazar
    CUST,C01,Abhijit,[email protected]
    CUST,C02,Anirban,[email protected]
    CUST,C03,Sharmistha,[email protected]
    DEPT,D03,Water,SW
    CUST,C01,Nirmalya,[email protected]
    DEPT,D04,Clothes,City style
    CUST,C02,Sarbajit,[email protected]
    CUST,C03,Abhishek,[email protected]

    Here's what you can do to handle CSV files using HSQL.
    Say the CSV file contains order data. Each order record contains data about a particular order like order number, product code, quantity, ordered by, date etc. Now lets take a hypothetical requirement which says, the user needs to know how many orders were ordered per product.
    Option 1]  At the basic level, read the order file, parse each line and write the logic to get count of orders per product.
    Option 2] Load this CSV file into a database like MySQL and write database queries to get the orders per product.
    So where does this leave us? Have we run out of options? I am sure we would have tried & used the above two options . But I wanted a different approach. Following questions were lingering in my mind:
    1] Why can’t I write SQL queries against the CSV file itself. After all it’s like any RDBMS table.
    2] Why should I load the CSV file into some database before I query it?
    3] Why can’t I create a database table & attach the CSV file to it?
    Continue Reading Here: Handling CSV Files

  • Flat files in BDC

    hi......to everybody.....
    i am working on session method with two application(transaction)s.
    i have the data in two flat files separate related to those applications in presentation server.
    how to update the data into the data base?
    Message was edited by:
            Alvaro Tejada Galindo

    HI,
    there is no difference as far as the code is concerned for the BDC.. only change is u use bdc_open_group,bdc_insert and bdc_close_group function modules instead of call transaction..
    See the example
    REPORT Z_PCA_PL
                         MESSAGE-ID ZYFI
                         NO STANDARD PAGE HEADING
                         LINE-SIZE  100.
    Progname    : ZF_BDCP_PCPLANE_01                                     *
    Request no  : RTDK905785
    Description : Profit center plan data upload for KIMO dates
    LOGICAL DB  :            VERSION OF :                                *
    AUTHOR      : Krishna M
    DATE        : 28/04/2004
    MODIFICATION LOG (latest change first):                              *
      TABLES
    *-- Imternal table declaration.
    DATA : BEGIN OF IT_UPLOAD OCCURS 0,
           YEAR(4),                        " Year Variable
           PROFIT(10),                     " Profit Center Variable
           GLACCOUNT(13),                  " GL account Variable
           AMOUNT(10),                     " Amount Variable
           END OF IT_UPLOAD.
    *-- Declaration of bdc data.
    DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *-Internal table for message control
    *data : msgtab like bdcmsgcoll occurs 0 with header line.
    *--Selection screen declaration
    SELECTION-SCREEN  BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
              PARAMETERS:  P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
             A T  S E L E C T I O N - S C R E E N .
    *--Value request for the file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      PERFORM VALUE_REQUEST.
                   S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
    *-- Upload data into internal table it_upload.
      PERFORM UPLOAD.
      PERFORM PROFIT_CENTER.
      PERFORM BDC_OPEN_GROUP.
      PERFORM CALL_TRANSACTION.
    *-- Close the bdc group
        PERFORM BDC_CLOSE_GROUP.
    *&      Form  upload
    Uploading of the flat file into the internal table
    FORM UPLOAD.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME            = P_FILE
                FILETYPE            = 'DAT'
           TABLES
                DATA_TAB            = IT_UPLOAD
           EXCEPTIONS
                CONVERSION_ERROR    = 1
                FILE_OPEN_ERROR     = 2
                FILE_READ_ERROR     = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                OTHERS              = 8.
      IF SY-SUBRC <> 0 .
        MESSAGE E999 WITH TEXT-002.      "File cannot be Uploaded
      ENDIF.
    ENDFORM.                    " upload
    *&      Form  value_request
          IN PUT HEPL REQUEST
    FORM VALUE_REQUEST.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_FILENAME     = ' '
                DEF_PATH         = 'C:\'
                MASK             = ',.txt,.*.'
                MODE             = 'S'
                TITLE            = TEXT-003  "'Upload'
           IMPORTING
                FILENAME         = P_FILE
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
      CASE SY-SUBRC.
        WHEN 3.
          MESSAGE I999 WITH TEXT-004.        "Selection Cancel
        WHEN 4.
          MESSAGE I999 WITH TEXT-005.        "Selection Error'.
      ENDCASE.
    ENDFORM.                    " value_request
            form call_transaction.
    FORM CALL_TRANSACTION.
      IF NOT IT_UPLOAD[] IS INITIAL.
        LOOP AT IT_UPLOAD.   " loop at it_upload
          PERFORM FILL_BDC.
        ENDLOOP.
      ELSE.
        MESSAGE E999 WITH TEXT-010. " 'No records found'.
      ENDIF.
    ENDFORM.
    *&      Form  fill_bdc
         This form is used to fill the bdcdata & call the transaction    *
    FORM FILL_BDC.
          PERFORM PROFIT_CENTER_UPLOAD.
    ENDFORM.
    *&      Form  Profit_Center_Upload.
    FORM PROFIT_CENTER_UPLOAD.
       PERFORM FILL_BDCDATA USING:
        'SAPLKPP0'               '1000'                           'X',
        'bdc_cursor'             'kpp0b-value(03)'                ' ',
        'kpp0b-value(03)'        IT_UPLOAD-YEAR                   ' ',
        'bdc_cursor'             'kpp0b-value(06)'                ' ',
        'kpp0b-value(06)'        IT_UPLOAD-PROFIT                 ' ',
        'bdc_cursor'             'kpp0b-value(09)'                ' ',
        'kpp0b-value(09)'        IT_UPLOAD-GLACCOUNT              ' ',
        'bdc_okcode'              '/00'                           ' ',
        'BDC_OKCODE'              '=CSUB'                         ' ',
        'SAPLKPP2'               '0103'                           'X',
        'bdc_cursor'             'BDC03(01)'                      ' ',
        'BDC03(01)'              IT_UPLOAD-AMOUNT                 ' ',
        'BDC_OKCODE'              '/00'                           ' ',
        'BDC_OKCODE'              '=CBUC'                         ' '.
    PERFORM BDC_INSERT.
    ENDFORM.
    *&      Form  fill_bdcdata
    This form is used to fill the IT_BDCDATA table                      *
    FORM FILL_BDCDATA USING PROGRAM  TYPE C
                              DYNPRO   TYPE ANY
                              DYNBEGIN TYPE C.
      IF DYNBEGIN = 'X'.
        IT_BDCDATA-PROGRAM  = PROGRAM.
        IT_BDCDATA-DYNPRO   = DYNPRO.
        IT_BDCDATA-DYNBEGIN = DYNBEGIN.
      ELSE.
        IT_BDCDATA-FNAM     = PROGRAM.
        IT_BDCDATA-FVAL     = DYNPRO.
      ENDIF.
      APPEND IT_BDCDATA.
      CLEAR  IT_BDCDATA.
    ENDFORM.                  " fill_bdcdata
    form profit_center
    FORM PROFIT_CENTER.
      PERFORM FILL_BDCDATA USING:
        'SAPLSPO4'               '0300'                           'X',
        'SVALD-VALUE(01)'        '0100'                           ' ',
        'BDC_OKCODE'             '=FURT'                          ' ',
        'SAPLKPP6'               '1007'                           'X',
        'RKPP6-PLPROF'           'RTA-PC-K'                       ' ',
        'BDC_OKCODE'             '=CWEI'                          ' '.
    ENDFORM.
          form bdc_open_group.
    FORM BDC_OPEN_GROUP.
      CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
                CLIENT = SY-MANDT
                GROUP  = '7KE1'
                KEEP   = 'X'
                USER   = SY-UNAME.
      IF SY-SUBRC NE 0.                    "Error in Opening error session
        MESSAGE E999 WITH TEXT-007.        "'Unable to open BDC Group'.
      ELSE.
        MESSAGE S999 WITH TEXT-008.       "Session created successfully"
      ENDIF.
    ENDFORM.
           form bdc_insert
    FORM BDC_INSERT.
    CALL FUNCTION 'BDC_INSERT'
        EXPORTING
             TCODE            = '7KE1'
         TABLES
              DYNPROTAB        = IT_BDCDATA[]
         EXCEPTIONS
              INTERNAL_ERROR   = 1
              NOT_OPEN         = 2
              QUEUE_ERROR      = 3
              TCODE_INVALID    = 4
              PRINTING_INVALID = 5
              POSTING_INVALID  = 6
              OTHERS           = 7.
      IF SY-SUBRC <> 0.
        MESSAGE E999 WITH TEXT-006.
        'Unable to Insert using Transaction 7KE1'.
      ENDIF.
      REFRESH IT_BDCDATA.
      CLEAR   IT_BDCDATA.
    ENDFORM.
    *&      Form  BDC_CLOSE_GROUP
       This form is used to close the group that is opend.
    FORM BDC_CLOSE_GROUP.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                NOT_OPEN    = 1
                QUEUE_ERROR = 2
                OTHERS      = 3.
    ENDFORM.                    " BDC_CLOSE_GROUP
    Thanks
    Mahesh

  • Thoughts on how LabVIEW handles checkout of file from SCC when file already open

    When you already have a file/project open in LabVIEW and it is set to read only because you haven't checked it out, you can go into SCC and do a checkout then save the file immediately. The issue with this is, if your local copy doesn't match the copy in SCC, you will probably be overwriting changes. Sometimes this is convenient because if you have ever edited a MS Word file and then gone to save and it won't let you because it was opened as read-only...then that sucks because you either lose your work, or have to do a copy of the entire word file->close the program->re-open as writable, then paste. This can be avoided with the "LabVIEW way", but the "MS Word" way seems much safer because it forces you to conscioiusly make the file writable (by either checking it out or manually write clicking and changing to writable) BEFORE opening it. I just wanted people's opinions on how LabVIEW handles this, and if there would be a better way.
    CLA, LabVIEW Versions 2010-2013

    VSS 
    CLA, LabVIEW Versions 2010-2013

Maybe you are looking for