Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Changes In Function Module

Hello abap Gurus,

My Zdevelopment reports shows the runtime errors due to

changes in this function module :-

ZCFM_HIDE_INITIALFIELD_ALV

So anybody pls. suggest me what i can do for this.I m attaching the coding also.

FUNCTION ZCFM_HIDE_INITIALFIELD_ALV.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(STRUC)

*" REFERENCE(FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV

*" REFERENCE(HIDE) OPTIONAL

*" EXPORTING

*" REFERENCE(FIELDCAT_E) TYPE SLIS_T_FIELDCAT_ALV

*" TABLES

*" IT_TAB

*" IT_TAB1

*"----


DATA S_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

FIELD-SYMBOLS <F1>.

FIELD-SYMBOLS <F2>.

DATA FIELDNAME(30).

DATA VALUE(100).

DATA : BEGIN OF DISPLAY OCCURS 0,

FIELDNAME LIKE DD03L-FIELDNAME,

END OF DISPLAY.

LOOP AT IT_TAB.

DO .

READ TABLE FIELDCAT INDEX SY-INDEX

INTO S_FIELDCAT.

IF SY-SUBRC NE 0.

EXIT.

ENDIF.

  • ASSIGN SY-INDEX OF STRUCTURE IT_TAB1 TO <F1>.

CONCATENATE 'IT_TAB-' S_FIELDCAT-FIELDNAME INTO

FIELDNAME.

ASSIGN (FIELDNAME) TO <F1>.

IF NOT <F1> IS INITIAL.

DISPLAY-FIELDNAME = S_FIELDCAT-FIELDNAME.

COLLECT DISPLAY.

ENDIF.

ENDDO.

ENDLOOP.

FIELDCAT_E = FIELDCAT.

LOOP AT FIELDCAT_E INTO S_FIELDCAT .

READ TABLE DISPLAY WITH KEY FIELDNAME = S_FIELDCAT-FIELDNAME.

IF SY-SUBRC NE 0.

IF HIDE IS INITIAL.

DELETE FIELDCAT_E.

ELSE.

S_FIELDCAT-NO_OUT = 'X'.

CLEAR S_FIELDCAT-KEY .

MODIFY FIELDCAT_E FROM S_FIELDCAT TRANSPORTING NO_OUT

KEY.

ENDIF.

ENDIF.

ENDLOOP.

endfunction.

Former Member
Not what you were looking for? View more on this topic or Ask a question