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

feild catalog

Former Member
0 Likes
410

how to generate a feild catalog

3 REPLIES 3
Read only

Former Member
0 Likes
387

Hi,

Use function module <b>REUSE_ALV_FIELDCATALOG_MERGE</b> to crate a field catalog.

CALL FUNCTION <i><b>'REUSE_ALV_FIELDCATALOG_MERGE'</b></i>

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'IT_FINAL'

I_INCLNAME = G_REPID

CHANGING

CT_FIELDCAT = DT_FLDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

Please use BCALV with F4 help to view some example on ALV using transaction code SE38.

<b>Plz mark all helpful answers and close the thread.</b>

Thanks,

Vinay

Read only

rahulkavuri
Active Contributor
0 Likes
387

this is how we do it in case u want to set your own field catalog along with some properties defined for it

Award points if found helpful

DATA: BEGIN OF IT_FINAL OCCURS 0,

LIFNR LIKE LFB1-LIFNR, "Account Number of Vendor

BUKRS LIKE LFB1-BUKRS, "COMP CODE

END OF IT_FINAL.

*WORK AREAS DEFINED FOR ALV'S

DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

X_FIELDCAT-FIELDNAME = 'LIFNR'.

X_FIELDCAT-TABNAME = 'IT_FINAL'.

X_FIELDCAT-SELTEXT_L = 'VENDOR'.

X_FIELDCAT-NO_ZERO = 'X'.

X_FIELDCAT-OUTPUTLEN = 10.

X_FIELDCAT-COL_POS = 1.

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'BUKRS'.

X_FIELDCAT-TABNAME = 'IT_FINAL'.

X_FIELDCAT-SELTEXT_L = 'COMPANY'.

X_FIELDCAT-NO_ZERO = 'X'.

X_FIELDCAT-OUTPUTLEN = 4.

X_FIELDCAT-COL_POS = 2.

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'IT_FINAL'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = IT_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.

Read only

Former Member
0 Likes
387

Darshdeep,

I understand this is for the ALV report requirment that you have...

Go through this link...read and this will help you understand the process....then refer to my reply for you earlier query...

http://help.sap.com/saphelp_erp2004/helpdata/en/8e/5dc9bee10111d2b47e006094192fe3/content.htm

Thanks,

Ketan.

Pls Award Points if you are findiing the answers useful.