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

urgent, abap statement

Former Member
0 Likes
874

Hi all,

Pleae fine below code

SELECT * FROM PA0001 INTO TABLE ITAB

WHERE WERKS = PER_AREA

AND BTRTL = SUB_AREA.

I was trying to select all personnel numbers with in particuler sub area and personnel area.

But surpsisingly, I above statement reading some funny vaues when I check with table. what would be reason?

Thanks

Shiva.

Hi all,

Pleae fine below code

SELECT * FROM PA0001 INTO TABLE ITAB

WHERE WERKS = PER_AREA

AND BTRTL = SUB_AREA.

I was trying to select all personnel numbers with in particuler sub area and personnel area.

But surpsisingly, I above statement reading some funny vaues when I check with table. what would be reason?

Thanks

Shiva.

6 REPLIES 6
Read only

Former Member
0 Likes
852

Hi,

ITAB should be the same Structure of the table PA0001.

DAta: ITAB like PA0001 occurs 0 with header line.

Regards

Sudheer

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
852

Hi,

Both the fileds you are using the WHERE clause are not part of the primary key, so you can expect some wierd results check the table key and improve your where clause.

Regards,

Sesh

Read only

amit_khare
Active Contributor
0 Likes
852

1. you are comparing character fields, so check accordingly.

2. pass a date range to get employees list, since in HR data is based on date.

Read only

Former Member
0 Likes
852

Hi,

In the where clause ,check,

WERKS = PER_AREA and

BTRTL = SUB_AREA.

per_area and sub_area should be of same type as werks and btrtl.

regards

Read only

Former Member
0 Likes
852

Hi Shiva ,

Could you please tell what value are you getting , so that we can help you better.

Funny values is too vague to suggest what can be the reason for the statement not working correctly.

Regards

Arun

Read only

Former Member
0 Likes
852

Hi shiva

DATA:epernr like pa0001-pernr,
                  ename1 like pa0001-ename.
DATA : int_pa0001 LIKE pa0001 OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'HR_TMW_GET_EMPLOYEE_NAME'
  EXPORTING
    person_no          = PA0001-PERNR
 IMPORTING
   EDIT_NAME          = PA0001-ENAME
*   NAME_WITH_NO       =
          .
  IF sy-subrc = 0.
    READ TABLE out_tab60 INDEX 1.
    out_tab60-value = PA0001-ENAME(11).




    MODIFY out_tab60 INDEX 1.


  ENDIF.

ENDFORM.                    "CHEQUE_JNTVENT


Reward if helpfull

Regards

Pavan