Skip to Content
avatar image
Former Member

Get field name which was changed on screen

Hi Experts,

i have a requirement that i need to get the field name of any input field which value is changed on screen by user. I am sure there is something is available in ABAP to achieve.

Any help would be appriciated.

Thanks in advance

Regards,

Ashutosh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 26, 2014 at 09:40 AM

    Hi Ashutosh,

    Can you give a details information of your requirement.

    What is the mean by input fields. Can you provide some example of requirement.

    Regards.

    Praveer.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 26, 2014 at 09:50 AM

    Hi Ashutosh,

    TRy this...

    PROCESS AFTER INPUT.

    MODULE get_cursor.

    MODULE get_CURSOR INPUT.

    data : wa_cursor(40).

    get CURSOR FIELD wa_cursor.

    ENDMODULE.        

    wa_cursor will have the field name which value is changed on screen by user.

    Thanks,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

    • Logic for identifying the changed fields:-

      DATA lr_structdescr   TYPE REF TO  cl_abap_structdescr.

      DATA l_component    TYPE abap_compdescr .

      FIELD-SYMBOLS:     <field_value1> TYPE any.

      FIELD-SYMBOLS:    <field_value2> TYPE any.

      lr_structdescr ?= cl_abap_typedescr=>describe_by_name( 'ZTABLE' ).

      LOOP AT lr_structdescr->components INTO l_component

      ASSIGN COMPONENT l_component-name OF STRUCTURE wa_table TO <field_value1>.

      ASSIGN COMPONENT l_component-name OF STRUCTURE ztable     TO <field_value2>.

      IF <field_value1> NE <field_value2>.

           "Field value has changed field name is in l_component-name

      ENDIF.

      ENDLOOP.