Doubt reg BAPI

Hi all,
can anyone tell me what all data needs to be passed to bapi BAPI_RESERVATION_CREATE.
any could me a sample code
Thanks

Hai Swathi
Check the following Code
DATA: BEGIN OF RES_HEAD.
         INCLUDE STRUCTURE BAPIRKPFC.
DATA: END OF RES_HEAD.
DATA: H_RSNUM LIKE RKPF-RSNUM.
DATA: BEGIN OF RES_ITEM OCCURS 10.
         INCLUDE STRUCTURE BAPIRESBC.
DATA: END OF RES_ITEM.
DATA: BEGIN OF RETURN OCCURS 10.
         INCLUDE STRUCTURE BAPIRETURN.
DATA: END OF RETURN.
DATA: BEGIN OF PROT_RS OCCURS 10,
         MATERIAL LIKE BAPIEBAN-MATERIAL.
         INCLUDE STRUCTURE BAPIRETURN.
DATA: END OF PROT_RS.
  CALL FUNCTION 'BAPI_RESERVATION_CREATE'
       EXPORTING
            RESERVATION_HEADER = RES_HEAD
       IMPORTING
            RESERVATION        = H_RSNUM
       TABLES
            RESERVATION_ITEMS  = RES_ITEM
            RETURN             = RETURN
       EXCEPTIONS
            OTHERS             = 0.
Auswertung der aufgetretenen Fehler und Fortschreiben Protokoll
  LOOP AT RETURN.
    ERROR_RS = 'X'.
    MOVE-CORRESPONDING RETURN TO PROT_RS.
    PROT_RS-MATERIAL = RES_ITEM-MATERIAL.
    APPEND PROT_RS.
  ENDLOOP.
Regards
Sreeni

Similar Messages

  • Doubt in BAPI

    Hi All I have a doubt in BAPI.
    I have created a function module which is remote enabled module. I didnu2019t create any BAPI using Tcode SWO1 or BAPI. Am using this function module in my VB code to get the data from SAP, Its working fine am getting all data from SAP database.
    My Question is since we can use sap Function module (which is remote enabled module) with out creating BAPI. Then what is the use of creating BAPI.?    
    If we click on radio button Remote enabled module is that function module act as BAPI?
    Please help me.
    Regards
    Prajwal K.

    Hi Prajwal,
    Please check this link
    RFC and BAPI Interfaces to SAP Systems
    http://help.sap.com/saphelp_45b/helpdata/en/cf/8ccab761ea11d2804a00c04fada2a1/content.htm
    BAPI's are the remote enabled Function modules which are defined in the Business Object Repository (BOR) as the methods of the business objects.I can say BAPI is the subset of RFC. RFC connects to the other system via BAPI and vice versa.
    BAPI methods are RFC enabled function modules. The difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call.Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.BAPI is having all Key fields, methods, interfaces etc.
    Best regards,
    raam

  • Hi guys doubt on bapi please reply

    hi,
    i have doubt on which import parameters to be used in the bapi BAPI_ACC_GL_POSTING_REV_POST we have posting date and document no with us we are confused about what import parameters to be sent as an input to this bapi...........
    reward will be given for nice reply...............

    Give any field string (variable) of type BAPIACREV
    Finally it will give these values..
    Reversal document number:
    o OBJ_TYPE Sender ID
    o OBJ_KEY Reference number of the reversal document (source
    document)
    o OBJ_SYS Logical system
    o OBJ_KEY_R Reference number of the document to be reversed.
    i gave the sender id as bkpff which i was using as obj type for posting.
    is obj_key the new unassigned document number in the row.
    obj_sys gave the specific logical system.
    obj_key_r can i give any document number generated during gl posting using bapi_acc_gl_posting_post
    i even specified the other parameters such as posting date and reversal type but no reversal is done...........need more clarification on this .....
    reward is sure..........

  • Doubt about BAPI

    Hi Experts,
    I have one doubt. I want to Attach document to the material of a particular BAPI  that have been existed in the sap r/3 system.Which BAPI wil work for this to attach a document to the material.Please let me know . Its very urgent.
    Helpful Answers wil be reward
    Regards
    Khanna

    Hi.
    Both of the listed BAPI's have no functionality/option to link a document!
    Can anyone suggest a BAPI/RFC to link a Document while creating a Material? Also, You can link a Document to a Material by "BAPI_DOCUMENT_CHANGE2".

  • Doubt in BAPI - BAPI_TRANSACTION_COMMIT

    Hi Gurus,
    I am posting material from customer storage palce to activate storage location through the follwo\ing BAPI-
    BAPI_TRANSACTION_COMMIT.
    in that i got error as follow
    Material 30000004 not maintained in plant SUND
    Material 30000005 not maintained in plant SUND
    Material 30000006 not maintained in plant SUND
    Material 30000007not maintained in plant SUND
    Material 30000008 not maintained in plant SUND
    BUt if i post through MIGO trasaction directly means, no errors occur.
    only through BAPI the above error occurs.
    Help me to Solve this problem.
    Thank in Advance.
    Regards,
    Bhuvana.

    Hi,
      Sit with your functional consultant .May be the plant parameters have been maintained for your plant
    under Inventory management and Physical inventory If not pl maintain the same in SPRO.
    Regards
    Kiran Sure

  • 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

  • Doubt Reg Generic Delta "Safety Interval" Setting

    Hi Experts,
    I have a doubt regarding Setting "Safety Interval Upper Limit" and Lower limit in RSO2 for generic delta.
    What does this setting imply?
    If I do setting for calender day say both 1 then wht will be difference between delta before setting amd after setting?
    Plz explain in terms other tham help provided...
    Points will be awarded to say thanks..
    Thanks in advance,
    Sorabh

    Hi Sorabh,
    Here some SAP informations:
    Safety Interval Upper Limit of Delta Selection
    This field is used by DataSources that determine their delta generically using a repetitively-increasing field in the extract structure. The field contains the discrepancy between the current maximum when the delta or delta init extraction took place and the data that has actually been read. Leaving the value blank increases the risk that the system could not extract records arising during extraction. Example: A time stamp is used to determine the delta. The time stamp that was last read is 12:00:00. The next delta extraction begins at 12:30:00. In this case, the selection interval is 12:00:00 to 12:30:00. At the end of extraction, the pointer is set to 12:30:00.  A record - for example, a document- is created at 12:25 but not saved until 12:35. It is not contained in the extracted data but, because of its time stamp, is not extracted the next time either.
    For this reason, the safety margin between read and transferred data must always be larger than the maximum length of time that it takes to create a record for this DataSource (with a time stamp delta), or it must display an interval that is sufficiently large (for determining delta using a serial number).
    Safety Interval Lower Limit
    This field contains the value taken from the highest value of the previous delta extraction to determine the lowest value of the time stamp for the next delta extraction. For example: A time stamp is used to determine a delta. The extracted data is master data: The system only transfers after-images that overwrite the status in the BW. Therefore, a record can be extracted into the BW for such data without any problems.
    Taking this into account, the current time stamp can always be used as the upper limit when extracting: The lower limit of the next extraction is not seamlessly joined to the upper limit of the last extraction. Instead, its value is the same as this upper limit minus a safety margin. This safety margin needs to be big enough to contain all values in the extraction which already had a time stamp when the last extraction was carried out but which were not read. Not surprisingly, records can be transferred twice. However, for the reasons above, this is unavoidable.
    Extracted Data Delta Type
    The system uses the delta type to determine how extracted data is to be interpreted in BW, and into which data targets it can be posted.
    A distinction is made between the following:
    1. Additive delta
    The key figures for extracted data are added up in BW. DataSources with this delta type can supply data to ODS objects and InfoCubes.
    2. New status for changed records
    Each record to be loaded delivers the new status for the key figures and characteristics. DataSources with this delta type can write to ODS objects or master data tables.
    Check also examples in "How to... Create Generic Delta" under www.service.sap.com/bi.
    Ciao.
    Riccardo.

  • Reg : BAPI create GL account

    Hi ,
    I need to create the GL (Company code data thro FSS1 transaction) .Data is available in Excel file . Is there any BAPI to create GL for this transaction?....
    Regards,
    Krishna.

    Hi
    This is a small BDC program which is enough to upload this GL accounts
    see the sample code
    ABAP Name   :   ZFI_GL_FSS0
    Description :   This Program is used to Upload the
                     GL Account Master using Transaction FSS0.
    REPORT zfi_gl_fss0
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_gl OCCURS 0,
            saknr(010),            " GL Account
            bukrs(004),            " Company Code
            waers(005),            " Currency
            xsalh(001),            " BAl Local Curr Ind
            mwskz(002),            " Tax Category
           xopvw(001),            " Open Item Ind
           xkres(001),            " Line Item Ind
            zuawa(003),            " Sort Key
            fstag(004),            " Field Category
          END OF i_gl.
    Data Variables & Constants
    CONSTANTS : c_x             VALUE 'X',  " Flag
                c_tax           VALUE '0'.  " Tax Category
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_gl
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Upload the Data from Internal Table
      LOOP AT i_gl.
    Initial Screen
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'
                                         '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ACC_CRE'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_KEY-SAKNR'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                      i_gl-saknr.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                      i_gl-bukrs.
        perform bdc_dynpro      using
                           'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=TAB02'.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                      i_gl-WAERS.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                      i_gl-XSALH.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                      i_gl-MWSKZ.
        perform bdc_field       using 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
       perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                     i_gl-XOPVW.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                      c_x."i_gl-XKRES.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                      i_gl-ZUAWA.
        perform bdc_dynpro      using
                             'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=SAVE'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_CCODE-FSTAG'.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                      i_gl-FSTAG.
    Call The Transaction
        PERFORM bdc_transaction USING 'FSS0'.
      ENDLOOP.
    Close the BDC Session
      PERFORM close_group.
    Regards
    Anji

  • 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

  • Reg: bapi examples

    Hi,
    Can i get some step by step procedure for using BAPI.
    Thanks,
    jeya

    Hi,
    check the below links u will find lot of info, examples and step by step procedure also....
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    If you find it useful mark the points
    ~~Guduri

Maybe you are looking for