Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

need help in table control wizard

Former Member
0 Kudos

Hai ,

I got a requirement to develop a module pool report for calcuation , save & print. I created a table control wizard I did all these things but when i was testing after i entered first 10 colmns visible in the table control and above to scroll and enter the materials in material column it got greyed out. I really dont know what to do. I set screen-input = '1'.

modify screen in PBO but still its not working. Please help me out. First time i was doing module pool pgm.

Regards

Nisha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai Amit,

Thanks for ur helpful answer. It works only for those items i entered in the first 10 visible rows and once i scroll down to enter remaining BOM items it got greyed out. Hope u got my problem. Actually ur codes reads the items i entered and made those datas to be changeable but i want to enter more item in the table which is not allowed. let me know amit if there is solution for this.

Regards

M.Nisha

7 REPLIES 7

Former Member
0 Kudos

Hi,

Its always hard to modify the auto generated code for table control, than doing it manually. Pls search for sample code on table control. This will do.

Former Member
0 Kudos

Hi nisha,

if u need to keep the table control in change mode keep

CONTROLS: tabctrl TYPE TABLEVIEW USING SCREEN 9002.

DATA: cols LIKE LINE OF tabctrl-cols,

lines TYPE i.

LOOP AT tabctrl-cols INTO cols.

cols-screen-input = '0'.

MODIFY tabctrl-cols FROM cols INDEX sy-tabix.

endloop.

in screen painter attributes double click on tabctrl and check all under resizing & seperators.

also check std programs

DEMO_DYNPRO_TABCONT_LOOP

DEMO_DYNPRO_TABCONT_LOOP_AT

for more info

Regards,

Amit

Edited by: Amit Iyer on Oct 14, 2008 4:51 PM

Former Member
0 Kudos

Hai Amit,

Thanks for ur helpful answer. It works only for those items i entered in the first 10 visible rows and once i scroll down to enter remaining BOM items it got greyed out. Hope u got my problem. Actually ur codes reads the items i entered and made those datas to be changeable but i want to enter more item in the table which is not allowed. let me know amit if there is solution for this.

Regards

M.Nisha

0 Kudos

The number of updateable lines on a screen is controlled by the table control LINES parameter which is set in a module at the start of the table contral wizard generated PBO code. The larger the number, the more updateable lines are available. I usually try to set it to at least the number of lines in my itab plus the number of lines displayed on the screen; this should have the effect of giving you always, when you've scrolled to the bottom of your filled fields, a complete screen of blank, enterable lines.

  CLEAR gv_lines.
  DESCRIBE TABLE gt_splits LINES gv_lines.
  g_TC_SPLITS_lines = sy-loopc + gv_lines + 20.
  TC_SPLITS-lines = g_TC_SPLITS_lines.

Former Member
0 Kudos

Hi Nisha,

Paste ur code here. so that we can solve ur problem easily...

Rgds.,

subash

Former Member
0 Kudos

Hai,

I have pasted my codes.This s my first pgm so please excuse me if there is any basic mistakes.

Regards

M.Nisha

&----


*& Module pool ZAGLP_CALC_COMP

*&

&----


*&

*&

&----


PROGRAM zaglp_calc_comp.

TABLES : mara , zaglp_mara , zaglp_rd,zaglp_rd_item, mbew .

DATA: my_ok TYPE sy-ucomm, ok_code TYPE sy-ucomm,

t_vol LIKE zaglp_rd_item-volume, t_wt LIKE zaglp_rd_item-volume,

t_cost LIKE zaglp_rd_item-cost,soild_vol LIKE zaglp_rd-density,

solid_wt LIKE zaglp_rd-tot_wt, t_voc LIKE zaglp_rd-voc, t_index LIKE sy-tabix,

t_cnt TYPE i VALUE 0 , t_ind(1).

DATA: lines TYPE i, limit TYPE i, fill TYPE i.

DATA: selcol(1).

DATA: BEGIN OF t_tab1 OCCURS 0,

mandt LIKE zaglp_rd-mandt,

fgcode LIKE zaglp_rd-fgcode,

version LIKE zaglp_rd-version,

seq_no LIKE zaglp_rd_item-seq_no,

rmcode LIKE zaglp_rd_item-rmcode,

rmdesc LIKE zaglp_rd_item-rmdesc,

weight LIKE zaglp_rd_item-weight,

volume LIKE zaglp_rd_item-volume,

cost LIKE zaglp_rd_item-cost,

END OF t_tab1.

***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'C_CONTROL'

*&SPWIZARD: DEFINITION OF DDIC-TABLE

*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'C_CONTROL'

TYPES: BEGIN OF t_c_control,

mandt LIKE zaglp_rd-mandt,

fgcode LIKE zaglp_rd-fgcode,

version LIKE zaglp_rd-version,

seq_no LIKE zaglp_rd_item-seq_no,

rmcode LIKE zaglp_rd_item-rmcode,

rmdesc LIKE zaglp_rd_item-rmdesc,

weight LIKE zaglp_rd_item-weight,

volume LIKE zaglp_rd_item-volume,

cost LIKE zaglp_rd_item-cost,

END OF t_c_control.

*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'C_CONTROL'

DATA: g_c_control_itab TYPE t_c_control OCCURS 0,

g_c_control_wa TYPE t_c_control. "work area

DATA: g_c_control_copied. "copy flag

*&SPWIZARD: DECLARATION OF TABLECONTROL 'C_CONTROL' ITSELF

CONTROLS: c_control TYPE TABLEVIEW USING SCREEN 0100.

*&SPWIZARD: LINES OF TABLECONTROL 'C_CONTROL'

DATA: g_c_control_lines LIKE sy-loopc.

*&SPWIZARD: OUTPUT MODULE FOR TC 'C_CONTROL'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: COPY DDIC-TABLE TO ITAB

MODULE c_control_init OUTPUT.

DESCRIBE TABLE t_tab1 LINES c_control-lines.

DATA: cols LIKE LINE OF c_control-cols,

lines1 TYPE i.

LOOP AT c_control-cols INTO cols.

cols-screen-input = '1'.

MODIFY c_control-cols FROM cols INDEX sy-tabix.

ENDLOOP.

ENDMODULE. "C_CONTROL_INIT OUTPUT

*&SPWIZARD: OUTPUT MODULE FOR TC 'C_CONTROL'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: MOVE ITAB TO DYNPRO

MODULE c_control_move OUTPUT.

MOVE-CORRESPONDING g_c_control_wa TO zaglp_rd_item.

ENDMODULE. "C_CONTROL_MOVE OUTPUT

*&SPWIZARD: OUTPUT MODULE FOR TC 'C_CONTROL'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: GET LINES OF TABLECONTROL

MODULE c_control_get_lines OUTPUT.

g_c_control_lines = sy-loopc.

ENDMODULE. "C_CONTROL_GET_LINES OUTPUT

*&SPWIZARD: INPUT MODULE FOR TC 'C_CONTROL'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: MODIFY TABLE

MODULE c_control_modify INPUT.

  • MOVE-CORRESPONDING ZAGLP_RD_ITEM TO G_C_CONTROL_WA.

  • MODIFY G_C_CONTROL_ITAB

  • FROM G_C_CONTROL_WA

  • INDEX C_CONTROL-CURRENT_LINE.

CLEAR : lines , fill , limit , selcol.

*----


Page Up & Page Down

my_ok = sy-ucomm.

lines = sy-loopc.

CASE my_ok.

WHEN 'P+'.

c_control-top_line = c_control-top_line + lines.

limit = fill - lines + 1.

IF c_control-top_line > limit.

c_control-top_line = limit.

ENDIF.

sy-ucomm = space.

WHEN 'P-'.

c_control-top_line = c_control-top_line - lines.

IF c_control-top_line < 0.

c_control-top_line = 0.

ENDIF.

ENDCASE.

*----


Changes begin by Nisha

MOVE-CORRESPONDING zaglp_rd_item TO t_tab1.

t_tab1-fgcode = zaglp_rd-fgcode.

t_tab1-version = zaglp_rd-version.

t_cnt = t_cnt + 1.

t_tab1-seq_no = t_cnt .

IF t_tab1-weight IS INITIAL.

MESSAGE i000(vz) WITH 'enter the weight'.

ELSE.

APPEND t_tab1.

CLEAR t_tab1.

ENDIF.

ENDMODULE. "C_CONTROL_MODIFY INPUT

*&SPWIZARD: INPUT MODULE FOR TC 'C_CONTROL'. DO NOT CHANGE THIS LINE!

*&SPWIZARD: PROCESS USER COMMAND

MODULE c_control_user_command INPUT.

ok_code = sy-ucomm.

PERFORM user_ok_tc USING 'C_CONTROL'

'G_C_CONTROL_ITAB'

'FLAG'

CHANGING ok_code.

sy-ucomm = ok_code.

ENDMODULE. "C_CONTROL_USER_COMMAND INPUT

----


  • INCLUDE TABLECONTROL_FORMS *

----


&----


*& Form USER_OK_TC *

&----


FORM user_ok_tc USING p_tc_name TYPE dynfnam

p_table_name

p_mark_name

CHANGING p_ok LIKE sy-ucomm.

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA: l_ok TYPE sy-ucomm,

l_offset TYPE i.

&SPWIZARD: END OF LOCAL DATA----


*&SPWIZARD: Table control specific operations *

*&SPWIZARD: evaluate TC name and operations *

SEARCH p_ok FOR p_tc_name.

IF sy-subrc <> 0.

EXIT.

ENDIF.

l_offset = STRLEN( p_tc_name ) + 1.

l_ok = p_ok+l_offset.

*&SPWIZARD: execute general and TC specific operations *

CASE l_ok.

WHEN 'INSR'. "insert row

PERFORM fcode_insert_row USING p_tc_name

p_table_name.

CLEAR p_ok.

WHEN 'DELE'. "delete row

PERFORM fcode_delete_row USING p_tc_name

p_table_name

p_mark_name.

CLEAR p_ok.

WHEN 'P--' OR "top of list

'P-' OR "previous page

'P+' OR "next page

'P++'. "bottom of list

PERFORM compute_scrolling_in_tc USING p_tc_name

l_ok.

CLEAR p_ok.

  • WHEN 'L--'. "total left

  • PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.

*

  • WHEN 'L-'. "column left

  • PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.

*

  • WHEN 'R+'. "column right

  • PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.

*

  • WHEN 'R++'. "total right

  • PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.

*

WHEN 'MARK'. "mark all filled lines

PERFORM fcode_tc_mark_lines USING p_tc_name

p_table_name

p_mark_name .

CLEAR p_ok.

WHEN 'DMRK'. "demark all filled lines

PERFORM fcode_tc_demark_lines USING p_tc_name

p_table_name

p_mark_name .

CLEAR p_ok.

  • WHEN 'SASCEND' OR

  • 'SDESCEND'. "sort column

  • PERFORM FCODE_SORT_TC USING P_TC_NAME

  • l_ok.

ENDCASE.

ENDFORM. " USER_OK_TC

&----


*& Form FCODE_INSERT_ROW *

&----


FORM fcode_insert_row

USING p_tc_name TYPE dynfnam

p_table_name .

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA l_lines_name LIKE feld-name.

DATA l_selline LIKE sy-stepl.

DATA l_lastline TYPE i.

DATA l_line TYPE i.

DATA l_table_name LIKE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <lines> TYPE i.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get the table, which belongs to the tc *

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

*&SPWIZARD: get looplines of TableControl *

CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.

ASSIGN (l_lines_name) TO <lines>.

*&SPWIZARD: get current line *

GET CURSOR LINE l_selline.

IF sy-subrc <> 0. " append line to table

l_selline = <tc>-lines + 1.

*&SPWIZARD: set top line *

IF l_selline > <lines>.

<tc>-top_line = l_selline - <lines> + 1 .

ELSE.

<tc>-top_line = 1.

ENDIF.

ELSE. " insert line into table

l_selline = <tc>-top_line + l_selline - 1.

l_lastline = <tc>-top_line + <lines> - 1.

ENDIF.

*&SPWIZARD: set new cursor line *

l_line = l_selline - <tc>-top_line + 1.

*&SPWIZARD: insert initial line *

INSERT INITIAL LINE INTO <table> INDEX l_selline.

<tc>-lines = <tc>-lines + 1.

*&SPWIZARD: set cursor *

SET CURSOR LINE l_line.

ENDFORM. " FCODE_INSERT_ROW

&----


*& Form FCODE_DELETE_ROW *

&----


FORM fcode_delete_row

USING p_tc_name TYPE dynfnam

p_table_name

p_mark_name .

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA l_table_name LIKE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <wa>.

FIELD-SYMBOLS <mark_field>.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get the table, which belongs to the tc *

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

*&SPWIZARD: delete marked lines *

DESCRIBE TABLE <table> LINES <tc>-lines.

LOOP AT <table> ASSIGNING <wa>.

*&SPWIZARD: access to the component 'FLAG' of the table header *

ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.

IF <mark_field> = 'X'.

DELETE <table> INDEX syst-tabix.

IF sy-subrc = 0.

<tc>-lines = <tc>-lines - 1.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " FCODE_DELETE_ROW

&----


*& Form COMPUTE_SCROLLING_IN_TC

&----


  • text

----


  • -->P_TC_NAME name of tablecontrol

  • -->P_OK ok code

----


FORM compute_scrolling_in_tc USING p_tc_name

p_ok.

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA l_tc_new_top_line TYPE i.

DATA l_tc_name LIKE feld-name.

DATA l_tc_lines_name LIKE feld-name.

DATA l_tc_field_name LIKE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <lines> TYPE i.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get looplines of TableControl *

CONCATENATE 'G_' p_tc_name '_LINES' INTO l_tc_lines_name.

ASSIGN (l_tc_lines_name) TO <lines>.

*&SPWIZARD: is no line filled? *

IF <tc>-lines = 0.

*&SPWIZARD: yes, ... *

l_tc_new_top_line = 1.

ELSE.

*&SPWIZARD: no, ... *

CALL FUNCTION 'SCROLLING_IN_TABLE'

EXPORTING

entry_act = <tc>-top_line

entry_from = 1

entry_to = <tc>-lines

last_page_full = 'X'

loops = <lines>

ok_code = p_ok

overlapping = 'X'

IMPORTING

entry_new = l_tc_new_top_line

EXCEPTIONS

  • NO_ENTRY_OR_PAGE_ACT = 01

  • NO_ENTRY_TO = 02

  • NO_OK_CODE_OR_PAGE_GO = 03

OTHERS = 0.

ENDIF.

*&SPWIZARD: get actual tc and column *

GET CURSOR FIELD l_tc_field_name

AREA l_tc_name.

IF syst-subrc = 0.

IF l_tc_name = p_tc_name.

*&SPWIZARD: et actual column *

SET CURSOR FIELD l_tc_field_name LINE 1.

ENDIF.

ENDIF.

*&SPWIZARD: set the new top line *

<tc>-top_line = l_tc_new_top_line.

ENDFORM. " COMPUTE_SCROLLING_IN_TC

&----


*& Form FCODE_TC_MARK_LINES

&----


  • marks all TableControl lines

----


  • -->P_TC_NAME name of tablecontrol

----


FORM fcode_tc_mark_lines USING p_tc_name

p_table_name

p_mark_name.

&SPWIZARD: EGIN OF LOCAL DATA----


DATA l_table_name LIKE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <wa>.

FIELD-SYMBOLS <mark_field>.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get the table, which belongs to the tc *

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

*&SPWIZARD: mark all filled lines *

LOOP AT <table> ASSIGNING <wa>.

*&SPWIZARD: access to the component 'FLAG' of the table header *

ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.

<mark_field> = 'X'.

ENDLOOP.

ENDFORM. "fcode_tc_mark_lines

&----


*& Form FCODE_TC_DEMARK_LINES

&----


  • demarks all TableControl lines

----


  • -->P_TC_NAME name of tablecontrol

----


FORM fcode_tc_demark_lines USING p_tc_name

p_table_name

p_mark_name .

&SPWIZARD: BEGIN OF LOCAL DATA----


DATA l_table_name LIKE feld-name.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <wa>.

FIELD-SYMBOLS <mark_field>.

&SPWIZARD: END OF LOCAL DATA----


ASSIGN (p_tc_name) TO <tc>.

*&SPWIZARD: get the table, which belongs to the tc *

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

*&SPWIZARD: demark all filled lines *

LOOP AT <table> ASSIGNING <wa>.

*&SPWIZARD: access to the component 'FLAG' of the table header *

ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.

<mark_field> = space.

ENDLOOP.

ENDFORM. "fcode_tc_mark_lines

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE user_command_0100 INPUT.

my_ok = ok_code.

CLEAR ok_code.

CLEAR: t_vol , t_wt, t_cost , solid_wt, soild_vol, t_voc, t_index.

IF t_ind = ' '.

LOOP AT t_tab1.

t_index = sy-tabix.

SELECT SINGLE * FROM mara WHERE matnr EQ t_tab1-rmcode.

IF sy-subrc EQ 0.

t_tab1-rmdesc = mara-matkl.

ENDIF.

SELECT SINGLE * FROM zaglp_mara WHERE matnr EQ t_tab1-rmcode.

IF sy-subrc EQ 0.

*Density

IF zaglp_mara-density NE 0.

t_tab1-volume = t_tab1-weight / zaglp_mara-density.

ELSE.

t_tab1-volume = 0.

ENDIF.

*Solid by weight.

solid_wt = solid_wt + ( ( ( 100 - zaglp_mara-volatile_wt ) * t_tab1-weight ) / 100 ).

*Solid by volume.

soild_vol = soild_vol + ( ( ( 100 - zaglp_mara-volatile_vol ) * t_tab1-volume ) / 100 ).

*VOC

IF t_tab1-rmcode NE 'RS85'.

t_voc = t_voc + ( zaglp_mara-volatile_wt * t_tab1-weight ) .

ENDIF.

ENDIF.

SELECT SINGLE * FROM mbew WHERE matnr EQ t_tab1-rmcode.

IF sy-subrc EQ 0.

IF mbew-vprsv EQ 'S'.

t_tab1-cost = mbew-stprs.

ELSEIF mbew-vprsv EQ 'V'.

t_tab1-cost = mbew-verpr.

ENDIF.

ENDIF.

t_wt = t_wt + t_tab1-weight.

t_vol = t_vol + t_tab1-volume.

t_cost = t_cost + t_tab1-cost.

MODIFY t_tab1 TRANSPORTING rmdesc volume cost seq_no.

ENDLOOP.

zaglp_rd-tot_cost = t_cost.

zaglp_rd-tot_vol = t_vol.

zaglp_rd-tot_wt = t_wt.

*DISPLAY OF HEADER DETAILS

SELECT SINGLE * FROM zaglp_rd WHERE fgcode EQ zaglp_rd-fgcode AND

version EQ zaglp_rd-version.

IF sy-subrc EQ 0.

zaglp_rd-descr = zaglp_rd-descr.

zaglp_rd-enterby = zaglp_rd-enterby.

zaglp_rd-dft = zaglp_rd-dft.

zaglp_rd-density = zaglp_rd-density.

zaglp_rd-pvc = zaglp_rd-pvc.

zaglp_rd-solid_vol = zaglp_rd-solid_vol.

zaglp_rd-soild_wt = zaglp_rd-soild_wt.

zaglp_rd-voc = zaglp_rd-voc.

zaglp_rd-spread = zaglp_rd-spread.

zaglp_rd-cost = zaglp_rd-cost.

ENDIF.

*DISPLAY OF ITEM DETAILS

SELECT * FROM zaglp_rd_item WHERE fgcode EQ zaglp_rd-fgcode AND

version EQ zaglp_rd-version.

IF sy-subrc EQ 0.

t_ind = 'X'.

t_tab1-rmcode = zaglp_rd_item-rmcode.

t_tab1-rmdesc = zaglp_rd_item-rmdesc.

t_tab1-weight = zaglp_rd_item-weight.

t_tab1-volume = zaglp_rd_item-volume.

t_tab1-cost = zaglp_rd_item-cost.

APPEND t_tab1.

CLEAR t_tab1.

ENDIF.

ENDSELECT.

  • When Calculation button is pressed

IF my_ok = 'CALC'.

selcol = 'X'.

PERFORM data_calc.

ENDIF.

IF my_ok = 'SAVE'.

t_ind = 'X'.

PERFORM data_save.

ENDIF.

ENDIF.

IF my_ok = 'CANC' OR my_ok = 'EXIT' OR my_ok = 'BACK'.

LEAVE PROGRAM.

ENDIF.

IF my_ok = 'PRINT'.

PERFORM data_print.

ENDIF.

IF my_ok = 'P+'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

IF my_ok = 'P-'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form DATA_CALC

&----


  • DATA CALCULATION

----


  • --> p1 text

  • <-- p2 text

----


FORM data_calc .

*DENSITY

IF zaglp_rd-tot_vol IS INITIAL.

zaglp_rd-density = 0.

ELSE.

zaglp_rd-density = zaglp_rd-tot_wt / zaglp_rd-tot_vol.

ENDIF.

*SOLID BY WEIGHT

IF zaglp_rd-tot_wt IS INITIAL.

zaglp_rd-soild_wt = 0.

ELSE.

zaglp_rd-soild_wt = solid_wt / zaglp_rd-tot_wt.

ENDIF.

*SOLID BY VOLUME

IF zaglp_rd-solid_vol IS INITIAL.

zaglp_rd-solid_vol = 0.

ELSE.

zaglp_rd-solid_vol = soild_vol / zaglp_rd-tot_vol.

ENDIF.

*VOC

IF zaglp_rd-tot_wt IS INITIAL.

zaglp_rd-voc = 0.

ELSE.

zaglp_rd-voc = ( t_voc * 1000 ) / zaglp_rd-tot_wt.

ENDIF.

*SPREAD

IF zaglp_rd-dft IS INITIAL.

zaglp_rd-spread = 0.

ELSE.

zaglp_rd-spread = ( zaglp_rd-solid_vol * 10 ) / zaglp_rd-dft.

ENDIF.

*Cost

IF zaglp_rd-tot_vol IS INITIAL.

zaglp_rd-cost = 0.

ELSE.

zaglp_rd-cost = zaglp_rd-tot_cost / zaglp_rd-tot_vol.

ENDIF.

*Entry Date

zaglp_rd-date_crd = sy-datum.

ENDFORM. " DATA_CALC

&----


*& Form DATA_SAVE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM data_save .

INSERT zaglp_rd FROM zaglp_rd .

INSERT zaglp_rd_item FROM TABLE t_tab1 ACCEPTING DUPLICATE KEYS .

MESSAGE i000(vz) WITH 'VERSION -' zaglp_rd-version 'IS SAVED FOR THE MATERIAL' zaglp_rd-fgcode .

ENDFORM. " DATA_SAVE

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'STATUS_0100'.

SET TITLEBAR 'TITLE_0100'.

  • for Pageup Pagedown

DESCRIBE TABLE t_tab1 LINES fill.

c_control-lines = fill.

screen-input = '1'.

MODIFY SCREEN.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Form DATA_PRINT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM data_print .

  • data: t_head like zaglp_rd occurs 0 with header line,

  • t_item like zaglp_rd_item occurs 0 with header line.

*

  • select single * from zaglp_rd into t_head where fgcode eq zaglp_rd-fgcode and

  • version eq zaglp_rd-version.

DATA: opts LIKE itcpo.

opts-tdimmed = 'X'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS = ARC_PARAMS

  • DEVICE = 'PRINTER'

  • OPTIONS = OPTS

  • DIALOG = ' '

form = 'ZAGLP_RD_PRINT'

language = sy-langu.

IF sy-subrc NE 0.

MESSAGE e000(vz) WITH 'please check'.

ENDIF.

LOOP AT t_tab1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM'.

    • FUNCTION = 'SET'

*

    • TYPE = 'BODY'

  • WINDOW = 'MAIN'.

ENDLOOP.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'FOOTER'.

CALL FUNCTION 'CLOSE_FORM'.

ENDFORM. " DATA_PRINT

Former Member
0 Kudos

Thanks christine.........Its working. Thank to all who helped me to sort out this

Regards

M.Nisha