Skip to Content
avatar image
Former Member

add entry to current line in table control

hi all,

i am working on module pool program.  how to add entry to current line of table control to ztable.

e.g:, i have ztable with 10 field, in that 5 fields already have value. And i created one screen with table contro wizard.

screen will display all fields with fields which have value in output only mode, remaining fields are in changable mode, now if i give value in remaining field and press save .

data as to store in ztable on the current line itself,  like this in ztable.

3961     2014     01     1006     2     6000     000     100     20     20     10     6000

but for me it is storing like new line. like this in ztable,

                                   1006     2     6000     000                                       6000

  3961     2014     01     1006     2     6000     000     100     20     20     10     6000

how to slove this.

regards,

S.Kavitha

Untitled.jpg (45.6 kB)
Untitled-1.jpg (52.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 07, 2015 at 02:34 AM

    Hi S.Kavitha,

    What`s your key fields of this ztable? Be care of this point.

    Others, do as @Chinmay said, check the PAI, modify command.


    regards,

    Archer

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Kavitha,

      before update ztable please check the key field values in GS_TABLE17.

      check the values of GS_TABLE17 through debugging whether it has the

      same values as old one or any key field value is blank.

      While inserting new record itself you need to update the key fields.

      when modifiying that record the modification data in work area must have

      same value in key fields.

      Thanks,

      Marimuthu.K

  • avatar image
    Former Member
    Jan 07, 2015 at 12:14 AM

    Check the "Loop at itab" part in PAI for table control.

    There would be a module in it. Check if it is appending or modifying the table.

    If there is a modify command, then put a watchpoint on the table to see where the rows are being added.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi chinmay ,

      in the above screen shot,

      if i give value to only HFM_GL_AMT_LC field its adding that entry on same line , but if igive company code , fiscal year means it is adding that as a new line as i gave in the above.

      i will check what u told ,

      regards,

      S.kavitha

  • Jan 07, 2015 at 05:38 AM

    Hi Kavitha,

    Module pool with table control basic logic is

    in PBO

    Loop at internal_table into work_area with control Tab_control.

         pass the information to Table control as below code

         move corresponding work_area to Tab_control Structure.

    endloop.

    In PAI.

    Loop at Internal table.

         pass the changes information to internal table.

         move corresponding Tab_control Strucuture to Work_area.

        

    Here You write your logic to data update for other fields in Table Control.

         modify Internal Table from Work Area Index Tab_control-Current_line.

    endloop.

    After that your Save Command in USE_COMMAND moduel

    In save command you have to write your save logic.

    Regards.

    Praveer.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 08, 2015 at 04:55 AM

    Very Simply Insert New module in PAI.

    write your logic in this module and modify internal table.

    you can Ref Sample Code.

      loop at temp_otentry.

        chain.

          field wa_tempotentry-emp_code.

          field wa_tempotentry-emp_name.

          field wa_tempotentry-start_dt.

          field wa_tempotentry-end_dt.

          field wa_tempotentry-start_time.

          field wa_tempotentry-end_time.

          field wa_tempotentry-ot_hour.

          field wa_tempotentry-zshift.

          field wa_tempotentry-zreliver.

          field wa_tempotentry-zreliver_emp.

          field wa_tempotentry-zreason.

          module overtime_modify on chain-request.

        endchain.

      endloop.

    MODULE overtime_modify INPUT.

    *please write your logic

    *if you want to insert new line then use append

    *else modify current line of work area


    *after modify internal table

      MODIFY temp_otentry

        FROM wa_tempotentry

        INDEX overtime-current_line.

    ENDMODULE.                    "overtime_modify input

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      just debug the code you are clearing somewhere the screen fields after this action.

      wa_answer is char1 data type so it should be wa_answer = 'N'.