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

adnanmaqbool
Contributor
0 Likes
628

Dear All

I have created a Table Control "ZAMT" on a screen with following code. I have also created a structure name ZCNG_PAYMENT from se11 and use fields of this structure to create table control on screen. But when I enters value in table data is not passing to Program in PAI and from Program to Table in PBO.



PROCESS BEFORE OUTPUT.

LOOP WITH CONTROL ZAMT.
    MODULE FILL_TABLE_CONTROL.
ENDLOOP.

PROCESS AFTER INPUT.

LOOP WITH CONTROL ZAMT.
    MODULE FILL_TABLE_CONTROL.
ENDLOOP.


////////////////////////////////////////////////

DATA: BEGIN OF ZCNG_PAYMENT,
        MANDT TYPE ZCNG_PAYMENTS-MANDT,
        CDPNO TYPE ZCNG_PAYMENT-CDPNO,
        SEQNR TYPE ZCNG_PAYMENT-SEQNR,
        ZMONTH TYPE ZCNG_PAYMENT-ZMONTH,
        PAMT TYPE ZCNG_PAYMENT-PAMT,
      END OF ZCNG_PAYMENT.

DATA: BEGIN OF ZCNG_PAYMENTSI OCCURS 0,
        MANDT TYPE ZCNG_PAYMENTS-MANDT,
        CDPNO TYPE ZCNG_PAYMENTS-CDPNO,
        SEQNR TYPE ZCNG_PAYMENTS-SEQNR,
        ZMONTH TYPE ZCNG_PAYMENT-ZMONTH,
        PAMT TYPE ZCNG_PAYMENTS-PAMT,
      END OF ZCNG_PAYMENTSI.


CONTROLS ZAMT TYPE TABLEVIEW USING SCREEN 9002.

*&---------------------------------------------------------------------*
*&      Module  FILL_TABLE_CONTROL  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE FILL_TABLE_CONTROL OUTPUT.

READ TABLE ZCNG_PAYMENTSI INTO ZCNG_PAYMENT INDEX ZAMT-current_line.

ENDMODULE.                 " FILL_TABLE_CONTROL  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  FILL_TABLE_CONTROL  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE FILL_TABLE_CONTROL INPUT.

 MODIFY ZCNG_PAYMENTSI FROM ZCNG_PAYMENT INDEX ZAMT-current_line.



ENDMODULE.                 " FILL_TABLE_CONTROL  INPUT



1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
592

Hi

use table control with wizard and in that after chain ....enchain in PAI u can write the code for updating DB.

regards

vivek

5 REPLIES 5
Read only

Former Member
0 Likes
592

Hi,

If you want to display the data that you have fetched you have to write it in PBO only.

so write th code that you have written here only in PBO and not in PAI.

Hope this helps.

Thanks,

Rashmi.

Read only

Former Member
0 Likes
592

Hi,

Use

PBO.

Loop at itab into wa with control tc.

module give_data_to_tc.

endloop.

PAI.

loop at itab.

module get_data_from_tc.

endloop.

Read only

adnanmaqbool
Contributor
0 Likes
592

Thanks For your comments.

Issue Resolved. I didnt declare

Table:ZCNG_PAYMENTS

due to which values were not passing to screen.

Read only

Former Member
0 Likes
593

Hi

use table control with wizard and in that after chain ....enchain in PAI u can write the code for updating DB.

regards

vivek