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

Small problem in code

Former Member
0 Likes
1,090

DATA: w_OBJID TYPE JEST-OBJNR.


LOOP at it_resb INTO wa_resb.

READ TABLE it_resb2 INTO wa_resb2 WITH KEY matnr = wa_resb-matnr.

if sy-subrc = 0.

    select single OBJID INTO w_OBJID FROM AUFK

     where aufnr = wa_resb-aufnr .


This select query does not fetch a value to w_OBJID.

but when i debug, wa_resb-aufnr has a value and when i take that value and run in se11 the table shows a record.


but my code doesnt fetc the value.. Any thoughts on why?


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,055

Make sure type of  "OBJID" and "JEST-OBJNR" are same.

6 REPLIES 6
Read only

former_member196157
Active Participant
0 Likes
1,055

hiii,

Check the value of  wa_resb-aufnr,


and use Conversion routine i.e. if length of aufnr is 12 digites then it is converted into 12 digites number. So convert aufnr value to 12 digites with adding the preceding zeros


USE " CONVERSION_EXIT_ALPHA_INPUT "

Read only

Former Member
0 Likes
1,056

Make sure type of  "OBJID" and "JEST-OBJNR" are same.

Read only

Former Member
0 Likes
1,055

Please check whether conversion exit is require for aufnr ? you need to convert aufnr using conversion exit before putting it in where clause.

Cheers,

Prakash

Read only

atul_mohanty
Active Contributor
0 Likes
1,055

Hi

Can you check DATA: w_OBJID TYPE JEST-OBJNR.

Instead declare DATA: w_OBJID TYPE CCOBJID. and try once again.

Regards,

Atul Mohanty

Read only

philipdavy
Contributor
0 Likes
1,055

Have a look on to your W_OBJID variable declaration (type) and  OBJID in AUFK table. Is it compatible ?

Regards,

Philip.

Read only

Former Member
0 Likes
1,055

hi ,

    There are mainly two possibility .

1) DATA: w_OBJID TYPE JEST-OBJNR 

      u declared in the ref of JEST table, but in that table data type is char and length is 1 but same field

you are fetching from  AUFK and there is having same data type but lenth is differ there is length 1 only



2) for most of transactions  AUFK table dont have data .



Thank You

shrikant