04-28-2014 6:57 AM
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.
04-28-2014 9:21 AM
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
04-28-2014 9:21 AM
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
04-28-2014 9:31 AM
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
04-28-2014 9:36 AM
Hi,
Maybe its the field WERKS which has a convertion exit built in. Debugging is your best bet for the time being
Regards,
Tunwiir
04-28-2014 9:44 AM
Thank you all for the replies ...
It was a issue with the date field VFROM .
Regards
Smitha
04-28-2014 10:01 AM
Thank you all for the replies ...
It was a issue with the date field VFROM .
Regards
Smitha