Function Module BAPI_ABSENCE_CREATE for creating leave request.

Hi Experts,
I am using FM BAPI_ABSENCE_CREATE for creating leave request. I am passing all the data into this as import parameter. When i am executing this return table gives statement  EPG184Employee/applicant is not locked yet
Please let me know what i have to follow.
Thanks And Regards
Ranjeet Singh

Use the below function modules in sequence
1) HR_EMPLOYEE_ENQUEUE'
2) BAPI_ABSENCE_CREATE
3) HR_EMPLOYEE_DEQUEUE
Functionality
Using this method, an Absences infotype record (2001) can be created.
Notes
Messages are returned in the RETURN parameter. The parameter documentation contains the return codes and their meanings.
The key fields used by this method are described under the parameters.
This method can only be used if the ENQUEUE method has already been called up for the business object EMPLOYEE. For more information on the ENQUEUE method, please see the documentation on the function module BAPI_EMPLOYEE_ENQUEUE.
Note: Create absence
Caution! This API method only writes the Absences infotype (2001). It should no longer be used as it can lead to inconsistent time data. Instead, please use the corresponding 'ManageCreation' API method for business object BUS7007.
Regards,
SaiRam

Similar Messages

  • Function Module / BAPI for Creating Material freight Group

    Hi All,
    Can anyone tell me the Function Module / Bapi for creating material freight group.
    Regards,
    Raj.

    Bapi for creating material freight group. :: You actually use mm01 or mm02 to change data for material flight.
    So you can use BAPI for mm02 and mm01
    For Ex:
    BAPI_MATERIAL_SAVEDATA
    Hope this helps

  • How to configure and test workflow for  Creating Leave Request

    Hi,
    When I select <b>leave request</b> iView in portals I get an R/3 screen titled "Create Leave Request".And when I fill in the details for <b>approver</b> and press<b> send</b> I get this error message <b>"You are not one of the possible agents of the task".</b>
    So help required to configure and test the workflow behind <b>Create leave request iView.</b>
    Regards,
    Pavanmeet.

    Pavanmeet,
    you have to set all activities in the workflow to "general task" as well, not only for WS12300111 itself (doubleclick on each symbol with the "triangle").
    check the status of the sent leave request in transaction PTARQ (Display Documents). Here the "next agent" & the "pers. no" of the next agent is of interest.
    logon with the user, that is saved in infotype 0105 of the above mentioned pers.no. there should be the approve request.
    you can check the status of the workitems with SWI1 (i assume your system is prepared for workflows , check SWU3)
    Message was edited by: Achim Hauck

  • Any BAPI s or functional modules avilabe for Create BOM  -- CS01

    client using ECC6.0  ,, Actually we are converting legacy data (Excel) in to SAP R/3 . we are writing BDC program for this.
    Any functional modules or BAPI are avilabe for convert data in to SAP R/3 for CS01 transaction. If any one know exact information give example and
    parameters also..

    Check this BDC of CS01
    *& Report YCS01_TEST
    REPORT ycs01_test.
    TYPE-POOLS truxs.
    DATA:f_file TYPE string.
    *TYPES: BEGIN OF ty_flat, " structure for flat file
    *string(200),
    *END OF ty_flat.
    TYPES: BEGIN OF ty_head, " structure for header file
    ind(2) TYPE n,
    matnr(18) ,
    werks(4) ,
    stlan(1) ,
    stlal(2) ,
    datuv(10) ,
    ztext(40),
    bmeng(13) ,
    bmein(3),
    stlst(2) ,
    END OF ty_head.
    TYPES :BEGIN OF ty_item, "structure for item file
    ind(2) TYPE n,
    postp(1) ,
    posnr(4) ,
    idnrk(18) ,
    menge(13),
    meins(3) ,
    potx1(40),
    lgort(4) ,
    sanka(1),
    END OF ty_item.
    TYPES :BEGIN OF ty_flat, " structure for final file
    matnr(18) ,
    werks(4) ,
    stlan(1) ,
    stlal(2) ,
    datuv(10) ,
    ztext(40),
    bmeng(13) ,
    bmein(3),
    stlst(2) ,
    postp(1) ,
    posnr(4) ,
    idnrk(18) ,
    menge(13),
    meins(3) ,
    potx1(40),
    lgort(4) ,
    sanka(1),
    END OF ty_flat.
    INTERNAL TABLE DECLARATIONS *
    DATA : t_flat TYPE TABLE OF ty_flat,
    *t_flat1 TYPE TABLE OF ty_flat1,
    t_head TYPE TABLE OF ty_head,
    t_item TYPE TABLE OF ty_item,
    t_bdcdata TYPE TABLE OF bdcdata,
    t_bdcmsg TYPE TABLE OF bdcmsgcoll.
    WORK AREA DECLARATIONS *
    DATA : st_flat LIKE LINE OF t_flat,
    *st_flat1 LIKE LINE OF t_flat1,
    st_head LIKE LINE OF t_head,
    st_item LIKE LINE OF t_item,
    st_bdcdata LIKE LINE OF t_bdcdata,
    st_bdcmsg LIKE LINE OF t_bdcmsg.
    VARIABLES *
    DATA : v_ind(2) TYPE n, " value 1,
    v_fld(20),
    v_no(2) TYPE n.
    SELECTION SCREEN *
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. "selection screen
    PARAMETERS: p_fnam TYPE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fnam.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    field_name = ' '
    IMPORTING
    file_name = p_fnam.
    IF p_fnam IS NOT INITIAL.
    VALIDATE FILE TYPE
    PERFORM sub_validate_txt_type.
    ENDIF.
    START-OF-SELECTION.
    f_file = p_fnam.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = f_file
    filetype = 'ASC'
    has_field_separator = '#'
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    VIRUS_SCAN_PROFILE =
    NO_AUTH_CHECK = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    TABLES
    data_tab = t_flat
    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.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    SORT t_flat BY posnr .
    LOOP AT t_flat INTO st_flat.
    MOVE :
    st_flat-matnr TO st_head-matnr,
    st_flat-werks TO st_head-werks,
    st_flat-stlan TO st_head-stlan,
    st_flat-stlal TO st_head-stlal,
    st_flat-datuv TO st_head-datuv,
    st_flat-ztext TO st_head-ztext,
    st_flat-bmeng TO st_head-bmeng,
    st_flat-bmein TO st_head-bmein,
    st_flat-stlst TO st_head-stlst.
    at new posnr.
    move:
    st_flat-posnr to st_item-posnr,
    st_flat-postp to st_item-postp,
    st_flat-idnrk to st_item-idnrk,
    st_flat-menge to st_item-menge,
    st_flat-potx1 to st_item-potx1,
    st_flat-lgort to st_item-lgort,
    st_flat-sanka to st_item-sanka.
    ADD 1 TO v_ind.
    ENDAT.
    MOVE v_ind TO st_head-ind.
    MOVE v_ind TO st_item-ind.
    APPEND st_head TO t_head.
    APPEND st_item TO t_item.
    CLEAR st_head.
    CLEAR st_item.
    *CLEAR v_ind.
    ENDLOOP.
    CLEAR v_ind.
    *perform open_group.
    SORT t_item BY ind.
    SORT t_head BY ind.
    DELETE ADJACENT DUPLICATES FROM t_head.
    DELETE ADJACENT DUPLICATES FROM t_item.
    LOOP AT t_head INTO st_head.
    PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RC29N-STLAN'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RC29N-MATNR'
    st_head-matnr.
    PERFORM bdc_field USING 'RC29N-WERKS'
    st_head-werks.
    PERFORM bdc_field USING 'RC29N-STLAN'
    st_head-stlan.
    PERFORM bdc_field USING 'RC29N-STLAL'
    st_head-stlal.
    PERFORM bdc_field USING 'RC29N-DATUV'
    st_head-datuv.
    PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RC29K-ZTEXT'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RC29K-ZTEXT'
    st_head-ztext.
    PERFORM bdc_field USING 'RC29K-BMENG'
    st_head-bmeng.
    PERFORM bdc_field USING 'RC29K-STLST'
    st_head-stlst.
    PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RC29K-LABOR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    LOOP AT t_item INTO st_item WHERE ind = st_head-ind.
    ADD 1 TO v_no.
    PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RC29P-POSTP(02)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    CONCATENATE 'RC29P-IDNRK(' v_no ')' INTO v_fld.
    CONDENSE v_fld.
    PERFORM bdc_field USING v_fld
    st_item-idnrk.
    CONCATENATE 'RC29P-MENGE(' v_no ')' INTO v_fld.
    CONDENSE v_fld.
    PERFORM bdc_field USING v_fld
    st_item-menge.
    CONCATENATE 'RC29P-MEINS(' v_no ')' INTO v_fld.
    CONDENSE v_fld.
    PERFORM bdc_field USING v_fld
    st_item-meins.
    CONCATENATE 'RC29P-POSTP(' v_no ')' INTO v_fld.
    CONDENSE v_fld.
    PERFORM bdc_field USING v_fld
    st_item-postp.
    PERFORM bdc_field USING 'BDC_SUBSCR'
    'SAPLCSDI'.
    v_no = 1.
    ENDLOOP.
    CLEAR v_no.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=FCBU'.
    CALL TRANSACTION 'CS01' USING t_bdcdata MODE 'A'
    UPDATE 'A' MESSAGES INTO t_bdcmsg.
    REFRESH t_bdcdata.
    CLEAR t_bdcdata.
    ENDLOOP.
    PERFORM fr_format_message.
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR st_bdcdata.
    st_bdcdata-program = program.
    st_bdcdata-dynpro = dynpro.
    st_bdcdata-dynbegin = 'X'.
    APPEND st_bdcdata TO t_bdcdata.
    ENDFORM. "BDC_DYNPRO
    Insert field *
    FORM bdc_field USING fnam fval.
    IF fval space. "NODATA.
    CLEAR st_bdcdata.
    st_bdcdata-fnam = fnam.
    st_bdcdata-fval = fval.
    APPEND st_bdcdata TO t_bdcdata.
    ENDIF.
    ENDFORM. "BDC_FIELD
    FORM sub_validate_txt_type .
    DATA : str1 TYPE localfile,
    str2 TYPE char3.
    SPLIT p_fnam AT '.'
    INTO str1 str2.
    TRANSLATE str2 TO LOWER CASE.
    IF str2 NE 'txt'.
    please enter '.txt' file format
    MESSAGE i001(zmsg).
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDFORM. "sub_validate_txt_type.
    Regards.

  • Using function module PT_ARQ_REQUEST_EXECUTE to approve leave requests

    I'm building a screen to approve or reject multiple leave requests using function module PT_ARQ_REQUEST_EXECUTE as the SAP standard program RPTARQAPP does, and this seems to be working fine.  However, I also need to include a note from the approver which is a bit of long text that ends up in table PTREQ_NOTICE.  This is something that RPTARQAPP does not do.
    I cannot find any way of passing this text into PT_ARQ_REQUEST_EXECUTE.  The only way I can find of doing this is to call FM PT_ARQ_REQUEST_PREPARE first (command = PREPARE_APPROVE), update the CURR_NOTICE field it sends back in structure EX_REQUEST, then pass the changed EX_REQUEST structure into FM PT_ARQ_REQUEST_CHECK (command = CHECK_APPROVE)  and then call PT_ARQ_REQUEST_EXECUTE (command = EXECUTE_APPROVE).  This works fine for a single leave request, but when I try to use this process to approve two leave requests the CHECK FM gives me an error on the second record with a message referring to a time conflict with the first message even though the dates on each are not the same.
    I've searched and there are a few posts about these FMs, but I still can't fix this problem.  Has anyone ever dealt with this situation before and found a solution?

    I've replaced the call to FM PT_ARQ_REQUEST_CHECK with the following and it seems to work pretty well.  Though of course it will need a lot more testing.
    STATICS:
        request TYPE REF TO if_pt_req_request.
      CALL METHOD ca_pt_req_header=>agent->get_request
          EXPORTING
            im_request_id     = p_im_request_id
          IMPORTING
            ex_request        = request
          EXCEPTIONS
            request_not_found = 1.
      CALL METHOD request->set_notice
          EXPORTING
            IM_NOTICE               = p_approver_text.

  • Function module(s) for Cube Collapsing/Compression

    Hi Experts,
    can anybody tell me if there's a SAP Function module availbale for Collapsing/Compressing requests of a cube ?
    Background is we want to automate collapsing of cubes by an APAB report instead of using a process chain or RSA1.
    Any suggestions? Any pitfalls for such an implementation ? Any expieriences ?
    We're on SAP BI 7.00 19, Oracle 10.2.0.4
    Best regards,
    yk

    Hi Srinivas,
    thanks for the quick answer, I will check the FM you mentioned.
    We think of a cube exceptions list wich should NOT be condensed, and all OTHER cubes should be condensed.
    With a process chain we have to maintain these OTHER list manually. In an ABAP report we could exclude the exceptions and condense the rest.
    Developers tend to "forget" to add the CONDENSE step. So with time more and more cubes store only in F-tables and nothing in the E-tables (producing more workload as query runtime, DB maintanence like index creation runtime , statistic runs ...) and last but not least occupy disk space wich is expensive if you have a mirrored high performance disk system .
    Best regards,
    yk

  • Function Module Name for Graph

    HI,
      Can any body tell me Function Module name for creating graph with horizontal scrollable.I dont want standard graph button.
    Thanks,
    Rakesh

    Hello,
    Check this standard programs they are using the same FM
    RFDOPR20                         Customer Payment History
    RFVD_COMPRESSION_01_I01
    RPRSTA01                         Travel Expense Reporting by Period
    RPSTA100                         Time-Related Statistical Reporting
    RPSTA200                         Time-Related Statistical Reporting
    RPSTA2GR
    RQALVF16
    RQETBI10                         Inspection lot selection
    RSDB4007                         iSeries: Display Wait Statistics by SAP Instance
    RSHOST10                         Monitor for OS Collector (ST06)
    RSORA003                         Statistics of Physical Accesses to Oracle Data Base
    RSORA007                         Statistics of Data Base Wait Situations
    RSORA138                         IO Stat for Each User Session (ORA7 V$SESS_10)
    Check this 3 FM
    GRAPH_2D                       Calling up the 2D business graphics
    GRAPH_2D_MENUE                 DO NOT USE (use 'GRAPH_2D' and 'GRAPH_BUSG_MENU_SET')
    GRAPH_MATRIX_2D                Calling up the 2D graphics (user-friendly version)

  • Function module/BAPI for Pgi creation

    hi all,
    any standard function module/ BAPI for create PGI.
    i know BAPI_OUTB_DELIVERY_CONFIRM_DEC, suppose if we are using PGI reverse not possibul.
    regards

    This is not answered

  • Attaching documents in Create Leave Request UI5 application

    Hi,
    We are planning to implement the SAP HR Renewal 2.0 FP1 based HR implementation with ESS/MSS based on the UI5 as well.
    I would like to know if the SAP UI5 application for Create Leave Request has the option to upload the documents or not in the standard delivery.
    Please let me if the attachment facility is available for the Create Leave request application in UI5 based ESS.
    Thanks & Regards,
    Urmi

    Hello Urmi,
    Yes, attachment option is available in Standard Leave Request in UI5.
    Best Regards,
    Deepak.. 

  • Function modules to create leave request?

    Hi experts,
    In my project I need to create a leave request and trigger workflow for approval. Do you know any function modules existed for this purpose? Or shall we need to create workflow and attach it with inserting IT2001 records?
    Thanks a lot.

    Are you going to use standard SAP Portal application for leave or not?
    If yes there are documents available about ESS configuration for the same and you can assign the standard workflow or copy and make the required chnages then assign it in configuration.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/108c31e7-b6a7-2d10-3692-c1a9f7a5c4dc?QuickLink=index&overridelayout=true
    Regards
    Ajay

  • Function module expression for dynamic value for Cost center in BRF

    Hello Experts,
    We are in SRM 7.0 and our business object is shopping cart using BRF.
    Right now we have Cost Center Approver and its evaluation id ()zev_sc_**_*) has expression zc_sc_*_** that checks whether overallvalue >= 5000. It initiates cost center approver only if value is greater than or equal to 5000. But this is static expression. We want it in a dynamic way so that we don't have to modify this value frequently. Therefore we have set approach to use an expression of Function Module BAdI as expression. We have a new z table which contains value field zval. Now I want to know how or what should be the process so that this FM knows the corresponding value from a z table that user might select in the SC.How it should be linked to this. I am using /SAPSRM/WF_BRF_0EXP000 function module. Please advise where should the code be written ? Any method ? And what should be the exporting and importing parameters for this ?
    Right now I can see EV_VALUE, EV_TYPE, EV_CURRENCY etc as exporting paramters. Looking for your suggestions experts.
    Thank you.
    Best regards.

    Dear abhijeet,
    just follow the steps.
    i) I believe you have created the event as Zev_***  with implememt Class     0EVENT.
    ii) copy the std fm /SAPSRM/WF_BRF_0EXP000 to z custom fm
    iii)  since you want to have an  expression as function module procurement type create expression  with                                                                               
    expression type  0CF001
                                                                                    result type B ( boolean)
                                                                                    Buffering as event-controlled buffering
    and very important procurement type as function module.
    iv) immediatly you may find written as AccessFM where pass your custom z function module.
    v) finally link this expression to your event.
    In the custom function module  the exporting parameter EV_VALUE is solely responsible for identifieng the approval based upon the approval criteria. If the field EV_VALUE = 'X' this notify that the approval is required  for current process level, otherwise if it is initial then it will skip the current level and continue with the next level.
    whatever your coding should be written in FM.
    just look into below code
      DATA LO_WF_BRF_EVENT       TYPE REF TO /SAPSRM/CL_WF_BRF_EVENT.
      DATA LO_CONTEXT_PROVIDER   TYPE REF TO /SAPSRM/IF_WF_CONTEXT_PROVIDER.
      DATA: LV_HEADER LIKE BBP_PDS_SC_HEADER_D.
      DATA: LT_ITEM TYPE STANDARD TABLE OF BBP_PDS_SC_ITEM_D.
      LO_WF_BRF_EVENT ?= IO_EVENT.
      LO_CONTEXT_PROVIDER = LO_WF_BRF_EVENT->GET_CONTEXT_PROVIDER( ).
      CALL METHOD LO_CONTEXT_PROVIDER->GET_DOCUMENT
        IMPORTING
          EV_DOCUMENT_GUID = LV_DOCUMENT_GUID
          EV_DOCUMENT_TYPE = LV_DOCUMENT_TYPE.
    pass this guid in the below function module in order to get the SC details.
    GET SC DETAILS
      CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
        EXPORTING
          I_GUID    = LV_DOCUMENT_GUID
        IMPORTING
          E_HEADER  = LV_HEADER
        TABLES
          E_ITEM    = LT_ITEM
    After that loop the internal  table LT__ITEM   and you decide based upon your approval criteria for each line item level wheather the gross price of  line item is exceed 5000k or not.
    you should decide the value for field EV_VALUE within the loop so that each line item will be verified for approval.
    Pls contribute if this helpfull.
    regards
    sahil purushan

  • Function Module require for Accounting Document

    Hi All,
    Is there any Function Module available for getting Accounting document no which is created after IR.
    Regards,
    Paras

    Hi,
    You can use BAPI_ACC_DOCUMENT_POST.
    Regards,
    Eli

  • Create Leave request

    Hi ,
    We have configured ESS/MSS with portal. We have created a Iview Leave request(IAC).
    When we executing this it is displaying R/3 inbox means SWBP insted of showing leave request create view..

    Hi Chuckie,
    Thanks for your response.
    I am trying to create a leve request from my inbox by pressing Create leave request. Earlier it opens a create window. Now a days we are getting SAP R/3 SWBP transation.
    We are using EP-6.

  • Problem with Team Calendar from Create Leave Request

    Hi Expert,
    We are facing following 2 issues with Team Calendar-
    1)     When manager checks Team Calendar from create leave request he gets a warning message 'No team set up for the user in the selection                period.Contact Administrator'
    I know this issue has been reported earlier as well but i didn't find the thread where it has been answered correctly.
    - OADP configuration is correct.
    - Manager is head of org unit.
    - Also IT105 exist for manager as well as employees.
    We are currently checking on authorization side for this.
    2)   Team Calendar is showing leave details only for the current month. If we navigate to previous month it does not show anything even though there exist leave data for the given month. 
    Please suggest if we are missing something.
    Thanks & regards,
    Avinash

    Hi Nagendra,
    I dont remember the exact auth object but ask security team to apply trace for the user id and identify the same.
    Also i would suggest you to check following setting before checking authorizations-
    Get the Group of Organizational Views applicable for rule group in your case  from following path
    SAP Customizing Implementation Guide--> Personnel Management-->Manager Self-Service (Web Dynpro ABAP)--> Service Specific Settings-->Working Time--> Team Calendar--> Select Employees:
    After getting Group of Org View Check the Evaluation path used in OADP configuration.
    Please check if the evaluation path is correct as per your requirement.
    Regards,
    Avinash

  • Function module exits for Tcode MD11.

    Please tell me, Function module exits for Tcode MD11.
    Reg .
    Praju

    Hi
    LMDR2001
    LMDZU001
    Try out these exits.
    Check the folloing BADI's
    MD_PLDORD_SCHEDULING
    MD_PIR_FLEX_CONS
    MD_PLDORD_SCHEDULING
    Regards
    Divya

Maybe you are looking for