10-31-2007 2:17 AM
Hi Experts
I want to modify a code by displaying CDPOS-CHNGIND = 'EDIT' if
CDPOS-CHNGIND ='E' . U as Update, I as Insert , D as delete.
It is displying in my ALV grid as U,I,E,D in the type
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'CHNGIND'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'CHNGIND'.
st_fieldcat-row_pos = '6'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
regards
10-31-2007 2:21 AM
Hi,
Check this code:
CASE CDPOS-CHANGIND.
WHEN 'E'.
CDPOS-CHANGIND = 'EDIT'
WHEN 'U'.
CDPOS-CHANGIND = 'Update'
WHEN 'I'.
CDPOS-CHANGIND = 'Insert'
WHEN 'D'.
CDPOS-CHANGIND = 'Delete'
ENDCASE.
Here i am changing the CDPOS-CHANGIND value. Make sure that CDPOS-CHANGIND length is sufficient to hold above strings.
Hope this helps.
ashish
Message was edited by:
Ashish Gundawar
10-31-2007 2:21 AM
Hi,
Check this code:
CASE CDPOS-CHANGIND.
WHEN 'E'.
CDPOS-CHANGIND = 'EDIT'
WHEN 'U'.
CDPOS-CHANGIND = 'Update'
WHEN 'I'.
CDPOS-CHANGIND = 'Insert'
WHEN 'D'.
CDPOS-CHANGIND = 'Delete'
ENDCASE.
Here i am changing the CDPOS-CHANGIND value. Make sure that CDPOS-CHANGIND length is sufficient to hold above strings.
Hope this helps.
ashish
Message was edited by:
Ashish Gundawar
10-31-2007 2:29 AM
Hi Ashish
When I enter your case statement it is displaying as
Field When is unknown it is neither in one of the speicified tables nor defined by DATA statement, where to declare this statement
regards
Piroz
10-31-2007 2:32 AM
You need to use internal table field reference in CASE statement
I think your internal table is PA_IT_MERGED and field is CHANGEIND.
So it will be CASE pa_it_merged-changeind.
ashish
10-31-2007 2:33 AM
CASE CDPOS-CHANGIND.
WHEN 'E'.
CDPOS-CHANGIND = 'EDIT' .
WHEN 'U'.
CDPOS-CHANGIND = 'Update' .
WHEN 'I'.
CDPOS-CHANGIND = 'Insert' .
WHEN 'D'.
CDPOS-CHANGIND = 'Delete' .
ENDCASE.
Hi It was missing dots after each line
regards
Nishant
10-31-2007 2:54 AM
10-31-2007 2:54 AM