‎2006 Oct 26 9:48 AM
Hi,
I am comparing a work area field (wa_entity-service_descript) with an internal table field (lt_output-catalog_name) using CS (Contains String).
It works fine when wa_entity-service_descript = Edwards Medical Supply - Internal catalog
and lt_output-catalog_name = EDWARDS MEDICAL.
It returns sy-fdpos = 0.
But when wa_entity-service_descript = AGRO Envelope corporation - Internal catalog
and lt_output-catalog_name = ARGO ENVELOPE CO
CS returns false and the value of sy-fdpos = 60.
Why is CS not returning true in this case? What should I do so that the comparison returns true?
Thanks and Regards,
Jayesh
‎2006 Oct 26 9:50 AM
‎2006 Oct 26 9:50 AM
‎2006 Oct 26 9:52 AM
In the example, you have mentioned that work area contains service desciption starting with "AGRO" and you are comparing with catalog name starting with "ARGO". So both values are not matching and that returns total length of service description, which is true by working definition of CS. Read below:
If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.
Let me know if you have any further queries.
Don't forget to mark helpful answers!
Gaurav Parmar.
‎2006 Oct 26 9:55 AM
when wa_entity-service_descript = Edwards Medical Supply - Internal catalog
and lt_output-catalog_name = EDWARDS MEDICAL.
st1 contains string st2...
in second case...
when wa_entity-service_descript = AGRO Envelope corporation - Internal catalog
and lt_output-catalog_name = ARGO ENVELOPE CO
st1 contains string st2...(WRONG NA)
st2 contains string st1...(CORRECT IS)..
THATS Y IT IS sy-fdpos = 60..
PLS TELL ME WT EXACTLY UR REQUIREMENT....
SO THAT WILL HELP U.
RAMESH
‎2006 Oct 26 9:55 AM
Hi,
The spelling is wrong.
wa_entity-service_descript = A<b>GR</b>O Envelope corporation - Internal catalog
and lt_output-catalog_name = A<b>RG</b>O ENVELOPE CO
‎2006 Oct 26 9:56 AM
Re: Problem with CS (Contains String)
Posted: Oct 26, 2006 4:55 AM Reply E-mail this post
when wa_entity-service_descript = Edwards Medical Supply - Internal catalog
and lt_output-catalog_name = EDWARDS MEDICAL.
st1 contains string st2...
in second case...
when wa_entity-service_descript = AGRO Envelope corporation - Internal catalog
and lt_output-catalog_name = ARGO ENVELOPE CO
st1 contains string st2...(WRONG NA)(AND ALSO OBSERVE 'AGRO' NOT THERE 'ARGO' IS THERE)
st2 contains string st1...(CORRECT IS)..
THATS Y IT IS sy-fdpos = 60..
PLS TELL ME WT EXACTLY UR REQUIREMENT....
SO THAT WILL HELP U.