Skip to Content

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

Report

HI all,

This is nagender,

this is an urgent reuirement.plz help me

i'm sending my samole code in this i want validate the values & where DELEG_STAT = ' ' i should need display NA(not appicable)

i don't know how to validate & write that condition.

TYPE-POOLS : SLIS.

TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,

USR21,ADR6, BUT000.

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

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

PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.

TYPES: BEGIN OF PROJECT ,

PROJECT_ID TYPE ZPROJECT_ID ,

SPR_PROJECT_ID TYPE ZSPR_PROJECT_ID ,

DEL_STATUS TYPE ZDELEG_STAT,

FLCB TYPE ZFLCB,

FLCL TYPE ZFLCL,

CIRCLE_ID TYPE ZCIRCLE_ID,

CIRCLE_DES TYPE ZCIRCLE_DESC,

NAME(40),

EMAIL_ID TYPE AD_SMTPADR,

CU_COUNT TYPE I,

PO_SHARE TYPE ZPO_VAL,

FLCB_NAME TYPE ZFLCB_NAME,

END OF PROJECT.

TYPES: BEGIN OF CFU_CU,

CU_PRJ_ID TYPE ZCU_PRJ_ID,

CFU_PRJ_ID TYPE ZCFU_PRJ_ID,

END OF CFU_CU.

DATA: IT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FIELD_CAT TYPE SLIS_FIELDCAT_ALV,

PG_NAME LIKE SY-REPID.

DATA: IT_PROJ TYPE TABLE OF PROJECT,

C TYPE SY-TABIX,

L_GUID TYPE BAPI_TS_GUID-PROJECT_DEFINITION_GUID,

PROJECT_NAME(40),

WA TYPE PROJECT.

DATA: IT_CFU_CU TYPE TABLE OF CFU_CU,

WA_CFU_CU TYPE CFU_CU.

DATA:CU_COUNT TYPE I.

CU_COUNT = 0.

SELECT APROJECT_ID ASPR_PROJECT_ID ADELEG_STAT AFLCB A~FLCL

B~CIRCLE_ID

B~CIRCLE_DESC

INTO TABLE IT_PROJ

FROM ZSCP_PROJECT AS A

INNER JOIN ZSCP_CIRCLE_M AS B

ON ACIRCLE_ID = BCIRCLE_ID

WHERE SPR_PROJECT_ID IN S_SPR_ID.

*IF DELEG_STAT EQ ' '.

  • WRITE : NA.

  • ENDIF.

LOOP AT IT_PROJ INTO WA.

C = SY-TABIX.

CALL FUNCTION 'CONVERSION_EXIT_DPRCE_INPUT'

EXPORTING

INPUT = WA-PROJECT_ID

IMPORTING

OUTPUT = L_GUID.

SELECT SINGLE TEXT1

FROM CGPL_TEXT

INTO PROJECT_NAME

WHERE GUID = L_GUID.

WA-NAME = PROJECT_NAME.

MODIFY IT_PROJ INDEX C FROM WA TRANSPORTING NAME.

CLEAR WA.

ENDLOOP.

WA_FIELD_CAT-COL_POS = 1.

WA_FIELD_CAT-FIELDNAME = 'PROJECT_ID '.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'C-PROJECT-ID'.

WA_FIELD_CAT-OUTPUTLEN = '24'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 2.

WA_FIELD_CAT-FIELDNAME = 'SPR_PROJECT_ID'.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'SPR-ID'.

WA_FIELD_CAT-OUTPUTLEN = '8'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 3.

WA_FIELD_CAT-FIELDNAME = 'NAME'.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'PROJECT NAME'.

WA_FIELD_CAT-OUTPUTLEN = '30'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 4.

WA_FIELD_CAT-FIELDNAME = 'CIRCLE_ID'.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'CIRCLE-ID'.

WA_FIELD_CAT-OUTPUTLEN = '10'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 5.

WA_FIELD_CAT-FIELDNAME = 'CIRCLE_DES'.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'CIRCLE DESCRIPTION'.

WA_FIELD_CAT-OUTPUTLEN = '20'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 6.

WA_FIELD_CAT-FIELDNAME = 'DEL_STATUS'.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'DELEGATION STATUS'.

WA_FIELD_CAT-OUTPUTLEN = '4'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 7.

WA_FIELD_CAT-FIELDNAME = 'FLCL '.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'FLCL'.

WA_FIELD_CAT-OUTPUTLEN = '20'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 8.

WA_FIELD_CAT-FIELDNAME = 'FLCB '.

WA_FIELD_CAT-TABNAME = 'IT_PROJ'.

WA_FIELD_CAT-SELTEXT_L = 'FLCB'.

WA_FIELD_CAT-OUTPUTLEN = '20'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 9.

WA_FIELD_CAT-FIELDNAME = 'CU_COUNT'.

WA_FIELD_CAT-TABNAME = 'IT_FINAL'.

WA_FIELD_CAT-SELTEXT_L = 'NO.OF CU'.

WA_FIELD_CAT-OUTPUTLEN = '5'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 10.

WA_FIELD_CAT-FIELDNAME = 'PO_VAL'.

WA_FIELD_CAT-TABNAME = 'IT_FINAL'.

WA_FIELD_CAT-SELTEXT_L = 'CU-PO SHARE'.

WA_FIELD_CAT-OUTPUTLEN = '10'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 11.

WA_FIELD_CAT-FIELDNAME = 'FLCB_NAME'.

WA_FIELD_CAT-TABNAME = 'IT_FINAL'.

WA_FIELD_CAT-SELTEXT_L = 'FLCB_NAME'.

WA_FIELD_CAT-OUTPUTLEN = '10'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

WA_FIELD_CAT-COL_POS = 12.

WA_FIELD_CAT-FIELDNAME = 'EMAIL_ID'.

WA_FIELD_CAT-TABNAME = 'IT_FINAL'.

WA_FIELD_CAT-SELTEXT_L = 'FLCL EMAIL ID'.

WA_FIELD_CAT-OUTPUTLEN = '30'.

WA_FIELD_CAT-KEY = 'X' .

APPEND WA_FIELD_CAT TO IT_FIELD_CAT.

CLEAR WA_FIELD_CAT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PG_NAME

IT_FIELDCAT = IT_FIELD_CAT[]

TABLES

T_OUTTAB = IT_PROJ

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.

&----


*& Form CU_COUNT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM CU_COUNT

USING

project_id TYPE zscp_project-project_id

CHANGING

cu_count.

cu_count = 0.

LOOP AT IT_CFU_CU INTO WA_CFU_CU WHERE CFU_PRJ_ID = project_id.

cu_count = cu_count + 1.

ENDLOOP.

CLEAR: WA_CFU_CU.

ENDFORM. " CU_COUNT

Tags:
Former Member

Helpful Answer

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