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

Similar Messages

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

  • How to use bapi to change so's schedule line category

    dear friends:
       I try to change so's schedule line category using bapi "BAPI_SALESORDER_CHANGE", but it doesn't work,the code is as following:
      T_SCHEDULE_LINES-ITM_NUMBER = ITAB-POSNR.
      T_SCHEDULE_LINES-SCHED_TYPE = ITAB-ETTYP.
      T_SCHEDULE_LINES-SCHED_LINE = '0001'.
      APPEND T_SCHEDULE_LINES.
      T_SCHEDULE_LINESX-ITM_NUMBER = ITAB-POSNR.
      T_SCHEDULE_LINES-SCHED_TYPE = ITAB-ETTYP.
      T_SCHEDULE_LINESX-SCHED_LINE = '0001'.
      T_SCHEDULE_LINESX-UPDATEFLAG = 'U'.
    who can tell me the reason.thanks in advance.

    Hi 
    First try to execute same bapi in test mode and then check thwe respective SO if this work then you have to commint the changes through program, some more help on this topic
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

  • ALV - Maybe a NEW problem to get changed data, after input from ALV

    Hi all,
    I have tried to search an existing post to solve this ALV problem, with key words 'ALV' and 'refresh', but I don't find the good one... so sorry if the problem have already been solved.
    <u>An example of the problem and process should be more clear than words :</u>
    1) CALL ALV
    CALL METHOD grid1->set_table_for_first_display
         EXPORTING
                   is_layout        = gs_layout
                   is_variant       = gs_variant "&see below
                   i_save           = x_save     "&see below
                   I_BYPASSING_BUFFER = 'X'
         CHANGING
                   it_outtab        = t_zppegam[]
                   it_fieldcatalog  = GT_field_cat_entete[].
    2) User edit values from cells from ALV.
    For example, insert a new line with '+' button, and <u>fills each cells</u>.
    3) The problem is that at the beginning of the PAI
    there is a blank line into internal table t_zppegam,
    instead of the line with the data filled into cells ALV by user
    3') Internal table t_zppegam have the good data only if user clik on the button refresh of ALV, before go throw PAI.
    Have any suggestions? Thank you for your help.
    Best Regards,
    Tony.

    Hi all,
    I have just solved my problem...
    I have found this one into SE38 / BCALV_GRID_EDIT fifth program.
    data: l_valid(1) type c.
    call method grid1->check_changed_data importing e_valid = l_valid.
    Tony

  • How to use BAPI function module for maintaing product type to material

    Hi,
    Can you pls suggest me how to use BAPI Fuction module CCAP_REV_LEVEL_MAINTAIN
    for maintaining the product type for the material using change number.
    Pts will be rewarded.
    Best Regards,
    Padhy

    Hi,
    Can you pls suggest me how to use BAPI Fuction module CCAP_REV_LEVEL_MAINTAIN
    for maintaining the product type for the material using change number.
    Pts will be rewarded.
    Best Regards,
    Padhy

  • How to use Bapi

    Hi
    How to use bapis
    BAPI_COMPANYCODE_GET_PERIOD
    BAPI_CCODE_GET_FIRSTDAY_PERIOD'
    BAPI_GL_ACC_GETPERIODBALANCES'

    BAPI_COMPANYCODE_GET_PERIOD:
    To retrieve the fiscal year variant for a given date u can use the following function module
    Retrieve fiscal year and period
    The below code shows how to use function modules BAPI_COMPANYCODE_GET_PERIOD and
    DETERMINE_PERIOD to retrieve fiscal year and fiscal period for a specific date.
    *: Report: ZFISCALYR :
    *: Author: www.SAPdev.co.uk :
    *: Date : 2004 :
    *: Description: Demonstrates how to return the corresponding fiscal :
    *: year and posting period for a company code and posting :
    *: date or posting date and fiscal year variant. :
    REPORT zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS: p_bukrs TYPE ekko-bukrs,
    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr TYPE bapi0002_4-fiscal_year,
    gd_fiscalp TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
    gd_fiscalp2 TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    get fiscal year and period - (requires date and company code)
    CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
    EXPORTING
    companycodeid = p_bukrs
    posting_date = p_bedat
    IMPORTING
    fiscal_year = gd_fiscalyr
    fiscal_period = gd_fiscalp.
    Alternative fiscal year function module
    - (requires date and fiscal year variant code from T009 table)
    gets first entry in fiscal year variant table (will need to choose
    correct one from table rather than just using first entry)
    SELECT SINGLE periv
    FROM t009
    INTO gd_periv.
    get fiscal year and period
    CALL FUNCTION 'DETERMINE_PERIOD'
    EXPORTING
    date = p_bedat
    PERIOD_IN = '000'
    version = gd_periv
    IMPORTING
    period = gd_fiscalp2
    year = gd_fiscalyr2
    EXCEPTIONS
    period_in_not_valid = 1
    period_not_assigned = 2
    version_undefined = 3
    OTHERS = 4.************************************************************************
    *END-OF-SELECTION.
    END-OF-SELECTION.
    WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
    / 'Fiscal year is:', gd_fiscalyr,
    / 'Fiscal period is:', gd_fiscalp.
    SKIP.
    WRITE:/ 'From function module: DETERMINE_PERIOD',
    / 'Fiscal year is:', gd_fiscalyr2,
    / 'Fiscal period is:', gd_fiscalp2.
    how to get the fiscal year
    BAPI_CCODE_GET_FIRSTDAY_PERIOD:
    CALL FUNCTION 'BAPI_CCODE_GET_FIRSTDAY_PERIOD'
    EXPORTING
    companycodeid = v_bukrs
    fiscal_period = marv-lfmon
    fiscal_year = marv-lfgja
    IMPORTING
    first_day_of_period = v_postdate
    return = i_return1.
    BAPI
    function module which could calculate the previous month's start date.....
    BAPI_GL_ACC_GETPERIODBALANCES:
    Transactions or BAPI for GL account
    Please give me reward point...

  • How to use type cast change string to number(dbl)?can it work?

    how to use type cast change string to number(dbl)?can it work?

    Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
    2 simple examples:
    "1" cast as I8 = 49 or 31 hex.
    "1" converted to decimal = 1.
    "20" cast as I16 = 12848 or 3230 hex.
    "20" converted to decimal = 20.
    Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
    32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
    When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
    See tha attached LabView 6.1 example.
    Attachments:
    TypeCastAndConvert.vi ‏34 KB

  • How to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?

    Can any body give me an idea on how to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?
    Regards,
    Dantham Conpolwedson

    Hi,
    try the link
    Link:[https://forums.sdn.sap.com/click.jspa?searchID=24060901&messageID=7265357]

  • How to use bapi response in XI

    HI ALL,
             Can any one suggest me, how to use bapi response in XI as a sender.
    I m using bapi BAPI_BCA_BANKSTATEMENT_EXECUTE , I am executing  this bapi manually ,but want to use this BAPI RESPONSE in XI as a sender and map it with receiver.
    can i have any idea about how to do it, or can i have the idoc which is used by this bapi BAPI_BCA_BANKSTATEMENT_EXECUTE.
    THANX
    HONEY

    Hi Honey,
    Have a look at these
    -Configuring the Sender RFC Adapter - step by step
    /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    -Troubleshooting - RFC and SOAP scenarios
    /people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009
    -sender RFC (forum thread)
    Is it possible to use the RFC sender adapter for asynchronous calls?
    Regards,
    Sreenivas

  • How to use TRUNC function with dates in Expression Builder in OBIEE.

    Hi There,
    How to use TRUNC function with dates in Expression Builder in OBIEE.
    TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
    Thanks in advance

    use this instead:
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE)

  • How to use clob or blob data type in OWB

    how to use clob or blob data type in OWB?
    if OWB not surport these data type,how can i extract the large data type from data source

    The same question was asked just two days ago No Data Found: ORA-22992
    Nikolai Rochnik

  • How to use BAPI with Decision Dialogue

    Hi Gurus
    would you please let me know how to use BAPI with decision dialogue in guided procedure .
    I have a BAPI checking logon credentials for the user . how to use this BAPI for making decisions that is if the logon is correct then perform one process else go to logon screen again .
    Thanks in advance
    Regards Namita

    Hi Namita,
    1. Follow the steps mentioned in section <a href="http://help.sap.com/saphelp_crm50/helpdata/en/33/198141f906040de10000000a1550b0/frameset.htm">Exposing an RFC-Enabled Function Module as a Callable Object</a> to use the BAPI as a Callable Object.
    2. Follow the steps mentioned in tutorial # 93 and 93a in the CAF Tutorial Center for the decision part.
    Hope these helps.
    Nilay

  • How to use BAPI to add a new version for a claim number in WTY transaction.

    How to use BAPI to add a new version for a claim number in WTY transaction.
    I am using  function module " BAPI_WARRANTYCLAIM_ADD_VERSION ".
    It needs to copy all contents of previous version to a new version.
    While doing so i am unable to copy fields like valic valoc etc. Any ways by which  i can copy this values.
    WTY will update PNWTYH , PNWTYV and PVWTY tables.
    Thanking you,
    Lokesh.

    Hi Vishnu,
    You can do that through EEWB. Please go through SAP Note 484597. You would get the details of using Easy Enhancement Work bench.
    Rewards point if you think this info is useful
    Regards,
    Dipender Singh

  • Will you tell me how to use BAPI "L_TO_CREATE_POSTING_CHANGE",please?

    Will you tell me how to use BAPI "L_TO_CREATE_POSTING_CHANGE" ,please?
    Is lt06 bapi "L_TO_CREATE_POSTING_CHANGE"&#65311;

    just do a where used list of the FM and see how its used in those programs.
    one of the programs where it is used = RLLQ0200
    Regards
    Raja

  • 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

Maybe you are looking for