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: 

Logic to control Screen Number

former_member295881
Contributor
0 Kudos

Hello experts,

Iu2019m trying to implement logic to control screen number and need some help. Iu2019ve a config table which I use to retrieve screen numbers. So intend is not to hard code and whenever there is a change required instead of changing program just change values in this table. Iu2019m using FM u2018Z_VAR_DEFAULTSu2019 to get back these values and hold them in a table (lit_param ). Now the challenge is I need to write an IF statement where I compare SY-DYNNR with all entries I receive back from FM..

The question is can I write the following statement? If not then how I can do it.

IF ( sy-dynnr IN lit_param )

SOME CODEu2026

ENDIF.

Many thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

well actually you can write

IF sy-dynnr in ITAB.

endif.

Just be aware, for this you itab must be a range table.

data: itab type range of SYDYNNR.

so after fetching your values from your customizing table, build a range table from it.

3 REPLIES 3

former_member191735
Active Contributor
0 Kudos

Yes you can write.

if sy-dynnr in lt_dynnr.

your code

endif.

Former Member
0 Kudos

well actually you can write

IF sy-dynnr in ITAB.

endif.

Just be aware, for this you itab must be a range table.

data: itab type range of SYDYNNR.

so after fetching your values from your customizing table, build a range table from it.

Former Member
0 Kudos

Pretty basic - make sure lit_param is a range table with all of the fields filled in.

Rob