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

code not working still

Former Member
0 Likes
885

IF sa30-yygpreisbi CA '#'.

EXIT.

ELSE.

IF sa30-yygpreisbi <= hgvabbv_30-yygpreisab.

fehler_vertrag = 1.

IF xscreen = space.

syst-msgno = '442'.

syst-msgid = 'YS'.

syst-msgty = 'W'.

PERFORM protokollausgabe.

ELSE.

MESSAGE e442.

ENDIF.

  • return_code = 4.

ENDIF.

ENDIF.

please tell me the reason?

my presbi is a date field also if it contains #### then also its not exiting

8 REPLIES 8
Read only

Former Member
0 Likes
862

Tell me the situation where in you get '####'.

Read only

0 Likes
862

My preisbi is a date field so if a situation arises when it contains a #### characters

then it shlod check and exit from perform

but its not doing that ?

Read only

0 Likes
862

below code works fine for me ...

data : v_c type C value '#'.

data : v_datum like sy-datum.

start-of-selection.

v_datum = '####'.

if v_datum CA v_c.

exit.

else.

*coding

endif.

Read only

Former Member
0 Likes
862

hi bhanu,

i dunno wot u using for CA = contains any..if that contains '#' ..it will exit..othawise i doesnt..

hope this helps

regds

Read only

Former Member
0 Likes
862

how do you ever get a situation where in you get a date field having characters '####' ??

Read only

0 Likes
862

There is a structure SA30 which contains all my dates

after this check its like

sa30 is been sa30 USING low_value_translator

which leads to value in sa-30 date field -00000 to #######

cn u please help me?

Read only

0 Likes
862

Hi,

If the content '####' is fixed then use the following condition

IF date CP '########'.

  • statements if condition is true.

endif.

If there are 4 # in the string then use 8 # in the if condition.

As # is escape character. If comparision is with '##', while execution the code will be interpreted like, first # is escape character, it will take next character # for the comparision.

reward if helps.

regards,

mahantesh

Read only

Former Member
0 Likes
862

Check this code. Its working fine.

REPORT ZSCD_TEST3.

data : dat(8) type c.

dat = 'sachin#'.

if dat CA '#'.

write:/ ' contain #'.

else.

write:/ ' Does contain #'.

endif.

**************************************

In your code, see in the debug mode what is the value coming in sa30-yygpreisbi.

It might be the reason that it does not contain the desired data.

regads,