Hello !  pls give some ti[ps how to use bapi's for data uploading?

hello !
  pls give some ti[ps how to use bapi's for data uploading?
regards,
Arjun

Hi,
See the below report extract:
where it_data is having uploaded data.
LOOP AT<b> it_data</b> INTO wa_data.
    line_count = sy-tabix.
    "Date Validation
    CONCATENATE wa_data-uplft_date4(4) wa_data-uplft_date2(2) wa_data-uplft_date+0(2)
    INTO wa_data-uplft_date.
    "READ TABLE it_ekko INTO wa_ekko WITH KEY lifnr = wa_data-vendor.
    LOOP AT it_ekko_temp INTO wa_ekko_temp WHERE lifnr = wa_data-vendor.
      IF wa_ekko_temp-kdatb <= wa_data-uplft_date AND wa_ekko_temp-kdate >= wa_data-uplft_date.
        MOVE-CORRESPONDING wa_ekko_temp TO wa_ekko.
        APPEND wa_ekko TO it_ekko.
      ENDIF.
    ENDLOOP.
    "IF sy-subrc = 0 AND wa_ekko-kdatb <= wa_data-uplft_date AND wa_ekko-kdate >= wa_data-uplft_date.
    LOOP AT it_ekko INTO wa_ekko.
      wa_data_header-pstng_date = wa_data-uplft_date.
      wa_data_header-doc_date = sy-datum.
      wa_data_header-bill_of_lading = wa_data-bill_of_lad.
      wa_data_header-ref_doc_no = wa_data-del_no.
      CONCATENATE wa_data-header_text1 '-'
                  wa_data-header_text2 '-'
                  wa_data-header_text3 '-'
                  wa_data-header_text4
                  into wa_data_header-HEADER_TXT.
      IF wa_data-indicator = 'Y'.
        wa_data_item-material = '000000000000200568'.
      ELSE.
        wa_data_item-material = '000000000000200566'.
      ENDIF.
      LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln = wa_ekko-ebeln AND matnr = wa_data_item-material.
        "Collect Item Level Data
        wa_data_item-plant = '1000'.
        wa_data_item-stge_loc = '1001'.
        wa_data_item-move_type = '101'.
        wa_data_item-vendor = wa_data-vendor.
        wa_data-qnty = wa_data-qnty / 1000.
        wa_data_item-entry_qnt = wa_data-qnty.
        wa_data_item-po_pr_qnt = wa_data-qnty.
        wa_data_item-entry_uom = 'KL'.
        wa_data_item-entry_uom_iso = 'KL'.
        wa_data_item-orderpr_un = 'KL'.
        wa_data_item-orderpr_un_iso = 'KL'.
        wa_data_item-no_more_gr = 'X'.
        wa_data_item-po_number = wa_ekpo-ebeln.
        wa_data_item-po_item = wa_ekpo-ebelp.
        wa_data_item-unload_pt = wa_data-unload_pt.
        wa_data_item-mvt_ind = 'B'.
        APPEND wa_data_item TO it_data_item.
        CLEAR wa_data_item.
      ENDLOOP.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header = wa_data_header
          goodsmvt_code   = goodsmvt_code
          testrun         = 'X'
        TABLES
          goodsmvt_item   = it_data_item
          return          = return.
      READ TABLE return INTO wa_return WITH KEY type = 'S'.
      IF sy-subrc <> 0.
        DESCRIBE TABLE return LINES sy-tfill.
        IF sy-tfill = 0.
          CALL FUNCTION <b>'BAPI_GOODSMVT_CREATE'</b>   
        EXPORTING
              goodsmvt_header = wa_data_header
              goodsmvt_code   = goodsmvt_code
              testrun         = ' '
            TABLES
              goodsmvt_item   = it_data_item
              return          = return.
          CALL FUNCTION <b>'BAPI_TRANSACTION_COMMIT'</b>
           EXPORTING
             WAIT          = 'X'
          IMPORTING
            RETURN        =
        ENDIF.
      ENDIF.
      LOOP AT return INTO wa_return.
        WRITE: 'Messsage TYPE  ', wa_return-type,
              /,'ID  ', wa_return-id,
              /, 'Number  ', wa_return-number,
              /, 'Message  ', wa_return-message,
              /, 'Long Text  ', wa_return-message_v1,
                                wa_return-message_v2,
                                wa_return-message_v3,
                                wa_return-message_v4,
             /, 'Failed at line', line_count.
      ENDLOOP.
      CLEAR: wa_ekko, wa_ekpo, wa_data, it_data_item[], wa_data_header.
    ENDLOOP.
Reward if useful!

Similar Messages

  • How to use the API for DATE, MONTH  AND YEAR

    I would like to use the java api in .util.calender in the java api to get the date.
    How to implement the API for the "DATE","MONTH","YEAR" which are available provide by java?
    can someone give me in one complete code?

    From the Java Developers Almanac 1.4:
        Calendar cal = new GregorianCalendar();
        // Get the components of the date
        int era = cal.get(Calendar.ERA);               // 0=BC, 1=AD
        int year = cal.get(Calendar.YEAR);             // 2002
        int month = cal.get(Calendar.MONTH);           // 0=Jan, 1=Feb, ...
        int day = cal.get(Calendar.DAY_OF_MONTH);      // 1...
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday, ...

  • How to use BAPI Program for change workcenter in co02?

    Hi  Abapers.
           Anybody please tell me how to change the workcenter in CO02 using BAPI Programe.
          Please give me sample of this.
           I will give urs reward of points.
    Thanks
    Regards,
    S.Muthu.

    Hi,
    Use the Function module CR_WORKCENTER_UPDATE
    for workcenter change.
    It is an update function module so you have to call it in update mode with a COMMIT statement to trigger it.
    CALL FUNCTION CR_WORKCENTER_UPDATE IN UPDATE TASK
    exporting...
    imporing..
    COMMIT WORK.
    Note: only after the commit statement the function module will be called in update mode.
    Regards,
    Raj.

  • How to use Bapi BAPI_ACC_DOCUMENT_POST for g/l account document posting

    Hi all,
    I am using BAPI_ACC_DOCUMENT_POST bapi for g/l account documents posting.as I am first time using BAPI in my program.can anyone give details about how to use this BAPI for document postings.what importing parameters need to be passed , which exporting parameters need to be passed and which tables need to be used.  
    Thanks in advance.
    Regards,
    Harshada

    Moderator message - Please search before asking - post locked
    Rob

  • Pls give some ideas? how to create a function.

    Make an MS-Access form to accomplish:
    Use a list box to display part-time employees and their assignments (SSN, Hours, FullName). Include only those who currently work a total of less than 40 hours/week.
    SSN , Hours and FullName are stored in 2 different table.
    I have no idea how to implement this function. How to create this function to get SSN, Hours and LastName and FirstName (RecordSet which will be used in application)?
    Thanks alot!

    I'm afraid this is an Oracle forum, not an MS-Access forum.
    ;)

  • How to use BAPI extension for updating field which is not in BAPI stracture

    I am doing a conversion for control cycle create. The data is maintained in DB Table "PKHD". i have to update 12 fields threre through BAPI "BAPI_KANBANCC_CREATE". there are 11 fields in BAPI structure. but 1 field called"BERKZ" is not there . How can i update it through EXTENSION.

    Hi ,
    in the bapi extension check one structure with name BAPIPAREX will available..
    you need to pass custom structure in that..
    ands conactenate 12 field of your structure and pass in to value1 in bapirex structure and append.
    go to se11 and enter >bapiparex> check where it is used -->see the zprogram and check how it is used the add your code according to that..
    Regards,
    Prabhudas

  • How to use BAPI TO change Data on EKPO from ALV

    hi all,
       i am a bignner  i have alv grid dispaly  forpurchasing document item (EKPO)  after editing my ALV i want use a BAPI to update the details on EKPO table,
    is it possible? if so please let me know how it can be done??

    hi davel,
    thank you for quick replay i am beginner to ABAP
      i am just practicing to study BAPI ...this requrement iwas taken  by myself for studing BAPI usage..if its possible please let me know how can it be done??
    thank u..

  • How to use string Variables for data provider names

    Really what I need to be able to do is insert the variable
    name in this:
    dataProvider="{chartXML2.lastResult.month.day}"
    I need to replace the "month" with a string variable name
    (i.e public var monthName = "January";)
    I also need to do the same for the categoryfield as it will
    not let me do categoryfield=$String.
    In PHP this is incredibly easy to do. You just say
    blah=$string . In fact, in PHP you can embed variable names
    everywhere. Its very powerful. For instance, in php, for the
    dataprovider issue above, i'd just do
    dataProvider="{chartXML2.lastResult.$StringName.day}"
    and it'd work just fine. Whats the syntax for doing this in
    Flex?

    You can use bracket notation. But don't. Use a reuslt handler
    to wrap the xmllist in an XMLListCollection instance variable and
    bind to that.
    Tracy

  • How to use Reference type of Data Element

    Hi guys, is there anyone could give me a trace how to use reference type of data element.
    More details i'm going to reach is:
    I create 2 tables:
    eq.
    1. table ZFIRST has field X with data element ZFX (Data element i declared).
    2. table ZSECOND has field Y.
    Here at field Y (second table) I'm going to declare a new data element say it ZFY, but in ZFY I'm going to use the data element as i declared before (ZFX). Is it possible if I do it using reference type data element (SE11)?
    I already did this way, but I got error :
    Field Y: Reference ZFX to class w/o interface cannot be used in DB table ZSECOND
    What does it mean?. Did I miss something about using reference data element type?.
    This error occurs when I activate ZSECOND table. However in creating ZFY (reference) to data element ZFX, there is no error occur.
    The point is I need to RE-declared existing data element and ot put existing data element(ZFX) to my current table (ZSECOND).
    Any helpful will be highly appreciated.
    Thanks.
    Edited by: dinivian dondi on Nov 4, 2010 8:30 AM

    Field Y: Reference ZFX to class w/o interface cannot be used in DB table ZSECOND
    What does it mean?. Did I miss something about using reference data element type?.
    Apparently system doesn't allow you to type a transparent table field with deep type. This refers to references and tables types as components. The RDBMS (Relational DB Management System) cannot interpret this componenets correclty and mapp them to TABLEs in DB.
    So I am affraid you won't be able to type table component with reference to other data element.
    The point is I need to RE-declared existing data element and ot put existing data element(ZFX) to my current table (ZSECOND).
    Sorry but I don't get it, could you please explain this more clearly. Maybe then we can think of some workaround for you.
    Regards
    Marcin

  • Pls. give some suggestion on Subsequent Credit and debit note?

    Dear Gurus,
    Pls. give some suggestion on Subsequent Credit and debit note?
    Regrds
    Shikha

    Hi Sikha
    We generaly use subsequent debit / credit to adjust invoice value without affecting Qty
    Pls check notes supplied by SAP
    A subsequent debit/credit arises if a transaction has already been settled, and a further invoice or credit memo is received afterwards.
    A subsequent debit/credit changes the total invoice value of a purchase order item; the total invoice quantity remains unchanged. Therefore, only a value-based update of the purchasing transaction takes place. There is no quantity-based update.
    You must enter an invoice as a subsequent debit if a purchase order item has already been invoiced and further costs are incurred. (Example: A vendor has inadvertently invoiced you at too low a price and then sends a second invoice for the difference.)
    You must enter a credit memo as a subsequent credit if a purchase order item was invoiced at too high a price and now you have received a credit memo. (Example: A vendor has inadvertently invoiced you at too high a price and then sends a credit memo for the difference.)
    If you enter a subsequent debit/credit, the system suggests the entire invoiced quantity, but no value. The maximum quantity that you can subsequently debit or credit is the quantity that has already been invoiced.
    You can only enter a subsequent debit/credit for a purchase order item if an invoice has already been posted for that item.
    A subsequent debit/credit cannot refer to a particular invoice.
    Subsequent debits and credits are listed separately in the PO history
    Typical example is like
    suppose vendor has overcharged u for perticular PO and afterward he want to correct it
    In such scenario u can post subsequent debit to correct PO without affecting Qty. field
    <b>Reward if usefull</b>
    Vishal..

  • Pls give some shell scripting for sql/plsql

    pls give some shell scripting for sql/plsql

    794244 wrote:
    pls give some shell scripting for sql/plsqlNeither SQL or PL/SQL are shell script languages. Both are server side languages that executes inside an Oracle database server process.
    This is an important concept to understand when using SQL*Plus for example to "script" interaction with an Oracle database.

  • Pls give some info about userexit

    hi everyone,
    i never did work on userexit before. Could you give some info about how to create userexit and some knowledge related to that. Any suggestion is appreciated.
    Best Regards,
    Julian

    User exits (Function module exits) are exits developed by SAP.
    The exit is implementerd as a call to a functionmodule.
    The code for the function module is writeen by the developer.
    You are not writing the code directly in the function module, but in the include that is implemented in the function module.
    The naming standard of function modules for functionmodule exits is:
    EXIT_<program name><3 digit suffix>
    The call to a functionmodule exit is implemented as:
    CALL CUSTOMER.-FUNCTION <3 digit suffix>
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    CUSTOMER EXITS-> t-code CMOD.
    As of Release 4.6A SAP provides a new enhancement technique, the Business Add-Ins.
    Among others, this enhancement technique has the advantage of
    being based on a multi-level system landscape (SAP, country versions, IS solutions, partner,
    customer, and so on)
    instead of a two-level landscape (SAP, customer) as with the customer exits.
    You can create definitions and implementations of business add-ins at any level of the system landscape.
    You can use below code to find out user exits associated with particular transaction.
    *& Report  ZUSEREXIT                                                   *
    *& Finding the user-exits of a SAP transaction code                    *
    *& Enter the transaction code in which you are looking for the         *
    *& user-exit and it will list you the list of user-exits in the        *
    *& transaction code. Also a drill down is possible which will help you *
    *& to branch to SMOD.                                                  *
    REPORT zuserexit NO STANDARD PAGE HEADING.
    TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    TABLES : tstct.
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
    IF sy-subrc EQ 0.
      SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
                       AND object = 'PROG'
                       AND obj_name = tstc-pgmna.
      MOVE : tadir-devclass TO v_devclass.
      IF sy-subrc NE 0.
        SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna.
        IF trdir-subc EQ 'F'.
          SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna.
          SELECT SINGLE * FROM enlfdir WHERE funcname = tfdir-funcname.
          SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
                                      AND object = 'FUGR'
                                    AND obj_name EQ enlfdir-area.
          MOVE : tadir-devclass TO v_devclass.
        ENDIF.
      ENDIF.
      SELECT * FROM tadir INTO TABLE jtab
                    WHERE pgmid = 'R3TR'
                     AND object = 'SMOD'
                   AND devclass = v_devclass.
      SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu
                                  AND  tcode EQ p_tcode.
      FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
      WRITE:/(19) 'Transaction Code - ',
           20(20) p_tcode,
           45(50) tstct-ttext.
      SKIP.
      IF NOT jtab[] IS INITIAL.
        WRITE:/(95) sy-uline.
        FORMAT COLOR COL_HEADING INTENSIFIED ON.
        WRITE:/1 sy-vline,
               2 'Exit Name',
              21 sy-vline ,
              22 'Description',
              95 sy-vline.
        WRITE:/(95) sy-uline.
        LOOP AT jtab.
          SELECT SINGLE * FROM modsapt
                 WHERE sprsl = sy-langu AND
                        name = jtab-obj_name.
          FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WRITE:/1 sy-vline,
                 2 jtab-obj_name HOTSPOT ON,
                21 sy-vline ,
                22 modsapt-modtext,
                95 sy-vline.
        ENDLOOP.
        WRITE:/(95) sy-uline.
        DESCRIBE TABLE jtab.
        SKIP.
        FORMAT COLOR COL_TOTAL INTENSIFIED ON.
        WRITE:/ 'No of Exits:' , sy-tfill.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'No User Exit exists'.
      ENDIF.
    ELSE.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
      WRITE:/(95) 'Transaction Code Does Not Exist'.
    ENDIF.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST   SCREEN.
    *---End of Program.
    I hope it gives some basic idea.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • When i turn my iPad on, it keeps showing me how to use it, some random pictures, how to use mail etc. Anyway how to disable this?

    When i turn my iPad on, it keeps showing me how to use it, some random pictures, how to use mail etc. Anyway how to disable this?

    Sounds like you got a store demo. Look in your settings and see if you see "Demo Mode/Demonstration Mode" or something similar.

  • How to use 2 GL for loss made on asset retirement w/o revenue ?

    how to use 2 GL for loss made on asset retirement w/o revenue.
    hello everyone
    i have some trouble.
    my company want to use 2 GL account for asset retirement
    example  some time use GL 6500001  some time use 6500002
    in standard configuration AO90 , field loss made on asset retirement w/o revenue, there is only one field.
    so i can use only one G/L.
    it' s not good if i must to change configuration (and transport request )every time that user need to change GL.
    now i got one idea.
    i know that table T095 keep account determinaton and GL account data.
    so if i make program that change data from table T095 directly. i donot need to change config everytime.
    but i am not sure that this way will make impact other standard program or not.
    i will wait for better idea from everyone.
    please help.

    Substitution consist of several steps  each with two parts:
    1- Prerequisite
    2- Replacement
    If the prerequisite is satisfied (TRUE), substitution (Replacement) is performed.
    Transaction Code: OBBH.
    Thank you
    Javed

  • How to use java api for function activity in embed oracle workflow?

    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

    The Java Function Activity Agent is not certified for Oracle Workflow embedded in Oracle Applications. Installing standalone workflow should be a lot easier than what you have found, although it looks like you did hit a Pentium 4 issue with the Oracle Universal Installer. I suggest you contact Oracle Support or Oracle Consulting for assistance.
    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

Maybe you are looking for