Application Development and Automation 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: 
Read only

Table control in Screen Painter

Former Member
0 Likes
1,299

Hi Friends,

I have created a screen using screen painter. The screen is having 4 tabs (subscreen) and in all the subscreen, i have used table control to insert multiple lines in the table.

The problem I am getting is that, the data of table control part is not getting inserted into the table.

The program part is given below for reference.

======================================================

PROCESS BEFORE OUTPUT.

MODULE SECDAM_CHANGE_TC_ATTR.

LOOP AT IT_SECDAM

INTO IT_SECDAM

WITH CONTROL SECDAM

CURSOR SECDAM-CURRENT_LINE.

MODULE SECDAM_GET_LINES.

ENDLOOP.

MODULE STATUS_0109.

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'SECDAM'

LOOP AT IT_SECDAM.

CHAIN.

FIELD ZTDRDTL-DIVSN.

FIELD ZTDRDTL-MATRL.

FIELD ZTDRDTL-SLQTY.

FIELD ZTDRDTL-DMQTY.

FIELD ZTDRDTL-SSQTY.

MODULE SECDAM_MODIFY ON CHAIN-REQUEST.

endchain.

ENDLOOP.

MODULE SECDAM_USER_COMMAND.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Flow-logic part:

-


DATA : BEGIN OF IT_SECDAM OCCURS 0,

DIVSN LIKE ZTDRDTL-DIVSN,

MATRL LIKE ZTDRDTL-MATRL,

SLQTY LIKE ZTDRDTL-SLQTY,

DMQTY LIKE ZTDRDTL-DMQTY,

SSQTY LIKE ZTDRDTL-SSQTY,

END OF IT_SECDAM.

CONTROLS: SECDAM TYPE TABLEVIEW USING SCREEN 0109.

DATA: G_SECDAM_LINES LIKE SY-LOOPC.

MODULE SECDAM_CHANGE_TC_ATTR OUTPUT.

DESCRIBE TABLE IT_SECDAM LINES SECDAM-LINES.

ENDMODULE. "SECDAM_CHANGE_TC_ATTR OUTPUT

MODULE SECDAM_GET_LINES OUTPUT.

G_SECDAM_LINES = SY-LOOPC.

ENDMODULE. "SECDAM_GET_LINES OUTPUT

MODULE SECDAM_MODIFY INPUT.

MODIFY IT_SECDAM

FROM IT_SECDAM

INDEX SECDAM-CURRENT_LINE.

ENDMODULE. "SECDAM_MODIFY INPUT

MODULE SECDAM_USER_COMMAND INPUT.

OK_CODE = SY-UCOMM.

PERFORM USER_OK_TC USING 'SECDAM'

'IT_SECDAM'

' '

CHANGING OK_CODE.

SY-UCOMM = OK_CODE.

ENDMODULE. "SECDAM_USER_COMMAND INPUT

=========================================================

Kindly guide me the solution.

TIA.

Regards,

Mark K

3 REPLIES 3
Read only

Former Member
0 Likes
630

HI

Look at these help programs ...

<b>demo_dynpro_tabcont_loop</b>

<b>demo_dynpro_tabcont_loop_at.</b>

and also have look at the below link

http://sts1.sts.tu-harburg.de/teaching/sap_r3/ABAP4/contro02.htm

Regards

Sudheer

Read only

Former Member
0 Likes
630

u mean to say the data is not getting inserted into database table....u have data in internal table...use this on some button click and insert to database by mmoving data from internal table to database table fields and use INSERT <database>...Commit Work...

Read only

Former Member
0 Likes
630

Hi

Try like this may be you will get it.

process before output.

module status_1000.

loop at itab with control tabctrl cursor tabctrl-top_line.

module assign_data.

endloop.

process after input.

module user_command_1000.

loop at itab.

endloop.

In flow logic.

tables vbak.

data itab like vbak occurs 0 with header line.

controls tabctrl type tableview using screen 1000.

data fill type i.

&----


*& Module Assign_data OUTPUT

&----


  • text

----


module assign_data output.

move itab to vbak.

endmodule. " Assign_data OUTPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module user_command_1000 input.

case sy-ucomm.

when 'EXIT'.

set screen 0.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

&----


*& Module STATUS_1000 OUTPUT

&----


  • text

----


module status_1000 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

select * from vbak into table itab.

describe table itab lines fill.

tabctrl-lines = fill.

Endmodule.

Regards

Haritha.