Skip to Content
author's profile photo Former Member
Former Member

function reuse_alv_fieldcatalog_merge

hi evryone,

I have been trying to use the function module reuse_alv_fieldcatalog_merge, but iam facing some problem with it.

can anybody tell me how to use it or if possible any small piece of code that can help.

the way iam trying to use it as follows

the internal table is i_del.

data s_fieldcat type slis_t_fieldcat_alv with header line. "declaring the field catalog

DATA REPNAME LIKE SY-REPID.

form zf_build_catalog .

data l_fieldcat type slis_fieldcat_alv.

REPNAME = SY-REPID.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = REPNAME

I_INTERNAL_TABNAME = 'I_DEL'

I_STRUCTURE_NAME = l_fieldcat

I_CLIENT_NEVER_DISPLAY = 'X'

  • I_INCLNAME =

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = S_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at s_fieldcat into l_fieldcat.

case s_fieldcat-fieldname.

when 'VBELN'.

l_fieldcat-outputlen = 20.

l_fieldcat-seltext_l = 'Delivery'.

modify s_fieldcat from l_fieldcat.

when 'LFART'.

l_fieldcat-outputlen = 20.

l_fieldcat-seltext_l = 'Delivery Type'.

modify s_fieldcat from l_fieldcat.

when 'LFDAT'.

l_fieldcat-outputlen = 20.

l_fieldcat-seltext_l = 'Delivery Date'.

modify s_fieldcat from l_fieldcat.

when 'POSNR'.

l_fieldcat-outputlen = 20.

l_fieldcat-seltext_l = 'Item'.

modify s_fieldcat from l_fieldcat.

when 'MATNR'.

l_fieldcat-outputlen = 20.

l_fieldcat-seltext_l = 'Material'.

modify s_fieldcat from l_fieldcat.

endcase.

endloop.

endform. " zf_build_catalog

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2005 at 06:40 AM

    Hi Varun,

    In the parameter I_STRUCTURE_NAME, you are passing a field catalog, which is incorrect. It should be something like 'EKKO' or 'SCARR'. Is it a custom structure ? Have you maintained/created this custom structure in database(SE11) ?

    Usually, merging of field-catalogs is done in programs where a hierarchy is to be displayed. Look at this program <b>BALVHD01</b> or even better do a WHERE-USED-LIST for the function module and you might find a better program.

    Regards,

    Subramanian V.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2005 at 07:00 AM

    Hi Subramanian,

    Thank you for the solution i'll try this one out and let u know if any issues.

    regards

    Varun

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Varun,

      In one of youe earlier posts, you have called the FM with the parameter I_INTERNAL_TABNAME as 'I_DATA'.

      But in your data declaration, you have declared the internal table as I_DATA1.

      Is that still the case ? If it is not, then you will have to give the <i>entire</i> code.

      Regards,

      Anand Mandalika.

      P.S. Don't forget to click the yellow star !!

  • Posted on Jan 27, 2005 at 08:27 AM

    Hello Varun,

    table structure of 'working' example is flat: just a list of fields.

    Your table structure contains some fields and a table celcol (because slis_t_specialcol_alv defines a table). If you want to include the fields, use slis_specialcol_alv.

    Rgds,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Serdar Simsekler

      Hi Varun,

      I m giving u the perfect solution. I m damn sure it will work becuase i faced the same problem.

      First of all don't change your table def. keep as it is means like described below...

      data : begin of itab_f occurs 0,

      field1 like tb-field1,

      field2 like tb-field2,

      ......

      end of itab_f.

      check your field catalog that u r passing to function. You have declared it with header line remove that and simply declare as i have.

      data : CT_FIELDCAT type SLIS_T_FIELDCAT_ALV.

      now u want to modify your field catalog so it will not allow u to directly loop at CT_FIELDCAT... U have to define work area as i have defined.

      TEMP_CAT type SLIS_FIELDCAT_ALV.

      no need to pass I_STRUCTURE_NAME....

      Just refer this function call.....

      call function 'REUSE_ALV_FIELDCATALOG_MERGE'

      exporting

      I_PROGRAM_NAME = G_REPID

      I_INTERNAL_TABNAME = 'ITAB_F'

      • I_STRUCTURE_NAME =

      • I_CLIENT_NEVER_DISPLAY = 'X'

      I_INCLNAME = G_REPID

      • I_BYPASSING_BUFFER = 'X'

      • I_BUFFER_ACTIVE = ' '

      changing

      CT_FIELDCAT = CT_FIELDCAT

      exceptions

      INCONSISTENT_INTERFACE = 1

      PROGRAM_ERROR = 2

      others = 3.

      now changing the field catalog....

      loop at CT_FIELDCAT into TEMP_CAT.

      case TEMP_CAT-FIELDNAME.

      when 'field1'.

      TEMP_CAT-SELTEXT_M = 'ACCOUNT NO.'.

      TEMP_CAT-OUTPUTLEN = 16.

      .......

      endcase.

      modify CT_FIELDCAT from TEMP_CAT.

      endloop.

      -


      If it works than give point...

      And i m sure it will work

      Regards,

      Sagar

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.