Upload data for by table

Hello again. there use to be a website where there was a created table and lots of data with script on how to load it. anybody remember where that is?
thanks. i know how to create a table but unable, healthwise to sit and type in lots of data into fields.
Lorenzo

Are you referring to the old emp and dept demo tables in the scott schema? 10g does not have that, but has a human resources schema/user (user hr password hr). If you want the same scott schema with password tiger and the emp and dept tables that 9i had, you can run the old 9i script to create it. I have provided a copy for your convenience below, that you can copy and paste into a sql file, then start.
Rem Copyright (c) 1990, 1996, 1997, 1999, 2001 by Oracle Corporation
Rem NAME
REM    UTLSAMPL.SQL
Rem  FUNCTION
Rem  NOTES
Rem  MODIFIED
Rem     menash     02/21/01 -  remove unnecessary users for security reasons
Rem     gwood      03/23/99 -  make all dates Y2K compliant
Rem     jbellemo   02/27/97 -  dont connect as system
Rem     akolk      08/06/96 -  bug 368261: Adding date formats
Rem     glumpkin   10/21/92 -  Renamed from SQLBLD.SQL
Rem     blinden   07/27/92 -  Added primary and foreign keys to EMP and DEPT
Rem     rlim       04/29/91 -         change char to varchar2
Rem     mmoore     04/08/91 -         use unlimited tablespace priv
Rem     pritto     04/04/91 -         change SYSDATE to 13-JUL-87
Rem   Mendels    12/07/90 - bug 30123;add to_date calls so language independent
Rem
rem
rem $Header: utlsampl.sql 21-feb-01.18:15:30 menash Exp $ sqlbld.sql
rem
SET TERMOUT OFF
SET ECHO OFF
rem CONGDON    Invoked in RDBMS at build time.   29-DEC-1988
rem OATES:     Created: 16-Feb-83
DROP USER SCOTT CASCADE;
DROP USER ADAMS CASCADE;
DROP USER JONES CASCADE;
DROP USER CLARK CASCADE;
DROP USER BLAKE CASCADE;
GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY TIGER;
DROP PUBLIC SYNONYM PARTS;
CONNECT SCOTT/TIGER
CREATE TABLE DEPT
       (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
     DNAME VARCHAR2(14) ,
     LOC VARCHAR2(13) ) ;
CREATE TABLE EMP
       (EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
     ENAME VARCHAR2(10),
     JOB VARCHAR2(9),
     MGR NUMBER(4),
     HIREDATE DATE,
     SAL NUMBER(7,2),
     COMM NUMBER(7,2),
     DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT);
INSERT INTO DEPT VALUES
     (10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES
     (30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES
     (40,'OPERATIONS','BOSTON');
INSERT INTO EMP VALUES
(7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);
INSERT INTO EMP VALUES
(7499,'ALLEN','SALESMAN',7698,to_date('20-2-1981','dd-mm-yyyy'),1600,300,30);
INSERT INTO EMP VALUES
(7521,'WARD','SALESMAN',7698,to_date('22-2-1981','dd-mm-yyyy'),1250,500,30);
INSERT INTO EMP VALUES
(7566,'JONES','MANAGER',7839,to_date('2-4-1981','dd-mm-yyyy'),2975,NULL,20);
INSERT INTO EMP VALUES
(7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-yyyy'),1250,1400,30);
INSERT INTO EMP VALUES
(7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-yyyy'),2850,NULL,30);
INSERT INTO EMP VALUES
(7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-yyyy'),2450,NULL,10);
INSERT INTO EMP VALUES
(7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87','dd-mm-rr')-85,3000,NULL,20);
INSERT INTO EMP VALUES
(7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-yyyy'),5000,NULL,10);
INSERT INTO EMP VALUES
(7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-yyyy'),1500,0,30);
INSERT INTO EMP VALUES
(7876,'ADAMS','CLERK',7788,to_date('13-JUL-87', 'dd-mm-rr')-51,1100,NULL,20);
INSERT INTO EMP VALUES
(7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy'),950,NULL,30);
INSERT INTO EMP VALUES
(7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
INSERT INTO EMP VALUES
(7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
CREATE TABLE BONUS
     ENAME VARCHAR2(10)     ,
     JOB VARCHAR2(9)  ,
     SAL NUMBER,
     COMM NUMBER
CREATE TABLE SALGRADE
      ( GRADE NUMBER,
     LOSAL NUMBER,
     HISAL NUMBER );
INSERT INTO SALGRADE VALUES (1,700,1200);
INSERT INTO SALGRADE VALUES (2,1201,1400);
INSERT INTO SALGRADE VALUES (3,1401,2000);
INSERT INTO SALGRADE VALUES (4,2001,3000);
INSERT INTO SALGRADE VALUES (5,3001,9999);
COMMIT;
EXIT

Similar Messages

  • Tcode to upload data into CATSDB table in HR ABAP

    Hi All,
      Could anyone let me know what is the TCODE to upload data into CATSDB table in HR ABAP.
    Regards,
    Srinivas.

    Thanks for your reply but i'm not able to find the required fields to upload.
    those are : pernr - employee number(ok)
    workdate - date
    awart - att./absence type
    lgart - wage type
    meinh - unit of measure
    catsquantity- quantity number
    Regards,
    Srinivas

  • Uploading data for Tcode IW21

    Hi,
    I want to upload data for the Tcode IW21,I tried to make BDC but i was giving only 1 problem that it is not able to capture the screen for Long Text as it is used as script handling.i am able to find a BAPI but i dont know how to use it,i tried to do work through LSMW but there is no information. Pleas provide me guidelines how to solve this problem.. I am providing the link to the code which i had developed(BDC) for the tcode IW21 .
    Here's the code:-
    http://docs.google.com/View?id=dfxswwff_3gtn9qsdp
    Edited by: ricx .s on Jun 24, 2009 6:24 AM

    hi,
    Thanks for your help. Can i use BAPI to upload data for IW21 and how to trace the fields of a BAPI to upload the data .
    Here's the code which i searched on net bu there is no information regarding the fields tobe traced and should i include it in my code which i had provided above ?
    data: i_bapi2080_nothdri type standard table of bapi2080_nothdri with header line.
    data: i_bapiret2 type standard table of bapiret2 with header line.
    data: i_bapi2080_nothdre type standard table of bapi2080_nothdre with header line.
    data: i_bapi2080_notfulltxti type standard table of bapi2080_notfulltxti with header line.
    * create header data
    i_bapi2080_nothdri-refobjectkey = 'PJAREF'.
    i_bapi2080_nothdri-equipment    = '10000030'.
    i_bapi2080_nothdri-reportedby   = 'PJAREP'.
    i_bapi2080_nothdri-short_text   = 'PJA Short Test from BAPI'.
    i_bapi2080_nothdri-priority     = '1'.
    * create header long text
    i_bapi2080_notfulltxti-objtype    = 'QMEL'.
    i_bapi2080_notfulltxti-FORMAT_COL = 'U1'.
    i_bapi2080_notfulltxti-text_line  = 'Long text 1'.
    append i_bapi2080_notfulltxti.
    i_bapi2080_notfulltxti-objtype    = 'QMEL'.
    i_bapi2080_notfulltxti-FORMAT_COL = 'U1'.
    i_bapi2080_notfulltxti-text_line  = 'Long text 2'.
    append i_bapi2080_notfulltxti.
    call function 'BAPI_ALM_NOTIF_CREATE'
      exporting
    *   EXTERNAL_NUMBER          =
        notif_type               = 'M1'
        notifheader              = i_bapi2080_nothdri
    *   TASK_DETERMINATION       = ' '
    *   SENDER                   =
    *   ORDERID                  =
    importing
        notifheader_export       = i_bapi2080_nothdre
    tables
    *   NOTITEM                  =
    *   NOTIFCAUS                =
    *   NOTIFACTV                =
    *   NOTIFTASK                =
    *   NOTIFPARTNR              =
        longtexts                = i_bapi2080_notfulltxti
    *   KEY_RELATIONSHIPS        =
        return                   = i_bapiret2.
    call function 'BAPI_ALM_NOTIF_SAVE'
      exporting
        number            = i_bapi2080_nothdre-notif_no
    * IMPORTING
    *   NOTIFHEADER       =
    * TABLES
    *   RETURN            =
    call function 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =
    Please provide me guidelines for it.Is there any way to upload  the data for this Tcode IW21 through LSMW?
    Edited by: ricx .s on Jun 24, 2009 10:20 AM

  • BDC to upload data into FF67 Tables

    Hi,
    I like to upload data into FF67 Tables to process manual Bank Reconciliation.
    I wanted to know to upload data into FF67 Tables what are the related table.fields I have to consider.  (fields name and table names)
    My inputs are --  Posting Date, Assignment, Business Area, Profit Center, Amount, Tran key, Value Date, Bank Account, G/L Account, Co. Code, Currency
    Regards
    Rahkes

    Hi Divraj,
    As this is a regular posting like tranasction, I have to create BDC for this data posting.
    For this I like to know the table.fields that I need to update for FF67 Posting.
    If you can let me know the impacted table.fiedls for TCode: FF67 update then it will help me for creating BDC.
    Thanks & Regards
    Rahkes

  • How to populate date & time when user enter data for custom table in sm30

    Can anyone tell me How to populate system date & time when user enter data for custom table in sm30..
      Req is
      i have custom table and using sm30 user can enter data.
    after saving date i want to update date & time in table
    Pls let me know where to write the code?
    Thanks in Advance

    You have to write the code in EVENT 01 in SE54 transaction. Go to SE54, enter your Ztable name and in the menu 'Environment-->Events'. Press 'ENTER' to go past the popup message. In the next screen, click on 'New Entries'. In the first column, enter 01 and in the next column give some name for your routine(say UPDATE_USER_DATE_TIME). Then click on the souce code icon that appears in blue at the end of the row. In the code, you need logic like below.
    FORM update_user_date_time.
      DATA: f_index LIKE sy-tabix.
      DATA: BEGIN OF l_total.
              INCLUDE STRUCTURE zztable.
      INCLUDE  STRUCTURE vimtbflags.
      DATA  END OF l_total.
      DATA: s_record TYPE zztable.
      LOOP AT total INTO l_total.
        IF l_total-vim_action = aendern OR
           l_total-vim_action = neuer_eintrag.
          MOVE-CORRESPONDING l_total TO s_record.
          s_record-zz_user = sy-uname.
          s_record-zz_date = sy-datum.
          s_record-zz_time = sy-uzeit.
          READ TABLE extract WITH KEY l_total.
          IF sy-subrc EQ 0.
            f_index = sy-tabix.
          ELSE.
            CLEAR f_index.
          ENDIF.
          MOVE-CORRESPONDING s_record TO l_total.
          MODIFY total FROM l_total.
          CHECK f_index GT 0.
          MODIFY extract INDEX f_index FROM l_total.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " UPDATE_USER_DATE_TIME
    Here ZZTABLE is the Z table and ZZ_USER, ZZ_DATE, and ZZ_TIME are the fields that are updated.

  • Customized LSMW (Batch Input Recording) to upload data for Vendor

    Hello Fiends,
       can u help me on this object and how to upload in xk01.
            Customized LSMW (Batch Input Recording) to upload data for Vendor Master using Transaction code XK01
    With best wishes,
    Chandu.
    Point will be rewarded....

    Hi,
    Go through the following link, you will find your answer
    http://www.sapbrain.com
    Regards,
    Bhaskar

  • BDC Program for Uploading Data for Property Tree in cg02

    Hi,
        How to upload data for property tree ( standard Properties ) of CG02. I checked for BAPI or Function Module but most them supports for specification header and sub item. 
    Please Let me know if any function module or BAPI available for this process.  I tried with BDC Program, but it fails.
    Regards,
    Rajesh Kumar Murugesan

    Hallo Rajesh
    take a look here:
    http://help.sap.com/erp2005_ehp_06/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
    Chapter "Import and Export".
    1.)  Reads cross these further chapters:
    "Tools (EHS-BD-TLS)" => "IMport and Export" => "Import: Process" => "Specifying the Sequence of the External Data Structure "  => "External File Structure: Specification"
    Here you will learn how to prepare the data. In chapter:" Example: Transfer File for Specifications" you will find an example of an file whcih could be used to upload data in the property tree
    2.) Chapter:" Importing Specifications"  is explaining the steps whcih are need to populate the property with data using the file as prepared; read cross chapter "Specification Import Control"
    I hope this helps.
    C.B.
    Edited by: Christoph Bergemann on Feb 4, 2012 6:59 PM
    Edited by: Christoph Bergemann on Feb 4, 2012 6:59 PM

  • How to upload data for custom infotype

    Hi  Friends
    Can we use HR_INFOTYPE_OPERATIONS   FM  for custom infotype too  or is there other way or other Standard FM to upload data for custom infotype  starting with 9000..etc.
    Points will be there for sure.
    Thanks
    Meeta & Roopa

    Thanks for quick response.
    my qns is can we use Standard FM like HR_INFOTYPE_OPERATIONS  for custom infotype too ?
    in my requirment  input will come from portal form and in background  Java Wd is going to use these FM  but i have this big  doubt can we use these standard FM for  uploading data in custom infotype as well or else is there any other way.. but for sure we can't use BDC and LSMW in this requirement .
    Thanks Meeta & Roopa

  • Where we maintain data for this Table T015W in SPRO

    Hi Gurus,
    I wanted to know that where we maintain data for this table T015W.
    This Table relates to banking.

    Hello,
           You could maintain the instruction keys in SPRO under the path
    Financial Supply Chain Management > Treasury and Risk Management > Basic Functions > SAP Business Partner for Financial Services > Settings for Financial Services > General Settings > Basic Settings > Define Instruction Keys
    Kind regards,
    Vinodh

  • Tcode to upload data into CATSDB table

    Hi All,
      Could anyone let me know what is the TCODE that we will record and upload data into CATSDB table in HR ABAP.
    Regards,
    Srinivas.

    Hi,
    I also need the same information...i.e i want to record overtime of Employees...Where to do this?
    I tried creating it in PA61. I am able to create it with attendance type. But its triggering the CREATED method of ATTENDANCE Bus. Object. But i have been asked to use CREATED method CATS Bus. Object.
      Can anyone help me in this??? Also tell me how make entries in CAT2 ....
    Thanks,
    Sivagami.R

  • Bapi - upload data for infotypes 0016 and 0019

    hello,
    Please let me know bapi to upload data for infotypes 0016 and 0019 as i am unable to find any bapi for this infotypes.
    Please use a more meaningful subject in future - I've edited it for you this time.
    Edited by: Matt on Nov 6, 2008 12:08 PM

    Hi Sunny,
    My suggestion is go txcode BAPI.
    After this in the left side of the window complete information on BAPIs will be available search out in Human resource you may get the BAPI, in the mean while some one may help you.
    Cheers!!
    VEnk@

  • FM for uploading data into internal table from Excel sheet

    Hi,
    I have a slight problem in one of the function modules that I have created. Actually it has been copied from a standard SAP function module “KCD_EXCEL_OLE_TO_INT_CONVERT”. Now my created function module is throwing me a dump suggesting “Data objects in a Unicode program are not convertible”. Can anybody help me out in removing the error .
    Actually the need of copying the standard FM to a ZFM is to increase the length of the column which can be uploaded thru this FM. The standard FM has a restriction of being able to upload 32 characters whereas my requirement is to upload data having at least 150 characters. So in order to care the need I made a ZStructure ZAKHIL_CELLS taking the Value parameters as 150 characters instead of 32 characters.
    Well this is all done because I wanted to upload a excel sheet into an internal table and not use a tab delimited file. Can anybody help in this regard or suggest some other function module which can upload more than 150 characters from a excel sheet .
    ‘m also attaching structure of my ZStructure for ur reference .
    STRUCTURE ZAKHIL_CELLS1 .
    ROW KCD_EX_ROW_N NUMC 4 Flexible Excel upload: row number
    COL KCD_EX_COL_N NUMC 4 Column
    VALUE KCD_VALUE CHAR 150 External Data Transfer: Values of Parameters or Variables
    Thanks & Rgds,
    Akhil

    hi,
    sample excel sheet.
    coloumn 1 is name and column 2 is age
    name age
    A     8
    C     13
    D     55
    DATA : int_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    data : record like db_name_age occurs 0 with header line.
    DATA : v_start_col TYPE i VALUE '1', "starting col
           v_start_row TYPE i VALUE '1', " starting row
           v_end_col   TYPE i VALUE '2', " total columns
           v_end_row   TYPE i VALUE '10'. "total no of record
    FORM f_upload .
      CLEAR : int_excel, int_excel[].
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = wf_filename
          i_begin_col             = v_start_col
          i_begin_row             = v_start_row
          i_end_col               = v_end_col
          i_end_row               = v_end_row
        TABLES
          intern                  = int_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    *Message is 'Unable to upload data from  '  wf_filename.
        MESSAGE e169(zm050) WITH wf_filename.
      ELSE.
        SORT int_excel BY row col.
        REFRESH : record.
        CLEAR   : record.
        LOOP AT int_excel.
          CASE int_excel-col. "go thru each column.
            WHEN 1.
              record-name  = int_excel-value.
            WHEN 2.
              record-age = int_excel-value.     
          ENDCASE.
          AT END OF row.
            APPEND record.
            CLEAR record.
          ENDAT.
        ENDLOOP.
    *inserting into table
      ENDIF.
    if this helped pld rewrd points,
    rgrds
    anver

  • Hi: Uploading data for CN22 tcode

    Hi,
    Iam uploading data from flat file to sap, for CN22 transaction.
    If i execute in foreground , it's working fine.
    when iam trying to execute in background it is not updating.
    i also used WAIT.
    still it is not updating.
    points will be rewarded,
    thanks in advance,
    ravi shankar reddy

    Hi Ravi,
    Iam using the same thing , but it is not working.
    pls check the code.
    REPORT zcn22networkid
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    *include bdcrecx1.
                 DATA DECLARATIONS                                      *
    TYPES : BEGIN OF ty_rectab,
              aufnr TYPE caufvd-aufnr,
              vornr TYPE afvgd-vornr,
              ltxa1 TYPE afvgd-ltxa1,
              dauno(7),   " TYPE afvgd-dauno,
              arbei(9),   " TYPE afvgd-arbei,
              arbpl TYPE afvgd-arbpl,
              mat_prkst(14),  " TYPE afvgd-mat_prkst,
              prkst(14),      "  TYPE afvgd-prkst,
              waers TYPE afvgd-waers,
              sakto TYPE afvgd-sakto,
            END OF ty_rectab.
    TYPES: BEGIN OF ty_msg,
              msgnr(24), " TYPE bdcmsgcoll-msgnr,
              msgtyp(10),  "TYPE bdcmsgcoll-msgtyp,
              message(500),
           END OF ty_msg.
    DATA : l_string(500).
    DATA : fname TYPE string.
    DATA : fname1 TYPE string.
    DATA : l_indx(6) TYPE n.
    DATA : l_indx1(6) TYPE n.
    DATA : l_tab(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    DATA : g_fieldname TYPE string.
    DATA : opt TYPE ctu_params.
                INTERNAL TABLES                                         *
    DATA : it_upload TYPE string OCCURS 0 WITH HEADER LINE.
    DATA : bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE.
    DATA : messtab TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
    DATA : it_rec TYPE STANDARD TABLE OF ty_rectab WITH HEADER LINE.
    DATA : it_rec1 TYPE STANDARD TABLE OF ty_rectab WITH HEADER LINE.
    DATA : it_msg TYPE STANDARD TABLE OF ty_msg WITH HEADER LINE.
    DATA : it_rec2 TYPE STANDARD TABLE OF ty_rectab WITH HEADER LINE.
    DATA : it_rec3 TYPE STANDARD TABLE OF ty_rectab WITH HEADER LINE.
         SELECTION SCREEN                                               *
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME.
    PARAMETERS : p_file TYPE rlgrap-filename OBLIGATORY.
    PARAMETERS : r_fgrd RADIOBUTTON GROUP g1.
    PARAMETERS : r_bgrd RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME.
    PARAMETERS : p_efile TYPE rlgrap-filename. " OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block2.
               F4 HELP FOR FILE                                         *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM f4_filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_efile.
      PERFORM get_errorfile.
    START-OF-SELECTION.
      PERFORM upload_data.
    *****FOR FOREGROUND*****
      IF r_fgrd = 'X'.
        opt-dismode = 'A'.
        opt-updmode = 'S'.
        opt-defsize = 'X'.
    ****FOR BACKGROUND******
      ELSEIF r_bgrd = 'X'.
        opt-dismode = 'N'.
        opt-updmode = 'S'.
        opt-defsize = 'X'.
      ENDIF.
    ****BDC Data************
      PERFORM bdc_data.
      IF it_msg[] IS NOT INITIAL.
        it_msg-msgnr = 'NetworkID'.
        it_msg-msgtyp   = 'Msgtyp'.
        it_msg-message  = 'Message'.
        PERFORM download_errorfile.
      ENDIF.
    *&      Form  f4_filename                                             *
    FORM f4_filename .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    ENDFORM.                    " f4_filename
    *&      Form  get_errorfile                                           *
    FORM get_errorfile .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_EFILE'
        IMPORTING
          file_name  = p_efile.
    ENDFORM.                    " get_errorfile
    *&           FORM UPLOAD_DATA                                         *
    FORM upload_data .
      fname = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = fname
          filetype                = 'ASC'
        TABLES
          data_tab                = it_upload
        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 NE 0.
        MESSAGE e001(00) WITH 'Error occurred while file reading'.
      ELSE.
        LOOP AT it_upload.
          SPLIT it_upload AT l_tab INTO it_rec-aufnr
                                        it_rec-vornr
                                        it_rec-ltxa1
                                        it_rec-dauno
                                        it_rec-arbei
                                        it_rec-arbpl
                                        it_rec-mat_prkst
                                        it_rec-prkst
                                        it_rec-waers
                                        it_rec-sakto  IN CHARACTER MODE.
          APPEND it_rec.
          CLEAR it_rec.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " upload_data
               FORM BDC DATA
    FORM bdc_data .
      it_rec1[] = it_rec[].
      SORT it_rec1 BY aufnr.
      DELETE ADJACENT DUPLICATES FROM it_rec1 COMPARING aufnr.
      LOOP AT it_rec.
        IF ( ( it_rec-dauno IS NOT INITIAL ) AND
                ( it_rec-arbei IS NOT INITIAL ) AND
                ( it_rec-arbpl IS NOT INITIAL ) AND
                ( it_rec-mat_prkst IS NOT INITIAL ) ).
          MOVE it_rec-aufnr TO it_rec2-aufnr.
          MOVE it_rec-vornr TO it_rec2-vornr.
          MOVE it_rec-ltxa1 TO it_rec2-ltxa1.
          MOVE it_rec-dauno TO it_rec2-dauno.
          MOVE it_rec-arbei TO it_rec2-arbei.
          MOVE it_rec-arbpl TO it_rec2-arbpl.
          MOVE it_rec-mat_prkst TO it_rec2-mat_prkst.
          APPEND it_rec2.
          CLEAR it_rec2.
        ELSEIF ( ( it_rec-dauno IS INITIAL ) AND
                       ( it_rec-arbei IS INITIAL ) AND
                       ( it_rec-arbpl IS INITIAL ) AND
                       ( it_rec-mat_prkst IS INITIAL ) ).
          MOVE it_rec-aufnr TO it_rec3-aufnr.
          MOVE it_rec-vornr TO it_rec3-vornr.
          MOVE it_rec-ltxa1 TO it_rec3-ltxa1.
          MOVE it_rec-prkst TO it_rec3-prkst.
          MOVE it_rec-waers TO it_rec3-waers.
          MOVE it_rec-sakto TO it_rec3-sakto.
          APPEND it_rec3.
          CLEAR it_rec3.
        ENDIF.
      ENDLOOP.
      SORT it_rec2 BY aufnr.
      SORT it_rec3 BY aufnr.
      LOOP AT it_rec1.
        CLEAR l_indx.
        CLEAR l_indx1.
        PERFORM bdc_dynpro      USING 'SAPLCOKO' '2000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'CAUFVD-AUFNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'CAUFVD-AUFNR'
                                       it_rec1-aufnr.
        PERFORM bdc_dynpro      USING 'SAPLCOKO' '2100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'CAUFVD-KTEXT'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=LIST'.
    --table control--
        LOOP AT it_rec2 WHERE aufnr = it_rec1-aufnr.
          l_indx  = l_indx + 1.
          IF l_indx EQ 14 .
            l_indx = l_indx MOD 12.
            PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=P+'.
          ENDIF.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CONCATENATE 'AFVGD-DAUNO(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING   g_fieldname
                                         'AFVGD-DAUNO'.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CONCATENATE 'AFVGD-ARBPL(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                         g_fieldname.
          CONCATENATE 'AFVGD-VORNR(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec2-vornr.
          CONCATENATE 'AFVGD-LTXA1(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec2-ltxa1.
          CONCATENATE 'AFVGD-DAUNO(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec2-dauno.
          CONCATENATE 'AFVGD-ARBEI(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec2-arbei.
          CONCATENATE 'AFVGD-ARBPL(' l_indx ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec2-arbpl.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec2-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec2-ltxa1.
          PERFORM bdc_field       USING 'AFVGD-ARBPL'
                                         it_rec2-arbpl.
          PERFORM bdc_field       USING 'AFVGD-ARBEI'
                                         it_rec2-arbei.
          PERFORM bdc_field       USING 'AFVGD-DAUNO'
                                         it_rec2-dauno.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec2-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec2-ltxa1.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec2-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec2-ltxa1.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec2-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec2-ltxa1.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-MAT_PRKST'.
          PERFORM bdc_field       USING 'AFVGD-MAT_PRKST'
                                         it_rec2-mat_prkst.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'VSNETEXT-NPLNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ARBL'.
        ENDLOOP.
        LOOP AT it_rec3 WHERE aufnr = it_rec1-aufnr.
          l_indx1  = l_indx1 + 1.
          IF l_indx1 EQ 14 .
            l_indx1 = l_indx1 MOD 12.
            PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'..
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=P+'.
          ENDIF.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          CONCATENATE 'AFVGD-SAKTO(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        'AFVGD-SAKTO'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=KOSL'.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'VSNETEXT-NPLNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=KOSL'.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CONCATENATE 'AFVGD-SAKTO(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                         g_fieldname.
          CONCATENATE 'AFVGD-VORNR(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec3-vornr.
          CONCATENATE 'AFVGD-LTXA1(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec3-ltxa1.
          CONCATENATE 'AFVGD-PRKST(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec3-prkst.
          CONCATENATE 'AFVGD-WAERS(' l_indx1')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec3-waers.
          CONCATENATE 'AFVGD-SAKTO(' l_indx1 ')' INTO  g_fieldname.
          PERFORM bdc_field       USING g_fieldname
                                        it_rec3-sakto.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec3-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec3-ltxa1.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-PRKST'.
          PERFORM bdc_field       USING 'AFVGD-PRKST'
                                         it_rec3-prkst.
          PERFORM bdc_field       USING 'AFVGD-WAERS'
                                         it_rec3-waers.
          PERFORM bdc_field       USING 'AFVGD-SAKTO'
                                         it_rec3-sakto.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec3-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec3-ltxa1.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec3-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec3-ltxa1.
          PERFORM bdc_dynpro      USING 'SAPLCONW' '1000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BACK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'AFVGD-VORNR'.
          PERFORM bdc_field       USING 'AFVGD-VORNR'
                                         it_rec3-vornr.
          PERFORM bdc_field       USING 'AFVGM-LTXA1'
                                         it_rec3-ltxa1.
          PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'VSNETEXT-NPLNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ARBL'.
        ENDLOOP.
        CLEAR it_rec.
        WAIT UP TO 10 SECONDS.
        PERFORM bdc_dynpro      USING 'SAPLCOVG' '2000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'VSNETEXT-NPLNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
        REFRESH messtab.
        CLEAR messtab.
        CALL TRANSACTION 'CN22' USING bdcdata
                          OPTIONS FROM opt MESSAGES INTO messtab.
    ********ERROR MESSAGES TABLE************
        LOOP AT messtab WHERE ( msgtyp = 'E' ).
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              id        = messtab-msgid
              lang      = '-D'
              no        = messtab-msgnr
              v1        = messtab-msgv1
              v2        = messtab-msgv2
              v3        = messtab-msgv3
              v4        = messtab-msgv4
            IMPORTING
              msg       = l_string
            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.
          ELSE.
            it_msg-msgnr    = it_rec-aufnr.
            it_msg-msgtyp   = messtab-msgtyp.
            it_msg-message  = l_string.
            APPEND it_msg.
            CLEAR it_msg.
            CLEAR l_string.
            CLEAR messtab.
          ENDIF.
        ENDLOOP.                "IT_REC
        REFRESH bdcdata.
        CLEAR bdcdata.
      ENDLOOP.                                                  "IT_REC1
    ENDFORM.                    " bdc_data
           Start new screen                                             *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                 *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  download_errorfile                                      *
    FORM download_errorfile .
      fname1 = p_efile.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = fname1
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = it_msg[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      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.                    " download_errorfile

  • Error while selecting data for mara table from KOTG516 table

    Hello all,
    I am trying to select the data from mara table with respect to KOTG516 table . but i am not getting the value into t_mara table as t_kotg516-matnr is empty . but the t_kotg516 conatins the matnr value . here is the code . i am not getting where i went wrong . please help .
    TYPES: BEGIN OF Y_KOTG516,
            KAPPL TYPE KAPPL,
            KSCHL TYPE KSCHG,
            VKORG TYPE VKORG,
            VTWEG TYPE VTWEG,
            KUNAG TYPE KUNAG,
            MATNR TYPE MATNR,
            DATBI TYPE KODATBI,
          END OF Y_KOTG516.
    DATA: T_KOTG516 TYPE STANDARD TABLE OF Y_KOTG516,
          E_KOTG516 TYPE Y_KOTG516.
    TYPES: BEGIN OF Y_MARA,
            MATNR TYPE MATNR,
            MEINS TYPE MEINS,
          END OF Y_MARA.
    DATA: T_MARA TYPE STANDARD TABLE OF Y_MARA,
          E_MARA TYPE Y_MARA.
        SELECT KAPPL
               KSCHL
               VKORG
               VTWEG
               KUNAG
               MATNR
               DATBI
         FROM KOTG516
         INTO TABLE T_KOTG516
       WHERE VKORG IN S_VKOR
         AND VTWEG IN S_VTWE
         AND KUNAG IN S_KUNAG.
            IF NOT T_KOTG516[] IS NOT INITIAL
                    and SY-SUBRC EQ 0.
              SELECT MATNR
                     MEINS
                FROM MARA
                INTO TABLE T_MARA
               FOR ALL ENTRIES IN T_KOTG516
               WHERE MATNR EQ T_KOTG516-MATNR
                 AND MEINS EQ 'CS'
                  OR MEINS EQ 'IT'.
              ENDIF.
      FOR T_KOTG516 I HAVE VALUE but matnr is not getting selected from mara table as i cheked t_kotg516-mara is empty . i cant use with header line . please advise .
    Regards

    hi,
    SELECT KAPPL
                 KSCHL
                  VKORG
                 VTWEG
                KUNAG
               MATNR
                DATBI
               FROM KOTG516
              INTO TABLE T_KOTG516
              WHERE VKORG IN S_VKOR
               AND VTWEG IN S_VTWE
                 AND KUNAG IN S_KUNAG.
    if sy-subrc = 0 .
    SELECT MATNR
    MEINS
    FROM MARA
    INTO TABLE T_MARA
    FOR ALL ENTRIES IN T_KOTG516
    WHERE MATNR EQ T_KOTG516-MATNR
    AND MEINS EQ 'CS'
    OR MEINS EQ 'IT'.
    ENDIF.
    regards
    deepak .

  • Best practice to upload data for Appraisals: BDC, LSMW or functional module

    Hi,
    I have heard that BDC and LSMW do not work for data upload in appraisals. Is it true?
    Can we use ECATT or SECATT to upload data in appraisals?
    I somewhere got the information that functional modules
    HRHAP_DOCUMENT_PREPARE
    HRHAP_DOC_UPDATE_BODY_AND_SAVE
    HRHAP_DOCUMENT_CREATE
    are used to upload the data for appraisals?
    Many of my earlier clients found it very hectic to create appraisal templates every year (PHAP_CREATE). They needed something automated for this.  I managed to suggest them manual upload or SECATT, but I am not sure if BDC/LSMW work for this.
    Can somebody throw some light on this?
    Best regards,
    Veera Sasidhar Jangam

    Hi,
    You need to write a code for same and use function modules available as those does direct updates to database.
    If client is not bothered about look and feel during dataload or do not care about display infotypes during data updates then use above method otherwise BDC needs to be written with screen control programming in it.
    Thanks,
    Ameet

Maybe you are looking for