Skip to Content

for the question raised from discussion

Re: Edit single row in list UIBB

Hi everyone someone raised question how to change the particular row content to editable on lead select so i worked on this and finally Mr.Jitin gave me an idea how can we achive this, i thought it may be helpful to everyone later so i created scenario for this.

SCENARIO:

 

/wp-content/uploads/2014/10/9_1_557567.jpg


WHEN I LOAD THE APPLICATION LIST GUIBB WILL DISPLAY THE DETAILS OF MATNR.WHEN WE CLICK ON CHECKBOX  FPM_GUIBB_LIST_ON_LEAD_SELECTI EVENT WILL BE TRIGGERED THEN THE PARTICULAR ROW WILL BE EDITABLE.

/wp-content/uploads/2014/10/9_2_557568.jpg

AFTER CHANGING THE VALUES WHEN YOU CLICK ON ENTER THEN FPM_GUIBB_LIST_CELL_ACTION IS TRIGGERED AND IT DISPLAYS THE SAVED DATA.( YOU CAN ADD CHECK CHANGE LOG INFORMATION THEN PROCEED WITH THIS ACTION IF CHANGES DONE OTHER WISE SIMPLY EXIT BUT IN THIS SCENARIO I DID NOT WRITTEN THAT CODE ).

/wp-content/uploads/2014/10/9_3_557569.jpg

NOW LET US START SCENARIO :

STEP1 : CREATE FEEDER CLASS

/wp-content/uploads/2014/10/1_557583.jpg

/wp-content/uploads/2014/10/2_557584.jpg

NOW GOTO INTERFACE TAB THEN ADD

IF_FPM_GUIBB_LIST(  IF_FPM_GUIBB AUTOMATICALLY ADDED ).

/wp-content/uploads/2014/10/3_557588.jpg

/wp-content/uploads/2014/10/4_557634.jpg

CODE IN METHOD IF_FPM_GUIBB_LIST~GET_DEFINITION:

data:
lt_field_description
type fpmgb_t_listfield_descr,
ls_field_description
type fpmgb_s_listfield_descr,
ls_action_definition
type fpmgb_s_actiondef,
lt_comp
type abap_component_tab,
ls_comp
type abap_componentdescr.

eo_field_catalog ?= cl_abap_tabledescr=>DESCRIBE_BY_DATA( lt_mara ).

ls_field_descriptionname = ‘MATNR’.
ls_field_description
text = ‘MATERIAL NUMBER’.
ls_field_description
read_only_ref = ‘MATNR_RO_REF’.
ls_field_description
visibility = cl_wd_uielement=>e_visiblevisible.
APPEND ls_field_description to lt_field_description.
ls_field_description
name = ‘MATNR_RO_REF’.
ls_field_description
text = ‘MATERIAL KEY’.
ls_field_description
visibility = cl_wd_uielement=>e_visiblevisible.
APPEND ls_field_description to lt_field_description.
ls_field_description
name = ‘MAKTX’.
ls_field_description
text = ‘MATERIAL DESCRIPTION’.
ls_field_description
read_only_ref = ‘MAKTX_RO_REF’.
ls_field_description
visibility = cl_wd_uielement=>e_visiblevisible.
APPEND ls_field_description to lt_field_description.
ls_field_description
name = ‘MAKTX_RO_REF’.
ls_field_description
text = ‘DESCRIPTION KEY’.
ls_field_description
visibility = cl_wd_uielement=>e_visiblevisible.
APPEND ls_field_description to lt_field_description.

et_field_description = lt_field_description.

ls_action_definitionid = IF_FPM_GUIBB_LIST=>GC_FPM_EVENT_ON_LEAD_SEL.
ls_action_definition
text = ‘ON LEAD SELECT’.
ls_action_definition
visible = cl_wd_uielement=>e_visiblevisible.
APPEND ls_action_definition to et_action_definition.


CODE IN METHOD IF_FPM_GUIBB_LIST~GET_DATA :

   data:ls_fieldusage type fpmgb_s_fieldusage,
lt_fieldusage
type fpmgb_t_fieldusage,
lo_fpm
type REF TO if_fpm.

IF IV_EVENTID->MV_EVENT_ID = ‘FPM_START’.
data:ls_mara like LINE OF lt_mara.

SELECT MATNR MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF TABLE LT_MARA WHERE SPRAS = ‘EN’.
loop at lt_mara into ls_mara.
ls_mara
matnr_ro_ref = ‘X’.
ls_mara
maktx_ro_ref = ‘X’.
MODIFY lt_mara from ls_mara.
clear:ls_mara.
endloop.
CT_DATA
= LT_MARA.
EV_DATA_CHANGED
= abap_true.
ELSEIF IV_EVENTID->MV_EVENT_ID = IF_FPM_GUIBB_LIST=>GC_FPM_EVENT_ON_LEAD_SEL.
REFRESH LT_MARA.
LT_MARA
= CT_DATA.
READ TABLE LT_MARA INTO LS_MARA INDEX CV_LEAD_INDEX.
LS_MARA
MATNR_RO_REF = ‘ ‘.
LS_MARA
MAKTX_RO_REF = ‘ ‘.
MODIFY LT_MARA FROM LS_MARA INDEX CV_LEAD_INDEX.

CT_DATA LT_MARA.
EV_DATA_CHANGED
= abap_true.
ELSEIF IV_EVENTID->MV_EVENT_ID = IF_FPM_GUIBB_LIST=>GC_GUIBB_LIST_ON_CELL_ACTION.
DATA:WA_MARA TYPE MAKT.
REFRESH LT_MARA.
LT_MARA
= CT_DATA.
READ TABLE LT_MARA INTO LS_MARA INDEX CV_LEAD_INDEX.
SELECT SINGLE * FROM MAKT INTO WA_MARA WHERE MATNR = LS_MARAMATNR AND SPRAS = SYLANGU.
IF SYSUBRC = 0.
WA_MARA
MAKTX = LS_MARAMAKTX.
UPDATE MAKT SET MAKTX = WA_MARAMAKTX WHERE MATNR = LS_MARAMATNR AND SPRAS = SYLANGU.
ELSE.
WA_MARA
MANDT = SYMANDT.
WA_MARA
MATNR = LS_MARAMATNR.
WA_MARA
SPRAS = SYLANGU.
WA_MARA
MAKTX = LS_MARAMAKTX.
WA_MARA
MAKTG = LS_MARAMAKTX.
INSERT MAKT FROM WA_MARA.
ENDIF.
lo_fpm
= cl_fpm_factory=>get_instance( ).
lo_fpm
->RAISE_EVENT_BY_ID( iv_event_id = ‘FPM_START’).
ENDIF.


STEP2: CREATE EMPTY WEBDYNPRO COMPONENT


/wp-content/uploads/2014/10/5_557590.jpg


NOW CREATE APPLICATION

   COMPONENT : FPM_OIF_COMPONENT.

   WINDOW       : FPM_WINDOW

   PLUG:   DEFAULT

/wp-content/uploads/2014/10/5_1_557639.jpg

STEP3: CONFIGURATION

  NOTE: WHILE DOING THE CONFIGURATION PARAMETER_LIST,INITIALIZATION,GET_DEFINITION WILL EXICUTE

             SO IF ANY CODE IN THOSE METHODS APPLICATION GOES TO DUMP.

/wp-content/uploads/2014/10/6_557640.jpg

/wp-content/uploads/2014/10/7_557641.jpg

NOW ENTER THE FEEDER CLASS NAME IF PARAMETERS ARE NOT DEFINED THEN IT WILL SHOW SOME SUSSES MESSAGE

/wp-content/uploads/2014/10/7_1_557642.jpg

ENTER THE FOLLOWING VALUES AS MENTIONED IN THE RECTANGULAR BOX ,NEXT MAINTAIN THE DISPLAY TYPE AS INPUTFIELD AS SHOWN BELOW,AND ONLY ADD MATNR,MAKTX FIELDS.CLICK ON THE LEAD SELECTION ACTION ASSIGNMENT  AS SHOWN BELOW THEN SELECT THE STANDARD LEAD SELECTION THEN EVENT FPM_GUIBB_LIST_ON_LEAD_SELECTI WILL BE TRIGGERED AUTOMATICALLY.


/wp-content/uploads/2014/10/8_557644.jpg


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply