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: 

Problems with REUSE_ALV_FIELDCATALOG_MERGE

former_member329522
Participant
0 Kudos

Hi all!!

How is it going?

I have this struct:

DATA: BEGIN OF wa_datos.

DATA: kunnr TYPE kunnr,

subcu TYPE zsubc,

desti TYPE kunwe,

vbeln TYPE vbeln,

zterm TYPE dzterm,

dpp TYPE zdescpp,

inco1 TYPE inco1,

sdabw TYPE sdabw,

zepc TYPE zepc,

ntgewk TYPE ntgew_ap,

volumk TYPE volum_ap,

kwmeng LIKE vbap-kwmeng,

gewei TYPE gewei,

etdat TYPE etdat, "Fecha de envio

arbpl TYPE arbpl,

bwtar TYPE bwtar_d, " Calidad

tarbas TYPE ztar,

recacb TYPE zacb,

reccan TYPE zrct,

desper TYPE zdsp,

kzwi1 LIKE vbap-kzwi1,

dtoseg TYPE zdca,

dtocom TYPE zdto,

dtoinc TYPE zdin,

prcnet TYPE znet,

netoud TYPE znet,

dtorap TYPE zrap,

sbrcrt TYPE zscc,

sbrpal TYPE zscp,

sbrrpd TYPE zsrv,

ntgew TYPE ntgew_ap,

volum TYPE volum_ap

.

DATA: END OF wa_datos.

And an itab with it:

DATA it_datos LIKE wa_datos OCCURS 0 WITH HEADER LINE.

I'm trying to do a fieldcatalog, but the function only shows a few fields...

  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • i_program_name = 'ZRPSD019_01'

  • i_internal_tabname = 'IT_DATOS'

  • i_client_never_display = 'X'

  • i_inclname = sy-repid

  • CHANGING

  • ct_fieldcat = gt_fieldcat[].

What's the problem?

Thanks a lot!

1 ACCEPTED SOLUTION

KK07
Contributor
0 Kudos

Hi Julio,

if u are using all the fields of the table (as in the data dictionary) then go for that function module,

otherwise u can append those fields to fieldcat and after that use the function modules

'REUSE_ALV_LIST_DISPLAY' or ''REUSE_ALV_GRID_DISPLAY'.

9 REPLIES 9

Former Member
0 Kudos

Hi Julio,

Which fields its showing???

Have you given the complete list of fields in the above code?

Regards,

Saba

0 Kudos

Yes, its complet...

The fields it shows are:

0 | 1 |KUNNR

0 | 4 |VBELN

0 | 7 |INCO1

0 | 8 |SDABW

0 | 9 |ZEPC

0 | 12 |KWMENG

0 | 13 |GEWEI

0 | 14 |ETDAT

0 | 15 |ARBPL

0 | 21 |KZWI1

Former Member
0 Kudos

Hello

Try

i_program_name = sy-repid

KK07
Contributor
0 Kudos

Hi Julio,

if u are using all the fields of the table (as in the data dictionary) then go for that function module,

otherwise u can append those fields to fieldcat and after that use the function modules

'REUSE_ALV_LIST_DISPLAY' or ''REUSE_ALV_GRID_DISPLAY'.

0 Kudos

Yeah, maybe I will have to append the fields manually...

0 Kudos

No need to do manually..

Don;t use TYPE use LIKE Change all the fields Definition using LIKE instead of Type.

DATA: BEGIN OF it_datos occurs 0.

DATA: kunnr LIKE KNA1-kunnr,

subcu LIKE zsubc,

desti TYPE kunwe,

vbeln TYPE vbeln,

zterm TYPE dzterm,

dpp TYPE zdescpp,

inco1 TYPE inco1,

sdabw TYPE sdabw,

zepc TYPE zepc,

ntgewk TYPE ntgew_ap,

volumk TYPE volum_ap,

kwmeng LIKE vbap-kwmeng,

gewei TYPE gewei,

etdat TYPE etdat, "Fecha de envio

arbpl TYPE arbpl,

bwtar TYPE bwtar_d, " Calidad

tarbas TYPE ztar,

recacb TYPE zacb,

reccan TYPE zrct,

desper TYPE zdsp,

kzwi1 LIKE vbap-kzwi1,

dtoseg TYPE zdca,

dtocom TYPE zdto,

dtoinc TYPE zdin,

prcnet TYPE znet,

netoud TYPE znet,

dtorap TYPE zrap,

sbrcrt TYPE zscc,

sbrpal TYPE zscp,

sbrrpd TYPE zsrv,

ntgew TYPE ntgew_ap,

volum TYPE volum_ap,

DATA: END OF it_datos.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'IT_DATOS'

i_inclname = sy-repid

CHANGING

ct_fieldcat = gt_fieldcat[].

Former Member
0 Kudos

Hi Julio,

Use of the FM is to create the Field catalog automatically for the given structure...

Here from the code provided by you, it seems that your internal table used for data and Field catalog is having different fields.....

Here there are 2 possibilities:

1. include all the required fields into your Z-structure...

2. Append the entry for additional fields manually into field catalog table.

Regards,

Kunjal

Former Member
0 Kudos

Hi Julio,

Try declaring all the data in a separate include and pass the include name in the F.M:

i_inclname = '<Include_name>'.

Regards,

Saba

Former Member
0 Kudos

hi,

in this case make the field catalog manually like as shown below:

&---------------------------------------------------------------------*
*& Form        : display
*&---------------------------------------------------------------------*
*  decription  : to display data in given format
*----------------------------------------------------------------------*
* parameters   :  none
*----------------------------------------------------------------------*
FORM display .

  IF alv_list = 'X'.
    PERFORM build_fieldcat TABLES i_fieldcat[]
                           USING :
*-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
   'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
   'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
   'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
   'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.



    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
*        i_callback_pf_status_set = c_pf_status
        i_callback_user_command  = 'USER_COMMAND '
*        it_events                = t_alv_events[]
        it_fieldcat              = i_fieldcat[]
      TABLES
        t_outtab                 = t_itab1[]
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  ENDIF.

it will make a structure now to populate that structure use ALV GRID or ALV LIST display as shown above.

hope it will help you

regards

rahul

Edited by: RAHUL SHARMA on Sep 23, 2008 12:01 PM