2007 May 04 6:10 AM
Hi abap gurus,
I have a requirement where I have fields VBUK-CMGST and VBUK-SPSTG in my display but now I want their descriptions to come beside them as one more field in ALV display ...
Please can any one suggest me the approach !!
Its an urgentrequirement !
Regards,
ArGz
2007 May 04 6:12 AM
in your itab which you are passing to alv declare the description fields and fill the data in that.
in fieldcatalog just add those two fields .
regards
shiba dutta
Hi abap gurus,
I have a requirement where I have fields VBUK-CMGST and VBUK-SPSTG in my display but now I want their descriptions to come beside them as one more field in ALV display ...
Please can any one suggest me the approach !!
Its an urgentrequirement !
Regards,
ArGz
2007 May 04 6:12 AM
in your itab which you are passing to alv declare the description fields and fill the data in that.
in fieldcatalog just add those two fields .
regards
shiba dutta
2007 May 04 6:12 AM
Hi
Use Reference Field and Refernce Table mapping while populating the data into Field Catalog.
Regards,
Sreeram
2007 May 04 6:13 AM
Hi raghu,
check the logic
DATA: ls_celltab TYPE lvc_s_styl.
REFRESH pt_celltab.
IF p_mode EQ text-103.
*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
to status "editable".
ls_celltab-fieldname = c_character1.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
regards
2007 May 04 6:14 AM
Hi
Take the values of thedescriptions from the Domains/ related tables for the fields
VBUK-CMGST and VBUK-SPSTG
Use the table DD07L, write a select and get the descriptions
for CMGST values
Credit check was not executed/Status not set
A Credit check was executed, document OK
B Credit check was executed, document not OK
C Credit check was executed, document not OK, partial release
D Document released by credit representative
SPSTG values
Not Relevant
A Not yet processed
B Partially processed
C Completely processed
and add them to the field catalog and display
Reward points if useful
Regards
Anji
2007 May 04 6:15 AM
Hi Raghvender,
populate descriptions of those fields into ur internal table using select query and append those fields in ur fieldcat also.
Reward points if helpful.
Regards,
Hemant
2007 May 04 6:20 AM
Raghavendra,
All the bolded ones to add new fields to the existing alv strcuture
&----
*& Report ZALVCHK *
*& *
&----
*& *
*& *
&----
REPORT ZALVCHK NO STANDARD PAGE HEADING.
TYPE-POOLS:SLIS. .
tables makt.
data: begin of imakt occurs 0,
matnr like makt-matnr,
spras like makt-spras,
maktx like makt-maktx,
maktg like makt-maktg,
chk,
end of imakt.
data:itfieldcat type slis_t_fieldcat_alv.
<b>data:itfieldcat1 TYPE slis_fieldcat_alv.</b>
data:itrepid like sy-repid.
itrepid = sy-repid.
data:itheader type slis_t_listheader.
data:itlist type slis_listheader.
data:top type slis_formname.
data:itevent type slis_t_event.
data:tmpevent type slis_alv_event.
START-OF-SELECTION.
select matnr spras maktx maktg from makt
into table imakt
where spras = sy-langu.
<b>clear ITFIELDCAT1.
ITFIELDCAT1-fieldname = 'CHECK'.
ITFIELDCAT1-TABNAME = 'IMAKT'.
ITFIELDCAT1-seltext_m = 'Check'.
ITFIELDCAT1-checkbox = 'X'.
ITFIELDCAT1-outputlen = '5'.
ITFIELDCAT1-col_pos = '1'.
ITFIELDCAT1-input = 'X'.
ITFIELDCAT1-edit = 'X'.
append ITFIELDCAT1 to ITFIELDCAT.
*clear ITFIELDCAT1.
*ITFIELDCAT1-fieldname = 'MATNR'.
*ITFIELDCAT1-seltext_m = 'MATNR'.
*ITFIELDCAT1-outputlen = '18'.
*ITFIELDCAT1-col_pos = '2'.
*ITFIELDCAT1-input = 'X'.
*append ITFIELDCAT1 to ITFIELDCAT.
*clear ITFIELDCAT1.
*ITFIELDCAT1-fieldname = 'SPRAS'.
*ITFIELDCAT1-seltext_m = 'SPRAS'.
*ITFIELDCAT1-outputlen = '5'.
*ITFIELDCAT1-col_pos = '3'.
*ITFIELDCAT1-input = 'X'.
*append ITFIELDCAT1 to ITFIELDCAT.
*clear ITFIELDCAT1.
*ITFIELDCAT1-fieldname = 'MAKTX'.
*ITFIELDCAT1-seltext_m = 'MAKTX'.
*ITFIELDCAT1-outputlen = '40'.
*ITFIELDCAT1-col_pos = '4'.
*ITFIELDCAT1-input = 'X'.
*append ITFIELDCAT1 to ITFIELDCAT.
*clear ITFIELDCAT1.
*ITFIELDCAT1-fieldname = 'MAKTG'.
*ITFIELDCAT1-seltext_m = 'MAKTG'.
*ITFIELDCAT1-outputlen = '40'.
*ITFIELDCAT1-col_pos = '5'.
*ITFIELDCAT1-input = 'X'.
*append ITFIELDCAT1 to ITFIELDCAT.</b>
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = ITEVENT
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
.
*READ TABLE itevent WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO tmpevent.
*IF SY-SUBRC = 0.
MOVE TOP TO TMPEVENT.
APPEND TMPEVENT TO itEVENT.
ENDIF.
CLEAR itlist.
itlist-TYP = 'H'.
itlist-INFO = 'SAPIEN' .
APPEND ITLIST TO ITHEADER.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = ITREPID
I_INTERNAL_TABNAME = 'IMAKT'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = ITREPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = ITFIELDCAT[]
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.
.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ITREPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'MAKT'
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = ITFIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = ITEVENT[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IMAKT
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 TOP.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = ITHEADER.
ENDFORM.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |