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

Dialog Programming table control problem

Former Member
0 Likes
968

Hi Friends i am struggling with this issue since long but not

getting the expected result please help,

>i know how to create table control as well as how to create a

> module pool program i tried my best also i used the save push

> button coding here and save push button is created in pf-status Frc1 menu painter and when i call the screen i never view the save push button as well but its not working i am not understanding

> why this is happening i am sending my module pool code as well

> as flow logic if u have time please see into this and help me,

Program ZUTABCONT_LOOP_AT_YAHOO Message-id zz.

TABLES: ZEMP.

DATA: CHK TYPE C.

DATA: ITAB TYPE ZEMP OCCURS 100 WITH HEADER LINE.

data: v_comm like sy-ucomm,

ok_code(04) type c.

DATA : BEGIN OF it_tab OCCURS 0,

zempno like zemp-zempno,

zname like zemp-zname,

zsal like zemp-zsal,

zcity1 like zemp-zcity1,

END OF it_tab.

CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN '0100'.

DATA COLS LIKE LINE OF TABCTRL-COLS.

*&----


-


*

*& Module STATUS_0100 OUTPUT

*&----


-


*

  • text

*----


-


*

module STATUS_0100 output.

SET PF-STATUS 'FRC1'.

SET TITLEBAR 'ZZ'.

MOVE-CORRESPONDING IT_TAB TO ZEMP.

endmodule. " STATUS_0100 OUTPUT

*----


-


*

  • MODULE user_command_0100_exit

*----


-


*

*

*----


-


*

MODULE user_command_0100_exit INPUT.

CASE OK_code.

WHEN 'DISP'.

CLEAR ITAB.

SELECT * FROM ZEMP INTO TABLE ITAB.

  • DISABLE THE TABLE CONTROL FOR INPUT

TABCTRL-LINES = SY-DBCNT.

LOOP AT TABCTRL-COLS INTO COLS WHERE index GT 0.

COLS-SCREEN-INPUT = '0'.

MODIFY TABCTRL-COLS FROM COLS INDEX sy-tabix.

ENDLOOP.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

endmodule. "user_command_0100_exit

*&----


-


*

*& Module USER_COMMAND_0100 INPUT

*&----


-


*

  • text

*----


-


*

module USER_COMMAND_0100.

CASE ok_code.

WHEN 'EDIT'.

  • ENABLE THE TABLE CONTROL FOR INPUT

LOOP AT TABCTRL-COLS INTO COLS WHERE index GT 1.

COLS-SCREEN-INPUT = '1'.

MODIFY TABCTRL-COLS FROM COLS INDEX sy-tabix.

ENDLOOP.

WHEN 'SAVE'.

insert into zemp values itab.

COMMIT WORK.

IF SY-SUBRC = 0.

MESSAGE I001(0) WITH 'UPDATED'.

ENDIF.

Endcase.

Endmodule. " USER_COMMAND_1000 INPUT

*&----


-


*

*& Module SCRTOIT INPUT

*&----


-


*

  • text

*----


-


*

module SCRTOIT INPUT.

MODIFY It_tab INDEX TABCTRL-CURRENT_LINE.

move-corresponding it_tab to itab.

append itab.

endmodule. " SCRTOIT INPUT

Flow logic for the same program is

PROCESS BEFORE OUTPUT.

loop at it_tab WITH CONTROL tabctrl

CURSOR tabctrl-current_line.

endloop.

MODULE STATUS_0100.

PROCESS AFTER INPUT.

MODULE user_command_0100_exit AT EXIT-COMMAND.

loop at it_tab.

Module SCRTOIT.

endloop.

Module user_command_0100.

I have used the table control manually not through wizard also

the table control fields are not from dictionary table they are

from internal table it_tab

and the requiremnet of this program output is when i execute the

table control should be in disable mode and when i press new

entries button it should go to enable mode and when i enter the

data and press save it should save the data into the CUSTOMISED

TABLE ztv_loan_master as well as it should update the last

record into table zts_global_field where the key1 =

'ZVXXR_LOAN_MASTER'.

One problem is when i created the save button in the se41 in

status Frc1 still i cant view the save button when i execute in

se51 screen painter why so i am not understanding how to code

for this please help.

pLEASE FIRST HELP ME FOR THE SAVE BUTTON AND NEW ENTRIES BUTTON.

Thanks and Best Regards,

Ujwala Shirsulla.

7 REPLIES 7
Read only

Former Member
0 Likes
899

hi ujwala,

i have create example as you said.

In PBO r u calling

PROCESS BEFORE OUTPUT.

<b>MODULE STATUS_0100.</b>

<b>&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'FRC1'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0100 OUTPUT</b>

Read only

Former Member
0 Likes
899

Hi Ujwala,

In your module pool program in PBO <b>double click on SET PF-STATUS 'FRC1'</b>. It will take you to Maintain status screen . There check whether the <b>save</b> button is there or not . If it is there press execute button and to check Status simulation .

Regards,

Balavardhan.K

Read only

0 Likes
899

Thanks Balavardhan,

There is one more problem which i see is when i enter the records into the table control and press enter the record gets cleared from the screen and when i enter multiple record its saving only one record how will i deal with this issue any clue.

Thanks and Best Regards,

Ujwala Shirsulla.

Read only

0 Likes
899

hi

I think in your pai, you are capturing the records entered in teh table control..you should include a module in your pai which modifies the lines of the table control..

In your PAI of itab.

LOOP AT ITAB.

CHAIN.

FIELD ITAB-MATNR.

FIELD ITAB-MTART.

FIELD ITAB-QTY.

MODULE ITAB_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE ITAB_MODIFY INPUT.

MODIFY ITAB

INDEX TBLCTRL2-CURRENT_LINE.

ENDMODULE.

if you include this module in your pai, the values will not be cleared when you press enter...if it was helpful, pl reward

Read only

Former Member
0 Likes
899

Hi Ujwala,

Check if your PF status is active or not.

In case, its not active the push button which you have created will not appear in the screen when you execute your program.

Hope this helps you,

Thanks and Regards,

Vijaya.

Read only

Former Member
0 Likes
899

hi ujwala,

as i observed u have commented the PBO

PROCESS BEFORE OUTPUT.

<b>MODULE STATUS_0100.</b>

Message was edited by:

Naresh Reddy

Read only

Former Member
0 Likes
899

Thanks for all ur efforts and replies My problem is resolved 90% still i have some new changes if any issues will reply u all

Thanks and Best regards,

Ujwala.