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

fieldcatalog problem

Former Member
0 Likes
858

TYPES : BEGIN OF gs_bill,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF gs_bill.

*internal tables

DATA : gt_vbrk TYPE STANDARD TABLE OF gs_bill INITIAL SIZE 0,

gt_vbrp TYPE STANDARD TABLE OF gs_bill INITIAL SIZE 0,

gt_empty TYPE STANDARD TABLE OF gs_bill INITIAL SIZE 0,

gs_vbrk TYPE gs_bill,

gs_vbrp TYPE gs_bill.

<b>these are my internal tables</b>

DATA ls_fcat type lvc_s_fcat .

data : pt_fcattemp TYPE slis_t_fieldcat_alv,

lt_fcattemp TYPE SLIS_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'GT_VBRK'

i_inclname = sy-repid

CHANGING

ct_fieldcat = pt_fcattemp[]

EXCEPTIONS

OTHERS = 3.

LOOP AT pt_fcattemp into lt_fcattemp.

move-CORRESPONDING lt_fcattemp to ls_fcat.

move lt_fcattemp-seltext_m to ls_fcat-coltext.

append ls_fcat to gt_fieldcatalog.

ENDLOOP.

<b>

this is my catalog merge but after calling fieldcatalog_merge FM,

my fieldcatalog not fill.

but if i declare my itab like this</b>

DATA : BEGIN OF gs_bill occurs 1,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF gs_bill.

<b>

and send to FM my fieldcatalog fills but seltext not fill. WHY ???</b>

thanks

Message was edited by:

Mustafa SADIK

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
826

I think field catalog using function module will not work if u declare the internal table using types.

8 REPLIES 8
Read only

Former Member
0 Likes
827

I think field catalog using function module will not work if u declare the internal table using types.

Read only

Former Member
0 Likes
826

Mustafa,

If you want to create a field catalog from a internal table, the internal table will have to declared in the traditional manner of BEGIN and END with a OCCURS clause.

Redefine your internal table declaration and it should work..

DATA : BEGIN OF GT_VBRK OCCURS 0

END OF GT_VBRK.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
826

If you use the TYPE/TYPES statament the function REUSE_ALV_FIELDCATALOG_MERGE doesn't work.

Delete this:

<b>DATA : gt_vbrk TYPE STANDARD TABLE OF gs_bill INITIAL SIZE 0.</b>

and difine it directly:

DATA : BEGIN OF GT_VBRK,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF GT_VBRK.

or declare a workarea:

data : BEGIN OF gs_bill,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF gs_bill.

<b>DATA : gt_vbrk LIKE STANDARD TABLE OF gs_bill INITIAL SIZE 0.</b>

Max

Read only

Former Member
0 Likes
826

thanks ravikumar;

but i declare my itab like

DATA : BEGIN OF gs_abc OCCURS 1,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF gs_abc.

after merge my catalog fills.

but THIS TIME seltext_s seltext_m .... not fills i can not achive coloumn headers.

Read only

former_member404244
Active Contributor
0 Likes
826

Hi Mustafa,

u have to declare the internal table GT_VBRK with occurs 0,

data : begin of gt_vbrk occurs 0,

field1....

field2

end of gt_vbrk.

now pass to ALV_fieldcatlog_merge fm.

i_program_name = sy-repid

i_internal_tabname = 'GT_VBRK'

i_inclname = sy-repid

CHANGING

ct_fieldcat = pt_fcattemp[]

EXCEPTIONS

OTHERS = 3.

it will work.

regards,

Nagraj

Read only

Former Member
0 Likes
826

DATA : BEGIN OF gs_abc OCCURS 1,

vbeln LIKE vbrp-vbeln,

fkdat LIKE vbrk-fkdat,

posnr LIKE vbrp-posnr,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

END OF gs_abc.

after merge my catalog fills.

but THIS TIME seltext_s seltext_m .... not fills i can not achive coloumn headers.

<b>

ANY IDEA ABOUT ABOVE PROBLEM SELTEXT not comming</b>

Read only

0 Likes
826

I guess you will have to manually fill them by looping the field catalog table.

<b>Please mark all the helpful ansewrs</b>

Regards,

Ravi

Read only

Former Member
0 Likes
826

thanks everyone i solved the problem

all helpfull answers awarded