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 Catalog from data object..

0 Likes
452

Hi all,

data:

g_head_ref TYPE REF TO data,

g_item_ref TYPE REF TO data.

CALL BADI handle->set_header_item_data

EXPORTING

i_document_type = g_document_type

i_head_item = g_head_item

i_ab_document_type = doc_typ

i_header_table = g_header_table

i_item_table = g_item_table

i_map_fields = g_map_fields

IMPORTING

e_subrc = l_subrc

e_head_ref = g_head_ref

e_item_ref = g_item_ref.

here i get the g_data_ref and g_item_ref filled with the values..

now i assigned these object to field symbols to display the same in the ALV.....

Issues is follwoing-->

I dont know the table structure or table name with which these ref object or the field symbols is type of now....

(in this case it can be a local prog type defined structure..)..

how can i create a fieldcatlog out of it..??

I have already tried

FM 'REUSE_ALV_FIELDCATALOG_MERGE' --> need an internal table with defined type...

cl_abap_structdescr=>describe_by_data --> need a DDIC structure (in this case it can be a local prog type defined structure..)..

if the class cl_abap_structdescr is the correct way to do it...please let me know exact flow of methods...if there is some other solution do let me know.

Regards,

Yadesh

3 REPLIES 3
Read only

Former Member
0 Likes
423

Hi

i don't know what the variable g_map_fields, perhaps has it the definition of the table? if it's so you can use it to fill catalog table for ALV, else you can use CL_ABAP_STRUCTDESCR

 data: g_head_ref TYPE REF TO data.
data: g_item_ref TYPE REF TO data.


..............................................................

field-symbols: <fs_head> type table.
field-symbols: <fs_wa> type any.

data: l_comp type flag.

DATA: MY_STRUCT TYPE REF TO CL_ABAP_STRUCTDESCR.

ASSIGN g_head_ref->* TO <fs_head>.

LOOP AT <fs_head> ASSIGNING <fs_wa>.
    MY_STRUCT ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <fs_wa> ).
    EXIT.
ENDLOOP.

Now in MY_STRUCT->COMPONENTS you have the definition of the table and u can use it in order to fill the catalog table for ALV

Max

Read only

0 Likes
423

hey thanks Max..

I was looking for some method and i was trying method GET_COMPONENTS

thanks for the information..

Points awarded..

Regards,

Yadesh

Read only

roberto_vacca2
Active Contributor
0 Likes
423

Hi....

*Issues is follwoing-->

*I dont know the table structure or table name with which these ref object or the field symbols is type of now....

*(in this case it can be a local prog type defined structure..)..

Sorry but you should have any "names" at runtime, in debug mode...

In that case we've to use field-symbol approach... Try to give any debug information... tables name, field name, etc.. of your interest