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: 

Comparing Values

Former Member
0 Kudos

I made an Internal Table and then append rows........enter hardcoded rows in the Internal Table.......

and now i made Parameter through where i enter id and semester and two group button options....

I know comparison operator but i can't do comparison between Internal Table Field and through Parameter value.........solove my problem.

Thanks in advance

8 REPLIES 8

Former Member
0 Kudos

Hi MKashif,

You need to loop through the internal table. Move every row of your internal table in to a structure. The compare the strucutre field with your parameter value. Guess this is what you were looking for.

Best Regards,

Ram.

former_member242255
Active Contributor
0 Kudos

you have to read the internal table and then compare with the parameter...

Former Member
0 Kudos

Hello,

1. Loop at the internal table

2. compare the field of the internal table with the parameter entered. suppose field2 is the corresponding field for parameter value, then use the statement : If tab-field2 eq p_parameter.

Thanks,

Sowmya

former_member222860
Active Contributor
0 Kudos

Hi,

You can do it, simply by looping the itab.

data: begin of itab occurs 0,
         val1(10) type c,
      end of itab.

parameters: p_val(50) type c.

itab-val1 = 'SAP ABAP'.
append itab. clear itab.

loop at itab.
  if itab-val1 = p_val.
    write:/ 'Equal'.
  else.
    write:/ 'Not equal'.
  endif.
endloop.

Former Member
0 Kudos

Hi:

read table <Internal table> into <workarea> with key

id = parameter-id

semester = parameter-semester.

or

loop at itab into workarea

if workarea-id = parameter-id

endif.

endloop.

Like this you can do.

Regards

Shashi

Former Member
0 Kudos

types : begin of itab,

F1(10) type c,

F2(10) type c,

F3(10) type c,

F4(10) type c,

end of itab.

Data : wa_itab type itab,

Itab2 type itab occurs 0 with header line.

parameter : ERP(10) type c,

Modul(10) type c,

site(10) type c,

subtype(10) type c.

at selection-screen .

wa_itab-F1 = 'sap'.

wa_itab-F2 = 'abap'.

wa_itab-F3 = 'sdn'.

wa_itab-F4 = 'forums'.

append wa_itab to itab2.

clear wa_itab.

TRANSLATE ERP TO LOWER CASE.

loop at itab2 into wa_itab.

if ERP = wa_itab-f1.

message 'Parameter input is correct' TYPE 'I'.

else.

message 'wrong entry' TYPE 'E'.

endif.

endloop.

Former Member
0 Kudos

basically i work on Student Transcript System.

i have done insertion in internal table via hardcoding.........and then make parameters of 3 types id, session and full or partial (Radio Group)......

so i make comparison twice at time

1. id & partial condition

if i select partial........then it shows only session result which i wrote in parameter field

2. id & full condition

if i select full......then complete result is shown of the given ID.

Now i am facing problem how to compare radio group option & session value & id of student?

Thanks in advance.

Former Member
0 Kudos

incomplete but fine