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

updating values in material master table

Hi,

I have few records in the o/p and the checkboxes were placed besides each record.If the user wants to change the data of some fields in a record,then he clicks the checkbox besides that particular record and click on the change button.Then the control goes to update screen.In this screen the user changes the values of the fields of which he wants to change and click on the execute button.Then the changed values should get updated in the material master table.

I have created the update screen.Now how can I write the logic for the changed values to get updated in the material master table?

Regards,

Hema

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 31, 2008 at 06:05 AM

    below program demosnstrate the muliple records selection and processing based on the selected records.

    go with the logic behind it and start working on u r requirement.

    *-----------------------------------------------------*
    * REPORT : ZSAN_PROJECT.
    * AUTHOR : SANTOSH REDDY
    * DATE OF CREATION : 12.07.07
    * DATE OF MODIFICATION:
    *              CHANGES:
    *CHANGE NO. : CL3K900289
    *------------------------------------------------------*
    REPORT  ZSAN_PROJECT LINE-SIZE 136 NO STANDARD PAGE HEADING.
    
    *------------TABLE DECLARATION-------------------------*
    
    TABLES: PROJ.
    *------------INTERNAL TABLE DECLARATION-----------------*
    
    DATA : BEGIN OF TAB_PROJ OCCURS 0,
           PSPNR LIKE PROJ-PSPNR,
           PSPID LIKE PROJ-PSPID,
           VERNA LIKE PROJ-VERNA,
           VBUKR LIKE PROJ-VBUKR,
           VGSBR LIKE PROJ-VGSBR,
           PLFAZ LIKE PROJ-PLFAZ,
           PLSEZ LIKE PROJ-PLSEZ,
           END OF TAB_PROJ.
    DATA : BEGIN OF TAB_PROJ1 OCCURS 0,
           PSPNR LIKE PROJ-PSPNR,
           PSPID LIKE PROJ-PSPID,
           VERNA LIKE PROJ-VERNA,
           VBUKR LIKE PROJ-VBUKR,
           VGSBR LIKE PROJ-VGSBR,
           PLFAZ LIKE PROJ-PLFAZ,
           PLSEZ LIKE PROJ-PLSEZ,
           END OF TAB_PROJ1.
    
    *-----------VARIABLE DECLARATION--------------------------*
    
    DATA:  CBOX .
    
    DATA:LNO TYPE I.
    *------------START OF SELECTION---------------------------*
    
    START-OF-SELECTION.
    
      PERFORM SELECT_DATA.
    
    *-------------END OF SELECTION-----------------------------*
    
    END-OF-SELECTION.
      PERFORM DISPLAY_DATA.
    
    *-------------TOP OF PAGE----------------------------------*
    
    TOP-OF-PAGE      .
      PERFORM DISPLAY_HEADER.
    
    *------------AT USER COMMAND--------------------------------*
    
      SET PF-STATUS 'ZSAN'.
    
    
    AT USER-COMMAND.
      CASE SY-UCOMM.
    
        WHEN 'PREVIEW'.
        LNO = 1.
          DO.
            READ LINE LNO FIELD VALUE CBOX.
            IF SY-SUBRC <> 0.
              EXIT.
            ENDIF.
            IF CBOX = 'X'.
              SELECT * FROM PROJ INTO CORRESPONDING FIELDS OF TAB_PROJ1
                     WHERE PSPNR = TAB_PROJ-PSPNR.
              ENDSELECT.
    
            ENDIF.
            LNO = LNO + 1.
          ENDDO.
          SET PARAMETER ID 'SAN' FIELD TAB_PROJ1-PSPNR.
          SUBMIT ZSAN_PROJECT_PRINT_PROG  AND RETURN.
    
      ENDCASE.
      SY-LSIND = SY-LSIND - 1.
      PERFORM DISPLAY_HEADER.
      PERFORM DISPLAY_DATA.
    
    *&---------------------------------------------------------------------*
    *&      Form  SELECT_DATA
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM SELECT_DATA .
      SELECT PSPNR
              PSPID
              VERNA
              VBUKR
              VGSBR
              PLFAZ
              PLSEZ
              FROM PROJ INTO TABLE TAB_PROJ.
    ENDFORM.                    " SELECT_DATA
    
    *&---------------------------------------------------------------------*
    *&      Form  DISPLAY_DATA
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM DISPLAY_DATA .
      LOOP AT TAB_PROJ.
        WRITE: / SY-VLINE,
               CBOX CENTERED AS CHECKBOX, SY-VLINE,
              (20) TAB_PROJ-PSPNR CENTERED, SY-VLINE,
              (20) TAB_PROJ-PSPID CENTERED, SY-VLINE,
              (20) TAB_PROJ-VERNA CENTERED, SY-VLINE,
              (10) TAB_PROJ-VBUKR CENTERED, SY-VLINE,
              (10) TAB_PROJ-VGSBR CENTERED, SY-VLINE,
              (15) TAB_PROJ-PLFAZ CENTERED, SY-VLINE,
              (15) TAB_PROJ-PLSEZ CENTERED, SY-VLINE.
      HIDE TAB_PROJ-PSPNR.
      CLEAR TAB_PROJ.
      ENDLOOP.
      ULINE.
    ENDFORM.                    " DISPLAY_DATA
    
    *&---------------------------------------------------------------------*
    *&      Form  DISPLAY_HEADER
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM DISPLAY_HEADER .
      ULINE.
    
      WRITE:/ SY-VLINE,
                  ' ', SY-VLINE,
                (20) 'Int Proj Def' CENTERED, SY-VLINE,
                (20) 'Proj Def' CENTERED, SY-VLINE,
                (20) 'Proj mngr' CENTERED, SY-VLINE,
                (10) 'C code' CENTERED, SY-VLINE,
                (10) 'B area' CENTERED, SY-VLINE,
                (15) 'Proj start date' CENTERED, SY-VLINE,
                (15) 'Proj finish date' CENTERED, SY-VLINE.
      ULINE.
    ENDFORM.                    " DISPLAY_HEADER
    

    REGARDS..

    SANTHOSH REDDY

    set parameter keeps the value in memory.

    it holds only one value.

    instead of set/get parameter

    use IMPORT/EXPORT

    For any help type the key word in editor and put the cursor on it and press F1

    tcode: ABAPDOCU and search in keyword help

    REWARD IF USEFUL.

    Edited by: Santhosh Reddy on Jan 31, 2008 12:56 PM

    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.