Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Update a field on the list

Former Member
0 Kudos

Hi,

I want the field value to be edited on the list once the report is generated and Once it is Edited it has to be update into the Database table.

Can anybody tell me how can i code for this.

Regards,

Sri.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

HI Sridhar,

You have set some of the fields in the list as ediatble using the statement

write var input on.

Then when the user enters the data in the input enabled field, then you can use the statement READ LINE <line number> FIELD VALUE var.

then you can update the z table using the update/modify or insert commands.

Regards,

Ravi

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

HI Sridhar,

You have set some of the fields in the list as ediatble using the statement

write var input on.

Then when the user enters the data in the input enabled field, then you can use the statement READ LINE <line number> FIELD VALUE var.

then you can update the z table using the update/modify or insert commands.

Regards,

Ravi

0 Kudos

Hi Ravi,

If you dont mind can you please send any sample code for this?

Regards,

Sri.

Former Member
0 Kudos

Hi

U have to use the events and own stauts to do that:

START-OF-SELECTION.

   SET PF-STATUS 'MY_GUI'.

   WRITE <VAR> INPUT ON.

AT USER-COMMAND.

   CASE SY-UCOMM.
       WHEN 'SAVE'.
           READ LINE <N> FIELD VALUE <VAR> INTO <VAR1>. 
           IF SY-SUBRC = 0.
              Z<TABLE>-<FIELD> = 'VAR1'.
              MODIFY Z<TABLE>.
            ENDIF.
        WHEN OTHERS.  
   ENDCASE.

<N> is number of the line of the page where the variable <VAR> was written.

Max