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 programming dump

Former Member
0 Likes
460

Hi gurus,

I can't seem to get rid of following dump in program i've coded... The goal is to get hierarchy father

org. unit of current employee org. unit (IT0001) that has IT1002 (description) with subty = 9000.

Short text:

"Error in module RSQL of the database interface."

Error analysis:

"An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in procedure "%_GET_PERNR" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the exception would occur,

the current program is terminated. The reason for the exception is:

In a SELECT access, the read file could not be placed in the target

field provided.

Either the conversion is not supported for the type of the target field,

the target field is too small to include the value, or the data does not

have the format required for the target field."

Code sample:

....
GET pernr.

* various MOVE commends.

* cost center txt
  SELECT SINGLE ktext FROM cskt
                      INTO wa_radnik-l_kostx...

* selection of father org. unit. until correct org. unit is reached, 
* correct org. unit is the existence of IT1002, SUBTY=9000
 
 l_orgbase = wa_radnik-l_orgeh.

  DO.
    SELECT SINGLE sobid FROM hrp1001 " >>>>> THIS IS WHERE DUMP OCCURS
                        INTO l_nadorg
                        WHERE plvar = '01' AND
                              otype = 'O' AND
                              objid = l_orgbase AND
                              rsign = 'A' AND
                              relat = '002' AND
                              istat = '1' AND
                              begda LE pn-endda AND
                              endda GE pn-begda.
    IF sy-subrc = 0.
      SELECT SINGLE objid FROM hrp1002
                          INTO l_objid
                          WHERE plvar = '01' AND
                                otype = 'O' AND
                                objid = l_nadorg AND
                                subty = '9000' AND
                                istat = '1' AND
                                begda LE pn-endda AND
                                endda GE pn-begda.

      IF sy-subrc = 0.
        wa_radnik-l_n_orgeh = l_nadorg.
        CLEAR: l_nadorg,
               l_objid.
        EXIT.
      ELSE.
        l_orgbase = l_nadorg.
        CLEAR l_nadorg.
      ENDIF.
    ENDIF.
  ENDDO.
...

thank you,

Tom

Edited by: Tom Baksa on Jan 8, 2010 12:47 PM

Edited by: Tom Baksa on Jan 8, 2010 12:52 PM

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
416

There is some problen in your l_nadorg declaration.

try like this.



data: begin of w_kurst_itab occurs 0,
        sobid like hrp1001-sobid,
end of w_kurst_itab.

   select distinct sobid
     into w_kurst_itab
     from hrp1001 client specified
     where mandt = sy-mandt and
           objid in pchobjid and
           otype = 'D' and
           plvar = '01' and
           rsign = 'B' and
           relat = '020' and
           istat <> '5' and
           sclas = 'E' and
           begda <= w_endda and
           endda >= w_begda.
      append w_kurst_itab.
    endselect.

2 REPLIES 2
Read only

GauthamV
Active Contributor
0 Likes
417

There is some problen in your l_nadorg declaration.

try like this.



data: begin of w_kurst_itab occurs 0,
        sobid like hrp1001-sobid,
end of w_kurst_itab.

   select distinct sobid
     into w_kurst_itab
     from hrp1001 client specified
     where mandt = sy-mandt and
           objid in pchobjid and
           otype = 'D' and
           plvar = '01' and
           rsign = 'B' and
           relat = '020' and
           istat <> '5' and
           sclas = 'E' and
           begda <= w_endda and
           endda >= w_begda.
      append w_kurst_itab.
    endselect.

Read only

Former Member
0 Likes
416

yeah, all of my local variables were declared as ORGEH by accident...

i should've paid more attention...