Skip to Content

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

pls help me this is an urgent requirement on ALV GRID

Hi all

Here i am sendig my requirement pls help me on coding ..

Report Assignment For ELTPs:

Selection criteria :

Circle id : Select option without interval and mandatory

SPR Id : Select option without interval

Project Status : Parameter

Output required in ALV Grid format with the below structure :

cProjects ID SPR ID Project Name Circle ID Circle Description Delegation Status No. of CU Projects CU-PO Share FLCB FLCB

NAME FLCL ID FLCL Name FLCL Email ID

1232007

1230

ABCD No 0

1242007

1240

ABCD Partial 2

1112007

1241

XYZ

2222007

1242

WXY

1252007

1250

EFGH Full 1

3332007

1251

DEF

Requirement :

1. The report should list all the CFU projects and the corresponding CU projects circle wise based on the circles entered on the selection screen and which have the SPR ids and Project status on the selection screen.

2. If SPR id or Project status is not entered then all the projects to be considered for the given circle/s.

3. It should display the details of the CFU project first. The corresponding CU projects should be listed below that CFU project in the successive rows.

4. For example, project 1232007 is a CFU project which does not have any CU under it. Hence, another CFU project 1242007 is displayed in the second row. It has 2 CU projects under it. The details of those two CU projects are displayed in the 3rd and 4th rows.

5. Total share given to the CU circle (by adding different PO shares to that circle in that project) by the CFU project should be displayed in the field ‘CU-PO Share’.

6. For CU projects, the fields ‘Delegation Status’, ‘No. of CU projects’ and ‘CU-PO share’ should be space.

7. FLCB, FLCL ID, FLCL name and FLCL email need to given for all the projects in all the rows.

Tables to be referred: ZSCP_PROJECT, ZSCP_CIRCLE_M, ZSCP_PJ_CL_PO_MP, ZSCP_PRJ_LINK, USR21,

ADR6, BUT000,CGPL_TEXT.

[<b>b]Here i done the coding the but the error showing that field catolog is not found..

pls check this and kindly send the code .....</b></b>

REPORT Z_64328_TEST .

TYPE-POOLS : SLIS.

TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,

USR21,ADR6, BUT000.

SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.

SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.

PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.

DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,

CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,

G_REPID TYPE SY-REPID,

TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,

HEADER_ALV1 TYPE SLIS_T_LISTHEADER,

HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,

GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,

GS_KEYINFO TYPE SLIS_KEYINFO_ALV.

DATA : SPRID TYPE ZSPR_PROJECT_ID.

DATA : CID TYPE ZCIRCLE_ID.

DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.

DATA : WA TYPE ZSCP_PROJECT.

DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.

DATA : WA1 TYPE ZSCP_CIRCLE_M.

SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.

SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.

*

LOOP AT ITAB INTO WA.

READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.

WRITE : WA1-CIRCLE_DESC.

WRITE : WA-CIRCLE_ID,

WA-PROJECT_ID,

WA-DELEG_STAT,

WA-PRJ_STAT,

WA-FLCB,

WA-FLCL.

ENDLOOP.

*PERFORM FIELD_CATALOG1.

PERFORM alv_display1.

FORM FIELD_CATALOG1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'FLCB'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'FLCB1'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'FLCL'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'FLCL1'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

ENDFORM. "END CATALOG1.

FORM ALV_DISPLAY1.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = GS_LAYOUT1

IT_FIELDCAT = CT_FIELDCAT1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT = GT_SORT[]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = 'A '

TABLES

T_OUTTAB = ITAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ENDFORM.

Thanks and regards

Nagendra Kumar

Tags:
Former Member
Former Member replied

hi nagendra,

go through this code.

TYPE-POOLS : SLIS.

TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,

USR21,ADR6, BUT000.

SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.

SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.

PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.

DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,

CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,

G_REPID TYPE SY-REPID,

TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,

HEADER_ALV1 TYPE SLIS_T_LISTHEADER,

HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,

GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,

GS_KEYINFO TYPE SLIS_KEYINFO_ALV.

DATA : SPRID TYPE ZSPR_PROJECT_ID.

DATA : CID TYPE ZCIRCLE_ID.

DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.

DATA : WA TYPE ZSCP_PROJECT.

DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.

DATA : WA1 TYPE ZSCP_CIRCLE_M.

SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.

SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.

LOOP AT ITAB INTO WA.

READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.

WRITE : WA1-CIRCLE_DESC.

WRITE : WA-CIRCLE_ID,

WA-PROJECT_ID,

WA-DELEG_STAT,

WA-PRJ_STAT,

WA-FLCB,

WA-FLCL.

ENDLOOP.

PERFORM FIELD_CATALOG1.

PERFORM alv_display1.

FORM FIELD_CATALOG1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'FLCB'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'FLCB1'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

CLEAR TEMP_CAT1.

TEMP_CAT1-TABNAME = 'ITAB'.

TEMP_CAT1-FIELDNAME = 'FLCL'.

TEMP_CAT1-KEY = 'X'.

TEMP_CAT1-SELTEXT_M = 'FLCL1'.

TEMP_CAT1-OUTPUTLEN = 10.

APPEND TEMP_CAT1 TO CT_FIELDCAT1.

ENDFORM. "END CATALOG1.

FORM ALV_DISPLAY1.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = GS_LAYOUT1

IT_FIELDCAT = CT_FIELDCAT1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT = GT_SORT[]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = 'A '

TABLES

T_OUTTAB = ITAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ENDFORM.

<b>please reward points if helpfull.</b>

with regards,

radhika kolluru.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question