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

Problem with IF statement

Former Member
0 Likes
617

Greetings Abaper's

Ive got a small problem. Ive got an IF statement and the code inside it wont execute. I debugged through it and all the parameters are met but it does not assign the short description i want to my local structure. Please help. The code snippet is included below. Thank you.

if ls_cacs_ctrtstt-appl = lv_appl

and ls_cacs_ctrtstt-ctrtst_id = ls_cacs_ctrtbu-ctrtst_id

and ls_cacs_ctrtstt-spras = 'E'.

ls_zrl_salescode_details-std_contract_desc = lt_cacs_ctrtstt-descr_short.

endif.

6 REPLIES 6
Read only

Former Member
0 Likes
587

hi,

Check out whether the data type of both the variables are same or not .. for example one of numc and the other of character will not sometime satisfy the condition ... so make it of same data type ...

Regards,

Santosh

Read only

Former Member
0 Likes
587

hi

Please check the following code

if ls_cacs_ctrtstt-appl EQ lv_appl

and ls_cacs_ctrtstt-ctrtst_id EQ ls_cacs_ctrtbu-ctrtst_id

and ls_cacs_ctrtstt-spras EQ 'E'.

ls_zrl_salescode_details-std_contract_desc = lt_cacs_ctrtstt-descr_short.

endif.

Regards,

Jaya Vani.

Read only

Former Member
0 Likes
587

Try this:



if ls_cacs_ctrtstt-appl = lv_appl
and ls_cacs_ctrtstt-ctrtst_id = ls_cacs_ctrtbu-ctrtst_id
and ls_cacs_ctrtstt-spras =  'EN'  .

ls_zrl_salescode_details-std_contract_desc = lt_cacs_ctrtstt-descr_short.

endif.

also check data typs of variables ls_cacs_ctrtstt-appl is same as lv_appl & ls_cacs_ctrtstt-ctrtst_id is same as ls_cacs_ctrtbu-ctrtst_id.

Read only

0 Likes
587

All data types are the same. Everything is syntactically correct and i even debugged it to see what varilables are assigned and everything looks fine except it just is not assigning anything to my local structure.

Read only

0 Likes
587

Language key should be EN it might be 2 characters..just check it out and laso past the values what u r passing and data type u defined for that..

Regards

sas

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
587

check whether the condition is getting satsfied.

Check whether any leading zeros problem is there