Skip to Content
author's profile photo Former Member
Former Member

Change of Cell in Webinterface works only after Refresh

Hi there 😊

I'm stuck here at a clients site and hope somebody of you guys can help me out.

I have a Webinterface which shows a layout with some characteristics and a 2 keyfigure columns. Depending on a condition the keyfigure of one column (col 22) should be input ready or protected from input. Found out, that this can be done by changing LR_LAY->MT_HTML_CELL-VALUE_TYPE.

This actually works fine. My problem now is that this only works after a refresh. Tried to move the code to the method Initialization, but the cant be used there like that.

Any hint would be appreciated!

Thanks

Gerald

Here is the coding:

method DISPATCH.

  constants:  C_LAYOUT_CLASS 	type STRING value 'LAYOUT',
              C_LAYOUT_METHOD 	type STRING value 'API_GET_DATA'.

  data: LR_COMPONENT type ref to IF_UPWB_C_COMPONENT,
      	 LR_CONVERT   type ref to IF_UPWB_C_COMPONENT,
      	 LR_LAY       type ref to IF_UPWB_C_LAYOUT2,
      	 LR_FUNC      type ref to IF_UPWB_C_BUT_FUNCTION,
         LV_CLASS     type STRING,
         LV_ID        type STRING,
  	 LV_SUBRC     like SY-SUBRC,
  	 LT_MSG_LOG   type table of BAPIRET2.

  field-symbols: <LY_CELL> type UPWB_YS_HTML_CELL.

	
  LR_COMPONENT  ?= IS_HANDLER-COMPONENT.
  LV_ID          = LR_COMPONENT->GET_ID( ).
  LV_CLASS       = LR_COMPONENT->GET_CLASS( ).

* Gewünschte Methode?
  if LV_CLASS          = C_LAYOUT_CLASS and
     IS_HANDLER-METHOD = C_LAYOUT_METHOD.
    LR_LAY ?= LR_COMPONENT.
      if LR_LAY is bound and
       LR_LAY->MT_HTML_CELL is not initial.
        loop at LR_LAY->MT_HTML_CELL assigning <LY_CELL>
                                where COL = '22'
                                  and VALUE_TYPE = 'I'.
          <LY_CELL>-VALUE_TYPE = SPACE.
          modify LR_LAY->MT_HTML_CELL from <LY_CELL>.
        endloop.
      endif.
    endif.
  endif.

  if R_SUBRC is initial.
    call method SUPER->DISPATCH
      exporting
        IS_HANDLER = IS_HANDLER
      receiving
        R_SUBRC    = R_SUBRC.
  endif.

endmethod.                    "dispatch

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 07:28 AM

    Hi,

    We can achieve this through a simple macro which runs when layout opens.

    IF condition TRUE

    cells(row,column).disable = true.

    ENDIF

    This will disable the cell from user entry. Keep this code in SAPAFTERDATAPUT and give tick for SAPAFTERDATAPUT in the excel settings of your layout so that it runs automatically when layout opens.

    Regards,

    Bindu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.