cancel
Showing results for 
Search instead for 
Did you mean: 

abap to abap web dynpro

Former Member
0 Kudos

hi!

i have the following code:


REPORT  ZGLK_BGT_YEAR.

TABLES: ZGLKC_BGTYR.


data : plus like ZGLKC_BGTYR-ZZYEAR.
data : lock like ZGLKC_YEAR_LOCK-YEAR_LOCK.

SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-002.

PARAMETER : p_ZZYEAR like ZGLKC_BGTYR-ZZYEAR OBLIGATORY.

SELECTION-SCREEN END OF BLOCK bl2.
SELECTION-SCREEN END OF BLOCK bl1.


INITIALIZATION.

  SELECT SINGLE ZZYEAR FROM ZGLKC_BGTYR INTO p_zzyear.

START-OF-SELECTION.

AT SELECTION-SCREEN ON p_ZZYEAR.

  CALL FUNCTION 'ZGLK_GET_YEAR_LOCK'
    EXPORTING
      I_COMP_CODE = '1000'
    IMPORTING
      E_YEAR_LOCK = lock.

    plus = sy-datum(4) + 1.

IF LOCK = 'X' .

    IF  p_zzyear = plus or  p_zzyear = sy-datum(4).
      MESSAGE I000(su) with  p_zzyear text-I01.
    else.
      MESSAGE E000(SU) with text-E01.
    endif.
  ZGLKC_BGTYR-ZZYEAR = p_ZZYEAR.
  MODIFY  ZGLKC_BGTYR .

  ELSEIF LOCK = ''.

  ZGLKC_BGTYR-ZZYEAR = p_ZZYEAR.
  MODIFY  ZGLKC_BGTYR .
  MESSAGE I000(SU) WITH P_ZZYEAR  TEXT-I01.

ENDIF.

END-OF-SELECTION.

my task is to develop this in web dynpro abap but i dont know how to do this.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create a node with an attirbute for p_ZZYEAR .

Create a view with the Input field for p_ZZYEAR .Set the state as Required. Bind the value of Input field to this node. Create a button and assign an event to it.

Up on click of this button (handler), call the method of the class to validate the entry.

Create a custom class and a method to set the lock and validate the entry. Instantiate this class and

Call this mehtod to validate the value. You can get the value using GET_ATTRIBUTE method of the IF_WD_CONTEXT_NODE.

Check my reply in this thread -

Regards,

Lekha.