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: 

Issue in select query

former_member342013
Contributor
0 Kudos

Hi All ,

Can anyone help on this , wn im trying to execute the record i should get error message as already exist for records already thr in the table. but my lsmw is not doing so. all records are getting converted .

SELECT SINGLE *

FROM /DS1/SD_MT_BOM

WHERE ZHEADER = DETPROTYPSS-ZHEADER

AND ZITEM = DETPROTYPSS-ZITEM

AND WERKS = DETPROTYPSS-WERKS

AND VFROM = DETPROTYPSS-VFROM

AND ZREL = DETPROTYPSS-ZREL.

IF SY-SUBRC EQ 0.

WRITE : / 'ERROR=>Record already exist for',

'ZHEADER=',DETPROTYPSS-ZHEADER,',',

'ZITEM=',DETPROTYPSS-ZITEM,',',

'WERKS=',DETPROTYPSS-WERKS,',',

'VFROM=',DETPROTYPSS-VFROM,',',

'ZREL=',DETPROTYPSS-ZREL.

SKIP_RECORD.

ELSE.

transfer_record.

ENDIF.

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

Are you sure that the runtime values in your WHERE-clause are correct, maybe there is internal/external value conversion exits effective, check the domains behind the relevant fields, especially ZHEADER and VFROM (internal/external date format). You must use the internal values in your WHERE-clause.

Thomas

5 REPLIES 5

ThomasZloch
Active Contributor
0 Kudos

Are you sure that the runtime values in your WHERE-clause are correct, maybe there is internal/external value conversion exits effective, check the domains behind the relevant fields, especially ZHEADER and VFROM (internal/external date format). You must use the internal values in your WHERE-clause.

Thomas

former_member225688
Participant
0 Kudos

Please check for the value at run time in debugging as most of the times query would be failed due to leading zeros  or may be there is a value mismatch and check the sy-subrc after the query execution . That would help you for sure.

Regards,

Dnyanehswar Lande

Former Member
0 Kudos

Hi,

Maybe its the field WERKS which has a convertion exit built in. Debugging is your best bet for the time being

Regards,

Tunwiir

former_member342013
Contributor
0 Kudos

Thank you all for the replies ...

It was a issue with the date field VFROM .

Regards

Smitha

former_member342013
Contributor
0 Kudos

Thank you all for the replies ...

It was a issue with the date field VFROM .

Regards

Smitha