Reg: Bapi query!!

Hi experts,
is it possible to call a standard SAP transaction in a custom BAPI ?? How do we suppress the standard SAP screens if we can call the transaction??
BAPI for creation of material document number by using static inputs like moment type 311, source and destination storage locations.Transaction for material document creation is MiGO.

Hi,
    You can create material document by the BAPI    <b>BAPI_GOODSMVT_CREATE</b>
see the documentaion for more details.
Regards

Similar Messages

  • Reg:BAPI for updation of Progress parameter and status profile

    Hi,
    Can anybody suggest name of BAPI used for updating "progress parameter" & "Status Profile" in actvity.
    With Regards
    Rohit Prakash

    Hi Ammar,
    I have checked both BAPI but BAPI are not working as per our requirement.
    Firstly we wanted to update progress parameter like measurement method(progress version,method plan,method actual) & POC weight into activity but as per BAPI given by you there is no any field available related to measurement method(progress version,method plan,method actual).
    And secondly we wanted to update status profile residing in Activity tab not in network header or WBS.
    Waiting for some more input related to  query.
    With Regards
    Rohit Prakash

  • Need example for BAPI query. Please, help.

    Hi,
    badly need help on BAPI_ACC_ACTIVITY_ALLOC_POST.
    Does anybody have some example code for jCO query?
    Thanks.
    Vladimir

    Hi,
    Try this code...
    package jco;
    import com.sap.mw.jco.*;
    public class jcosample
       public static void main(String args[])
           JCO.Client myConnection = null;
           JCO.Repository mRepository = null;
           JCO.Function myFunction = null;
           try
           myConnection = JCO.createClient("client","username","password" ,"language","ip address","system no");           
           myConnection.connect();
           mRepository = new JCO.Repository("WIPRO",myConnection);
           try
                  if (mRepository == null )
                         System.out.println("NuLL");
                  try
                         IFunctionTemplate ft=mRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");                                                 
                         myFunction=ft.getFunction();                    
                  }catch (Exception ex)
                         throw new Exception(ex + "Problem retrieving JCO.Function object.");
            if (myFunction == null)
                     System.exit(1);
                  myConnection.execute(myFunction);                                  
                  }catch (Exception ex)
                         ex.printStackTrace();
                         System.exit(1);
                myConnection.execute(myFunction);
                JCO.Table codes = null;
                  codes =myFunction.getTableParameterList().getTable("COMPANYCODE_LIST");
                  int size;
                 size =codes.getNumRows();
                  if (size == 0)
                      System.out.println("No value matches the selection cretaria");
                  else
                     for (int i = 0;i<=size; i++)
                            codes.setRow(i);                      System.out.print(codes.getString("COMP_CODE"));                     System.out.println(codes.getString("COMP_NAME"));
           }catch( Exception e)
                  e.printStackTrace();
    Hope that helps...
    Note: in case for the BAPI that inserts or modified data you must call the BAPI_TRANSACTION_COMMIT also for the changes to get reflected in the Database.
    Please let me if that helps you.
    Cheers
    Kathir~

  • BAPI - Query

    I am using this std BAPI (BAPI_ENTRYSHEET_CREATE)
    Suppose 30 fields required for creating a service entry.
    Third party system is sending 10 fields to XI and XI is putting these 10 fields to the BAPI.
    This will inlcude the PO number and line item number.
    Now fields like material group, company code , business area etc will not be sent by third party system, but these fields are required to create service entry.
    Query:
    1. If PO and PO line item entered in BAPI will the BAPI pick other data which are required for creating the service entry?
    2. How does BAPI works ? Can anyone please explain in simple terms.
    Please advice.
    Thanks
    Moderator message - Cross thread locked. And please use a meaningful subject line.
    Edited by: Rob Burbank on Nov 12, 2009 11:41 AM

    I am using this std BAPI (BAPI_ENTRYSHEET_CREATE)
    Suppose 30 fields required for creating a service entry.
    Third party system is sending 10 fields to XI and XI is putting these 10 fields to the BAPI.
    This will inlcude the PO number and line item number.
    Now fields like material group, company code , business area etc will not be sent by third party system, but these fields are required to create service entry.
    Query:
    1. If PO and PO line item entered in BAPI will the BAPI pick other data which are required for creating the service entry?
    2. How does BAPI works ? Can anyone please explain in simple terms.
    Please advice.
    Thanks
    Moderator message - Cross thread locked. And please use a meaningful subject line.
    Edited by: Rob Burbank on Nov 12, 2009 11:41 AM

  • Reg select query problem

    hi all,
    hope all r doing fine?
    anyway i have a query which is mentioned below:-
    select field1,.....fieldn
             from <dbtable1>
             into corresponding fields of table itab
             where <condition>.
    select field1,...fieldn
              from <dbtable2>
             appending corresponding fields of table itab
            where <condition>.
    the above two select stmts retrieve same set of  fields from two different database tables into same internal table itab..
    now my question is ...........is any other way to change 2nd select statement without using appending correspondin fields
    but the functionality should remain the same as it is after changing..................
    bcos appending corresponding is causing performance problem in data retrieval.
    thanx alot in advance.
    for sure points will be given for all the helpful answers
    Jack

    Hi,
    You can use like that:
    select field1,.....fieldn
    from <dbtable1>
    into corresponding fields of table itab1
    where <condition>.
    select field1,...fieldn
    from <dbtable2>
    appending corresponding fields of table itab2
    where <condition>.
    now u use:
    loop at itab2 into w_itab2.
    read table itab1 into w_itab1 with key w_itab1-<primary field> = w_itab2-<Primary field>.
    if sy-subrc = 0.
      append w_final into i_final.
    else continue.
    endif.
    endloop.
    *i_final table having all data ( i.e itab2 & itab1 data)

  • Reg:Bapi for mass creation of production order/confirmation

    Dear Experts,
    I wanted to know with the following BAPI is it possible to create Multiple production orders for different semifinshed Materials along with material availability check and other functions similar to CO01 transaction.
    I knew there are standard transactions for mass confirmation for production orders. But i need a confirmation on this BAPI . As i am planning to go-ahed with ,mass creation of production order creation / Order confirmation in single custom transaction.Need back flush activity even supported.
    BAPI_PRODORD_CREATE to create the orders.
    BAPI_PRODORD_RELEASE to release the orders.
    BAPI_PRODORDCONF_GET_TT_PROP to get the default data for the confirmation.
    BAPI_PRODORDCONF_CREATE_TT to ost the confirmation of production order.
    Along with this BAPI do i need to commit any other BAPI to carry out back flush for components.
    Need your suggestions to take it further.
    Regards,
    Daya.

    Dear SAP Daya
    If the issue has been solved, please close this thread.
    You have already mentioned that the issue has been resolved, thefore, you should not ask for help on another thread before closing this one, as it looks like you are trying to force people to answer your threads.
    Users are always trying to answer as many threads as possible on good will we don't need this kind of "incentive".
    Please read carefully the The SCN Rules of Engagement, especially point 8:
    Be responsive. If an SCN member has answered your question, please mark the answer as "helpful” or “correct”. Mark the discussion as “answered,” so that other members can find the answers more easily
    Also, I checked your old threads and I could observe that there is only one closed. Please review your old threads and close those already solved.
    BR
    Caetano

  • Reg bapi for creation of purchase order

    hai to all,
    i have to upload purchase orders from  legacy file to R/3 system
    certain order having more than 50 line items
    so please any one send me <b>stardard bapi program or bdc program for me21n</b> transaction which will suitable for my senario.
    please send asap
    regards
    vijay

    hai
    i am trying to create po using bapi
    the following code explains
    constants : c_x value 'X'.
      data: del_date type sy-datum.
      data: pohead  type bapimepoheader.
      data: poheadx type bapimepoheaderx.
      data: exp_head type bapimepoheader.
      data: t_return_out  type table of bapiret2 with header line,
            wa_return_out  TYPE bapiret2.
      data: poitem  type table of bapimepoitem with header line.
      data: poitemx type table of bapimepoitemx with header line.
      data: posched  type table of bapimeposchedule with header line.
      data: poschedx type table of bapimeposchedulx with header line.
      data: ex_po_number type bapimepoheader-po_number.
    Header Level Data
      pohead-comp_code = '1011'.
      pohead-doc_type   = 'NB'     .
      pohead-creat_date = sy-datum   .
      pohead-vendor = 'A1138'.
      pohead-purch_org = 'DOMS'.
      pohead-pur_group = 'MFR'.
      pohead-langu      = sy-langu   .
      pohead-doc_date   = sy-datum.
      poheadx-comp_code  = c_x.
      poheadx-doc_type   = c_x.
      poheadx-creat_date = c_x.
      poheadx-vendor     = c_x.
      poheadx-langu      = c_x.
      poheadx-purch_org  = c_x.
      poheadx-pur_group  = c_x.
      poheadx-doc_date   = c_x.
    Item Level Data
      poitem-po_item  = 1.
      poitem-material = '000000000100001079'.
      poitem-plant    = 'HO01'.
    poitem-stge_loc = ''.
      poitem-quantity = 1.
      append poitem.
      poitemx-po_item    = 1.
      poitemx-po_itemx   = c_x.
      poitemx-material   = c_x.
      poitemx-plant      = c_x .
      poitemx-stge_loc   = c_x .
      poitemx-quantity   = c_x .
      poitemx-tax_code   = c_x .
      poitemx-item_cat   = c_x .
      poitemx-acctasscat = c_x .
      append poitemx.
    Schedule Line Level Data
    posched-po_item        = 1.
    posched-sched_line     = 1.
    posched-del_datcat_ext = 'D'.
    del_date = sy-datum + 1.
    write del_date to posched-delivery_date.
    posched-deliv_time     = '000001'.
    posched-quantity       = 1.
    append posched.
    poschedx-po_item        = 1.
    poschedx-sched_line     = 1.
    poschedx-po_itemx       = c_x.
    poschedx-sched_linex    = c_x.
    poschedx-del_datcat_ext = c_x.
    poschedx-delivery_date  = c_x.
    poschedx-quantity       = c_x.
    append poschedx.
      call function 'BAPI_PO_CREATE1'
           EXPORTING
                poheader         = pohead
                poheaderx        = poheadx
                testrun          = ' '
           IMPORTING
                exppurchaseorder = ex_po_number
                expheader        = exp_head
           TABLES
                return           = t_return_out
                poitem           = poitem
                poitemx          = poitemx.
               poschedule       = posched
               poschedulex      = poschedx.
    call function 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
               wait = 'X'.
    if not ex_po_number is initial.
       call function 'DEQUEUE_ALL'.
    else.
       call function 'DEQUEUE_ALL'.
       message i036.
    endif.
    **endform. " create_po
    IF ex_po_number IS NOT INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          PERFORM show_result.
    ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          PERFORM show_result.
        ENDIF.
    *&      Form  show_result
          text
    -->  p1        text
    <--  p2        text
    FORM show_result .
      LOOP AT t_return_out INTO wa_return_out.
        write : ex_po_number.
        WRITE : / wa_return_out-type,
                / wa_return_out-id,
                / wa_return_out-number,
                / wa_return_out-message,
                / wa_return_out-log_no,
                / wa_return_out-log_msg_no,
                / wa_return_out-message_v1,
                / wa_return_out-message_v2,
                / wa_return_out-message_v3,
                / wa_return_out-message_v4,
                / wa_return_out-parameter,
                / wa_return_out-row,
                / wa_return_out-field,
                / wa_return_out-system.
      ENDLOOP.
    <b>iam geting the error such that</b>
    E                                                                            
    BAPI                                                                         
    001                                                                          
    No instance of object type PurchaseOrder has been created. External reference:
    000000                                                                       
    PurchaseOrder                                                                
    POHEADER                                                                     
            1                                                                 
    E                                                                         
    ME                                                                        
    062                                                                       
    Account assignment mandatory for material 100001079 (enter acc. ***. cat.)
    000000                                                                    
    100001079                                                                 
    POITEM                                                                    
    <b>how to correct this error</b>
    regards
    vijay

  • Reg BAPI  BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    We are creating the sales order using the BAPI BAPI_SALESORDER_CREATEFROMDAT2  the BAPI is successfully creating Sales order successfully with out any issues,but the problem is the sales order line item which has been created through BAPI is being greyed out it is not allowing changes changes to be done for the line item.
    The same we checked manually executing the BAPI from Se37 it is creating sales order and also it is allowing to change the line item details manually(by going through VA02).We cross checked the parameters that we are passing through SE37 and through program both are same but I am not getting what is cause for the error.Please suggest some body some resolution for this.
    Regards
    Mahesh

    Hi All,
    We are creating the sales order using the BAPI BAPI_SALESORDER_CREATEFROMDAT2  the BAPI is successfully creating Sales order successfully with out any issues,but the problem is the sales order line item which has been created through BAPI is being greyed out it is not allowing changes changes to be done for the line item.
    The same we checked manually executing the BAPI from Se37 it is creating sales order and also it is allowing to change the line item details manually(by going through VA02).We cross checked the parameters that we are passing through SE37 and through program both are same but I am not getting what is cause for the error.Please suggest some body some resolution for this.
    Regards
    Mahesh

  • Reg BAPI to be used for cancellation of GI/GR

    Dear Experts,
    The requirement at our client side is , Through control recipe messages process order numbers and material details are sent to MES system and the Goods issue, confirmation and Goods receipts are taking place in MES and data is transferred to SAP via a middleware .
    What is the BAPI to be used to pass the message  cancel the Goods issue or Goods receipt document in middleware to SAP
    What is the BAPI to be used to pass the message of cancellation of confirmation from Middleware to SAP
    Thanks in advance
    Regards
    venkat

    Dear Venkat,
    for cancelling GI/GR you may use BAPI_GOODSMVT_CREATE with GM_Code 06
    for cancelling confirmations you may use BAPI_PRODORDCONF_CANCEL
    Regards, Andreas

  • Reg : bapi

    Hi All,
    Am currently working in 4.6b version i have an requirement to upload purchase order creation i.e stock transport order using BAPI. I just want to know how to simulate purchase order before upload in bapi,and if error occurs how can i say that particular line item is error in purchase order creation.But i know that we can simulate in BAPI_PO_CREATE1 in ECC 6.0 how can i achieve in 4.6 version.
    am using the function module :BAPI_PO_CREATE
    my upload file format :
         Material
            Quantity
            Plant
         Storage Location
         Delivery Date

    hi
    hope it will help you.
    Pls reward if help.
    REPORT zpo_bapi_purchord_tej.
    DATA DECLARATIONS *
    TYPE-POOLS slis.
    TYPES: BEGIN OF ty_table,
    v_legacy(8),
    vendor TYPE bapimepoheader-vendor,
    purch_org TYPE bapimepoheader-purch_org,
    pur_group TYPE bapimepoheader-pur_group,
    material TYPE bapimepoitem-material,
    quantity(13),
    delivery_date TYPE bapimeposchedule-delivery_date,
    net_price(23),
    plant TYPE bapimepoitem-plant,
    END OF ty_table.
    TYPES: BEGIN OF ty_alv,
    v_legs(8),
    success(10),
    v_legf(8),
    END OF ty_alv.
    TYPES: BEGIN OF ty_alv1,
    v_legf1(8),
    v_msg(500),
    END OF ty_alv1.
    *-----Work area declarations.
    DATA: x_table TYPE ty_table,
    x_header TYPE bapimepoheader,
    x_headerx TYPE bapimepoheaderx,
    x_item TYPE bapimepoitem,
    x_itemx TYPE bapimepoitemx,
    x_sched TYPE bapimeposchedule,
    x_schedx TYPE bapimeposchedulx,
    x_commatable(255),
    x_alv TYPE ty_alv,
    x_alv1 TYPE ty_alv1,
    x_alv2 TYPE ty_alv1.
    *-----Internal table declarations.
    DATA: it_table TYPE TABLE OF ty_table,
    it_commatable LIKE TABLE OF x_commatable,
    it_item TYPE TABLE OF bapimepoitem,
    it_itemx TYPE TABLE OF bapimepoitemx,
    it_sched TYPE TABLE OF bapimeposchedule,
    it_schedx TYPE TABLE OF bapimeposchedulx,
    it_alv TYPE TABLE OF ty_alv,
    it_alv1 TYPE TABLE OF ty_alv1,
    it_alv2 TYPE TABLE OF ty_alv1.
    DATA: po_number TYPE bapimepoheader-po_number,
    x_return TYPE bapiret2,
    it_return TYPE TABLE OF bapiret2,
    v_file TYPE string,
    v_temp(8),
    v_succsount TYPE i VALUE 0,
    v_failcount TYPE i VALUE 0,
    v_total TYPE i.
    DATA: v_temp1(5) TYPE n VALUE 0.
    DATA: x_event TYPE slis_t_event,
    x_fieldcat TYPE slis_t_fieldcat_alv,
    x_list_header TYPE slis_t_listheader,
    x_event1 LIKE LINE OF x_event,
    x_layout1 TYPE slis_layout_alv,
    x_variant1 TYPE disvariant,
    x_repid2 LIKE sy-repid.
    DATA : it_fieldcat TYPE TABLE OF slis_t_fieldcat_alv.
    SELECTION-SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK v_b1 WITH FRAME.
    *-----To fetch the flat file.
    PARAMETERS: p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK v_b1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN.
    IF p_file IS INITIAL.
    MESSAGE text-001 TYPE 'E'.
    ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    *-----To use F4 help to find file path.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_file.
    v_file = p_file.
    START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM gui_upload.
    LOOP AT it_table INTO x_table.
    PERFORM header_details.
    v_temp = x_table-v_legacy.
    LOOP AT it_table INTO x_table WHERE v_legacy = v_temp.
    PERFORM lineitem.
    PERFORM schedule.
    ENDLOOP.
    DELETE it_table WHERE v_legacy = v_temp.
    PERFORM bapicall.
    MOVE po_number TO x_alv-success.
    APPEND x_alv TO it_alv.
    CLEAR x_alv.
    *-----To clear the item details in internal table after the operation for a header.
    REFRESH: it_item,
    it_itemx,
    it_sched,
    it_schedx.
    CLEAR: v_temp1.
    ENDLOOP.
    v_total = v_succsount + v_failcount.
    PERFORM display_alv.
    FORM GUI_UPLOAD *
    FORM gui_upload .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = v_file
    filetype = 'ASC'
    TABLES
    data_tab = it_commatable
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17
    IF sy-subrc = 0.
    *-----To fetch the comma seperated flat file into an internal table.
    LOOP AT it_commatable INTO x_commatable.
    IF x_commatable IS NOT INITIAL.
    SPLIT x_commatable AT ',' INTO
    x_table-v_legacy
    x_table-vendor
    x_table-purch_org
    x_table-pur_group
    x_table-material
    x_table-quantity
    x_table-delivery_date
    x_table-net_price
    x_table-plant.
    APPEND x_table TO it_table.
    ENDIF.
    CLEAR x_table.
    ENDLOOP.
    ENDIF.
    ENDFORM. " gui_upload
    FORM HEADER_DETAILS *
    FORM header_details .
    MOVE 'NB' TO x_header-doc_type.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-vendor
    IMPORTING
    output = x_table-vendor
    MOVE x_table-vendor TO x_header-vendor.
    MOVE x_table-purch_org TO x_header-purch_org.
    MOVE x_table-pur_group TO x_header-pur_group.
    x_headerx-doc_type = 'X'.
    x_headerx-vendor = 'X'.
    x_headerx-purch_org = 'X'.
    x_headerx-pur_group = 'X'.
    ENDFORM. " header_details
    FORM LINEITEM *
    FORM lineitem .
    v_temp1 = v_temp1 + 10.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = v_temp1
    IMPORTING
    output = v_temp1.
    MOVE v_temp1 TO x_item-po_item.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = x_table-material
    IMPORTING
    output = x_table-material.
    MOVE x_table-material TO x_item-material.
    MOVE x_table-quantity TO x_item-quantity.
    MOVE x_table-net_price TO x_item-net_price.
    MOVE x_table-plant TO x_item-plant.
    x_itemx-po_item = v_temp1.
    x_itemx-material = 'X'.
    x_itemx-quantity = 'X'.
    x_itemx-net_price = 'X'.
    x_itemx-plant = 'X'.
    APPEND x_item TO it_item.
    APPEND x_itemx TO it_itemx.
    CLEAR: x_item, x_itemx.
    ENDFORM. " lineitem1
    FORM SCHEDULE *
    FORM schedule .
    MOVE x_table-delivery_date TO x_sched-delivery_date.
    MOVE v_temp1 TO x_sched-po_item.
    x_schedx-delivery_date = 'X'.
    x_schedx-po_item = v_temp1.
    APPEND x_sched TO it_sched.
    APPEND x_schedx TO it_schedx.
    CLEAR: x_sched, x_schedx.
    ENDFORM. " schedule
    FORM BAPICALL *
    FORM bapicall .
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    poheader = x_header
    poheaderx = x_headerx
    IMPORTING
    exppurchaseorder = po_number
    TABLES
    return = it_return
    poitem = it_item
    poitemx = it_itemx
    poschedule = it_sched
    poschedulex = it_schedx.
    IF po_number IS NOT INITIAL.
    v_succsount = v_succsount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legs.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ELSE.
    v_failcount = v_failcount + 1.
    MOVE x_table-v_legacy TO x_alv-v_legf.
    MOVE x_table-v_legacy TO x_alv1-v_legf1.
    LOOP AT it_return INTO x_return.
    IF x_alv1-v_msg IS INITIAL.
    MOVE x_return-message TO x_alv1-v_msg.
    ELSE.
    CONCATENATE x_alv1-v_msg x_return-message INTO x_alv1-v_msg SEPARATED BY space.
    ENDIF.
    ENDLOOP.
    APPEND x_alv1 TO it_alv1.
    CLEAR x_alv1.
    ENDIF.
    ENDFORM. " bapicall
    FORM DISPLAY_ALV *
    FORM display_alv .
    PERFORM x_list_header.
    PERFORM build_fieldcat CHANGING x_fieldcat.
    x_repid2 = sy-repid.
    x_event1-name = 'TOP_OF_PAGE'.
    x_event1-form = 'TOP_OF_PAGE'.
    APPEND x_event1 TO x_event.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = x_fieldcat
    i_callback_user_command = 'USER_COMMAND'
    i_callback_top_of_page = 'TOP_OF_PAGE'
    i_save = 'A'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " display_master_data
    FORM USER_COMMAND *
    FORM user_command USING ucomm LIKE sy-ucomm selfield
    TYPE slis_selfield.
    READ TABLE it_alv INTO x_alv INDEX selfield-tabindex.
    CLEAR : x_alv2,it_alv2[].
    LOOP AT it_alv1 INTO x_alv1 WHERE v_legf1 = x_alv-v_legf.
    x_alv2 = x_alv1.
    APPEND x_alv2 TO it_alv2 .
    ENDLOOP.
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv.
    DATA : x3_fieldcat LIKE LINE OF it_fieldcat.
    CLEAR : x3_fieldcat,it_fieldcat[].
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_LEGF1'.
    x3_fieldcat-reptext_ddic = text-111.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    CLEAR x3_fieldcat.
    x3_fieldcat-col_pos = '1'.
    x3_fieldcat-fieldname = 'V_MSG'.
    x3_fieldcat-reptext_ddic = text-112.
    x3_fieldcat-ref_tabname = 'IT_ALV2'.
    APPEND x3_fieldcat TO it_fieldcat.
    CLEAR x3_fieldcat.
    x_layout1-colwidth_optimize = 'X'.
    x_layout1-zebra = 'X'.
    IF it_alv2[] IS NOT INITIAL.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = x_repid2
    is_layout = x_layout1
    it_fieldcat = it_fieldcat
    i_save = 'A'
    i_callback_top_of_page = 'TOP'
    is_variant = x_variant1
    it_events = x_event
    TABLES
    t_outtab = it_alv2
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDIF.
    ENDFORM.
    FORM USER_COMMAND *
    FORM top.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = 'Commentry'.
    ENDFORM.
    FORM BUILD_FIELDCAT *
    FORM build_fieldcat CHANGING et_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: x1_fieldcat TYPE slis_fieldcat_alv.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '1'.
    x1_fieldcat-fieldname = 'V_LEGS'.
    x1_fieldcat-reptext_ddic = text-108.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '2'.
    x1_fieldcat-fieldname = 'SUCCESS'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-109.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    x1_fieldcat-col_pos = '3'.
    x1_fieldcat-fieldname = 'V_LEGF'.
    x1_fieldcat-key = 'X'.
    x1_fieldcat-reptext_ddic = text-110.
    x1_fieldcat-ref_tabname = 'IT_ALV'.
    APPEND x1_fieldcat TO et_fieldcat.
    CLEAR x1_fieldcat.
    ENDFORM. " build_fieldcat
    FORM BUILD_LIST_HEADER *
    FORM x_list_header.
    DATA: x_list_header1 TYPE slis_listheader.
    *-----List Header: type H
    CLEAR x_list_header1 .
    x_list_header1-typ = 'H'.
    x_list_header1-info = text-105.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: type S
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-106.
    x_list_header1-info = v_total.
    APPEND x_list_header1 TO x_list_header.
    *-----List Key: Type S
    CLEAR x_list_header1 .
    x_list_header1-typ = 'S'.
    x_list_header1-key = text-107.
    x_list_header1-info = v_succsount.
    APPEND x_list_header1 TO x_list_header.
    ENDFORM. " build_list_header
    FORM TOP_OF_PAGE *
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = x_list_header.
    ENDFORM. " TOP_OF_PAGE

  • Reg: BAPI for HR

    Hi Experts,
    Please help me onthis.
    To which InfoType does it belong (both HR US and HR INT.)
    Which BAPI is used or available to read the information? (both HR US and HR INT.)
    Which BAPI is used or available to write the e-mail address? (both HR US and HR INT.)
    Which BAPI is used or available to write the different phone numbers (telephone, telex, pager, mobile, fax) (HR INT. only)
    Is it correct the default BAPI will only return objects that are ACTIVE? Is there a BAPI available that will return person objects, independent of their status? (this is needed to be able to provision the AD account in a disabled state right after the HR record creation. This way HP has the time to finish the configuration of that AD account and mailbox BEFORE the person starts working for SaraLee) A BAPI is needed that returns objects whether or not the object are ACTIVE.
    I am waiting for ur reply
    Thanks & Regards,
    ABAP

    Hi,
    you can check with this function module.
    BAPI_HRMASTER_SAVE_REPL_MULT,
    RH_CALL_BAPI_HRMD_APPL.
    Regards,
    Shamma

  • Reg select query

    Hi Guys,
    I got a problem with select query...could you polease help me out...plz check the second select query statement
    when i open tstcp table i gave Ztable and then when I exceute i am able to get the list when i do it programatically it is not working .....
    any suggestions...points will be rewarded..
    select tabname
                   from dd02l into table i_dd02l where tabname like 'Z%' and
                                                  ( tabclass = 'VIEW'
                                                          or
                                                   tabclass = 'TRANSP' ) and
                                                  ( mainflag = 'X'
                                                          or
                                                    mainflag = '' ).
    if not i_dd02l[] is initial.
    loop at i_dd02l.
    v_tabna = i_dd02l-tabname.
    select single tcode
                  param into (v_tcode , v_param)
                  from tstcp where param like '%v_tabna%'.
    i_tstcp-tcode = v_tcode.
    i_tstcp-param = v_param.
    append i_tstcp.
    clear i_tstcp.
    endloop.
    endif.
    Regards,
    Ravi Ganji

    Hi ,
      The statement will not work because it will try to find all records which has v_tabna in its field.
    So what you need to do is concatenate % before and after the value of the varaible v_tabna and store it in some varaible say v_value and use it in the where clause.
    so your code will look like this
    *v_tabna = i_dd02l-tabname.
    concatenate '%'  i_dd02l-tabname '%' into v_tabna
    select single tcode
    param into (v_tcode , v_param)
    from tstcp where param like tabna.
    Regards
    Arun

  • REG:- SQL QUERY

    HI FRENDS
    MY PROBLEM IS IN BELOW QUERY
    select SUBSTR('Sales - Alternate Channels (Sub Department).Area Manager.1',1,7) from dual
    HERE I WANT TO TAKE ONLY 'SALES' FROM THE STRING.
    BUT SOME TIME INSTEAD OF SALES IT WILL COME 'Branch Operations' LIKE THAT THEN I WANT TAKE THESE STRING ONLY....
    IN SHORT I WAN TO TAKE ONLY THAT STRING WHICH IS BEFORE '-'......NOT THAT VALUE WHICH AFTER '-'...
    PL HELP.

    If u want srting before '-' than use instr to search '-'
    e.g.
    select substr('Branch Operations - Alternate Channels (Sub Department).Area Manager.1',1
    ,instr('Branch Operations - Alternate Channels (Sub Department).Area Manager.1','-',1)-1)
    from dual
    SQL> select substr('Branch Operations - Alternate Channels (Sub Department).Area Manager.1',1
    2 ,instr('Branch Operations - Alternate Channels (Sub Department).Area Manager.1','-',1)-1)
    3 from dual
    4 /
    SUBSTR('BRANCHOPERATIONS-ALTER
    Branch Operations
    SQL> select substr('Sales - Alternate Channels (Sub Department).Area Manager.1',1
    2 ,instr('Sales - Alternate Channels (Sub Department).Area Manager.1','-',1)-1)
    3 from dual
    4 /
    SUBSTR('SALES-ALTERNATECHANNEL
    Sales

  • Reg. Query for UDFs.

    Hello All,
    I've created a multiple UDFs Like, Vendor Name,Vendor Address,Vendor Excise Details like ECC No,Range, Division,VAT No,CST No. in Marketing Documents.
    I want to write a query, for example if I select the Vendor Name, the vendor address and excise details should pick up automatically from that vendor master record. Please help.
    Thanks,
    Pratheeviraj.

    Dear Avijit,
    Thanks for your reply.
    I can't understand your solution.  Can you please explain me in detail?
    I'm giving the scenario in detail,
    In the marketing document 'Outgoing Excise Invoice', I've created UDFs like vendor name, vendor address, vendor excise number, etc., my requirement is the moment I select the vendor in Vendor Name UDF, the address and excise number should get populated in the respective UDFs.
    Thanks,
    Pratheeviraj

  • Reg.write query for report

    Dear Experts
    I am MM consultant and I am in need of generate reports.I don't know how to get the data from two table. Pls help me
    with some codings
    Thanks
    Rajakumar.K

    Hi.....
    Check this... Here Iam joining MARA and MAKT tables.....
    data: begin of itab occurs 0,
          matnr like mara-matnr,             <----like this you can select no.of fields from MARA
          spras like makt-spras,             <----like this you declare ur internal table with no.of fields of MAKT table
          end of itab.    
    parameters: p_matnr like mara-matnr.      <------ Later according to this material number you can display details
    select p~matnr q~spras          <----with p~ you can declare no.of from MARA, but those should me mention in above ITAB , also MAKT with q~
             from
             mara as p                      <---- p is for first table fileds
             inner join                         <----- key word
             makt as q                          <----- q is for second table fields
              on p~matnr = q~matnr       <----this is for link
              into corresponding fields of table itab
              where p~matnr = p_matnr.       <------checking where condition with parameter
    loop at itab.
    write:/ itab-matnr,            <--------here you can display the fields which you defined in ITAB
              itab-spras.
    endloop.
    Also check this query....
    Here you can display all the details of that tables...
    data: begin of itab occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          end of itab.
    data: p_matnr like mara-matnr.
    select-options: g_matnr for p_matnr.              <------First change
    select p~matnr q~spras from mara as p inner join makt as q
              on p~matnr = q~matnr
              into corresponding fields of table itab
              where p~matnr in g_matnr.                   <----second change
    loop at itab.
    write:/ itab-matnr,
              itab-spras.
    endloop.
    Also check this code and get an idea about for all entries method and joining of more than two tables...
    data: begin of itab occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          end of itab.
    data: begin of jtab occurs 0,
          matnr like marc-matnr,
          werks like marc-werks,
          end of jtab.
    data: begin of t_out occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          werks like marc-werks,
          end of t_out.
    data: p_matnr like mara-matnr.
    select-options: g_matnr for p_matnr.
    select p~matnr q~spras from mara as p inner join makt as q
              on p~matnr = q~matnr
              into corresponding fields of table itab
              where p~matnr in g_matnr.
    if itab[] is not initial.
      select * from marc into corresponding fields of table jtab
                for all entries in itab
                where matnr = itab-matnr.
    endif.
    loop at itab.
      t_out-matnr = itab-matnr.
      t_out-spras = itab-spras.
      read table jtab with key matnr = itab-matnr.
      if sy-subrc = 0.
        t_out-werks = jtab-werks.
      endif.
      append t_out.
      clear t_out.
    endloop.
    loop at t_out.
      write:/ t_out-matnr,
              t_out-spras,
              t_out-werks.
    endloop.
    All the best!!
    Thanks,
    Naveen.I

Maybe you are looking for

  • OIM 11g R2 - User random password Generation

    Hi All, In my case users are getting created in OIM using Trusted source reconciliation and need to populate a random password for each user. Please suggest me which of the following methods is better and why? Method 1: Created a post Event Handler a

  • Generate a report that shows all customers that have changed groupcodes

    We use our groupcodes on the business partner to define retail customers, wholesale customers or vendors.  I have been requested to generate a report by data range any customers who have changed from retail to wholesale. The information can be viewed

  • Pa30 create external url link ( mass opload

    Has anyone been able to upload multiple attachments from a spread sheet to this transaction. Obviously using the function upload. I think the function module that I will need to use is called BDS_BUSINESS_DOCUMENT_CREA_URL. I have passed the followin

  • Sound issues_interactive pdf

    Ive  created a brochure in Indesign of videos and interactive work for an exhibition,  after exporting my interactive pdf to a swf file I have problems with the sound. Ive placed all the videos (aprox20, maily flv's) into the interactive pdf and put

  • Get Source Filename

    Hello,   I have a requirement where I need to get the source filename and use that in the XI message mapping. I need to append the source file with a value from the payload and create the new file with the new values (Source file name + value from th