Query in BAPI.................Urgent

Hi Friends,
  Here is my query in BAPI,
  I need a BAPI to upload asset information (which is currently held in Physical data) data  to SAP.
Its very very urgent for me,plz help me on this.
Thanks a lot in Advance.
mrutyun^

hi Mrutyunjaya,
try using BAPI_FIXEDASSET_CREATE1.
You will get lot of information about asset in business object ‘BUS1022’.
regards,

Similar Messages

  • Query on Bapi

    HI
    This is the query on BAPi,I have got one FS on Enhancement.i.e EPOS Upload program,that means i have to upload the data from Excel sheet to sap by using BAPI.I have one BAPI Name also,i.e XBAPI_RE_CN_SALES_REP_REPORT.This was given from onsite,i am workig in offshore,Actually in the excel sheet the fields are comp code,contact number,sale type,report name ,report to,and sales netvolume.But in that BAPI i could not find all the parameters which are existing in the excel sheet.If we want to upload the data from excel sheet,we shud have the same fields in the BAPI na!! to pass from that fucntion module(BAPI).So please tell me the process and coding ,I know its very simple procedure.But I am unable to do it.Please help me out

    it is necessary to have fields...but there might be a  case where company code in BAPI will hold some other field, means it might not be company code but some other field and when executed it transfers data to company code field. also, XBAPI_RE_CN_SALES_REP_REPORT is not a BAPI...check it...

  • Querying a BAPI Function Module

    Is it possible to write a query on the BAPI Function Module. For example I have a views in oracle database and i can query the views based on some condition and get the required data from the views. In the same way is it possible to query the BAPI function module to get the data based on given condition

    Hi Nikki,
       You can use FM RFC_READ_TABLE to read data from any SAP table.
      Also check following post by Raja -
         RFC_READ_TABLE for SAP Web AS - Code Sample
    Cheers,
    Sanjeev

  • Error while creating BOM using BAPI (urgent)

    Hi all,
    Thanks for ur help. i am getting some error while creting a BOM using that BAPI
    BAPI_MATERIAL_BOM_GROUP_CREATE.
    errors are
    1) Error/warning when checking the structure of the BOM group with ID =
    2)Alternative does not exist for material assignment to material BAPIBOMFG1
    is it mandatory to pass the bom group id to this bapi?
    In bomgroup structure , i am not passing anything to BOM_GROUP field.
    is it mandatory to pass this data? i am giving my coding below.plz suggest , where i am making mistake. it is urgent.
    regards
    pabitra
    report z_bom_create
    line-size 132
    line-count 65
    no standard page heading.
    *-- DATA DECLARATION--
    include <icon> .
    *---Tables
    tables : s076, t100, marc .
    *---Types
    types : begin of t_upload, " Upload file data
    col1(18),
    col2(10),
    col3(30),
    col4(12),
    col5(50),
    end of t_upload,
    begin of t_split,
    location like stpu-ebort,
    end of t_split.
    data:begin of i_return occurs 10.
    include structure bapiret2.
    data:end of i_return.
    types:begin of t_item."occurs 10.
    include structure BAPI1080_ITM_C.
    types:end of t_item.
    types:begin of t_subitem." occurs 10.
    include structure BAPI1080_SUI_C.
    types:end of t_subitem.
    types:begin of t_header." occurs 10.
    include structure BAPI1080_MBM_C.
    types:end of t_header.
    types:begin of t_bomgroup." occurs 10.
    include structure BAPI1080_BGR_C.
    types:end of t_bomgroup.
    types:begin of t_variant." occurs 10.
    include structure BAPI1080_BOM_C.
    types:end of t_variant.
    *--- Tables
    data: i_upload type standard table of t_upload, " to hold data
    i_upload1 type standard table of t_upload,
    i_split type standard table of t_split,
    i_item type standard table of t_item,
    i_subitem type standard table of t_subitem,
    i_header type standard table of t_header,
    i_bomgroup type standard table of t_bomgroup,
    i_variant type standard table of t_variant.
    data: wa_upload type t_upload, " to hold file data,
    wa_upload1 type t_upload, " to hold plan data,
    wa_split type t_split,
    wa_item type t_item,
    wa_subitem type t_subitem,
    wa_header type t_header,
    wa_bomgroup type t_bomgroup,
    wa_variant type t_variant.
    data:v_matnr like mara-matnr,
    v_start like sy-index,
    v_count(3) type c.
    *--Constants
    data: c_dot type c value '.',
    c_x type c value 'X',
    c_comma type c value ','.
    -------Selection Screen Design -
    *Selection screen for input of upload file address
    selection-screen skip 2.
    selection-screen begin of block blk1 with frame.
    parameters : p_file like rlgrap-filename obligatory .
    parameters : p_matnr like mara-matnr obligatory,
    p_werks like marc-werks obligatory memory id wrk,
    p_stlan like afko-stlan obligatory default '1' .
    selection-screen end of block blk1.
    ---AT SELECTION SCREEN -
    at selection-screen on value-request for p_file.
    *--For popup to select file.
    perform f_give_help.
    at selection-screen on p_matnr.
    perform f_check_matnr.
    -----START OF SELECTION -
    *--Data upload using WS_Upload.
    perform f_get_data.
    perform f_get_bom_data.
    perform f_get_bom_data1.
    perform f_call_bapi.
    *& Form f_give_help
    text
    --> p1 text
    <-- p2 text
    FORM f_give_help.
    call function 'WS_FILENAME_GET'
    exporting
    mask = ',.,..'
    mode = 'O'
    importing
    filename = p_file
    exceptions
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    others = 5.
    if sy-subrc <> 0 and not sy-msgty is initial.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ENDFORM. " f_give_help
    *& Form f_check_matnr
    text
    --> p1 text
    <-- p2 text
    FORM f_check_matnr.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = p_matnr
    PLANT = p_werks
    BOMUSAGE = '1'
    VALID_FROM_DATE =
    VALID_TO_DATE =
    TABLES
    RETURN = i_return.
    ENDFORM. " f_check_matnr
    *& Form f_get_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_data.
    call function 'WS_UPLOAD'
    exporting
    CODEPAGE = ' '
    filename = p_file
    filetype = 'DAT'
    tables
    data_tab = i_upload
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    others = 10
    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. " f_get_data
    *& Form f_get_bom_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data.
    delete i_upload where col1 is initial.
    delete i_upload where col1 cs 'ITEM'.
    read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
    if sy-subrc = 0.
    v_matnr = wa_upload-col2.
    if v_matnr <> p_matnr.
    message e001(zl) with p_matnr.
    endif.
    else.
    message e000(zl).
    endif.
    ENDFORM. " f_get_bom_data
    *& Form f_get_bom_data1
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data1.
    loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
    v_start = sy-tabix + 1.
    loop at i_upload into wa_upload1 from v_start .
    if wa_upload1-col1 cs 'FINISHED GOOD'.
    exit.
    else.
    perform f_split_upload_data.
    endif.
    endloop.
    endloop.
    ENDFORM. " f_get_bom_data1
    *& Form f_split_upload_data
    text
    --> p1 text
    <-- p2 text
    FORM f_split_upload_data.
    if not wa_upload1-col5 is initial.
    if wa_upload1-col5 cs c_comma.
    split wa_upload1-col5 at c_comma into table i_split.
    loop at i_split into wa_split.
    v_count = v_count + 1.
    endloop.
    if wa_upload1-col4 <> v_count.
    wa_upload1-col4 = v_count.
    endif.
    clear wa_upload1-col5.
    clear wa_split.
    loop at i_split into wa_split.
    wa_upload1-col5 = wa_split-location.
    append wa_upload1 to i_upload1.
    endloop.
    else.
    append wa_upload1 to i_upload1.
    endif.
    else.
    append wa_upload1 to i_upload1.
    endif.
    ENDFORM. " f_split_upload_data
    *& Form f_call_bapi
    text
    --> p1 text
    <-- p2 text
    FORM f_call_bapi.
    clear wa_upload1.
    wa_header-material = p_matnr.
    wa_header-plant = p_werks.
    wa_header-bom_usage = p_stlan.
    append wa_header to i_header.
    wa_bomgroup-bom_usage = p_stlan.
    wa_bomgroup-created_in_plant = p_werks.
    append wa_bomgroup to i_bomgroup.
    wa_variant-alternative_bom = 1.
    wa_variant-base_qty = 1.
    wa_variant-valid_from_date = sy-datum.
    append wa_variant to i_variant.
    loop at i_upload1 into wa_upload1.
    wa_item-item_no = wa_upload1-col1.
    wa_item-item_cat = wa_upload1-col2.
    wa_item-component = wa_upload1-col3.
    wa_item-comp_qty = wa_upload1-col4.
    append wa_item to i_item.
    wa_subitem-subitem_qty = '1'.
    wa_subitem-installation_point = wa_upload1-col5.
    append wa_subitem to i_subitem.
    endloop.
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
    TESTRUN = ' '
    ALL_ERROR = ' '
    TABLES
    BOMGROUP = i_bomgroup
    VARIANTS = i_variant
    ITEMS = i_item
    SUBITEMS = i_subitem
    MATERIALRELATIONS = i_header
    ITEMASSIGNMENTS =
    SUBITEMASSIGNMENTS =
    TEXTS =
    RETURN = i_return.
    if i_return[] is initial.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *write: /'BOM created:', stpo-stlnr.
    else.
    *if not i_return[] is initial.
    loop at i_return.
    IF i_return-TYPE = 'E'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_RED as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    IF i_return-TYPE = 'W'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    ENDLOOP.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    *write: /'Error'.
    endif.
    ENDFORM. " f_call_bapi

    Hi shashi,
    Thanks for ur help.i tried after passing the group but it is giving same error.
    i am getting the error
    "Error/warning when checking the structure of the BOM group with ID= test"
    i am gettig the above error when i put bomgroup-bom_group_identification = 'TEST'.
    whatever i am putting in this field, the same error is comming having different value.
    if i put--- bomgroup-bom_group_identification = ' '. then i will get error
    "Error/warning when checking the structure of the BOM group with ID=
    if i omit that field, then also , i am getting same error.
    plz suggest what r the fields i need to pass for BOMGROUP structure for that bapi?
    regards
    pabitra

  • Query Tuning-very Urgent

    Beloq query is taking time to execute and cost is 934.
    The db in which it is run has lesser volume of data compared to that of prod.
    There is a full table scan on psd
    inspite of a pk present on table psd columns (psd_id,psd_serial_no)
    also a pk present on table ltc_iss_rec columns(ltc_iss_rec_id,psd_serial_num)
    Pl help to optimize the query.
    select a.psd_id,a.psd_serial_no,a.sys_id,a.cosmos_ref_no,a.src_sys_asgn_ref_no,
    a.bank_id,b.lc_expr_dt
    from psd a,ltc_iss_rec b
    where ((b.ltc_iss_rec_id >= 'T200203140731163') and (b.ltc_iss_rec_id <= 'T200606224485207'))
    and a.psd_id = b.ltc_iss_rec_id
    and a.psd_serial_no = b.psd_serial_num
    and a.psd_typ_cod = 'ISS'
    and b.lc_expr_dt <= '13-Mar-07'
    and a.psd_serial_no =
    select nvl(max(link_psd_ser_no),'000') from psd_link c,psd_lcs d
    where c.psd_id = d.psd_id
    and c.psd_serial_no = d.psd_serial_num
    and c.link_psd_id = a.psd_id
    and c.link_psd_id >= 'T200203140731163' and c.link_psd_id <= 'T200606224485207'
    and d.update_serial_num = (
    select max(update_serial_num) from psd_lcs e
    where e.psd_id = d.psd_id
    order by a.psd_id
    Explain plan for the query :
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          1           934                     
    SORT ORDER BY          1      96      900                     
    FILTER                                        
    NESTED LOOPS          1      96      898                     
    PARTITION RANGE ALL                                   1     2
    TABLE ACCESS FULL     IWH_OWNER.PSD     61      4 K     837                1     2
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.LTC_ISS_REC     1      26      1                1     1
    INDEX UNIQUE SCAN     IWH_OWNER.XPKLTC_ISS_REC     1                               
    SORT AGGREGATE          1      112                          
    HASH JOIN          1      112      34                     
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.PSD_LCS     1      40      2                ROWID     ROW L
    NESTED LOOPS          1      82      5                     
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.PSD_LINK     1      42      3                ROWID     ROW L
    INDEX RANGE SCAN     IWH_OWNER.XIE1PSD_LINK     1           2                     
    INDEX RANGE SCAN     IWH_OWNER.XIE1PSD_LCS     2           1                     
    VIEW     SYS.VW_SQ_1     134 K     3 M     26                     
    SORT GROUP BY          134 K     4 M     26                     
    INDEX FULL SCAN     IWH_OWNER.XIE1PSD_LCS     217 K     7 M     26

    Read this link.
    When your query takes too long ...
    If you really need help from any of the forum members then you should avoid using the word "urgent" and give more useful information (check the above link what I meant by useful information) rather than simply saying it's very urgent please help me. It's of no use to anybody.
    Regards
    Raj

  • Urgent Sql Query Problem - -Very Urgent

    Hi Guys,
    I need a urgent solution for a problem.I am
    using the following query
    select ename from emp where deptno =10
    Now I will declare a bind variable and if user passes 'A'
    then the query will run as it is and if he passes B
    then it should run the above query with this additional clause -> birthdate - hiredate >15.
    Please can any one help its very urgent

    Assuming that you have a birthdate column in your emp table, the following will do what you are asking for:
    VARIABLE bind_var VARCHAR2(1)
    EXECUTE :bind_var := '&bind_variable'
    SELECT ename FROM
    (SELECT 'A' AS selection, ename FROM emp WHERE deptno = 10
    UNION ALL
    SELECT 'B' AS selection, ename FROM emp WHERE deptno = 10 AND birthdate - hiredate > 15)
    WHERE selection = :bind_var
    However, the clause "birthdate - hiredate > 15" will only retrieve rows for employees who were born more than 15 days after they were hired. I doubt that this is what you really want, since this is impossible.

  • Objects_objref_not_assigned  - error ( while executing the bapi) - urgent

    Hi,
    i designed a bapi  which is internally calling a transaction (i.e. TRIP ), and returning the status.
    when i call this in back end(abap) side it is giving the desired results correctly.  but when i call the bapi from the front end side , i am getting the error : objects_objref_not_assigned.
    what could be the reasons.
    for your information : we have provided the correct user name and password to execute this tcode.
    regards
    giri

    hi,
    thx for your response, but in the front end side they are calling the rfc using the JCO connection.
    for  your information other bapi's are all working the way which we call.
    regards
    giri
    since it's very urgent if you give your phone no or email .id , it would be helpful.
    thx

  • To create Multilevel BOM---- BAPI (urgent)

    Hi all,
    i am using BAPI_MATERIAL_BOM_GROUP_CREATE to create a <u><b>MULTI LEVEL</b></u> BOM in sap. but i am not getting any field for <b>LEVEL</b> in this BAPI.so,  can i create a multilevel bom without a level ?
    can u plz suggest, how can i use this BAPI to create a <b>multi level</b> bom?
    is there any field relating to assembly indicator (stlkz) in this BAPI?i am not getting this field.plz suggest.
    any idea will be highly appreaciated.
    Regards
    pabitra

    Hi eswar,
    Thanks for ur help. i am getting some error while creting a BOM using that BAPI.
    errors are
    1) Error/warning when checking the structure of the BOM group with ID =
    2)Alternative  does not exist for material assignment to material BAPIBOMFG1
    is it mandatory to pass the bom group id to this bapi?
    In bomgroup structure , i am not passing anything to BOM_GROUP field.
    is it mandatory to pass this data? i am giving my coding below.plz suggest , where i am making mistake. it is urgent.
    regards
    pabitra
    report z_bom_create
           line-size 132
           line-count 65
           no standard page heading.
    *-- DATA DECLARATION--
    include <icon> .
    *---Tables
    tables : s076, t100, marc .
    *---Types
    types : begin of t_upload,      " Upload file data
             col1(18),
             col2(10),
             col3(30),
             col4(12),
             col5(50),
           end of t_upload,
           begin of t_split,
           location like stpu-ebort,
           end of t_split.
    data:begin of i_return occurs 10.
    include structure bapiret2.
    data:end of i_return.
    types:begin of t_item."occurs 10.
    include structure BAPI1080_ITM_C.
    types:end of t_item.
    types:begin of t_subitem." occurs 10.
    include structure  BAPI1080_SUI_C.
    types:end of t_subitem.
    types:begin of t_header." occurs 10.
    include structure  BAPI1080_MBM_C.
    types:end of t_header.
    types:begin of t_bomgroup." occurs 10.
    include structure  BAPI1080_BGR_C.
    types:end of t_bomgroup.
    types:begin of t_variant." occurs 10.
    include structure  BAPI1080_BOM_C.
    types:end of t_variant.
    *--- Tables
    data: i_upload type standard table of t_upload, " to hold data
          i_upload1 type standard table of t_upload,
          i_split type standard table of t_split,
          i_item type standard table of t_item,
          i_subitem type standard table of t_subitem,
          i_header type standard table of t_header,
          i_bomgroup type standard table of t_bomgroup,
          i_variant type standard table of t_variant.
    data: wa_upload  type t_upload, " to hold file data,
          wa_upload1 type t_upload, " to hold plan data,
          wa_split type t_split,
          wa_item type t_item,
          wa_subitem type t_subitem,
          wa_header type t_header,
          wa_bomgroup type t_bomgroup,
          wa_variant type t_variant.
    data:v_matnr like mara-matnr,
         v_start like sy-index,
         v_count(3) type c.
    *--Constants
    data: c_dot type c value '.',
          c_x type c value 'X',
          c_comma type c value ','.
    -------Selection Screen Design -
    *Selection screen for input of upload file address
    selection-screen skip 2.
    selection-screen begin of block blk1 with frame.
    parameters     : p_file like rlgrap-filename obligatory .
    parameters     : p_matnr like mara-matnr obligatory,
                     p_werks like marc-werks obligatory memory id wrk,
                     p_stlan like afko-stlan obligatory default '1' .
    selection-screen end of block blk1.
    ---AT SELECTION SCREEN -
    at selection-screen on  value-request for p_file.
    *--For popup  to select file.
      perform f_give_help.
    at selection-screen on  p_matnr.
      perform f_check_matnr.
    -----START OF SELECTION -
    *--Data upload using WS_Upload.
    perform f_get_data.
    perform f_get_bom_data.
    perform f_get_bom_data1.
    perform f_call_bapi.
    *&      Form  f_give_help
          text
    -->  p1        text
    <--  p2        text
    FORM f_give_help.
    call function 'WS_FILENAME_GET'
           exporting
                mask             = ',.,..'
                mode             = 'O'
           importing
                filename         = p_file
           exceptions
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                others           = 5.
      if sy-subrc <> 0 and  not sy-msgty is initial.
        message id sy-msgid type sy-msgty number sy-msgno
        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    ENDFORM.                    " f_give_help
    *&      Form  f_check_matnr
          text
    -->  p1        text
    <--  p2        text
    FORM f_check_matnr.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
      EXPORTING
        MATERIAL              = p_matnr
        PLANT                 = p_werks
        BOMUSAGE              = '1'
      VALID_FROM_DATE       =
      VALID_TO_DATE         =
      TABLES
        RETURN                = i_return.
    ENDFORM.                    " f_check_matnr
    *&      Form  f_get_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_data.
    call function 'WS_UPLOAD'
       exporting
      CODEPAGE                      = ' '
          filename                      = p_file
          filetype                      = 'DAT'
        tables
          data_tab                      = i_upload
       exceptions
         conversion_error              = 1
         file_open_error               = 2
         file_read_error               = 3
         invalid_type                  = 4
         no_batch                      = 5
         unknown_error                 = 6
         invalid_table_width           = 7
         gui_refuse_filetransfer       = 8
         customer_error                = 9
         others                        = 10
      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.                    " f_get_data
    *&      Form  f_get_bom_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_bom_data.
    delete i_upload where col1 is initial.
    delete i_upload where col1 cs 'ITEM'.
    read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
    if sy-subrc = 0.
    v_matnr = wa_upload-col2.
    if v_matnr <> p_matnr.
    message e001(zl) with p_matnr.
    endif.
    else.
    message e000(zl).
    endif.
    ENDFORM.                    " f_get_bom_data
    *&      Form  f_get_bom_data1
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_bom_data1.
    loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
    v_start = sy-tabix + 1.
    loop at i_upload into wa_upload1 from v_start .
            if wa_upload1-col1 cs 'FINISHED GOOD'.
              exit.
            else.
    perform f_split_upload_data.
         endif.
    endloop.
          endloop.
    ENDFORM.                    " f_get_bom_data1
    *&      Form  f_split_upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_split_upload_data.
    if not wa_upload1-col5 is initial.
    if wa_upload1-col5 cs c_comma.
    split wa_upload1-col5 at c_comma into table i_split.
    loop at i_split into wa_split.
    v_count = v_count + 1.
    endloop.
    if wa_upload1-col4 <> v_count.
       wa_upload1-col4 = v_count.
    endif.
    clear wa_upload1-col5.
    clear wa_split.
    loop at i_split into wa_split.
    wa_upload1-col5 = wa_split-location.
    append wa_upload1 to i_upload1.
    endloop.
    else.
    append wa_upload1 to i_upload1.
    endif.
    else.
    append wa_upload1 to i_upload1.
    endif.
    ENDFORM.                    " f_split_upload_data
    *&      Form  f_call_bapi
          text
    -->  p1        text
    <--  p2        text
    FORM f_call_bapi.
    clear wa_upload1.
    wa_header-material = p_matnr.
    wa_header-plant = p_werks.
    wa_header-bom_usage = p_stlan.
    append wa_header to i_header.
    wa_bomgroup-bom_usage = p_stlan.
    wa_bomgroup-created_in_plant = p_werks.
    append wa_bomgroup to i_bomgroup.
    wa_variant-alternative_bom = 1.
    wa_variant-base_qty = 1.
    wa_variant-valid_from_date = sy-datum.
    append wa_variant to i_variant.
    loop at i_upload1 into wa_upload1.
    wa_item-item_no = wa_upload1-col1.
    wa_item-item_cat = wa_upload1-col2.
    wa_item-component = wa_upload1-col3.
    wa_item-comp_qty = wa_upload1-col4.
    append wa_item to i_item.
    wa_subitem-subitem_qty = '1'.
    wa_subitem-installation_point = wa_upload1-col5.
    append wa_subitem to i_subitem.
    endloop.
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
      TESTRUN                  = ' '
      ALL_ERROR                = ' '
      TABLES
        BOMGROUP                 = i_bomgroup
        VARIANTS                 = i_variant
       ITEMS                    = i_item
       SUBITEMS                 = i_subitem
        MATERIALRELATIONS        = i_header
      ITEMASSIGNMENTS          =
      SUBITEMASSIGNMENTS       =
      TEXTS                    =
        RETURN                   = i_return.
    if  i_return[] is initial.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *write: /'BOM created:', stpo-stlnr.
    else.
    *if not i_return[] is initial.
    loop at i_return.
        IF i_return-TYPE = 'E'.
       errmsg-type = i_return-type.
       errmsg-line = i_return-message.
       append errmsg.
          ULINE /1(108).
          write:/ icon_led_RED as icon, i_return-MESSAGE.
          ULINE /1(108).
        ENDIF.
        IF i_return-TYPE = 'W'.
       errmsg-type = i_return-type.
       errmsg-line = i_return-message.
       append errmsg.
          ULINE /1(108).
          write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
          ULINE /1(108).
        ENDIF.
      ENDLOOP.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    *write: /'Error'.
    endif.
    ENDFORM.                    " f_call_bapi

  • Not able to find query in sq01.Urgent!!!!!!!!

    Hi all,
    I am trying to search a query AQL4CUST_SERVICECONTRACTINFO==.
    In sq01, in user group cust_service i can find a query name of contractinfo but the report name assign to it is AQFKCUST_SERVICECONTRACTINFO==.but I am searching for AQL4CUST_SERVICECONTRACTINFO==.
    can anybody please help me. its really urgent.

    Hi anyone plz............
    Its ugent.
    Reagards,
    Ruchika Saini

  • Report select options similar to Query output options : Urgent !!!!!

    Hi All,
    I have developed a custom report . The output options of this report needs to be included in Selection screen like in SQ01 queries, there should be option to output the report results in different formats like List Viewer, ABAP List, Spread Sheet etc.,. 
    If some variant is selected then user will select whatever the format he want .
    the output should display in that format .
    How I can acomodate all these options to output a report .
    How can I do this ..Pls help me its Urgent !!!!
    Points for Sure !!!
    Regards,
    Varma

    Hi,
       Try this code,
       at user-command.
       case sy-ucomm.
       when 'disp'.
       write:.......   "abap list
       when 'buton1'
        call function 'reuse_alv_list_display'.
         endcase.
    i hope it gives ur answer
    Reward if it helps.

  • HELP NEEDED IN FORMING A QUERY...URGENT.....

    Hi,
    I have a table where in that an employee has multiple rows,
    in that i need to query a particular column values, and need to display
    in one column separated any special charactar like ":". I need this query.
    ex:
    EmpID in_time
    1900 9:00:00
    1900 9:45:00
    1900 10:50:00
    Here i want to display this as
    EmpID time
    1900 9:00;9:45;10:50;
    Please give me your valuable contributions...

    create table user644354(empid number(4),in_time varchar2(8));
    insert into user644354 values(1900,'9:00:00');
    insert into user644354 values(1900,'9:45:00');
    insert into user644354 values(1900,'10:50:00');
    commit;
    select substr(max(SYS_CONNECT_BY_PATH(In_Time, ', ')),2) In_Time FROM
    (SELECT in_time,ROWNUM NBR FROM (SELECT In_time FROM user644354 e where empid=1900))
    CONNECT BY PRIOR NBR = NBR - 1 START WITH NBR = 1
    Regards
    Girish Sharma

  • Query Issue(Very Urgent)

    Hi,
         I have issue with select statement to pull the records from two tables. Here I have two tables one is with Billing Document Items and Service Order Operations.
    I have service order as unique field in both tables, When I execute select statement with one service order I got 10 records like
    S Ord Oper                           Billing Document Items
    Oper    Repair Code                 Item    Oper    Repair Code
    10        AD01                           1         10        AD01
    20        AD01                           2         20        AD01  
    30        OT01                           3         10        AD01
    40        RE01                           4         20        AD01
    50        RP01                           5         20        AD01
                                                   6        20         AD01
                                                    7        30         OT01
                                                    8        40         RE01  
                                                    9        50         RP01
                                                   10      50         RP01
                 This are the records with same Service order number, and my select statement giving data like
    O/P
    Service Order =  60001212
    OPER    ITEM    REPAIR TYPE
    10         1           AD01
    20         1           AD01
    10         2           AD01
    20         2           AD01
    10         3           AD01
    20         3           AD01
    10         4           AD01
    20         4           AD01
    10         5           AD01
    20         5           AD01
    10         6           AD01
    20         6           AD01
    30         7           OT01
    40         8           RE01
    50         9           RP01
    50         10         RP01
    But I need output like this
    Item  Oper                   Rep Code
    1      10                      AD01
    2      20                      AD01
    3      10                      AD01
    4      20                      AD01
    5      20                      AD01
    6      20                      AD01
    7      30                      AD01
    8      40                      RE01
    9      50                      RP01
    10    50                      RP01
             Please give me the select statement which gives the above output. I need very urgent please....
    Thanks
    Robbie

    hi robert,
    The ouput u want is just a little away from the one u r actually getting. it is the two fields OPER and ITEM interchangeably..
    U just have to use GROUP BY ITEM..........if u want the desired output with ITEM as first field.
    <group-by-clause> &#8594; GROUP BY [<column-ref>,*]<column-ref>
    if it helps please reward points.
    thanks

  • Row to column query ( Please its urgent)

    The query is
    SELECT
    WO.WORKORDERKEY,
    UDF1.PROJECT_MANAGER,
    UDF1.TEAM_MANAGER,
    UDF1.TEAM_LEAD,
    UDF1.CUSTOMER_COORDINATOR,
    UDF1.AVIONICS_LEAD,
    UDF1.INTERIOR_LEAD,
    UDF1.INSPECTOR,
    UDF1.MECHANICAL_ENGINEER,
    UDF1.AVIONICS_ENGINEER,
    UDF1.PLANNER,
    UDF1.PARTS_COORDINATOR,
    UDF1.LOGO_HEADER_SELECTION
    FROM
    WORKORDERS WO,
    SELECT
    DISTINCT WOUD.WORKORDERKEY,
    DECODE(UDF.LABEL,'Project Manager',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS PROJECT_MANAGER,
    DECODE(UDF.LABEL,'Team Manager',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS TEAM_MANAGER,
         DECODE(UDF.LABEL,'Team Lead',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS TEAM_LEAD,
    DECODE(UDF.LABEL,'Customer Coordinator',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS CUSTOMER_COORDINATOR,
    DECODE(UDF.LABEL,'Avionics Lead',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS AVIONICS_LEAD,
    DECODE(UDF.LABEL,'Interior Lead',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS INTERIOR_LEAD,
    DECODE(UDF.LABEL,'Inspector',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS INSPECTOR,
    DECODE(UDF.LABEL,'Mechanical Engineer',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS MECHANICAL_ENGINEER,
    DECODE(UDF.LABEL,'Avionics Engineer',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS AVIONICS_ENGINEER,
    DECODE(UDF.LABEL,'Planner',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS PLANNER,
    DECODE(UDF.LABEL,'Parts Coordinator',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS PARTS_COORDINATOR,
    DECODE(UDF.LABEL,'Report Logo/Header Selection',SUBSTR(TO_CHAR(WOUD.DATA), 1, 50),NULL) AS LOGO_HEADER_SELECTION
    FROM
    USERDEFINEDFIELDS UDF,
    WORKORDERUDFDATA WOUD
    WHERE
    UDF.USERDEFINEDFIELDKEY = WOUD.USERDEFINEDFIELDKEY
    AND UDF.LABEL IN('Project Manager','Team Manager','Team Lead','Customer Coordinator','Avionics Lead','Interior Lead','Inspector','Mechanical Engineer','Avionics Engineer','Planner','Parts Coordinator','Report Logo/Header Selection')
    AND UDF.DELETED = 0
    AND WOUD.DELETED = 0
    ) UDF1
    WHERE
    WO.WORKORDERKEY = UDF1.WORKORDERKEY(+);
    The output i am getting like:
    WORKORDERKEY     PROJECT_MANAGER     TEAM_MANAGER     TEAM_LEAD     CUSTOMER_COORDINATOR
    1     abc               
    2          ddf          
    2               rrr     
    3     aaf               
    3                    ege
    i need in single line work order key
    WORKORDERKEY     PROJECT_MANAGER     TEAM_MANAGER     TEAM_LEAD     CUSTOMER_COORDINATOR
    1     abc               
    2          ddf     rrr     
    3     aaf               ege
    Please solve my problem.

    maybe this example might be of some help.
    SQL> select * from pivot_tab;
          COL1 COL2
             1 a
             1 b
             1 c
             2 h
             2 h
    SQL>
    SQL>
    SQL> select p.col1,
      2         substr(max(substr(sys_connect_by_path (p.col2,','),2)),1,60)
      3         as col2
      4    from (select col1,
      5                 col2,
      6                 row_number() over (partition by col1 order by col1, col2) rn
      7            from pivot_tab) p
      8  start with p.rn = 1
      9  connect by p.rn = prior p.rn + 1
    10  and prior p.col1 = p.col1
    11  group by col1;
          COL1 COL2
             1 a,b,c
             2 h,h
    SQL>

  • Oracle Forms6i Query Performance issue - Urgent

    Hi All,
    I'm using oracle forms6i and Oracle DB 9i.
    I'm facing the performance issue in query forms.
    In detail block form taking long time to load the data.
    Form contains 2 non data blocks
    1.HDR - 3 input parameters
    2.DETAILS - Grid - Details
    HDR input fields
    1.Company Code
    2.Company ACccount No
    3.Customer Name
    Details Grid is displayed the details.
    Here there are 2 tables involved
    1.Table1 - 1 crore records
    2.Table2 - 4 crore records
    In form procedure one cursor bulid and fetch is done directly and assign the values to form block fields.
    Below i've pasted the query
    SELECT
    t1.entry_dt,
    t2.authoriser_code,
    t1.company_code,
    t1.company_ac_no
    initcap(t1.customer_name) cust_name,
    t2.agreement_no
    t1.customer_id
    FROM
    table1 t1,
    table2 t2
    WHERE
    (t2.trans_no = t1.trans_no or t2.temp_trans_no = t1.trans_no)
    AND t1.company_code = nvl(:hdr.l_company_code,t1.company_code)
    AND t1.company_ac_no = nvl(:hdr.l_company_ac_no,t1.company_ac_no)
    AND lower(t1.customer_name) LIKE lower(nvl('%'||:hdr.l_customer_name||'%' ,t1.customer_name))
    GROUP BY
    t2.authoriser_code,
    t1.company_code,
    t1.company_ac_no,
    t1.customer_name,
    t2.agreement_no,
    t1.customer_id;
    Where Clause Analysis
    1.Condition 1 OR operator (In table2 two different columbs are compared with one column in table)
    2.Like Operator
    3.All the columns has index but not used properly always full table scan
    4.NVL chk
    5.If i run the qry in backend means coming little fast,front end very slow
    Input Parameter - Query retrival data - limit
    Only compnay code means record count will be 50 - 500 records -
    Only compnay code and comp ac number means record count will be 1-5
    Only compnay code,omp ac number and customer name means record count will be 1 - 5 records
    I have tried following ways
    1.Split the query using UNIOIN (OR clause seaparted) - Nested loops COST 850 , Nested loops COST 750 - index by row id - cost is 160 ,index by row id - cost is 152 full table access.................................
    2.Dynamic SQL build - 'DBMS_SQL.DEFINE COLUMN .....
    3.Given onlu one input parameter - Nested loops COST 780 , Nested loops COST 780 - index by row id - cost is 148 ,index by row id - cost is 152 full table access.................................
    Still im facing the same issue.
    Please help me out on this.
    Thanks and Regards,
    Oracle1001

    Sudhakar P wrote:
    the below query its take more than one minute while updating the records through pro*c.
    Execute 562238 161.03 174.15 7 3932677 2274833 562238Hi Sudhakar,
    If the database is capable of executing 562,238 update statements in one minute, then that's pretty good, don't you think.
    Your real problem is in the application code which probably looks something like this in pseudocode:
    for i in (some set containing 562,238 rows)
    loop
      <your update statement with all the bind variables>
    end loop;If you transform your code to do a single update statement, you'll gain a lot of seconds.
    Regards,
    Rob.

  • AD-hoc query...urgent

    hi,
    I wanted to generate ad hoc query.I kno that it is generated to transmit the data in the Vendor systems from the SAP System.
    so plz tell me how to generate it in SAP HR.plz if possible explain it with the example and what is the impact of it on SAP system as well as vendor system??
    points r assured.
    Thanx

    Ad hoc query is a report which is based on database tables. It is normally used if a report is required to dump the data from one or more tables using table join not having complex logic.
    Ad hoc query can be created for any module. You need to know the database table/s or logical database with correct logic. Since, it is just a report, it does not have any impact on another area.
    regards,

Maybe you are looking for

  • How do you install the JDBC-OCI patch for a Windows NT4 IFS Installation?

    I am about to install IFS on a Windows NT4 Server. I dont understand the instructions for installing the JDBC-OCI patch. How do you install the JDBC-OCI drivers? Do I install them after installing Oracle 8.1.6? and before installing IFS? Is it necess

  • ABAP Code Required to remove #

    Hi, I have 2 characteristics 0COORDER and 0WBS_ELEMT value for which do not exist for all the data records. As a result I get # in the report. How do I replace # in the report with blank? I don’t want to use the VB Script, need a permanent fix. Where

  • Looking for games\apps that run on 3.1.3 1st Gen iPod Touch

    I am looking for a way to search for games and apps that still will run on 3.1.3.  I am mostly interested in educational\kids games.  This is for the iPod my 3yr old gets handed from time to time to use. For my own library, it's easy enough.....selec

  • Finding special characters

    Hi, I have a table which has got a customer detail field which should have only alpahbets and numbers ie a to z, A to Z , 0 to 9.However due to typo there are some special chars entered in this field. How can i find all the rows with special char in

  • Toolchain Setup Error? Cannot compile...

    Hi there! I am trying to set up the C Code Environment but I run into trouble when trying to compile one of the example projects. In general, I followed the instructions within C Support for NI myRIO 1.0 User Guide. I have been trying this for a whil