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

Query regarding ALV

Former Member
0 Likes
773

Hi all,

Please clarify this query of mine in ALV.

***Code:**

data : itab_data1 like standard table of zdetails1.

data: repid type syrepid.

data : fieldcat type slis_t_fieldcat_alv.

repid = sy-repid.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = repid

i_internal_tabname = 'itab_data1'

i_bypassing_buffer = 'X'

changing

ct_fieldcat = fieldcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

After the execution of the Function Module the fieldcat does not contain any rows .

Kindly explain me why the fieldcat does not contain any rows.

Please reply as fast as possible.

Regards,

Vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
753

Hi

Try like thi s

data : itab_data1 like standard table of zdetails1.
data: repid type syrepid.
data : fieldcat type slis_t_fieldcat_alv.


call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy_repid
i_internal_tabname = 'ITAB_DATA1'
i_bypassing_buffer = 'X'
changing
ct_fieldcat = fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.

check this sample one

 type-pools : slis.
 
data : begin of it_toto occurs 0 ,
         matnr type matnr ,
         maktx type maktx ,
       end   of it_toto ,
 
       it_fieldcatalog  type slis_t_fieldcat_alv.
 
 
 
 
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               = sy-repid
    I_INTERNAL_TABNAME           = 'IT_TOTO'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
    I_BYPASSING_BUFFER           = 'X'
*    I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fieldcatalog.
* 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.



Reward all helpfull answers

Regards

Pavan

7 REPLIES 7
Read only

Former Member
0 Likes
753

hi,

Change the repid type syrepid to r_repid type sy-repid

and where is u r select query..

Regards

suresh.d

null

Read only

Former Member
0 Likes
753

Use this code instead.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
I_STRUCTURE_NAME = 'ZDETAILS1'
i_bypassing_buffer = 'X'
changing
ct_fieldcat = fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

Former Member
0 Likes
753

Hi,

See how SAP uses:-

  • --- merge fieldcat from ddic structure ---

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = con_self

  • I_INTERNAL_TABNAME = PD_TABNAME_FIELDCAT

i_structure_name = pd_strucname_ddic

  • I_INCLNAME = LC_INCLUDENAME

CHANGING

ct_fieldcat = lt_fieldcat

EXCEPTIONS

OTHERS = 1.

Reward if useful!

Read only

Former Member
0 Likes
753

Hi Balasubramanian,

In the FM you need to pass the parameter

I_STRUCTURENAME with the ZStructure that you have created in the data dictionary. Then it will work.

Reward if answer is informatory.

Best Regards,

Ram.

Read only

0 Likes
753

Hi Bala,

Along with the I_STRUCTURE_NAME, also pass the I_INCLNAME = SY-REPID.

Reward points for useful answers.

Best Regards,

Ram.

Read only

Former Member
0 Likes
754

Hi

Try like thi s

data : itab_data1 like standard table of zdetails1.
data: repid type syrepid.
data : fieldcat type slis_t_fieldcat_alv.


call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy_repid
i_internal_tabname = 'ITAB_DATA1'
i_bypassing_buffer = 'X'
changing
ct_fieldcat = fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.

check this sample one

 type-pools : slis.
 
data : begin of it_toto occurs 0 ,
         matnr type matnr ,
         maktx type maktx ,
       end   of it_toto ,
 
       it_fieldcatalog  type slis_t_fieldcat_alv.
 
 
 
 
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               = sy-repid
    I_INTERNAL_TABNAME           = 'IT_TOTO'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
    I_BYPASSING_BUFFER           = 'X'
*    I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fieldcatalog.
* 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.



Reward all helpfull answers

Regards

Pavan

Read only

Former Member
0 Likes
753

HI,

do like this.

data : itab_data1 like standard table of zdetails1.

data: repid type syrepid.

data : fieldcat type slis_t_fieldcat_alv.

repid = sy-repid.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = repid

i_internal_tabname = <b>'ITAB_DATA1'</b>

i_bypassing_buffer = 'X'

changing

ct_fieldcat = fieldcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

rgds,

bharat.