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 Controls

Former Member
0 Likes
653

In my Scenario In the first screen i have cust No and a display button .

in the 2nd screen i have a table control where i have to display records based on custid.

Following is my code in the first screen(No:100)

WHEN 'DISP'.

clear it_cef.

clear wa_cef.

SELECT MANDT

CUST_NO

EVAL_DATE

CUST_NAME

FLAT_NO

PROJECT_NAME

ELIGIBILITY

ALLOCATED

ACHEIVABLE

FROM ZCUST_EF

INTO table it_CEF

WHERE CUST_NO = ZCUST_EF-CUST_NO .

loop at it_cef to wa_cef.

*move wa_CEF-cust_no to ZCUST_EF-cust_no.

*move wa_CEF-EVAL_DATE to ZCUST_EF-EVAL_DATE.

*move wa_CEF-cust_name to ZCUST_EF-cust_name.

*move wa_CEF-FLAT_NO to ZCUST_EF-FLAT_NO.

*move wa_CEF-PROJECT_NAME to ZCUST_EF-PROJECT_NAME.

**move wa_CEF-ELIGIBILITY to ZCUST_EF-ELIGIBILITY.

*move wa_CEF-ALLOCATED to ZCUST_EF-ALLOCATED.

**move wa_CEF-ACHEIVABLE to ZCUST_EF-ACHEIVABLE.

endloop.

At least help me with the simple example which resolves my Query

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
621

Hi

Declare all the variables in top include

try this simple code make sure all the screen field names are same as that you declare in the TOP include

in PAI

CASE ok_code

when 'DISP'.

SELECT * -


CALL SCREEN 200.

endcase.

in PBO of second screen

loop at itab2 with control tc.

endloop

Regards

Ramchander rao.K

5 REPLIES 5
Read only

Former Member
0 Likes
622

Hi

Declare all the variables in top include

try this simple code make sure all the screen field names are same as that you declare in the TOP include

in PAI

CASE ok_code

when 'DISP'.

SELECT * -


CALL SCREEN 200.

endcase.

in PBO of second screen

loop at itab2 with control tc.

endloop

Regards

Ramchander rao.K

Read only

Former Member
0 Likes
621

PBO (second screen)

loop at itab with control <table control>

module PBO

endloop

PAI

module

loop at itab

endloop.

try doing this

u might get the result

Read only

Former Member
0 Likes
621

Hi,

Check this Code..

PROCESS BEFORE OUTPUT.

  • Module to fetch data from the database

SELECT MANDT

CUST_NO

EVAL_DATE

CUST_NAME

FLAT_NO

PROJECT_NAME

ELIGIBILITY

ALLOCATED

ACHEIVABLE

FROM ZCUST_EF

INTO table it_CEF

WHERE CUST_NO = ZCUST_EF-CUST_NO .

LOOP AT it_CEF-

INTO g_val_destin_main_wa -


Workarea

WITH CONTROL val_destin_main -


Table Control

CURSOR val_destin_main-current_line.

  • Module to move data from work area to the Table control

move wa_CEF-cust_no to ZCUST_EF-cust_no.

*move wa_CEF-EVAL_DATE to ZCUST_EF-EVAL_DATE.

*move wa_CEF-cust_name to ZCUST_EF-cust_name.

*move wa_CEF-FLAT_NO to ZCUST_EF-FLAT_NO.

*move wa_CEF-PROJECT_NAME to ZCUST_EF-PROJECT_NAME.

**move wa_CEF-ELIGIBILITY to ZCUST_EF-ELIGIBILITY.

*move wa_CEF-ALLOCATED to ZCUST_EF-ALLOCATED.

**move wa_CEF-ACHEIVABLE to ZCUST_EF-ACHEIVABLE.

  • Module to get total line displayed

g_val_destin_main_lines = sy-loopc.

  • Module to decide the Display/Hide characteristics on screen '0110'

MODULE display_tab.

ENDLOOP.

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
621

Hi Pranu,

WHEN 'DISP'.

clear it_cef.
clear wa_cef.
SELECT MANDT
CUST_NO
EVAL_DATE
CUST_NAME
FLAT_NO
PROJECT_NAME
ELIGIBILITY
ALLOCATED
ACHEIVABLE
FROM ZCUST_EF
INTO table it_CEF
WHERE CUST_NO = ZCUST_EF-CUST_NO .

Call Screen 200.

in the flow logic of screen 200. write the follwoing statements

PROCESS BEFORE OUTPUT.
 LOOP AT it_cef INTO wa_cef  WITH CONTROL<table Control name defined in top include>l.
    MODULE disp_data.
  ENDLOOP.

PROCESS AFTER INPUT.
  LOOP.
  ENDLOOP.

*&---------------------------------------------------------------------*
*&      Module  disp_data  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE disp_data OUTPUT.
 ZCUST_EF-MANDT. = wa_cef-MANDT.
'
'
'
'
 ZCUST_EF-ACHEIVABLE  =  wa_cef-ACHEIVABLE 
ENDMODULE.                 " disp_data  OUTPUT

Thanks & Regards

Read only

Former Member
0 Likes
621

Thanks Buddy

Have a nice weekend.

Regards

Ramchander Rao.K