‎2007 May 30 4:45 AM
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
‎2007 May 30 5:20 AM
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
‎2007 May 30 4:50 AM
‎2007 May 30 4:50 AM
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
‎2007 May 30 5:20 AM
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
‎2007 May 30 6:03 AM
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