BAPI to Upload the data

I have to upload BOM Data from legacy system( Excel .csv format ) to SAP. I can do that with BDC but client requirement is that i have to send data by using BAPI. I dont know how to do. After long search i found BAPI_MATERIAL_BOM_GROUP_CREATE is the function module i have to use.
There are many tables and structures in that Function Module.
I have many doubts..
1. In the BOM there are many items ( components ) for a material.. How can i link that this Header ( Material ) has many items ( Components ) in BAPI.
2. Is there any possibility to see the screens ( As if in Call transaction ) to see whether the data is correctly filed or not.
3. How can i see the error messages by using BAPI.
please let me know how to use the BAPI.

Hi Bharani,
I can answer two of your questions:
2. No, with a BAPI you cannot see the screens during processing.  After it is called you can display the BOM and check that the data is loaded correctly.
3. You can see the error messages of the BAPI by looking in the RETURN structure.  This will contain details of any error, warning, information, and success messages generated during the creation of the BOM.
Cheers,
Brad

Similar Messages

  • How to upload the data to 'abzu' transaction using bapi

    Hi Experts ,
    I need to upload the data to the (asset write up ) transaction 'abzu' and please help me inthis regard
    i found some bapi's like below
    BAPI_FIXEDASSET_CHANGE Changes an Asset
    BAPI_FIXEDASSET_CREATE Creates an Asset
    BAPI_FIXEDASSET_CREATE1 Creates an Asset
    BAPI_FIXEDASSET_GETDETAIL Display Detailed Information on a Fixed Asset
    BAPI_FIXEDASSET_GETLIST Information on Selected Assets
    BAPI_FIXEDASSET_OVRTAKE_CREATE BAPI for Legacy Data Transfer
    BAPI_FIXEDASSET_TEST BAPI for Legacy Data Transfer
    i tried with this bapies but unable to do the transfer the data ,
    please help me ,
    which is the exactly suitable bapi for uploading the data to 'abzu' transaction
    i apriciate you advanced ,
    please give me the exactly solution for this ,
    Regards.,

    Hi Experts ,
    I need to upload the data to the (asset write up ) transaction 'abzu' and please help me inthis regard
    i found some bapi's like below
    BAPI_FIXEDASSET_CHANGE Changes an Asset
    BAPI_FIXEDASSET_CREATE Creates an Asset
    BAPI_FIXEDASSET_CREATE1 Creates an Asset
    BAPI_FIXEDASSET_GETDETAIL Display Detailed Information on a Fixed Asset
    BAPI_FIXEDASSET_GETLIST Information on Selected Assets
    BAPI_FIXEDASSET_OVRTAKE_CREATE BAPI for Legacy Data Transfer
    BAPI_FIXEDASSET_TEST BAPI for Legacy Data Transfer
    i tried with this bapies but unable to do the transfer the data ,
    please help me ,
    which is the exactly suitable bapi for uploading the data to 'abzu' transaction
    i apriciate you advanced ,
    please give me the exactly solution for this ,
    Regards.,

  • 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

  • Upload the data using BAPI in LSMW

    Hi
      I want to upload the data using the BAPI in LSMW,but i dont know what value should be passed in
      1- Business Object
      2- Method
    fields.
    Ex- Suppose i want to upload the Material Master Data then what should be the value of these two fields.
    Thanks
    Mrutyunjaya Tripathy

    Hi
      Sorry to say that i am little bit confuse with your answer
    1-The business object already contains some object name wheather i have to give object names or different,As you have mentioned to give the tcode than what tcode that would be
    2-If i am giving any internal table name in the method field it is giving me error because this field is related to the business object field
    Thanks
    Tripathy m

  • Upload the data for sales order using BAPI

    hi experts,
    how to upload the data for sales order using BAPI.
    what is the FM?
    it would be much helpful if i have the sample code as i am very new to BAPI.
    thanks and Regards
    Shyam

    Hi  Shyam
    Its very useful for u
    BAPISDORDER_GETDETAILEDLIST
    BAPI_ACC_SALES_ORDER_CHECK
    BAPI_ACC_SALES_ORDER_POST
    BAPI_ACC_SALES_QUOTA_CHECK
    BAPI_ACC_SALES_QUOTA_POST
    Reward all the helpful answers..
    With Regards
    Navin Khedikar

  • Upload the data into interface

    HI Abapers,
    My requirement is that i want to upload the data into the transaction where for the header data there are n number of  item transactions , so my requirement is to select all the item  transactions that should be done in background, so i have written the code below but it is selectiong only the first row
    itd2[] = itd[].
    *icount = 1.
        LOOP AT itd2 INTO wa_itd2.
    icount = 1.
        CONCATENATE 'GWA_MTBAL-CHECK(' icount ')'  INTO w_fnam.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  w_fnam.
          PERFORM bdc_field       USING w_fnam
            'X'.
          icount = icount + 1.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMZPP001_PRODORDCONF' '9010'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=GR'.
    Pls reply for any changes in code or any clarifications for this post.
    Thanks In advance.

    Hi thank you  for kind reply i need to create the entries  for CO Activity /Price planning .
    i have to upload data to KP26 which i have posted the fields ..
    i already cheked the function modules which you have been given .. it is not suitable ..
    Is there any ohter  BAPI is there ... le t me know ...
    regards
    purushotham.ineni

  • How to upload the data to SAP-DMS(Document Management System)

    Dear sir,
    How to upload the data to SAP-DMS (Document Management System) please give me the code for this .ex for (excel format or tab  deliminated) to sap system through BAPI i have to pass.
    regards
    R M Patil

    Hi,
    May be following link may help you.
    /thread/315373 [original link is broken]
    /message/205534#205534 [original link is broken]
    Thanks,
    Sree.

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

  • Function or bapi to upload the lead questionnaire to lead partner portal

    hi all,
    Is there any function or bapi to upload the lead questionnaire that exists in the marketing leads-lead partner portal . The survey should get attached to the lead . I am able to create the lead though with the LDPO process by a function module .Any help on this will be very useful.
    Thanks in advance.
    Mithun

    Hi Bharani,
    I can answer two of your questions:
    2. No, with a BAPI you cannot see the screens during processing.  After it is called you can display the BOM and check that the data is loaded correctly.
    3. You can see the error messages of the BAPI by looking in the RETURN structure.  This will contain details of any error, warning, information, and success messages generated during the creation of the BOM.
    Cheers,
    Brad

  • " Can not interpret the data in file " error while uploading the data in DB

    Dear All ,
    After running the below report I am getting the " Can not interpret the data in file " error.
    Need to upload the data in DB through excel or .txt file.
    Kindly advise to resolve the issue.
    REPORT  ZTEST_4.
    data : it like ZPRINT_LOC occurs 0 with header line,
    FILETABLE type table of FILE_TABLE,
    wa_filetable like line of filetable,
    wa_filename type string,
    rc type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    CHANGING
    FILE_TABLE = filetable
    RC = rc.
    IF SY-SUBRC = 0.
    read table filetable into wa_filetable index 1.
    move wa_filetable-FILENAME to wa_filename.
    Else.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = wa_filename
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = it.
    IF SY-SUBRC = 0.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    insert ZPRINT_LOC from table it.
    if sy-subrc = 0.
    commit work.
    else.
    rollback work.
    endif.
    Regards
    Machindra Patade
    Edited by: Machindra Patade on Apr 9, 2010 1:34 PM

    Dear dedeepya reddy,
    Not able to upload the excel but have sucess to upload the .csv file to db through the below code. Thanks for your advise.
    REPORT  ZTEST_3.
             internal table declaration
    DATA: itab TYPE STANDARD TABLE OF ZPRINT_LOC,
          wa LIKE LINE OF itab,
          wa1 like line of itab.
                       variable  declaration
    DATA: v_excel_string(2000) TYPE c,
           v_file LIKE v_excel_string VALUE    'C:\Documents and Settings\devadm\Desktop\test.csv',  " name of the file
            delimiter TYPE c VALUE ' '.         " delimiter with default value space
         read the file from the application server
      OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    write:/ 'error opening file'.
      ELSE.
        WHILE ( sy-subrc EQ 0 ).
          READ DATASET v_file INTO wa.
          IF NOT wa IS INITIAL.
            append wa TO itab.
          ENDIF.
          CLEAR wa.
        ENDWHILE.
      ENDIF.
    CLOSE DATASET v_file.
    EXEC SQL.
         TRUNCATE TABLE "ZPRINT_LOC"
    ENDEXEC.
    *------display the data from the internal table
    LOOP AT itab into wa1.
    WRITE:/ wa1-mandt,wa1-zloc_code,wa1-zloc_desc,wa1-zloc,wa1-zstate.
    ENDLOOP.
    insert ZPRINT_LOC from table itab.

  • Problem to upload the data into internal table record length more than 6000

    Hi all
            I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
    how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there?  while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
    can any one of you help me out. ASAP
    thnks in advance

    from one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
    you have to create multiple lines with do...enddo loop., like this:
    (assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
    __GLOBAL_DATA__
    data: offset type i,
    text_132(132) type c.
    __BEGIN_OF_RECORD__ Before Using Conversion Rules
    Rule : Default Settings Modified
    Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
    CLEAR offset.
    DO 7 TIMES.
    text_132 = excel_long_text-text+offset(132).
    offset = offset + 132.
    __END_OF_RECORD__ After Using Conversion Rules
    Rule : Default Settings Modified
    Code: transfer_record.
    ENDDO.
    also check this
    COMMIT_TEXT
    To load long text into SAP
    READ_TEXT
    To load long text into SAP

  • How to upload the data from two sheets in one excel into SAP

    Hi experts,
                    My requirement is to upload the data from two sheets in an excel into an internal table.How can this be achieved.Is some OLE application has to be used?
    Thanks
    Abhishek

    Hi
    see this program will upload excel file to application.
    *& Report  ZSD_EXCEL2
    REPORT  ZSD_EXCEL2.
    types: begin of ttab ,
          fld1(30) type c,
          fld2(30) type c,
          fld3(30) type c,
          fld4(30) type c,
          fld5(30) type c,
          end of ttab.
    data: itab type table of ttab with header line.
    selection-screen skip 1.
    parameters: p_file type localfile default
                'C:\test.xls'.
    selection-screen skip 1.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
    start-of-selection.
      clear itab. refresh itab.
      perform upload_data.
      loop at itab.
        write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
      endloop.
    * Upload_Data
    form upload_data.
      data: file type  rlgrap-filename.
      data: xcel type table of alsmex_tabline with header line.
      file = p_file.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = file
                i_begin_col             = '1'
                i_begin_row             = '1'
                i_end_col               = '200'
                i_end_row               = '5000'
           tables
                intern                  = xcel
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      loop at xcel.
        case xcel-col.
          when '0001'.
            itab-fld1 = xcel-value.
          when '0002'.
            itab-fld2 = xcel-value.
          when '0003'.
            itab-fld3 = xcel-value.
          when '0004'.
            itab-fld4 = xcel-value.
          when '0005'.
            itab-fld5 = xcel-value.
        endcase.
        at end of row.
          append itab.
          clear itab.
        endat.
      endloop.
    endform.

  • Uploading the data from a flat file into ztable

    Hi,
    I have a requirement where I have to upload the data from 2 flat files into 2 z tables(ZRB_HDR,ZRB_ITM).From the 1st flat file only data for few fields have to be uploaded into ztable(ZRB_HRD) .Fromthe 2nd flat file data for all the fields have to me uploaded into ztable(ZRB_ITM). How can I do this?
    Regards,
    Hema

    hi,
    declare two internal table with structur of your tables.
    your flat files should be .txt files.
    now make use of GUI_UPLOAD function module to upload your flatfile into internal tables.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = 'c:\file1.txt'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab1
        EXCEPTIONS
          OTHERS              = 1.
    use this function twice for two tables.
    then loop them individually and make use of insert command.

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • Error while uploading the data using FM"upload"

    Hi,
    I encountering an error while uploading the data using text file with FM " UPLOAD"
    The error is "File does not exist or cannot be opened "
    But there is a file with name and extenstion right.
    Regards
    Vishnu

    You have to create RC29P-IDNRK(var) using concatenate statement. Try this.
    DATA: new_mark TYPE bdcdata-fnam.
    CONCATENATE 'RC29P-IDNRK(' var ')' INTO new_mark.
    PERFORM bdc_field USING new_mark W_BOM-QTY

Maybe you are looking for