Error in uploding data using bapi for me51n("urgent")

i am getting the error "error in function,000 does not exist"
i am sending u the code & txt file plz check it out and let me know..
REPORT  zrv_bapi_pr.
DATA: BEGIN OF itab OCCURS 0,
            bsart(4),
           ."Purchase requisition document type
            txz01(40),
           ."Short text
            menge(13),
           ."Purchase requisition quantity
            meins(3),
           ."Purchase requisition unit of measure
            eeind LIKE bapiebanc-deliv_date,
           ."Item delivery date
            wgbez(9),
           ."Material Group
            name1(4),
           ."Plant
            ekgrp(3),
           ."Purchasing Group
            afnam(12),
           ."Name of requisitioner/requester
            bednr(10),
           ."Requirement Tracking Number
            knttp(1),
           ."Account assignment category
            sakto(10),
           ."G/L Account Number
            ps_posid(8),
           ."Work Breakdown Structure Element (WBS Element)
            editor(132),
           ."Text line
      END OF itab.
DATA: itab_bapiebanc  LIKE bapiebanc  OCCURS 0 WITH HEADER LINE.
DATA: itab_bapiebkn   LIKE bapiebkn   OCCURS 0 WITH HEADER LINE.
DATA: itab_bapiebantx LIKE bapiebantx OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF errmsg OCCURS 10.
        INCLUDE STRUCTURE bapiret2.
DATA: END OF errmsg.
DATA: errflag.
CALL FUNCTION 'UPLOAD'
  EXPORTING
    filename = 'C:\Documents and Settings\sap\Desktop\New Text Document (2).txt'
    filetype = 'DAT'
  TABLES
    data_tab = itab.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  EXIT.
ENDIF.
LOOP AT itab.
  itab_bapiebanc-doc_type       =    itab-bsart.
  itab_bapiebanc-short_text     =    itab-txz01.
  itab_bapiebanc-quantity       =    itab-menge.
  itab_bapiebanc-unit           =    itab-meins.
  itab_bapiebanc-deliv_date     =    itab-eeind.
  itab_bapiebanc-plant          =    itab-name1.
  itab_bapiebanc-pur_group      =    itab-ekgrp.
  itab_bapiebanc-preq_name      =    itab-afnam.
  itab_bapiebanc-trackingno     =    itab-bednr.
  itab_bapiebanc-mat_grp        =    itab-wgbez.
  itab_bapiebanc-acctasscat     =    itab-knttp.
  itab_bapiebkn-g_l_acct        =    itab-sakto.
  itab_bapiebkn-wbs_elem_e      =    itab-ps_posid.
  itab_bapiebantx-text_line     =    itab-editor.
  APPEND itab_bapiebkn.
  APPEND itab_bapiebanc.
  APPEND itab_bapiebantx.
ENDLOOP.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
  TABLES
    requisition_items              = itab_bapiebanc
    requisition_account_assignment = itab_bapiebkn
    requisition_item_text          = itab_bapiebantx
    return                         = errmsg.
LOOP AT errmsg.
  IF errmsg-type EQ 'E'.
    WRITE:/'Error in function', errmsg-message.
    errflag = 'X'.
  ELSE.
    WRITE:/ errmsg-message.
  ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*LOOP AT itab_bapiebanc.
WRITE:/   itab_bapiebanc-doc_type,
      itab_bapiebanc-short_text,
      itab_bapiebanc-quantity,
      itab_bapiebanc-unit ,
    itab_bapiebanc-deliv_date,
    itab_bapiebanc-plant,
    itab_bapiebanc-pur_group,
    itab_bapiebanc-preq_name,
    itab_bapiebanc-trackingno,
    itab_bapiebanc-mat_grp,
      100 itab_bapiebanc-acctasscat.
*ENDLOOP.
*LOOP AT itab_bapiebkn.
WRITE:/
             itab_bapiebkn-g_l_acct,
             itab_bapiebkn-wbs_elem_e.
*ENDLOOP.
*LOOP AT itab_bapiebantx.
WRITE:/ itab_bapiebantx-text_line.
*ENDLOOP.
txt file
NB     MOTOR     2     EA     20.04.2006     18000000     0020     010     SANGEETE     J505     P     4000     J525.2.2     crompton greaves make,3 phase motor

Hi Ravi,
Please use FM <b>GUI_UPLOAD</b> instead of FM UPLOAD (obsolete).
call function 'GUI_UPLOAD'
  exporting
    filename            = 'C:Documents and SettingssapDesktopNew Text Document (2).txt'
    filetype            = 'DAT'
  tables
    data_tab            = itab.
loop at itab.
endloop.
I think your error is related to line item in internal table <b>itab_bapiebanc</b>. You need to increment for each loop.
Hope this will help.
Regards,
Ferry Lianto

Similar Messages

  • How to update data using BAPI for MD61

    Hello,
    IN my zprogram i used to bapis for uploading data from flat file to sap-system
    1)BAPI_requirement_create
    2)BAPI_requirement_change
    i)my program is taking data from my flat file but it is wipping out old data i nned to update not to overwrite is there any BAPI for this query
    ii)One more thing if data is already entered in on date (i.e 10.07.2009) and when he upload data from flat file for another date same month (12.07.2009) old date data sholud not removed ...
    Please reply me if my query is not understand..
    Thanks in advance..

    Assuming you have your new requirements in table IT_REQ.
    You could do something like:
    DATA: it_req TYPE TABLE OF BAPISSHDIN.
    DATA: l_req TYPE BAPISSHDIN.
    DATA: it_req_out TYPE TABLE OF bapisitmeo.
    DATA: l_req_out TYPE bapisitmeo.
    *   Get existing requirements
        CLEAR it_req_out[].
        CALL FUNCTION 'BAPI_REQUIREMENTS_GETDETAIL'
             EXPORTING
                  material         = p_matnr
                  plant            = p_werks
                  requirementstype = p_bedae
                  version          = p_versb
                  reqmtsplannumber = ''
             TABLES
                  requirements_out = it_req_out[]
                  return           = lt_return[].
    *   Append old requirements to requirements table
        LOOP AT it_req_out INTO l_req_out.
          MOVE: l_req_out-date_type TO l_req-date_type,
                l_req_out-req_date TO l_req-req_date,
                l_req_out-req_qty TO l_req-req_qty,
                l_req_out-unit TO l_req-unit.
          APPEND l_req TO it_req.
        ENDLOOP.
    *   Change requirements
        CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
             EXPORTING
                  material                 = p_matnr
                  plant                    = p_werks
                  requirementstype         = p_bedae
                  version                  = p_versb
                  reqmtsplannumber         = ''
                  vers_activ               = p_vervs
             TABLES
                  requirements_schedule_in = it_req[]
                  return                   = lt_return[].

  • How to update the Weekly data using BAPI for MD61

    Hi All,
    i have used two BAPI's in my Z program to upload data from flat file to sap-system (BAPI_REQUIREMENTS_GETDETAIL and BAPI_REQUIREMENTS_CHANGE) and i uploaded the Monthly Data from the flat file on sap system successfully.
    but i have to also upload the Weekly Data on the sap system using BAPI.
    is there any BAPI for the same or what can be the solution for the uploading weekly data on sap system ?
    Please reply me.
    Thanks in advance..
    Edited by: Prajapati_Shyam on Dec 29, 2010 4:19 PM

    Hi Jovito,
    thanks for your reply,
    i developed a Z program to upload monthly data as well as weekly data into tcode MD61 by selecting the radio button weekly or monthly but i am not able to upload the weekly data as i didnt' get any BAPI OR any other logic to upload weekly data Or not able to use the existing BAPI BAPI_Requirement_create , because the upload file is in monthly format.
    MD61 tcode can be used for both data (Monthly or weekly data).
    can you suggesst me any BAPI to upload the weekly data or any other logic for the same
    thanks & regards
    Prajapati

  • Upload data using bapi for migo

    dear all,
    i 'm faching froblem with migo
    my requriment is : if u give one PO,is the input. under one PO  we have a 1....N Bom s under one BOM we have  a 1...N line items OK  but quenty field was chaning accourding to our requriment. we need FOR BOM QNTY and LINE ITEM QNTY  was chnging how  it is possible or not please give me possiblites to me
    i will be waiting for reply.
    regards
    eswar

    Issue is Fixed!

  • Can anyone list problems/errors when uploading data using BDC's and BAPI's?

    Can anyone list the problems/errors when uploading data using BDC's and BAPI's?

    Hi,
    If you are actually creating a BDC to load data pls be more specific.
    Data format incorrect. Tab delimited/ etc
    Dates in wrong formats
    Currency incorrect formats
    Missing screens
    Wrong transaction code
    File not found,
    Missing Mandatory fields,
    Screen resoultion.
    You should always use refresh for your Bdcdata table.
    Loop at internal table.
    refresh Bdcdata.
    regards,
    sowjanya.

  • Error while updating AFS weights & measures material master data using BAPI

    Hello ABAP experts,
    Please help me in finding the right way in updating AFS weights & measures data (/AFS/MARM) data using BAPI /AFS/BAPI_MATERIAL_SAVE_DATA.
    I'm populating the following table parameters of the BAPI,
    1. SKUUNITSOFMEASURE with /AFS/MARM records
    s_bapi_marm-ALT_UNIT = 'EA'.
    s_bapi_marm-ALT_UNIT_ISO = 'EA'.
    s_bapi_marm-grid_value = 'XXXXS'.
    *s_bapi_marm-STOCK_CATEGORY = '01000'.
    s_bapi_marm-volume  = '10'.
    s_bapi_marm-GROSS_WT  = '10'.
    s_bapi_marm-NET_WEIGHT  = '10'.
    append s_bapi_marm to t_bapi_marm.
    2. UNITSOFMEASURE with MARM records
    s_bapi_uom-ALT_UNIT = 'EA'.
    s_bapi_uom-ALT_UNIT_ISO = 'EA'.
    s_bapi_uom-NUMERATOR = '1'.
    s_bapi_uom-DENOMINATR = '1'.
    s_bapi_uom-UNIT_OF_WT = 'KG'.
    s_bapi_uom-VOLUMEUNIT = 'CCM'.
    append s_bapi_uom to t_bapi_uom.
    But the BAPI returns me an error "Stock Category & is not valid in Category structure  &"
    Let me know if you have any inputs on this one.
    Thanks,
    Partha.

    Hi VAMSHI,
    I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
    Please, let me know.
    Thanks in advance.
    GB

  • Interface Using BAPI for Uploading shipment datas

    Can any1 send me the example code for Inbound Interface using BAPI for Uploading shipment datas.please kindly send me the programs which u using with BAPI

    Hi
    Except hiring (or new joinee) for all other actions you can use below Function Module.
    HR_INFOTYPE_OPERATION.
    ~~~Ganesh Kumar K.

  • For transaction code MD61, I want to upload data using BAPI

    Hi,
    for transaction code MD61, I want to upload data using BAPI.
    Which BAPi I ll call ?
    Can anyone suggest me how to do it with any simple example program ?

    Refer the thread for details about coding-
    BAPI_REQUIREMENTS_CREATE
    Reards,
    Amit

  • Error while insert data using execute immediate in dynamic table in oracle

    Error while insert data using execute immediate in dynamic table created in oracle 11g .
    first the dynamic nested table (op_sample) was created using the executed immediate...
    object is
    CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT (
    mark1 number,
    mark2 number
    t_sub_mark is a class of type sub_mark
    CREATE OR REPLACE TYPE ASI.t_sub_mark is table of sub_mark;
    create table sam1(id number,name varchar2(30));
    nested table is created below:
    begin
    EXECUTE IMMEDIATE ' create table '||op_sample||'
    (id number,name varchar2(30),subject_obj t_sub_mark) nested table subject_obj store as nest_tab return as value';
    end;
    now data from sam1 table and object (subject_obj) are inserted into the dynamic table
    declare
    subject_obj t_sub_mark;
    begin
    subject_obj:= t_sub_mark();
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,subject_obj from sam1) ';
    end;
    and got the below error:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7
    then when we tried to insert the data into the dynam_table with the subject_marks object as null,we received the following error..
    execute immediate 'insert into '||dynam_table ||'
    (SELECT

    887684 wrote:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7The problem is that your variable subject_obj is not in scope inside the dynamic SQL you are building. The SQL engine does not know your PL/SQL variable, so it tries to find a column named SUBJECT_OBJ in your SAM1 table.
    If you need to use dynamic SQL for this, then you must bind the variable. Something like this:
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,:bind_subject_obj from sam1) ' USING subject_obj;Alternatively you might figure out to use static SQL rather than dynamic SQL (if possible for your project.) In static SQL the PL/SQL engine binds the variables for you automatically.

  • I am unable to upload the customer master data using BAPI.?

    Hi Guru's,
    i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1)
    Please guide me how upload the data...
    Thanks in iadvance
    Srinivas...

    Hello Srinivas
    This BAPI does not allow to create a new customer from scratch but only to copy an existing customer to a new one and change its address data.
    The reference customer has to be provided using IMPORTING parameter PI_COPYREFERENCE. See also the BAPI documentation for more details.
    The BAPI does the same like transaction XD01 with Reference.
    Regards
      Uwe

  • Upload the data using bapi

    hi,
    i am new for bapi , can anyone tell me how to upload data using bapi with example?
    plz tell how to find bapi & how to use in coding to upload the data?

    Hi ,
             To find Bapi There a tcode Bapi which will take you to bapi Explorer From there you can find required
              the Bapi Function Module and its Documentation .
      [  www.sap-img.com/abap/bapi-step-by-step-guidance.htm ]
    [http://www.sappro.com/tag.cfm?session=&tag=bapi%20programming]
    [https://wiki.sdn.sap.com/wiki/display/Snippets/SalesordercreationusingBAPI]
    Regards
    Nilesh

  • Using BAPIs for sales contracts

    Hi,
    I'm having this situation that I have to upload sales contracts into SAP from flat files. We planned to use BAPIs for this purpose. Is it a good option. Can anyone suggest better ideas. If BAPI is a good option, has anyone used standard BAPIs for sales contracts updation in SAP System. If yes, can you guide me through the process.

    Hi,
      You can start off with a program with:
    Get the filename of the convert file
      IMPORT /SAPDMC/LSMEMORY FROM MEMORY ID '/SAPDMC/LSMW'.
      V_PROJECT = /SAPDMC/LSMEMORY-PROJECT. " Project
      V_SUBPROJ = /SAPDMC/LSMEMORY-SUBPROJ. " Subproject
      V_OBJECT  = /SAPDMC/LSMEMORY-OBJECT.  " Object
      IF V_PROJECT IS INITIAL.
        V_PROJECT = 'XXXX_LOC'.
      ENDIF.
      IF V_SUBPROJ IS INITIAL.
        V_SUBPROJ = 'SD'.
      ENDIF.
      IF V_OBJECT IS INITIAL.
        V_OBJECT = 'XXXX_VA41'.
      ENDIF.
    Function will return path of converted file by LSMW object
      CALL FUNCTION '/SAPDMC/LSM_FILE_INFO_GET'
        EXPORTING
          PROJECT           = V_PROJECT  " /sapdmc/lsmemory-project
          SUBPROJ           = V_SUBPROJ  " /sapdmc/lsmemory-subproj
          OBJECT            = V_OBJECT   " /sapdmc/lsmemory-object
          X_ONLY_USED_FILES = 'X'
        IMPORTING
          FILE_CONV         = V_DSNAME   " Path of converted file
        EXCEPTIONS
          NO_SUCH_OBJECT    = 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.
    I am not much of an LSMW expert so wont be able to comment much.
    regards
    Aveek

  • ERPI Error during Export data to GL for period 2012

    Hi, experts
    When I write back data from Planning to EBS, I encounter the following error during Export data to GL for period 2012. I have confirmed that Planning data has been upload to ERPI.
    Do you have any hints on this error for me? Thanks a lot.
    Log:
    ,COALESCE(ppa.YEARTARGET, pp.YEARTARGET) YEARTARGET
    ,CASE
    WHEN (INSTR(UPPER(wld.TEMP_COLUMN_NAME),'AMOUNT',1) = 1) THEN
    CAST(SUBSTR(wld.TEMP_COLUMN_NAME,7,LENGTH(wld.TEMP_COLUMN_NAME)) AS NUMERIC(15,0))
    ELSE 0
    END ENTITY_NAME_ORDER
    FROM (
    AIF_WRITEBACK_LOAD_DTLS wld
    LEFT OUTER JOIN TPOVPERIODADAPTOR_FLAT_V ppa
    ON ppa.INTSYSTEMKEY = 'JC2PLN'
    AND ppa.PERIODTARGET = wld.DIMENSION_NAME
    AND ppa.YEARTARGET = 'FY12'
    ) LEFT OUTER JOIN TPOVPERIOD_FLAT_V pp
    ON pp.PERIODTARGET = wld.DIMENSION_NAME
    AND pp.YEARTARGET = 'FY12'
    WHERE wld.LOADID = 176
    AND wld.COLUMN_TYPE = 'DATA'
    ) query
    GROUP BY PERIODTARGET
    ,YEARTARGET
    ,ENTITY_NAME_ORDER
    ) q
    ,TPOVPERIOD p
    ,AIF_GL_PERIODS_STG prd
    WHERE p.PERIODKEY = q.PERIODKEY
    AND NOT EXISTS (
    SELECT 1
    FROM AIF_PROCESS_DETAILS pd
    WHERE pd.PROCESS_ID = 176
    AND pd.ENTITY_TYPE = 'PROCESS_WB_EXP'
    AND pd.ENTITY_ID = prd.YEAR
    AND prd.SOURCE_SYSTEM_ID = 3
    AND prd.SETID = '0'
    AND prd.CALENDAR_ID = '10000'
    AND prd.PERIOD_TYPE = 'Month'
    AND prd.START_DATE > p.PRIORPERIODKEY
    AND prd.START_DATE <= p.PERIODKEY
    AND prd.ADJUSTMENT_PERIOD_FLAG = 'N'
    ORDER BY prd.YEAR
    2012-10-12 11:05:10,078 INFO [AIF]: COMM Writeback Period Processing - Insert Periods into Process Details - END
    2012-10-12 11:05:10,516 INFO [AIF]: COMM End Process Detail - Update Process Detail - START
    2012-10-12 11:05:10,594 DEBUG [AIF]:
    UPDATE AIF_PROCESS_DETAILS
    SET STATUS = 'FAILED'
    ,RECORDS_PROCESSED = CASE
    WHEN RECORDS_PROCESSED IS NULL THEN 0
    ELSE RECORDS_PROCESSED
    END + 0
    ,EXECUTION_END_TIME = CURRENT_TIMESTAMP
    ,LAST_UPDATED_BY = CASE
    WHEN ('native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER' IS NULL) THEN LAST_UPDATED_BY
    ELSE 'native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER'
    END
    ,LAST_UPDATE_DATE = CURRENT_TIMESTAMP
    WHERE PROCESS_ID = 176
    AND ENTITY_TYPE = 'PROCESS_WB_EXP'
    AND ENTITY_NAME = '2012'
    2012-10-12 11:05:10,594 INFO [AIF]: COMM End Process Detail - Update Process Detail - END
    2012-10-12 11:05:10,719 INFO [AIF]: ERPI Process End, Process ID: 176

    I do not have any hints on this.
    Would need to see the ODI Operator when the process is ran.

  • Getting an error while using BAPI for data upload using FB50

    Hi,
    Can someone please help with the error below :
    To Upload Data Using FB50 , am using 'BAPI_ACC_DOCUMENT_POST' FM
    and passing values as
    obj_type = REACI
    obj_KEY = '$'
    obj_sys = t000-logsys
    getting errors errors in return as
    'Error in document: REACI $ R3_AFRICA
    G/L account 2511510 is not defined in chart of accounts CSGP(though the account exists in the COA)
    Control indicators for controlling area EU01 do not exist'.(we have not input any indicators)
    Thanks

    Control indicators for controlling area (t-code OKKP ) is a primary configuration before the company is set to production. Here we maintain which sub areas of controlling are activated. Have a look at those settings.
    Check the validity of the accounts/cost element in the KA03 to ensure the cost element is valid on the date of transaction.
    What is the error message number?

  • Runtime Error while uploading data using a BAPI

    Hi ALL,
        I am trying to upload duties for PO items using BAPI from a excel sheet.In this BAPI I am saving the data into a z table(Customizing table, maintenance only by cust., not SAP import).The data is getting saved into the table and it shows the data uploaded successfully message also,but when I scroll up I see RUN time error,althogh the data is getting saved.
            I have seen in the st22 and it shows the following information.
    Internal error: Invalid page number.                                                                               
    What happened?                                                                               
    The current ABAP program had to be terminated because the                    
    ABAP processor detected an internal system error.                            
    The current ABAP program "ZFI_UPD_BOE_UPLOAD" had to be terminated because the
    ABAP                                                                        
    processor discovered an invalid system state.                                
        My functional consultants opinion is after data getting saved it comes into me23n's  condition tab.He has done it many times.But for one PO it is not showing.
        I checked the upload program.In upload program a BAPI is written which simply takes the data from a excelsheet and saves into the z table.
      My query is whether we can show the data of a z table into standard tocde?

    Thanks Lakshman!
               I debug the program.There is no BDC used update.In this program after taking the data from excel sheet one internal table is prepared and this internal table is directly used to insert data into z table.This is the last code which executes.
      INSERT zmmpoamend FROM TABLE t_zmmpo_amend_tab.
      IF sy-subrc EQ '0'.
        MESSAGE 'Data Upload Successfully completed' TYPE 'S'.
      ELSE.
        ROLLBACK WORK.
        MESSAGE 'Data Upload failed ' TYPE 'E'.
      ENDIF.
      CLEAR t_zmmpo_amend_tab.
      REFRESH t_zmmpo_amend_tab.
         Is it possible to configure z table using SPRO tcode,such that this z tables data will go to standard table and then we can see it in the standard tcode?
    I am not sure but it's just a guess.

Maybe you are looking for

  • Unable to open 10g Database Control Webpage from another computer

    Unable to open 10g Database Control Webpage from another computer Hi Gurus I have just installed Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 on my PC Windows XP , created database and configured DB control I can open Database Control We

  • Flash Player wont install on my macbook pro

    I have a macbook pro with Mac OS X 10.6.8 system, and each time i try to upload the latest version of flash player it will stop half way and tell me installation failed!!!! please someone help me, i need to get this installed

  • Editing an email address in Pages.

    If I make a typo in an email address I'm unable to correct my mistake because Pages converts the cursor to the hand icon and opens an email window.  How can I edit an email address without deleting it and starting over? Thanks.

  • Multiple ActiveX event registrations

    The attached zip file contains a .NET 2003 project that builds an ATL COM object with two identically typed events. Both events fire every half second sending the same count integer as data for 10 seconds when the Go method is invoked. The eventrig t

  • Macbook Pro Retina 15 has a creaking noise even without touching it

    These days I found that my macbook pro retina Early 2013 Model has a creaking noise when the CPU and GPU's temperature is going up to 50 degree Celsius, which should be normal temperature when you only run the machine for web browsing and video watch