Application Development and Automation 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: 
Read only

HR_INFOTYPE_OPERATION problem

Former Member
0 Likes
1,815

dear all,

i am using HR_INFOTYPE_OPERATION function module for inserting a record in infotype 0008 .

but i am getting dump like this

In the running program "SAPLHRMM" a field should have been assigned to a field

symbol, which is shorter than the type of the field symbol.

This is not possible.

It is a statement of the form ASSIGN f TO <fs> CASTING...

or ASSIGN f TO <fs> with a field symbol that was created with the

STRUCTURE addition.

kindly help me regarding this error

chinnaiya

Edited by: chinnaiya pandiyan on Feb 23, 2009 6:33 AM

dear all,

i am using HR_INFOTYPE_OPERATION function module for inserting a record in infotype 0008 .

but i am getting dump like this

In the running program "SAPLHRMM" a field should have been assigned to a field

symbol, which is shorter than the type of the field symbol.

This is not possible.

It is a statement of the form ASSIGN f TO <fs> CASTING...

or ASSIGN f TO <fs> with a field symbol that was created with the

STRUCTURE addition.

kindly help me regarding this error

chinnaiya

Edited by: chinnaiya pandiyan on Feb 23, 2009 6:33 AM

5 REPLIES 5
Read only

Former Member
0 Likes
1,227

I think UR missing something ..

Please look at FM : HR_SPA_FILL_IT0008_STRUCTURE to get an idea how data is passed to

HR_INFOTYPE_OPERATION ...

Read only

Former Member
0 Likes
1,227

hai srini vas .. i checked the FM which you prescribed ..

still i am getting the same error

for your reference i am attaching the code ..

TABLES : pa0008.


data : l_file type string .
data : l_return like BAPIRETURN1.
data : insert TYPE pspar-actio VALUE 'INS'.

data : BEGIN OF itab OCCURS 0,
        PERNR like pa0008-PERNR,
        SUBTY like pa0008-subty,
        OBJPS like pa0008-OBJPS,
        sprps like pa0008-sprps,
        ENDDA like pa0008-ENDDA ,
        BEGDA like pa0008-BEGDA,
        SEQNR like pa0008-SEQNR,
        trfar like pa0008-trfar,
        trfgb like pa0008-trfgb,
        trfgr like pa0008-trfgr,
        waers like pa0008-waers,
       lga01 like pa0008-lga01,
       bet01 like pa0008-bet01,
  END OF itab .

data : f_file like rlgrap-filename.
parameter : p_file LIKE rlgrap-filename  .
at selection-screen on value-request for p_file .
    CALL FUNCTION 'F4_FILENAME'
     EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = 'P_FILE'
    IMPORTING
       FILE_NAME           = f_file .
    l_file = f_file .
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = l_file
  FILETYPE                        = 'DAT'
   HAS_FIELD_SEPARATOR           = 'X'
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  tables
    data_tab                      = itab
         .

IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

if itab[] is not initial .
  loop at itab.
  CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
    EXPORTING
      number             = itab-pernr
*   IMPORTING
*     RETURN             =
*     LOCKING_USER       =
            .
***** upto here i am getting every thing is fine *****
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
  EXPORTING
    infty                  = '0008'
    number                 =  itab-pernr
    SUBTYPE                =  itab-SUBTY
   OBJECTID               =   itab-OBJPS
   LOCKINDICATOR          =   itab-sprps
   VALIDITYEND            =   itab-ENDDA
   VALIDITYBEGIN          =   itab-BEGDA
   RECORDNUMBER           =   itab-SEQNR
    record                 =  itab
    operation              =  insert
*   TCLAS                  = 'A'
   DIALOG_MODE            = '0'
   NOCOMMIT                =  'X'
*   VIEW_IDENTIFIER        =
*   SECONDARY_RECORD       =
 IMPORTING
   RETURN                 = l_return
*   KEY                    =
          .
IF NOT l_return IS INITIAL AND
     l_return-type EQ 'E'.
  MESSAGE e888(sabapdocu) WITH 'error occured '.

  ENDIF.

  BREAK-POINT.
  CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
    EXPORTING
      number        = itab-pernr
*   IMPORTING
*     RETURN        =
            .

endloop .
ENDIF.

kindly check out this code

regards

chinnaiya

Edited by: chinnaiya pandiyan on Feb 23, 2009 7:26 AM

Read only

0 Likes
1,227

Itab must be declared like structure p0008 ..

DATA : ITAB like p0008.

comment the below itab declaration ...

data : BEGIN OF itab OCCURS 0,

PERNR like pa0008-PERNR,

SUBTY like pa0008-subty,

OBJPS like pa0008-OBJPS,

sprps like pa0008-sprps,

ENDDA like pa0008-ENDDA ,

BEGDA like pa0008-BEGDA,

SEQNR like pa0008-SEQNR,

trfar like pa0008-trfar,

trfgb like pa0008-trfgb,

trfgr like pa0008-trfgr,

waers like pa0008-waers,

lga01 like pa0008-lga01,

bet01 like pa0008-bet01,

END OF itab .

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0008'

number = itab-pernr

SUBTYPE = itab-SUBTY

OBJECTID = itab-OBJPS

LOCKINDICATOR = itab-sprps

VALIDITYEND = itab-ENDDA

VALIDITYBEGIN = itab-BEGDA

RECORDNUMBER = itab-SEQNR

record = itab <---

operation = insert

  • TCLAS = 'A'

DIALOG_MODE = '0'

NOCOMMIT = 'X'

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

IMPORTING

RETURN = l_return

  • KEY =

.

Read only

Former Member
0 Likes
1,227

hi chinnaiya,

sirini is correct.

you must declare as

DATA: ITAB TYPE p0008 OCCURS 0 WITH HEADER LINE.

Cheers,

Madhu

Read only

Former Member
0 Likes
1,227

hi,

Declatre the structure as P0008.

Use the value 'INS' in the operation field.