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

Urg : implementation and defination

Former Member
0 Likes
396

Hi floks ,

in my requirement is same like below code can be utilized in that program .

how can declare in class in program [defination component as well as implementation component] to access data /get data .

Could u please help out in this programgive me ...........

data: catsxt_tab type catsxt_wa_itab,

docflow_tab type catsxt_flow_alv_itab,

data: ls_docflow like line of docflow_tab.

call method gr_dbsel->get_time_sheet_data

exporting

im_personnel_number_tab = pernr_sel_tab

importing

ex_catsxt_data = catsxt_tab

ex_docflow = docflow_tab.

thanks for ur better advanced support,

Suresh

1 REPLY 1
Read only

Former Member
0 Likes
337

Hi

Which type of class you wants to use

We have Local classes and Global Classes

Global class has to defined in SE24 and there you have to define methods and have to write the implementation

then you create a program in SE38 and then call that class by creation a ref object and use that method

see the sample code using Local classes

REPORT zs_class.

----


  • SELECTION SCREEN

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS:p_var TYPE i,

p_var1 TYPE i.

SELECTION-SCREEN END OF BLOCK b1.

----


  • CLASS d_class DEFINITION

----


CLASS d_class DEFINITION.

PUBLIC SECTION.

METHODS:

add,

sub.

PROTECTED SECTION.

DATA : var2 TYPE i.

ENDCLASS. "d_class DEFINITION

----


  • CLASS d_class IMPLEMENTATION

----


CLASS d_class IMPLEMENTATION.

METHOD add.

var2 = p_var + p_var1.

WRITE:/ var2.

ENDMETHOD. "add

METHOD sub.

var2 = p_var - p_var1.

WRITE:/ var2.

ENDMETHOD. "sub

ENDCLASS. "d_class IMPLEMENTATION

----


  • START-OF-SELECTION

----


START-OF-SELECTION.

DATA: obj TYPE REF TO d_class.

CREATE OBJECT: obj .

CALL METHOD: obj->add,

<b>Reward points for useful Answers</b>

Regards

Anji