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

SandySingh
Active Contributor
0 Likes
390

In a table control ,there is Serial no and verson no Columns. The serial no is generated as soon as it press ADD button on screen.Corressponding one generated Serial no , i need to generate version nos when i press ADD button again. and next time when i logon again in CHANGE or CREATE mode. The serail no is generated again say 2 and agin new version nos like 1,2,3,4,5 are generated could anyone help me in this..if someone could send me a sample code, then it would be really nice . I am using following code to generated Serial no.

********************************************************

DATA l_zvig_pack_dates LIKE wa_zvig_pack_dates.

    • Get the Max S.No from the internal table and add 1.

CLEAR wa_zvig_pack_dates.

      • reading the last line in wa

READ TABLE it_zvig_pack_dates

INTO l_zvig_pack_dates

INDEX tbc_actions-lines.

wa_zvig_pack_dates-sno = l_zvig_pack_dates-sno + 1.

wa_zvig_pack_dates-mark = ' '.

APPEND wa_zvig_pack_dates TO it_zvig_pack_dates.

***getting the last line of table control to get the SNO

DESCRIBE TABLE it_zvig_pack_dates

LINES tbc_actions-lines.

**********************************************************

thanks

sandeep

Message was edited by:

SANDEEP SINGH

1 ACCEPTED SOLUTION
Read only

former_member196299
Active Contributor
0 Likes
371

hi ,

Try doing like this: in the PAI of your flow logic,add this logic ,

case sy-ucomm.

when 'ADD'.

loop at screen.

screen-input = 1.

modify screen.

endloop.

Write a logic for adding a line into your code . ( u may append a blank line to your table control ) .

endcase .

Regards,

Ranjita

4 REPLIES 4
Read only

Former Member
0 Likes
371

hi Refer to these related threads

Read only

Former Member
0 Likes
371

Hi,

1) Have a field FLAG in the table control internal table..

2) User-command in PAI.


CASE SY-UCOMM.
  WHEN 'ADD'.    " When ADD button is pressed.
    CLEAR WA.
    WA-FLAG = 'I'.
    APPEND WA TO ITAB.

ENDCASE.

3) Module in PBO.


LOOP AT ITAB WITH CONTROL TC.
  MODULE enable.
ENDLOOP.

MODULE ENABLE.

* Process the screen internal table.
  LOOP AT SCREN. 

  IF WA-FLAG = 'I'.
    SCREEN-INPUT = 1.    " Enable for input.
  ELSE.
    SCREEN-INPUT = 0.    " Disable for input.
  ENDIF. 

ENDMODULE.

Thanks

Naren

Read only

former_member196299
Active Contributor
0 Likes
372

hi ,

Try doing like this: in the PAI of your flow logic,add this logic ,

case sy-ucomm.

when 'ADD'.

loop at screen.

screen-input = 1.

modify screen.

endloop.

Write a logic for adding a line into your code . ( u may append a blank line to your table control ) .

endcase .

Regards,

Ranjita

Read only

Former Member
0 Likes
371

Hi Sandeep,

try to get the rowcount of internal table using DESCRIBE TABLE IntTab LINES lin and then use loop at screen to enable the empty rows.

Regards,

Sathish