cancel
Showing results for 
Search instead for 
Did you mean: 

Characteristic cannot be retrieved after BDC change in single program run

michal_sporszil
Explorer
0 Kudos

Hi,

I am struggling with some odd problem. I wrote a report that allows a change of configuration of an item (for material characteristic) in sales order with usage of BDC (UPDATE = S , synchronously). That part works perfectly - changes are visible immediately in VA03 and by FM in SE37 for VBAK-CUOBJ (FM: VC_I_GET_CONFIGURATION_IBASE as we use VMS module).

However when program comes back to ALV after a change and I use custom Refresh button which calls the same FM (VC_I_GET_CONFIGURATION_IBASE) with exactly the same parameters the characteristic values are not retrieved 😞 When I go back to selection screen and execute again (not recall the tcode just reselect!) the characteristic is retrieved correctly.

I assume there is some buffer to be cleaned but I haven't found any hints regarding that....

Any ideas?

DoanManhQuynh
Active Contributor
0 Kudos
I dont know for sure but i think it could be related to SAP LUW, could you try to submit after BDC?
michal_sporszil
Explorer
0 Kudos

Anyone? 😞

Accepted Solutions (1)

Accepted Solutions (1)

chaouki_akir
Contributor

May be you can try to refresh some buffer. I found a function that is called by SAPMV45A (during init).

    call function 'CUCB_INITIALIZER'.

You can try to call it after returning from CALL TRANSACTION.

PS:

- you can try also to call transaction with update mode "L-Local update task"

- you can share more of your code

michal_sporszil
Explorer

That worked perfectly! Many thanks!

Answers (1)

Answers (1)

michal_sporszil
Explorer
0 Kudos

Hi,

Actually even though it is probably unnecessary to do COMMIT I got it after - changes are applied to DBT but configuration still cannot be retrieved

PS: the FM used is VC_I_GET_CONFIGURATION (I couldn't edit question)

  DATA:   lt_messtab TYPE TABLE OF bdcmsgcoll,
          ls_ctu     LIKE ctu_params.

  FIELD-SYMBOLS:  <lfs_msg> LIKE LINE OF lt_messtab.


  ls_ctu-dismode = 'N'. "Screens are not displayed
  ls_ctu-updmode = 'S'. "Synchro

  CALL TRANSACTION tcode USING bdcdata
                   MODE   ls_ctu-dismode
                   UPDATE ls_ctu-updmode
                   MESSAGES INTO lt_messtab.

*  set status
  READ TABLE lt_messtab ASSIGNING <lfs_msg> WITH KEY msgtyp = 'E'.



  IF sy-subrc = 0.
*   error
  ROLLBACK WORK.

  ELSE.
    READ TABLE lt_messtab ASSIGNING <lfs_msg> WITH KEY msgtyp = 'S'.
    IF sy-subrc = 0.
*  success
      COMMIT WORK AND WAIT.
    ENDIF.
  ENDIF.
DoanManhQuynh
Active Contributor
0 Kudos

What tcode are you using to update charateristic?