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: 

Very Urgent: how to define field symbols in class using se24 Points assured

Former Member
0 Kudos

hi all

I am new to abap oo programming. I am using se24 to build a class

where some methods have code which involves working with field sybmols but i am not able to figure out way for how to define field symbols in the attributes section.

I tried defining like : fld_sym type ref to dbtab-fld

but in the method implementation if i try to use it like assign fld to <fld_sym> there it says fld_sym is not defined as a field symbol.

So can anyone please guide me how to define field symbols in se24.

Also what should be the general steps while creating a class using se24.

Points assured

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Global classes are like Global fun modules in which the Methods and code is already written and is mainly used for Reusability purpose.

Goto SE24 tcode and see the std global classes like

CL_ABAP_CHAR_UTILITIES

see the links

chk out the links below:

General Tutorial for OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

Have a look at these links for OO ABAP.

http://www.sapgenie.com/abap/OO/

http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm

http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt

http://www.allsaplinks.com/

http://www.sapgenie.com/abap/controls/index.htm

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf

http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

SDN Series:

https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b... [original link is broken]

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf

Basic concepts of OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c4...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

http://www.henrikfrank.dk/abapuk.html

http://www.erpgenie.com/abap/OO/

Reward oints if useful,

Aleem.

5 REPLIES 5

Former Member
0 Kudos

Hi

Global classes are like Global fun modules in which the Methods and code is already written and is mainly used for Reusability purpose.

Goto SE24 tcode and see the std global classes like

CL_ABAP_CHAR_UTILITIES

see the links

chk out the links below:

General Tutorial for OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

Have a look at these links for OO ABAP.

http://www.sapgenie.com/abap/OO/

http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm

http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt

http://www.allsaplinks.com/

http://www.sapgenie.com/abap/controls/index.htm

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf

http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

SDN Series:

https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b... [original link is broken]

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf

Basic concepts of OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c4...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

http://www.henrikfrank.dk/abapuk.html

http://www.erpgenie.com/abap/OO/

Reward oints if useful,

Aleem.

Former Member
0 Kudos

Hi ,

field-symbols : <lf_name> type vbak-vbeln.

data : lv_name type vbeln.

lv_name = '0002334'.

assign lv_name to <lf_name>.

write : 'Hi'.

Pls use break point and check - it will assign the value to <lf_name> at run time.

Regards

Sathish

Former Member
0 Kudos

Hi,

You cant use field symbol as an attribute in a class. Instead i can achive the same functionality using generic references or references to a class. expain your problem clearly i will send you the solution.

i can write a method which accepts a table name as a parameter and gives its contents as output. If this suffices your requirement. get back to me i'll write and send you the code.

Thanks,

Aleem.

0 Kudos

Hi aleem,

Can u pleas send me the code...., regarding passing table to method....

id: pradeep.phogat@gmail.com

thanx in advance..

Regards,

Former Member
0 Kudos

hi aleem can u give me ur mail id. It wont be possible to explain the whole thing over here.

thanks