2015 Jan 15 6:07 AM
DATA: BEGIN OF GT_ZKOTG603 OCCURS 0,
FNAME(100),
LNAME(100),
MANDT LIKE ZKOTG603-MANDT,
KAPPL LIKE ZKOTG603-KAPPL,
KSCHL LIKE ZKOTG603-KSCHL,
VKORG LIKE ZKOTG603-VKORG,
VTWEG LIKE ZKOTG603-VTWEG,
KUNNR LIKE ZKOTG603-KUNNR,
ZZSPART LIKE ZKOTG603-ZZSPART,
DATBI LIKE ZKOTG603-DATBI,
DATAB LIKE ZKOTG603-DATAB,
END OF GT_ZKOTG603.
DATA : "GT_zkotg603 TYPE STANDARD TABLE OF TY_TABLE WITH HEADER LINE,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GV_REPID1 LIKE TRDIR-NAME,
GV_REPID LIKE SY-REPID.
PARAMETERS : S_KUNNR LIKE ZKOTG603-KUNNR,
S_VKORG LIKE ZKOTG603-VKORG,
S_VTWEG LIKE ZKOTG603-VTWEG,
S_ZZSPAT LIKE ZKOTG603-ZZSPART.
GT_ZKOTG603-FNAME = 'DARSHAN'.
GT_ZKOTG603-LNAME = 'PANCHAL'.
SELECT * FROM ZKOTG603
WHERE KUNNR = S_KUNNR
AND VKORG = S_VKORG
AND VTWEG = S_VTWEG.
* AND ZZSPART = S_ZZSPAT.
IF SY-SUBRC = 0.
GT_ZKOTG603-KSCHL = ZKOTG603-KSCHL .
GT_ZKOTG603-ZZSPART = ZKOTG603-ZZSPART.
GT_ZKOTG603-VKORG = 'ABCD'.
GT_ZKOTG603-VTWEG = 'XYZ'.
APPEND GT_ZKOTG603.
ENDIF.
ENDSELECT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GV_REPID
I_INTERNAL_TABNAME = 'GT_ZKOTG603'
* I_STRUCTURE_NAME = 'TY_TABLE'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = GV_REPID1
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = GT_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.
2015 Jan 15 6:23 AM
Hi Darshan,
Use the following code.
"Program Name
GV_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GV_REPID
I_INTERNAL_TABNAME = 'GT_ZKOTG603'
I_INCLNAME = GV_REPID
I_BYPASSING_BUFFER = 'X'
CHANGING
CT_FIELDCAT = GT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
Kindly check whether the Field catalog is generating, else check the SY-SUBRC value, that lead us to know the exception.
Regards
Rajkumar Narasimman
Hi Darshan,
Please check that the whether field cat is building or no that in debugging.
Pass the structure name also in the Function module.
With Regards
Arun VS
2015 Jan 15 6:19 AM
2015 Jan 15 6:24 AM
yes,
sy-subrc = 1
SY-MSGID :- 0K
SY-MSGTY :- A
SY-MSGNO : - 530
Field catalog not found
2015 Jan 15 6:31 AM
2015 Jan 15 6:23 AM
Hi Darshan,
Use the following code.
"Program Name
GV_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GV_REPID
I_INTERNAL_TABNAME = 'GT_ZKOTG603'
I_INCLNAME = GV_REPID
I_BYPASSING_BUFFER = 'X'
CHANGING
CT_FIELDCAT = GT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
Kindly check whether the Field catalog is generating, else check the SY-SUBRC value, that lead us to know the exception.
Regards
Rajkumar Narasimman
2015 Jan 15 6:31 AM
HI Rajkumar ,
Did the same but its not working..
Field catalog is not creating...
sy-subrc = 1
SY-MSGID :- 0K
SY-MSGTY :- A
SY-MSGNO : - 530
Field catalog not found...
2015 Jan 15 6:52 AM
Hi Darshan,
Try to use below code.
data: lv_internal_tale type SLIS_TABNAME value 'GT_ZKOTG603'.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = lv_internal_table
i_inclname = sy-repid
changing
ct_fieldcat = GT_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.
reagrds.
Praveer.
2015 Jan 15 6:36 AM
Hi Darshan,
Please check that the whether field cat is building or no that in debugging.
Pass the structure name also in the Function module.
With Regards
Arun VS
2015 Jan 15 7:03 AM
I am checking in debugger,,
field catalogue is not creating..
2015 Jan 15 7:12 AM
Hi Darshan,
Can you pass the structure name to the function module and check it.
With Regards
Arun VS
2015 Jan 15 7:11 AM
Hi Darshan,
You need to define below fields with Like instead as below. I am not sure what exactly you need to populate in these fields.
FNAME(100),
LNAME(100),
2015 Jan 15 7:14 AM
Hi Darshan,
The structure name you are passing must be created in SE11. In your case TY_TABLE must be present in Data dictionary. Try and create it in data dictionary using SE11 Tocde and check it.
Hope this will help you.
Regards,
Sneha.
2015 Jan 15 7:15 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |