Register Login

Table control in Module pool

Updated May 18, 2018

Hi all,

I am new to module pool programming. I want to know how to insert multiple rows from a table control to database table.

Thanks.

 

 


Comments

  • 28 Mar 2011 10:06 am rekha
    The Module pool program should be like this way :

    program znilmodpl2.

    tables : zniltable.

    data : it_table type table of zniltable with header line.

    controls : tabcntrl type tableview using screen 100.

    data : ok_code type sy-ucomm.

    &---------------------------------------------------------------------
    *& Module STATUS_0100 OUTPUT
    &---------------------------------------------------------------------
    * text
    ----------------------------------------------------------------------
    module status_0100 output.
    set pf-status '0100'.
    set titlebar '100'.

    move-corresponding it_table to zniltable.



    endmodule. " STATUS_0100 OUTPUT


    &---------------------------------------------------------------------
    *& Module USER_COMMAND_0100 INPUT
    &---------------------------------------------------------------------
    * text
    ----------------------------------------------------------------------
    module user_command_0100 input.

    case ok_code.
    when 'INS'.


    it_table-carrier = zniltable-carrier .
    it_table-personnelno = zniltable-personnelno.
    it_table-flightname = zniltable-flightname.
    it_table-flightdate = zniltable-flightdate.
    it_table-f_name = zniltable-f_name.
    it_table-l_name = zniltable-l_name.
    it_table-rol_emp = zniltable-rol_emp.
    it_table-telephone = zniltable-telephone.
    it_table-city_dept = zniltable-city_dept.
    it_table-city_arrv = zniltable-city_arrv.
    append it_table.

    insert into zniltable values it_table.
    message 'SUCCESSFUL INSERTION OF DATA' type 'S' .

    when 'ENTE'.

    select * from zniltable into corresponding fields of it_table where carrier = zniltable-carrier and personnelno = zniltable-personnelno.
    append it_table.
    endselect.

    if it_table is initial.
    message 'CORRECT MATCHING INPUT FOR CARRIER-ID AND PERSONNEL-ID IS NOT GIVEN' type 'E'.
    endif.



    when 'EXIT'.
    leave program.

    endcase.
    endmodule. " USER_COMMAND_0100 INPUT


    ********************************************************
    And the flow logic will be :

    process before output.
    loop at it_table with control tabcntrl.
    module status_0100.
    endloop.

    process after input.

    loop at it_table .
    module user_command_0100.
    endloop.
  • 13 Jan 2012 3:11 pm kakoli das
    thanx.its become to much helpful for me..
  • 10 Dec 2012 2:09 pm Guest
    Hi,
    i need to display table control in already created module pool program. My program consist of conversion like hexadecimal to binary. In this, i use screen painter to getting values and also i need to display values of hexadecimal and binary values from my table in same screen. Is it possible to display both.


    With Regards,
    T.Venkatesh Kumar,
  • 18 Feb 2013 6:34 am Guest
    how moved up and down the selected row in the table control by pressing the corresponding push buttons in modulepool program
  • 21 Nov 2013 7:56 am Vinod
    i have done module pool program and i am able to insert data in table control through module pool and the challenging part is it is not showing all the fields in display mode,how can i get that,please help me in dis.

×