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

field updating to db table

hi all,

I create a field on screen(from dictionary) named zvtrans-zsdate. and the value entered in this screen field should be update to zvtrans table.

but in the PAI of the screen if I write like this it is not working

PROCESS AFTER INPUT.

MODULE finalise.

MODULE finalise INPUT.

IF sy-dynnr = '0200'..

IF ok_code = 'SAVE'.

PERFORM refresh_screen_200.

PERFORM save_screen_200.

endif.

FORM save_screen_200

zvtrans-zsdate = zvtrans-zsdate.

MODIFY zvtrans.

endform.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:40 AM

    Hi,

    Change your modify statement to

    MODIFY zvtrans from zvtrans.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 10:40 AM

    Hi please see wat is the key fild of the table that u are using..

    supose zkey is the field...

    then inside the FM

    FORM save_screen_200

    zvtrans-zsdate = zvtrans-zsdate.

    zvtrans-zkey = wf_zkey.

    MODIFY zvtrans transporting zsdate.

    endform.

    wf_zkey ...is the value of the key in the program...that u will be using

    alternatively u can declare a workarea of the type ztrans i.e wa_ztrans.

    selct * into wa_ztrans

    from ztrans

    where zkey = wf_key.

    FORM save_screen_200

    wa_ztrans-zsdate = zvtrans-zsdate.

    .

    MODIFY zvtrans from wa_ztrans transporting zsdate.

    endform.

    this also will work....

    Reward points if the soltn is helpful...

    Edited by: Rudra Prasanna Mohapatra on Jun 18, 2008 12:41 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:41 AM

    Hi

    U should post the code of form refresh_screen_200, probably u clear the headerline of the table before saving it.

    MAx

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:43 AM

    hi....

    just check if you hae declared ok_code in the screen attributes.

    and also in the top include of the program.

    activate it and then check if the ok_code is getting assigned properly.

    you can use the update functionality to update your table corressponding the screen field rather than modify if you dont have the key fields.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:54 AM

    Hi,

    Why don't you try UPDATE command.

    Example :

    UPDATE zvtrans-zsdate = zvtrans-zsdate
         SET  zvtrans-zsdate = zvtrans-zsdate
          WHERE  some condition....
    
            IF sy-subrc EQ 0.
              COMMIT WORK.
              l_error = 'X1'.
            ELSE.
               l_error = 'X2'.
               CLEAR l_error.
               ROLLBACK WORK.
             ENDIF.

    Hope this will help you.

    Plz reward if useful.

    Thanks,

    Dhanashri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:13 AM

    if i am giving zvtrans-zsdate eq sy-datum.

    it is taking the current system date.

    but if i am giving zvtrans-zsdate(table field) = zvtrans-zsdate(screen field).

    it is not taking the database table.

    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.