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

Want Help.

Hi,

I have a requirement like ,

After doubleclicking on report output,detail output will come <b>in which two fields will be in change mode</b>.<b>When user will modify the value and press the update button database will be updated with this new value</b>.

Now my query is :-

1) I am getting out put in change mode ( using 'input in' with write statement)

<b>But,how to get the modified value in workarea ?</b>

2) and how to update that new value in database as well .

Please check your self and ehlp me with sample code.

Award is assured.

Thanks in advance.

Regards.

Srikanta.

<b></b>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 03:53 PM

    Get the total no. of line on the list output using sy-linct.

    Do sy-linct times.

    Using 'Read line'(Check in online Documentation) you can read the output list hich the user has changed and update those values in your internal table first

    Enddo.

    The using Update dbtab you can update the values to database table from internal table.

    try this sample code:

    DATA: date TYPE d,

    flag TYPE c LENGTH 1,

    wa TYPE c LENGTH 10.

    START-OF-SELECTION.

    date = sy-datum.

    DO 10 TIMES.

    date = date + sy-index.

    WRITE: / flag AS CHECKBOX, (10) date.

    ENDDO.

    AT LINE-SELECTION.

    DO.

    READ LINE sy-index FIELD VALUE flag

    date INTO wa.

    IF sy-subrc <> 0.

    EXIT.

    ELSEIF flag = 'X'.

    WRITE / wa.

    ENDIF.

    ENDDO.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 03:55 PM

    You need to use the READ LINE syntax.

    Like this:

    DATA: date TYPE d, 
          flag(1) TYPE c, 
          wa(10) TYPE c. 
    
    START-OF-SELECTION. 
      date = sy-datum. 
      DO 10 TIMES. 
        date = date + sy-index. 
        WRITE: / flag AS CHECKBOX, (10) date. 
      ENDDO. 
    
    AT LINE-SELECTION. 
      DO. 
        READ LINE sy-index FIELD VALUE flag 
                                       date INTO wa. 
        IF sy-subrc <> 0. 
          EXIT. 
        ELSEIF flag = 'X'. 
          WRITE / wa. 
        ENDIF. 
      ENDDO.

    Store your data from the screen into one internal table and then use MODIFY ZTAB FROM ITAB syntax to update the database table.

    I would advise to make a ALV, if possible.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 03:59 PM

    Hi,

    try this sample code...

    REPORT  ztest  NO STANDARD PAGE HEADING.
    TABLES eban.
    DATA : BEGIN OF itab OCCURS 100,
            matnr LIKE eban-matnr,
            menge LIKE eban-menge,
           END OF itab.
    DATA : itab2 LIKE itab OCCURS 0 WITH HEADER LINE.
    DATA : total LIKE itab-menge.
    SELECT-OPTIONS : s_matnr FOR eban-matnr.
    
    *AT USER-COMMAND.
    AT LINE-SELECTION.
    "write this below sample code in AT USER-COMMAND becasue you are using
    "Push button. here I'm using AT LINE-SELECTION.
    
    READ LINE sy-lilli FIELD VALUE itab-matnr
                                     itab-menge.
    
    UPDATE eban SET   menge = itab-menge
                   WHERE matnr   = itab-matnr.
    
    *----------------------------------------------------------*
    * Get data from table EBAN                                     *
    *----------------------------------------------------------*
    START-OF-SELECTION.
    
      SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE itab
      FROM eban UP TO 20 ROWS WHERE matnr IN s_matnr
      AND matnr NE space .
    
      SORT itab BY matnr.
    
      LOOP AT itab.
        WRITE :/ sy-vline,
               2 itab-matnr INPUT ON,
               20 sy-vline,
               21 itab-menge DECIMALS 0 INPUT ON,
               40 sy-vline.
               HIDE : itab-matnr, itab-menge.
      ENDLOOP.
      ULINE /(40).
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 04:09 PM

    You can use AT pf5 or any function key.

    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.