07-11-2011 10:51 AM
Hi Friends,
In coding i have make use of the Static Internal Table and not making use of the Field Symbols, As i had to Develop a ALV LIst which is having a Column ( Comment ) editable. Ii develop the same with making use of Field Symbol as well as Static Internal Table, so want to share with u all...
The Coding As Follows
PERFORM build_fieldcatalog USING:
'1' 'VBELN' 'LIKP' text-b01 'X' '',
'2' 'LFDAT' 'LIKP' text-b02 '' '',
'3' 'WADAT_IST' 'LIKP' text-b03 '' '',
'4' 'VKORG' 'LIKP' text-b04 '' '',
'5' 'KUNNR' 'LIKP' text-b06 '' '',
'6' 'KUNAG' 'LIKP' text-b07 '' '',
'7' 'COMMENT1' 'zsd_delivery_not' text-b08 '' 'X' .
FORM build_fieldcatalog USING col_pos TYPE i
fieldname TYPE c
tabname TYPE c
seltext_l TYPE c
key TYPE c
edit TYPE c.
wa_fc1-col_pos = col_pos.
wa_fc1-fieldname = fieldname .
wa_fc1-tabname = tabname.
wa_fc1-seltext_m = seltext_l.
wa_fc1-key = key.
wa_fc1-edit = edit.
APPEND wa_fc1 TO it_fieldcat. "Appending each column to
"table
"it_fldcat_basic for basic list
CLEAR wa_fc1.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
* i_structure_name = c_table
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = it_basic
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'CNG'.
gv_ucomm = 'CNG'.
gv_select = rs_selfield.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = '&REFRESH'
EXCEPTIONS
function_not_supported = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE 'Refersh Not performed' TYPE 'S'.
STOP.
ENDIF.
READ TABLE it_basic INTO wa_basic INDEX
rs_selfield-tabindex .
************************************************************************
* locking the customize table(zsd_delivery_not)
************************************************************************
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = c_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
"populating the zsd_delivery_not from workarea <dyn_ztable_wa>
MODIFY zsd_delivery_not FROM TABLE it_basic.
IF sy-subrc EQ 0.
MESSAGE 'DataBase Updated' TYPE 'S'.
ELSE.
MESSAGE 'DataBase Updatation Fail' TYPE 'E'.
ENDIF.
ENDIF.
************************************************************************
* release the lock from the customize table
************************************************************************
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = c_table.
Edited by: RameezSheikh-LnT on Jul 11, 2011 12:26 PM
Moderator Message: Please post the relevant portions of you code only! If possible try to elaborate the business/technical requirement you're trying to achieve.
Edited by: Suhas Saha on Jul 11, 2011 3:57 PM
Edited by: RameezSheikh-LnT on Jul 11, 2011 2:00 PM
07-11-2011 1:44 PM
07-12-2011 4:25 AM
hI vinod,
just want to share the coding and as i am a beginner, i thought SDN member can share coding in Forum ..
07-12-2011 5:28 AM
If you want to share the source code, better you post the same in [Wiki Stage|http://wiki.sdn.sap.com/wiki/display/stage/Home] where the Wiki moderators will review the content before moving to the respective area.
To know more about how contiribute, refer to the link : [How to contribute|]
Regards, Vinod
07-12-2011 5:33 AM
07-11-2011 2:04 PM
Marvelous...from the stone age of ALV (function modules), and not a field symbol in sight...don't understand your post.
07-12-2011 4:14 AM
hi DaveL,
I just want to share coding with others, so the post will help them . when i am searching for the "Edittable Alv", every where "Editable Alv" is Achieve by making use of "Field Symbols" and i Didn't want to make use of "Field Symbol". Is Something worng with the coding?
03-14-2014 4:53 AM
hi rameez...
Thnax a lot for this information...it helped me a lot....!!!!!!!!