cancel
Showing results for 
Search instead for 
Did you mean: 

error when updating back to ODS using tableview iterator.

Former Member
0 Kudos
59

I get this error when I try to execute my bsp page. The page collects a cell value that was edited on the previous page and updates it to the ods.

The error is "Function not possible in a captured session"

The termination type was: TH_RES_FREE

When I debug, every thing looks fine. ITab3 returns values it's supposed to. So I am not sure what's causing it to fail. Any ideas? Thanks.

Here is my code:


CLASS cl_htmlb_manager DEFINITION LOAD.

DATA: event TYPE REF TO cl_htmlb_event.


event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
if event->id = 'Update' and event->event_type = 'click'.
  DATA: tv TYPE REF TO cl_htmlb_tableview.

FIELD-SYMBOLS <i> LIKE LINE OF selectedrowindextable.

tv ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                 name = 'tableView'
                                 id = 'tv1' ).

IF tv IS NOT INITIAL.

DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
  tv_data = tv->data.
  refresh itab2.
  refresh itab3.
  call method tv_data->GET_ROWS_SELECTED
  receiving selected_rows = itab2.
  endif.
  data : ind type SELECTEDROW,
          row_s type row.

  if itab2 is not initial.
    data: rw LIKE LINE OF itab.

    loop at itab2 into ind.
    READ TABLE itab INDEX ind-index into
    rw.
    if rw is not initial.
    row_s = rw.
    append row_s to itab3.
    clear row_s.
    endif.
    endloop.

        MODIFY /bic/aNCN_O01300 FROM table itab3.
 


      ENDIF.
      endif.

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

In your code no where you are reading the cell value...

 COL_VALUE = TV_DATA->GET_CELL_VALUE( ROW_INDEX = IND-INDEX COLUMN_INDEX = COL_NO ).

Look at the below thread for mode detail..

<i>*Reward each useful answer</i>

Raja T

Former Member
0 Kudos

Thanks Raja. This works fine. I initially had problems updating all fields that I edited. It was giving the last rows value to all rows. I figured it out and it works great now. Thanks for all your help and patience.

raja_thangamani
Active Contributor
0 Kudos

Good to see that you solved it...

Raja T

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Uday,

We also have a similar type of scenario where we need to update the ODS, but what we are doing is that we've created a Ztable of the same structure of ODS and then updating only the Ztable and calling a process chain to update the ODS....

regarding your problem....are you sure that the values in itab3 are alpha converted.... coz if Alpha conversion is not applied on ODS, then for a field of length 10, `9233` is not equal to `000000009233`.

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

No, they are not alpha converted. That may be the reason. How can I over come this problem? I cannot change them to alpha converted characteristics since they are important ones like FACID. What other solutions do I have?

Former Member
0 Kudos

hi Uday,

This is simple....

Use the function module

<b>1) For adding leading zero's or spaces...!</b>

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT   = lw_variable
 IMPORTING
   OUTPUT   = lw_variable.

<b>2) and for removing leading zero's or spaces.....</b>

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    INPUT   = lw_variable
 IMPORTING
   OUTPUT   = lw_variable.

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

I did accordingly. It doesn't give me any error this time but it doesn't update the ODS. The itab3 values in the debug mode look good. It's just not updating the ods.

field-symbols: <fs_itab3> like line of itab3.
LOOP AT itab3 assigning <fs_itab3>.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
	input  = <fs_itab3>-/BIC/FACID
IMPORTING
	output = <fs_itab3>-/BIC/FACID.

 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
	input  = <fs_itab3>-CO_AREA
IMPORTING
	output = <fs_itab3>-CO_AREA.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
	input  = <fs_itab3>-CALMONTH
IMPORTING
	output = <fs_itab3>-CALMONTH.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
	input  = <fs_itab3>-PROFIT_CTR
IMPORTING
	output = <fs_itab3>-PROFIT_CTR.


Append <fs_itab3> to itab3.

endloop.


        MODIFY /bic/aNCN_O01300 FROM table itab3.

raja_thangamani
Active Contributor
0 Kudos

Did you check sy-subrc after MODIFY /bic/aNCN_O01300 FROM table itab3.?

Check whether 0 or <> 0

Raja T

Former Member
0 Kudos

sy-subrc returns 0.

raja_thangamani
Active Contributor
0 Kudos

Add the below code & give a try

MODIFY /bic/aNCN_O01300 FROM table itab3.

if sy-subrc = 0.

COMMIT WORK.

endif.

<i>*Reward each useful answer</i>

Raja T

Former Member
0 Kudos

That didn't work either. I have a question. Do I have to specify any special settings to the ODS or any thing?

raja_thangamani
Active Contributor
0 Kudos

Nothing specific to BSP..

Raja T

Former Member
0 Kudos

I will create a table as Tatvagana says and see if that will work. Will keep you updated.

Former Member
0 Kudos

Ok, I was able to use a table I created. It is storing the records in the table fine. But the problem I am having now is that it is not storing the edited value in a column. I am editing values in 1 column and need to store that value in the table but it's storing the old value itself. I checked itab3 values and it's not capturing the new value. What is wrong with my code?

raja_thangamani
Active Contributor
0 Kudos

Does the structure of DB /bic/aNCN_O01300 & itab3 same?

Raja T

Former Member
0 Kudos

Yes, they are the same.

TYPES : tab type standard table of /bic/aNCN_O01300,

and itab3 is of type tab