on 05-06-2015 7:49 AM
Hi all,
I am trying to create a button in a list uibb, that adds a new line to an existing list. I am doing this in the lean sales order web dynpro application using class CL_LO_OIF_GUIBB_ITEM_LIST. I can get the additional line if i implement an enhancement in the flush and just "piggyback" on an existing change in the context. However if i click my button and try to call the flush method, then my coding isn't working. I tried to trigger a new event loop but then my changes are gone.
I tried to trigger a new event loop that catches the flush method. However my enhancement isn't being caught as there is a return statement that are being executed before this.
As i see it i can modify the class, which i would prefer not to do.
Is there any way to manipulate the context of the web dynpro uibb through an interface or something like that?
I would appreciate any help i can get.
Kind regards Jakob
Jakob,
We had a similar development to add a line item to the sales order , we added a button to open popup to enter the article and we used following code to add the line item on enter action. Please check if this might work for you ?
DATA: LO_MODEL TYPE REF TO CL_LO_OIF_MODEL.
DATA: LV_HANDLE TYPE GUID_32,
LT_OBJINST TYPE TDT_OBJINST,
LS_OBJINST TYPE TDS_OBJINST.
* GET THE MODEL
LO_MODEL = CL_LO_OIF_MODEL=>GET_MODEL( ).
IF LV_MATERIAL IS NOT INITIAL.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
EV_GUID_32 = LV_HANDLE.
LS_OBJINST-OBJECT_ID = CL_LORD_CO=>SC_OT_ITEM.
LS_OBJINST-HANDLE = LV_HANDLE.
INSERT LS_OBJINST INTO TABLE LT_OBJINST.
LS_ITEM_COMV-HANDLE = LV_HANDLE.
LS_ITEM_COMV-MABNR = LV_MATERIAL.
LS_ITEM_COMV-KWMENG = '1'.
APPEND LS_ITEM_COMV TO LT_ITEM_COMV.
LS_ITEM_COMX-HANDLE = LV_HANDLE.
LS_ITEM_COMX-MABNR = 'X'.
LS_ITEM_COMX-KWMENG = 'X'.
LS_ITEM_COMX-ZZPACKAGE_PRICE = 'X'.
APPEND LS_ITEM_COMX TO LT_ITEM_COMX.
CALL METHOD LO_MODEL->REGISTER_CHANGES
EXPORTING
IT_OBJINST = LT_OBJINST
IT_ITEM_COMV = LT_ITEM_COMV
IT_ITEM_COMX = LT_ITEM_COMX.
* construct fpm event on enter
DATA: LO_FPM_EVT TYPE REF TO CL_FPM_EVENT,
LO_FPM TYPE REF TO IF_FPM.
LO_FPM_EVT = CL_FPM_EVENT=>CREATE_BY_ID( 'FPM_GUIBB_LIST_CELL_ACTION' ).
LO_FPM = LO_MODEL->GET_FPM_API( ).
LO_FPM->RAISE_EVENT( LO_FPM_EVT ).
LO_FPM_EVT = CL_FPM_EVENT=>CREATE_BY_ID( LO_MODEL->C_EVT_ENTER ).
LO_FPM = LO_MODEL->GET_FPM_API( ).
LO_FPM->RAISE_EVENT( LO_FPM_EVT ).
CALL METHOD LO_MODEL->CLOSE_POPUP
EXPORTING
IV_POPUP = 'XXXXXXX' .
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jakob,
actually the method flush is not intended to make changes to the data, its only purpose is to receive the changes done by the user and to do with those changes whatever is appropriate. For making changes to the data please use the method get_data.
Kind regards,
Ulrich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jakob,
the wd abap context really is internal stuff, manipulating it would be "a bad hack" and such a solution would not be supported officially by SAP. I see two option:
1) Via get_data add a new empty row to ct_data.
2) Use the new FPM List ATS UIBB (wd component fpm_list_uibb_ats). There is a build in feature
for exactly this use case.
I assume that solution 2) is not an option since you are building on a existing solution.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.