Create and Approve absence using BAPI's

Hello Experts,
I got to know that BAPI_EMPLOYEE_ENQUEE, BAPI_ABSENCE_CREATE & BAPI_ABSENCE_APPROVE. has to called in a sequence (test sequence) for creating and approving absence.
But when I test them I am getting the following error: "Attendance/absence type 0148 requires minimum of 1 attendance/absence days " for absence type 0148, when I try to use 425 it says fill in all required fields.
Please suggest,
Thanks,
Sandhya

Because of no relevant replies I am closing this question.....

Similar Messages

  • Create and Approve Absence using BAPI_ABSENCE_CREATE/APPROVE

    Hello Experts,
    Have any one ever used BAPI_ABSENCE_CREATE and BAPI_ABSENCE_APPROVE for creating and approving absence?
    Please help me with test data that can be used on to the BAPI.
    Thanks,
    Suma

    Hi Thyagu,
    I was able to create an absence using BAPI_EMPLOYEE_ENQUEUE, BAPI_ABSENCE_CREATE/REQUEST in a sequence. But not able to approve the same using BAPI_ABSENCE_APPROVE.
    Approve BAPI has the following input fields(input data that I am passing):
    1. EMPLOYEENUMBER - Emp Number
    2. SUBTYPE - 0200
    3. OBJECTID - 01 "not sure if I am using correct data here"
    4. LOCKINDICATOR - X
    5. VALIDITYBEGIN - Start date
    6. VALIDITYEND - End Date
    7. RECORDNUMBER - 000
    8. NOCOMMIT - blank
    It returns the following error " No data stored for 2001 in the selected period".
    In a critical situation please help
    Thanks in advace,
    Suma
    Edited by: Suma B on Oct 14, 2008 11:04 AM

  • Create and Approve leave's either using BAPI or IDoc

    Hello Experts,
    My requirment is to create a leave from my JSP in to SAP(Employee Login), then there will be a approval process where in my manger will approve the leave from his JSP(Manager login).
    Approach 1: If I use BAPI for this approach what are the BAPI's that I can use? I have found the below BAPI's out of which 1&2's documentation say " Using these APIs can create inconsistencies in time data.Instead, use the corresponding API Methods "ManageDelete," "ManageCreation," and "ManageChange" for the Business Object BUS7007"
    1. BAPI_ABSENCE_APPROVE
    2. BAPI_ABSENCE_CREATE
    3. BAPI_PTMGRATTABS_MNGCREATION
    Approach 2: If I use IDoc what are the Idoc types and process codes for Create and Approve leave's.
    Please help...
    Thanks in Advance,
    Suma
    Edited by: Suma B on Sep 16, 2008 4:16 PM

    Hi,
    Can you please give me the details of the workflow, I will try to get info from that to levarage.
    Thanks,
    Suma

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • Create a Puchase order using Bapi

    Hi all,
    I have requirent to create  a PO by using Bapi based on text file sent from
    interface system here with the file layout.
    1.plant (ekko-werks)                
    2. material   EKPO-MATNR     
    3. pur.group       EKKO-EKGRP
    4.vendor      EKKO-LIFNR
    5.shiping ins     EKPO-EVERS
    6.quantity  EKPO-MENGE
    please  some one help me step setp coding using by bapi.
    i know using BDC but no idea how to use BAPI.

    Hello,
    U can make use of the
    BAPI_PO_CREATE1                Create purchase order
    BAPI_PO_CREATE                 Create purchase order
    BAPI_PO_GETDETAIL              Display Purchase Order Details
    BAPI_PO_GETITEMS               List Purchase Order Items
    BAPI_PO_GETITEMSREL            List Purchase Orders for Release (Approval): New as of 4.0A
    BAPI_PO_GETRELINFO             Display Detailed Release (Approval) Information on Purchase Order
    BAPI_PO_GET_LIST               List Purchase Orders - Only up to 4.0A
    Regards,
    Vasanth

  • Create Service entry sheet using BAPI in SAP

    Hi
    Experts,
    Scenario : SES will be created in third party system , once it created, txt file will be generated and placed in their server.We will be writing a program
    to pick that file and post SES in ECC using BAPI ( Idoc is not available to create SES i believe).
    I will be using BAPI_ENTRYSHEET_CREATE to create SES sheet but we dont have service masters and creating unplanned service entry sheet.
    I will be checking by passing the values manually in BAPI to create SES.
    I am passing PO no, line no and qty, value and other details to create SES.
    It is creating SES with only header data. it is not updating line item details.
    I am missing some parameters to be passed to create SES using BAPI I feel.
    I need your help to create SES using BAPI.
    What are the details to be passed to create SES in SAP using BAPI.
    Regards,
    Suresh.A

    Did you not search? Google has 3600 hits for BAPI_ENTRYSHEET_CREATE
    the second hit is a wiki from SCN with sample coding
    the third hit  has a link to a OSS note with a promising title 420334 - BAPI_ENTRYSHEET_CREATE: Model for creation

  • How to Get Each line item Create and Approval dates for a SHOPPING CART in SAP SRM (ABAP Programming)

    Hi All,
    I have to Get Each line item Create and Approval dates for a SHOPPING CART in SAP SRM. Either a table, or any Function module, Method, please let me know ASAP. Same i can use in my Program.
    Thank you Very much.
    Regards,
    Ramesh J.

    Hi,
    Refer the below wiki link it may help you.
    Product catlog configuration for ECC - CRM - SCN Wiki

  • Creating Service entry sheet using bapi  BAPI_ENTRYSHEET_CREATE

    Hello Guys,
    I  am trying to create a service entry sheet for single line item only using bapi  BAPI_ENTRYSHEET_CREATE.
    its is creating Service entry document but not populating the line item  for me (here only one line item for me).
    If you guys have sample code (how the poupulate the internal tables)  could you please send it across?.
    Thanks in Advance..
    Steevan

    Hi,
    Creating Service entry sheet using bapi  BAPI_ENTRYSHEET_CREATE
    For creating service entry sheet follow below link and it helps to you.
    http://wiki.sdn.sap.com/wiki/display/ABAP/CreatingServiceEntrySheetusing+BAPI
    Regards,
    Sekhar

  • Deletion of Scheduling Agreement and Delivery Schedule using BAPI

    Hi SAP MM Gurus,
    Please assist in inquiry below:
    My scenario is that I am trying to delete delivery schedules and scheduling lines using BAPIs. I have no issues when there is no GR made yet for the delivery schedules. The error arises when there are already existing Goods Receipts and Invoices for the schedule line that I wish to delete
    When using the BAPIs (either BAPI_SAG_CHANGE or BAPI_SCHEDULE_MAINTAIN), I set the deletion indicator to "L" and set to X all change relevant fields (i.e. DELETION_INDX). However, whenever I execute it, I get the error message 06088. The funny thing is both the Quantities and the delivered quantities that are normally populated are left blank.
    For example:
    Normal error for 06088:
    Quantity 100.0 smaller than quantity delivered 179.0
    Error using BAPI with deletion indicator:
    Quantity  smaller than quantity delivered
    Is this a bug of the BAPI? or am I just missing some settings?
    Your immediate response is appreciated
    Regards,
    DeLo

    Hi,
    Please find the below link check the setting are correct or not
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02cb00a-bfb4-2c10-98aa-e33e7f64ba28?quicklink=index&overridelayout=true
    Reagrds,
    Pramod

  • Sale Order Item Quantity Not Populating When Create A Sale Order Using BAPI

    I am having a problem when creating a sale order using BAPI
    BAPI_SALESORDER_CREATEFROMDAT2
    Problem is that sale order item quantity field is not populating
    code is as follows
    ORDER_ITEMS_IN-ITM_NUMBER = '0010'.
    ORDER_ITEMS_IN-MATERIAL = '000000000010000262'.
    ORDER_ITEMS_IN-TARGET_QU = 'LB'.
    ORDER_ITEMS_IN-TARGET_QTY = 1.

    Hi,
    Try populating ORDER_SCHEDULES_IN table in the bapi field REQ_QTY.
    Regds,
    Rudra

  • Change Scheduling Agreement and Info Record using Bapi

    Hi Experts,
    Can anybody say how to change the Scheduling agreement and Info Record using Bapi.
    I use BAPI_AGREEMENT_MAINTAIN to change Scheduling Agreement .
    But it does not changing Scheduling lines.

    Hi,
    Please find the below link check the setting are correct or not
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02cb00a-bfb4-2c10-98aa-e33e7f64ba28?quicklink=index&overridelayout=true
    Reagrds,
    Pramod

  • Creating a sales document using BAPI in web dynpro by uploading a file

    Hi ALL,
    Can some one help me how to create a sales document using  BAPI by uploading a file as input...Can someone  provide me a sample program....
    Thanks n Regards,
    Praveenn.
    Edited by: praveenn on Aug 23, 2011 12:42 PM

    Hi Sri,
    Thx for the response...
    Here is the code that i followed for creating a BAPI_SALESORDER_CREATE1 by uploading a text file as input.
    Just create a Attribute  in the VIEW CONTEXT of type String.
    method ONACTIONCREATE_SO .
    types : Begin of ty_data,
             sales_org  type vkorg,
             doc_type   type AUART,
             DISTR_CHAN type VTWEG,
             DIVISION   type spart,
             material   type matnr,
             partn_role type PARVW,
             PARTN_NUMB type kunnr,
           end of ty_data.
      DATA  :it_table TYPE  TABLE OF ty_data,
             i_data   TYPE  TABLE OF string,
             l_string TYPE string,
             wa_table TYPE ty_Data,
             l_xstring TYPE xstring,
             fields TYPE string_table,
             lv_field TYPE string.
    DATA: wa_order_header_in TYPE BAPISDHD1,
          it_order_items_in  TYPE TABLE OF BAPISDITM,
          wa_order_items_in  TYPE BAPISDITM,
          it_order_partners  TYPE TABLE OF BAPIPARNR,
          wa_order_partners  TYPE BAPIPARNR,
          it_return TYPE TABLE OF BAPIRET2,
          wa_return TYPE BAPIRET2.
    DATA : sales_doc type bapivbeln-vbeln.
    DATA:
       node_zfinal_node  TYPE REF TO if_wd_context_node,
       elem_zfinal_node  TYPE REF TO if_wd_context_element,
       stru_zfinal_node  TYPE if_main_view=>element_zfinal_node .
    get single attribute
      wd_context->get_attribute(
      EXPORTING
      name =  'DATASOURCE'
      IMPORTING
      value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
    SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
      LOOP AT i_data INTO l_string.
       SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        READ TABLE fields INTO lv_field INDEX 1.
        wa_table-sales_org = lv_field.
        READ TABLE fields INTO lv_field INDEX 2.
        wa_table-doc_type = lv_field.
        READ TABLE fields INTO lv_field INDEX 3.
        wa_table-DISTR_CHAN = lv_field.
        READ TABLE fields INTO lv_field INDEX 4.
        wa_table-DIVISION = lv_field.
        READ TABLE fields INTO lv_field INDEX 5.
        wa_table-material  = lv_field.
        READ TABLE fields INTO lv_field INDEX 6.
        wa_table-partn_role  = lv_field.
        READ TABLE fields INTO lv_field INDEX 7.
        wa_table-partn_numb  = lv_field.
    APPEND wa_table TO it_table.
      ENDLOOP.
    loop at it_table into wa_table.
    clear : wa_order_header_in.
    wa_order_header_in-sales_org   = wa_table-sales_org.
    wa_order_header_in-doc_type    = wa_table-doc_type.
    wa_order_header_in-distr_chan  = wa_table-distr_chan.
    wa_order_header_in-division    = wa_table-division.
    clear : wa_order_items_in.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = wa_table-material
    IMPORTING
       OUTPUT        = wa_order_items_in-material.
    *wa_order_items_in-req_qty  = wa_table-req_qty.
    append wa_order_items_in to it_order_items_in.
    clear : wa_order_partners.
    wa_order_partners-partn_role = wa_table-partn_role.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = wa_table-partn_numb
    IMPORTING
       OUTPUT        = wa_order_partners-partn_numb
    *wa_order_partners-partn_numb = wa_table-partn_numb.
    append wa_order_partners to it_order_partners.
    endloop.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        order_header_in               = wa_order_header_in
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                 = sales_doc
      tables
       RETURN                        = it_return
       ORDER_ITEMS_IN                = it_order_items_in
      ORDER_ITEMS_INX               =
        order_partners                = it_order_partners.
      ORDER_SCHEDULES_IN            =
    get message manager
    DATA: l_current_controller TYPE REF TO if_wd_controller,
           l_message_manager    TYPE REF TO if_wd_message_manager.
           l_current_controller ?= wd_this->wd_get_api( ).
    DATA:  v_message_text TYPE string.
    When Sales Order is created commit the data
    IF NOT sales_doc IS INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING wait = 'X'.
      CONCATENATE 'Sales Document' sales_doc 'has been created.' INTO v_message_text SEPARATED BY space.
    Report Success message
      CALL METHOD l_message_manager->report_success
      EXPORTING
      message_text = v_message_text.
      ELSE.
      v_message_text = 'Error Creating Sales Order'.
    Report Error message
    CALL METHOD l_message_manager->report_error_message
    EXPORTING
    message_text = v_message_text.
    ENDIF.
    endmethod.
    Edited by: praveenn on Aug 30, 2011 2:41 PM

  • How to create a sales order using bapi

    hi
        i need to create a sales order using bapi.
    can any one help me

    Do NOT USE BAPI_SALESORDER_CREATEFROMDATA, that FM is obsolete!
    Use BAPI_SALESORDER_CREATEFROMDAT1 .
    To build a reference to your contract you have to supply ORDER_HEADER_IN.
    Here´s a sample:
    MOVE:
    gs_vbak-vbeln TO ls_bapisdhd1-refobjkey,
    gs_vbak-vbeln TO ls_bapisdhd1-ref_doc,
    gs_vbak-vbtyp TO ls_bapisdhd1-refdoc_cat,
    gs_vbak-auart TO ls_bapisdhd1-refdoctype.
    also gothrouh the links
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2b-%2bsimple%2bprogram%2bto%2bcreate%2bsales%2border%2busing%2bbapi

  • Is it possible to prevent a user from creating and approving a JV

    Hi,
    Is it possible to prevent a user from creating and approving a JV.  We have a rule that one user cannot do both.  What happens is user#1 creates the JV, then some other user#9 approves the JV.  Both user#1 and user#9 need to be able to create a JV and approve someone else's JV.
    The transactions in question are...
    F-02  General Posting - enter Journal Voucher (create & post)
    F-65  Enter General Document - Parking (create)
    FBV0  Post or Delete a Parked Document (approval)
    Please let me know the details.
    Thanks in advance,
    regrads,
    Chaks

    Hi,
    Requisition is submitted.....it means Requisition is saved or it means Requisition is Released..?
    Regards,
    manish

  • Module pool to create goods mvt by using Bapi

    Hi can any one help me to develop a module pool program to create goods movement by using BAPI. Pls give me guidelines to proceed further...
    i should be grateful to you people for proving help...
    thank you
    with regards
    bheem

    Why do you want to develop a module pool to do this?  There are standard transactions to do goods movement (MB01, MB1A, MB1B, MIGO, etc.)
    Not sure why you want to development something that is already there.  Granted, if you are interfacing to an external system.
    Albert

Maybe you are looking for

  • IPod recognized by My Computer but is not recognized by iTunes

    I have an iPod Nano which is recognized by my PC but not recognized by iTunes I have tried most everything and still does not get recognized. Any assistance would be helpful iPod Nano   Windows XP  

  • How to add a gui status in selection screen

    hi experts can u help me plzzzzzzzzzzzzzzzzzzzzzz for this

  • Cross connection

    Hi everyone I have installed oracle database 11g on my pc and recently installed oracle developer suite 10g I am unable to connect to my database using oracle developer suite It's giving an error that "ORA-12154:TNS could not resolve the connect iden

  • "No qualifying products found to apply this update" for Adobe Acrobat 8.1.2 Security Update 1 patch

    I am attempting to deploy the security update for Acrobat 8.1.2 [http://www.adobe.com/support/security/bulletins/apsb08-15.html] via computer startup script in AD. I am receiving this error message; "No qualifying products found to apply this update"

  • MacBook shuts down when unplugged

    Today I got a message saying my computer needed to be restarted. Later, when I unplugged the AC cord to move my MacBook, it shut down. I did this a few times but it kept turning off. My MacBook is only two months old and it is already acting up? Here