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

How to pass selection screen parameter value to the method

Former Member
0 Likes
1,969

Hello folks,

I am new to OOPS concept in ABAP. I am using a Method which is defiend as private section. I want to use the selection screen parameter in my method for some validation purpose.. This might be a basic thing in OOPS but i am not sure how to do it..

Could you please suggest how to do so...

Thanks in advance,

Shyam.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
996

Shyam,

check this

&----


*& Report ZDEMO

*&

&----


*&

*&

&----


REPORT ZDEMO.

tables:pa0000.

SELECTION-SCREEN begin of BLOCK b1.

PARAMETERS p1 type i .

SELECTION-SCREEN end of block b1.

class lc DEFINITION.

PUBLIC SECTION.

data ty type i.

methods:

get.

PRIVATE SECTION.

methods:

getty.

ENDCLASS.

class lc IMPLEMENTATION.

method getty.

ty = p1.

ENDMETHOD.

method get.

me->getty( ).

write ty.

ENDMETHOD.

ENDCLASS.

START-OF-SELECTION.

data obj type ref to lc.

create OBJECT obj.

call METHOD obj->get( ).

Thanks

Bala Duvvuri

Hello folks,

I am new to OOPS concept in ABAP. I am using a Method which is defiend as private section. I want to use the selection screen parameter in my method for some validation purpose.. This might be a basic thing in OOPS but i am not sure how to do it..

Could you please suggest how to do so...

Thanks in advance,

Shyam.

1 REPLY 1
Read only

Former Member
0 Likes
997

Shyam,

check this

&----


*& Report ZDEMO

*&

&----


*&

*&

&----


REPORT ZDEMO.

tables:pa0000.

SELECTION-SCREEN begin of BLOCK b1.

PARAMETERS p1 type i .

SELECTION-SCREEN end of block b1.

class lc DEFINITION.

PUBLIC SECTION.

data ty type i.

methods:

get.

PRIVATE SECTION.

methods:

getty.

ENDCLASS.

class lc IMPLEMENTATION.

method getty.

ty = p1.

ENDMETHOD.

method get.

me->getty( ).

write ty.

ENDMETHOD.

ENDCLASS.

START-OF-SELECTION.

data obj type ref to lc.

create OBJECT obj.

call METHOD obj->get( ).

Thanks

Bala Duvvuri