Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR infotype operation -inserting through webservice

Former Member
0 Kudos

Hi ,

I am trying to create a new entry in infotype 2001 for absences.

The FM is being called indirectly from sharepoint through a web service.

I have performed ENQUEUE ,DEQUEUE before  and after calling the HR_INFOTYPE_OPERATION FM.

The FM executes fine, without any error messages.

But no data is created. Everything works fine when tested from sap itself.It fails only when calling from sharepoint.

i have already tried commit work and bapi_transaction_Commit. Doesnt help.

Is there any limitation when calling from external webservice?

_

12 REPLIES 12

Former Member
0 Kudos

Hi,

FM HR_INFOTYPE_OPERATION is not Remote-Enabled Module. It does not work for Web Service

Instead use FM BAPI_ABSENCE_CREATE.

Hope this helps.

Pradeep.

0 Kudos

The FM is being called in a Z RFC. It doesnt help.

I have tried bapi_Absence_create also.Same outcome. No errors no update.

Former Member
0 Kudos

Did you check if it was an authorization problem? Check if the RFC user ID is authorized to create infotype records.

Former Member
0 Kudos

must work with HR_INFOTYPE_OPERATION and BABI_EMPLOYEE_ENQUEUE / DEQUEUE

Did ist several times.

Authorization issue?

0 Kudos

Hi All,

No its not an authorization issue. The same user can update in other scenarios.

The weird part is, it doesnt work only from sharepoint.But works from WS navigator.

Any limitations on infotype updation?  Refered to this thread, but doesnt help.:(

http://scn.sap.com/thread/134238

0 Kudos

did you check the return key?

What message do you get?

May be there is a functional error. Infotype 2001 goes to several different screens depending on SUBTY/AWART.

0 Kudos

Hi Volker,

The return message is initial. No errors are encountered.

Please find my code snippet below:

CALL FUNCTION 'HR_INITIALIZE_BUFFER'

     EXPORTING

       tclas = 'A'

       pernr = it_ absence-pernr.

  

   CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

     EXPORTING

       number        = it_absence-pernr

    IMPORTING

      RETURN        = wa_return

             .

    IF wa_return-type = ' '.

     CLEAR wa_return.

     CALL FUNCTION 'HR_INFOTYPE_OPERATION'

       EXPORTING

         infty         = '2001'

         number        = it_absence-pernr

         record        = wa_pa2001

         operation     = 'INS'

         validityend   = it_absence-endda

         validitybegin = it_absence-begda

         nocommit      =  ''

       IMPORTING

         return        = wa_return

         KEY       =   PERSONALDATAKEY.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

       EXPORTING

         wait = '5'

        "IMPORTING

       .  " RETURN        = wa_Return

    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

     EXPORTING

       number = it_absence-pernr.

0 Kudos

you don't have to pass a PAxxxx but a Pxxxx structure to the fm, mind the difference.

0 Kudos

Hi,

The structure is defined as:

DATA: wa_pa2001 TYPE p2001.

Its correctly declared.

Former Member
0 Kudos

Hey Meghna!

I'm having one error like this... How do you solve this problem? Can you share with me?

0 Kudos

please check if structure P2001 is filled correctly, particularly fields INFTY and SUBTY

and check OSS notes

I found a solution there for a different problem by simply adding a "do nothimg" statemnet:

load-of-program.
perform do_nothing(sapfp50p).


0 Kudos

Where did you put it? My problems is different, I have problem with infotype 9001, when I execute in report is ok, but after, I create a function and call this funtion in another report, the infotype 9001 is not added! Why? only this infotype is not added!!!

Thanks.