Insert or change the employee status (pa0000-stat1) using HR_MAINTAIN_MAST

hi abapers
i am using HR_MAINTAIN_MASTERDATA to insert or modify employee status (pa0000-stat1).
IN HR_MAINTAIN_MASTERDATA there is return statement in import. and i am giving BAPIRETURN1 and BAPIRETURN2 and pass data(employee status to be changed) to proposed_values table
when i check return IS iNITIAL or not. return is coming initial. what does it mean??
actually i am new in HR module. plz help
thanks
Sachin

hi Napsterr
yes i am getting '000'.
when i am giving incorrect data , some error is coming.
what does it mean?
employee status is not yet inserted or modified.
here is my code. please tell me where i am missing.
REPORT  ZTEST_STATUSUPDATE2.
Parameter p_pernr like pa0000-pernr.
Parameter p_stat1 like pa0000-stat1.
DATA: OPERATION     LIKE PSPAR-ACTIO,
        RETURN1        LIKE BAPIRETURN1,
        RETURN        LIKE BAPIRETURN,
        VALIDITYBEGIN LIKE P0001-BEGDA,
        ILINES        LIKE SY-TABIX.
  DATA: VALUES        LIKE PPROP OCCURS 10 WITH HEADER LINE,
        IP0000        LIKE P0000 OCCURS  1 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        PERNR     = p_pernr
        INFTY     = '0000'
        BEGDA     = SY-DATUM
        ENDDA     = SY-DATUM
      TABLES
        INFTY_TAB = IP0000.
      DESCRIBE TABLE IP0000 LINES ILINES.
      IF ILINES EQ 0.
        OPERATION     = 'INS'.
        VALIDITYBEGIN = SY-DATUM.
      ELSE.
        READ TABLE IP0000 INDEX 1.
        VALIDITYBEGIN = IP0000-BEGDA.
        OPERATION     = 'MOD'.
      ENDIF.
      VALUES-INFTY = '0000'.
      VALUES-FNAME = 'P0000-stat1'.
      VALUES-FVAL  = p_stat1.
      APPEND VALUES.
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
        EXPORTING
          PERNR           = p_pernr
          ACTIO           = OPERATION
          BEGDA           = VALIDITYBEGIN
          ENDDA           = '99991231'
          SUBTY           = SPACE
          NO_ENQUEUE      = SPACE
          NO_EXISTENCE_CHECK       = 'X'
        IMPORTING
           RETURN        = RETURN
          RETURN1         = RETURN1
        TABLES
          PROPOSED_VALUES = VALUES
        MODIFIED_KEYS   =
        EXCEPTIONS
          OTHERS          = 1.
      IF ( return-type EQ 'E' OR return1-type EQ 'E').
      MESSAGE 'error' type 'E'.
       ELSEIF  RETURN is INITIAL.
        MESSAGE 'initial value' type 'I'.
      ELSE.
        MESSAGE ID     RETURN1-ID
                TYPE   'S'
                NUMBER RETURN1-NUMBER
                WITH   RETURN1-MESSAGE_V1 RETURN-MESSAGE_V2
                       RETURN1-MESSAGE_V3 RETURN-MESSAGE_V4.
endif.
thanks
Sachin

Similar Messages

  • Error came while changing the Employee status

    Dear Guru's
    I want to exclude few Employees from the payroll with out using the assignment set
    by changing the Assignment status to Suspend Assignment
    but when i am trying to save the data one error came please find the attachment
    regards
    jaggu

    An Employee record must have atleast one primary assignment record, so the error.
    If you dont want to pay the employees -
    1. Process the payroll run and then delete individual assignment actions from the Payroll process results screen.
    2. Write skip rule on the earning elements and write your logic in the skip rule formula
    3. Assignment set ( which you dont want to use )
    4. Move the employee into a Dummy Payroll ( Not a very good option, as your accruals might get affected. Also unneccesary element links etc.. )
    Hope that helps.
    Cheers,
    VB

  • Function Module to change the user status of a business transaction

    Hi,
      I want to change the user status of a business transaction. Plz let me know if there is a function module to change the user status.I found some FMs.
    - CRM_STATUS_MAINTAIN_OW
    - BBP_PROCDOC_STATUS_CHANGE_DIRE
    - CRM_ORDER_CHANGE_STATUS
      But these FM says that it has to be used for changing system status.
    Thanx,
    Sivagami.R

    hi Siva,
    here is some sample code :
    data :
      ip_guid            type  crmt_object_guid,
      ls_status            type  crmt_status_com,
      lt_status            type  crmt_status_comt,
      ls_input_field       type  crmt_input_field,
      ls_input_field_names type  crmt_input_field_names,
      lt_input_fields      type  crmt_input_field_tab,
      lt_obj_guids         type  crmt_object_guid_tab,
    ip_guid = <your guid>.
    ls_status-ref_guid = IP_GUID.
    ls_status-ref_kind = 'A'.
    ls_status-status = lv_newstat.
    ls_status-user_stat_proc = 'ZCRMCOM1'.
    ls_status-activate   = 'X'.
    INSERT ls_status INTO TABLE  lt_status.
    ls_input_field-ref_guid = IP_GUID.
    ls_input_field-ref_kind = 'A'.
    ls_input_field-objectname = 'STATUS'.
    ls_input_field_names-fieldname = 'ACTIVATE'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'STATUS'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field INTO TABLE lt_input_fields.
    insert IP_GUID into table lt_obj_guids.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
        it_status       = lt_status
    CHANGING
        ct_input_fields = lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_SAVE'
    EXPORTING
        it_objects_to_save = lt_obj_guids
    EXCEPTIONS
        OTHERS              = 2.
    COMMIT WORK.
    please award points if helps
    cheers

  • Change the transaction status when creating a follow up activity

    Hello All
    We need to change the activity status if a follow up document is created from. E.g. If an activity is created type 001  then a follow-up activity type 003 as a follow up document from 001 the system automatically changes the activity status from open to in process. I need detailed steps regarding how to reach this
    Regards
    Jacopo

    See if you can "exploit" CRM_COPY_BADI and function modules CRM_STATUS_CHANGE_EXTERN to change the User status or CRM_STATUS_CHANGE_INTERN for System status.

  • Is it possible to change the user status of a TECO Order

    Hello Folks
    Is it possible to changes the user status of a TECO Order?
    I have tried to change it using the FM 'STATUS_CHANGE_EXTERN'. Its working fine for NON TECO Orders but not for TECO Orders.
    On the other hand I was able to manually change the user status for a TECO Order in transaction IW32.
    I need to change the user status from NFBK to FBK.
    Please provide some inputs for the same.
    Thanks n Regards
    Ramesh

    The simple way is via the Internationalization settings via ARD or RDP or Screen Sharing, either via System Preferences or (if enabled) via the menu bar. If you're looking for a lower-level approach, there's not AFAIK a direct command for this. As for one possible approach, might [threadID=2106201|http://discussions.apple.com/thread.jspa?threadID=2106201] help?

  • Possible to Change the Order Status

    Hai
    When i am booking the sales order the status is showing the Booked is it possible to change the Booked status according to the customer requirement ....
    thanks in advance
    M.Meenashi Sundaram

    Hai its possible to change the order status from the
    setup>quick codes>order management>
    type --flow status
    we can able to change it
    thanks
    M.Meenashi Sundaram

  • TO change the user status in the PM order

    Hi,
    My requirement is that a techician is assiged to do the work using MRS and based on that user status is update in the PM when the save button is clicked on the MRS board.
    Now according to my requirement if anybody click on the save button and the technician is assigned to do the operation is done through MRS than the User status in the PM order should get changed.
    As a part of standard functionality the user status is not updated.
    A new user status is created in the trasaction BS02.
    Can anybody please let us know how to achieve this functionality
    Thanks
    Mohit

    We had a similar requirement and this is what we did :
    1) Set up a task as a reciever for the WORKORDER SAVE event.
    2) In this task called a method of a business object.
    3) In the method called STATUS_CHANGE_EXTERN to change the user status.

  • How to change the IO status to CLOSE after it has been settled through ko8g

    hi ,
    I have the following scenario : An internal order is assigned to a PO and after setllement of such an order i need to CLOSE the order .
    The PO has a GR done (no IR) . Currently Internal Order is in the status : TECO [technically complete] and setlement has ben doneusing Actual Settlemnet Run using KO8G.
    Now i need to change the IO status to  [ CLOSE ] : it is gving an error in KO02 : Balance is not zero .
    How  to change the Internal Order status to CLOSE or rather how to make teh balance in that Order toZero?
    Is it reqd to process some GR's for teh same PO ?
    Thansk
    Trina

    Hi,
    Check the order balance in Ko02
    Menu -->  Extras  -->  Order Balance if balance exist it means that the order has not completely settled.
    Regards,
    Raj

  • Need to change the Idoc Status based on the Text in the Idoc

    Hi All,
    I have developed Idoc--SOAP Sync Process Scenario Using BPM and Works Perfectly.
    I have used STATUS.SYSTAT01 Idoc to capture the Response that is comming from the Webservice.
    I have mapped the response Text( Success or Fail) to one of the field in the Response Idoc, this is perfect.
    Requirement:
    1) If the Response Idoc Field receives Success Text means the Idoc Status shld be in Green Status.
    2) If the Respnse Idoc Field Receives FAIL means the Idoc Status shld be in RED Status.
    How can i Do this. please suggest me......
    Regards

    Hi Santhosh,
    YES, I have to Capture the Response from Webservice in SAP R/3 by using STATUS.SYSTAT01 Idoc.
    I have mapped the response from webservice to the one of the field in the Idoc.
    If this field contains Success as text means the Idoc Status in We05 shld be 53 else it shld be 56
    With out changing the FM code, can we use any other process to achieve this???
    @ Mario
    Can u please Allobarate your views more based on my requirement
    Regards

  • Can't change the 'compilation status' for multiple items in iTunes 8.

    Hi there,
    I've got an issue regarding the disappearance of the compilation 'tick box' when changing multiple items. Its there when you click on 'get info' for the individual track but its no longer there (in iTunes 8) when I want to change the compilation 'status' for multiple tracks at a time.
    In iTunes 7 I selected all the tracks and changed their compilation status by accident, but now, in iTunes 8 I can't change this without going through my library, track by track!.
    Please help.
    Thanks,
    Fred

    Multiple Get info now has tabs - look on the options tab.

  • Vehicle stuck in Yard Management - Is there a way to change the HU Status?

    Hi Everyone,
    I'm trying to remove a vehicle that's stuck in Yard Management (under a warehouse) but I had no luck so far. The problem is that the Handling Unit was set to deleted and I haven't been able to change its status through HU02 or even using HUMO. The system status right now is DLTD. When I try to delete the vehicle in YM, it says that I can't because of the status that's in right now.
    Is there a way to change the system status back to 'PLND' for example?
    Also, if I could find a way to set the user status, would it prevail over the system status?
    If more information is needed, I'll gladly provide it.
    Thanks everyone!

    Hi Petr,
    Thanks for replying.
    I tried using this transaction but I don't think it's implemented in my company's SAP version.
    I think I found what the problem is. In VEKP, the status field (VEKP-STATUS) is set to '0001' (Planned) instead of 0060 (Deleted). But if I display it using tcode HUMO, it shows up as 'DLTD'. Maybe the issue is that both status are not in sync with each other and that's why I can't remove the vehicle from Yard Management.

  • EXIT after changing the document status to Parked and complete

    Hi,
    I have an urgent requirement to findout a exit which will trigger after changing the document status to PARKED and COMPLETE. I need this for invoice and FI document.
    I will really appreciate your help.
    Kuntal

    Yes the Workflow Background process completed successfully with no errors. I see the error when I query up the Sales Order go to menu --> Workflow Status -->
    Activity History.
    The Activity History shows error in the Wait Function and the error message is 3001: Invalid command argument.?
    This error message does not explain much. I followed all the steps in document# 397364.1
    Don't know why it should end in error and how it can be fixed?
    Any more ideas?
    Thanks

  • Changing the System status for previous transactions

    Hello,
    Could some body help me with this ?
    I have a User status profile with user status ABC which triggers system status Inprocess. This is applicable for all the new transactions for which we set the status ABC which works fine. But we have some previous transactions  ( Prior to this config ) with status ABC , but system status is not Inprocess.
    How can we change the system statuses for all these transactions? do we have a report for this?
    Best Regards,

    Hi,
      You can use 'STATUS_CHANGE_INTERN' FM to change the system status. Pass Object number and status ID as inputs to the Function Module.
    Regards,
    Lakshmi.Y

  • Not change the scheduled status after new planning explosion

    Dear  Expert
    We do detail schedule once a month, but MRP heuristic run in every day. We need new explosion every date for new master data, but after new exlopsion the allocated order come back to status 'deallocated'. Then we can not distinguish which are the plan order already scheduled which are new.  Is that any way to keep the order in allocated after new explosion.
    Thanks
    Hailiang

    In MMBE te stock should be showing in restricted batch status.
    Use MSC2n to change the batch status to released.
    Modify the "next inspection date" to the current date.  Set the SLED to the next day.
    Check MMBE and the stock should now show in unrestricted stock.
    Run QA07 using the material as an input and you should get a new recurring inspection lot for the material.  Do not enter in any value for the "window" of expired material in the bottom half of the screen.
    You should get an 09 lot generated now.  (As long as 09 inspection type is active).
    Craig

  • How to change the IDOC Status from 30 to 03

    Hi Friends,
    In the Partner Profiles Collect IDOCS option is Selected and the Output mode is 4.
    In my Custom Program i am Using the Function Module MASTER_IDOC_DISTRIBUTE to generate the IDOCs
    I am getting the IDOCs of Status 30.
    then in my Custom Program, I am Submitting the IDOCs to RSEOUT00 program.
    to change the IDOC status from 30 to 03.
      SUBMIT rseout00 USING SELECTION-SCREEN '1000'
                   WITH docnum  IN  gt_range_idocs
                   WITH p_compl EQ 'Y'
                   AND RETURN.
    but still i am not getting the IDOCs of changed status.
    I need to get the Changed IDOC status and if the IDOC status is not changed then I need to generate an Error file for the IDOCs data and send that data to customers as a mail.
    so my requirment is to call the RSEOUT00 in the Custom Program and Change the IDOCs Status to 03.
      When i am Executing the RSEOUT00 Indidually by giving the IDOCs numbers, then the IDOCs Status is going to change to 03 from 30.
    Kindly Guide me how to proceed furthur
    Thanks in Advance,
    Ganesh

    Thanks Shrishit,
    RC1_IDOC_SET_STATUS changing the Status from 30 to 03.
    Its fine, But my Question is will IDOC Data will be reached to XI Server or not.??
    means is the functionality of this Program is same as the RSEOUT00.
    MY job is to change Status from 30 to 03 only
    and then Check the Status of those IDOCs, and if the IDOC is not sended to XI  i.e.;03 status, then I need to send the Details of IDOC (i.e.; data in filed IDOC) to Customer Mail ID through an Attachement.
    I hope you Understood my AIM, why I need to change the Status in my Custom Program only, by submitting IDOCs to this report .
    Kindly waiting for your reply,
    Thanks in Advance,
    Ganesh

Maybe you are looking for

  • Why can't i install flash player 12 on my mac?

    I am having problems installing flash palyer 12 on my mac osx 10.8, it says its installed but its not working i never had a problem with this before

  • I'm not able to sync my Iphone 4.  It doesn't show up as a device in iTunes.

    I'm in need of help getting my IPhone 4 to sync with my pc.  I have downloaded the latest update for iTunes.  When I connect my IPhone using the USB cord, it is not recognized in iTunes.  There is no "devices" tab on the left and I don't see any opti

  • FI to COPA Value fields Currency translation

    Hello All, We are having the following situation. 1) The company code currency is RUB 2) Operating concern currency is EUR. 3) Second local currency as EUR. we are using a customised program to run the settlement. This program calls the KE21 transact

  • Title in summary different

    I'm using X5 to create PDF documents. My help title is defined in the Single Source Layouts | Printed Documentation properties and in the Project properties. That topic is displayed in the title bar of the Adobe PDF, which is as you'd expect, however

  • Strange behavior of adapter sequence in SFTP

    Hi all For SFTP sender callsap(which calls the queue and ....) is the last module in the module sequence. That implies that any module placed after callSap should not have any effect on the processing of message. However I observed if we place some m