Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Monday, December 13, 2010

OOPS:Use of parameter table

For dynamic method call, one can use the concept of PARAMETER TABLE to include references of all interface parameters of the method(instead of mentioning them separately).
-------------------------------------------------------------------------------------------
REPORT YSUBOOPS24 .

DATA : i_result type i,
i_num type i value 5 .
DATA f(2) TYPE c VALUE 'M1'.

CLASS cl_abap_objectdescr DEFINITION LOAD .

DEFINE : poptable.
ptab_line-name = &1.
ptab_line-kind = CL_ABAP_OBJECTDESCR=>&2.
GET REFERENCE OF &3 INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
IF sy-subrc ne 0.
EXIT.
ENDIF.
END-OF-DEFINITION.

CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS m1 IMPORTING p1 TYPE i
exporting p3 type i .
ENDCLASS.

CLASS c1 IMPLEMENTATION.
METHOD m1.
p3 = p1 + 200.
ENDMETHOD.
ENDCLASS.

DATA r TYPE REF TO c1.
DATA: ptab TYPE abap_parmbind_tab,
ptab_line LIKE LINE OF ptab.

START-OF-SELECTION.

poptable : 'P1' EXPORTING i_num ,
'P3' IMPORTING i_result .

CREATE OBJECT r TYPE c1.
CALL METHOD r->(f) PARAMETER-TABLE ptab.
write:/5 i_result .


Output 205

No comments: