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

Field Symbols Field Name.

Former Member
0 Kudos
1,421

Hi Sap Gurus,

  I have one query hope you people give the path. I created a internal table dynamically using parameter passed value like ( kna1 )

                      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
                              EXPORTING
                                          IT_FIELDCATALOG = IT_FIELDCAT 
                              IMPORTING
                                          EP_TABLE        = NEW_TABLE.


                               ASSIGN NEW_TABLE->* TO <L_TABLE>.
                               CREATE DATA NEW_LINE LIKE LINE OF <L_TABLE>.
                               ASSIGN NEW_LINE->* TO <L_LINE>.


Every thing is fine But the confusion is i want to read fieldsymbol's ( <l_table> ) fieldname. Is it Possible???

   Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Kudos
456

Try an COMPONENT fieldname OF STRUCTURE <L_LINE>, look at the sample code in this documentation document.

(Also don't hesitate to use search help or google site:help.sap.com)

Regards,

Raymond

9 REPLIES 9
Read only

former_member241258
Active Participant
0 Kudos
456

USE THIS CLASS: CL_ABAP_DATADESCR

METHOD : DESCRIBE_BY_DATA OR  DESCRIBE_BY_DATA_REF

U WILL GET FIELDS OF THAT TABLE STRUCTURE.

Read only

0 Kudos
456

i will get structure in other way but want to move some data to field-symbol which have exact field name.

Read only

Former Member
0 Kudos
456

Use assign component..

Read only

RaymondGiuseppi
Active Contributor
0 Kudos
457

Try an COMPONENT fieldname OF STRUCTURE <L_LINE>, look at the sample code in this documentation document.

(Also don't hesitate to use search help or google site:help.sap.com)

Regards,

Raymond

Read only

yogendra_bhaskar
Contributor
0 Kudos
456

Hi Srinivas ,

Try something like this :

DATA: field_key TYPE char100.

field_key = 'KUNNR'.

READ TABLE <L_TABLE> ASSIGNING <L_LINE> WITH KEY (field_key) = '0000123456'.

Regards

Yogendra Bhaskar

Read only

Former Member
0 Kudos
456

Thank you so much for replay to all.I want to move data to field-symbol from work area for this i want to access field names which are in field-symbol because of move proper data to field-symbol.

Read only

0 Kudos
456

If both your table and work area share the same fields' name, move-corresponding still works

Read only

Former Member
0 Kudos
456

I am Moving data to field-symbol from excel file. Excel file have value based on row and col but field-symbol have actual fields so my move corresponding not works.

Read only

0 Kudos
456

Then both Raymond and Elzkie already gave you all the hints/info you need to complete