2013 Jun 28 6:17 AM
I am new in screen painter if I am doing something wrong please mention me
I have created the screen with screen painter and saving the enter data in my Z tables.I am having a problem in saving a next record . My cursor is not moving to next record.
Check the screen shot and coding.
*&SPWIZARD: OUTPUT MODULE FOR TC 'BARTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE BARTABLE_INIT OUTPUT.
IF G_BARTABLE_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZBAR_DATA'
*&SPWIZARD: INTO INTERNAL TABLE 'g_BARTABLE_itab'
SELECT * FROM ZBAR_DATA
INTO CORRESPONDING FIELDS
OF TABLE G_BARTABLE_ITAB.
G_BARTABLE_COPIED = 'X'.
REFRESH CONTROL 'BARTABLE' FROM SCREEN '0100'.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'BARTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE BARTABLE_MOVE OUTPUT.
MOVE-CORRESPONDING G_BARTABLE_WA TO ZBAR_DATA.
INSERT INTO ZBAR_DATA VALUES G_BARTABLE_WA.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'BARTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE BARTABLE_MODIFY INPUT.
MOVE-CORRESPONDING ZBAR_DATA TO G_BARTABLE_WA.
MODIFY G_BARTABLE_ITAB
FROM G_BARTABLE_WA
INDEX BARTABLE-CURRENT_LINE.
ENDMODULE.
I want to enter data in the next record . How can I do this
2013 Jun 28 6:38 AM
Hi,
Have you used wizard to create the table control?
Thanks,
Sreekanth
2013 Jun 28 6:54 AM
Hi,
While creating TC trhough Wizard there is an option to get INSERT, DELETE buttons also. This will help you to get a new line to insert data. Or you have to design such that whole table is editable.
Regards,
Swarna
2013 Jun 28 6:43 AM
hi ,
remove
REFRESH CONTROL 'BARTABLE' FROM SCREEN '0100'.
in Your coding .
Regards,
Ams K.
2013 Jun 28 7:12 AM
Check somewhere in the code the wizard would be setting.
CONTROL_NAME-LINES = The no of lines in table.
Remove this and it is done.
Regards
2013 Jun 28 7:27 AM
Change PBO module
MODULE bartable_init OUTPUT.
IF g_bartable_copied IS INITIAL. " First time
SELECT * INTO CORRESPONDING FIELDS OF TABLE g_bartable_itab
FROM zbar_data.
g_bartable_copied = 'X'.
REFRESH CONTROL 'BARTABLE' FROM SCREEN '0100'.
ENDIF.
DESCRIBE TABLE g_bartable_itab LINES bartable-lines. " Always
ENDMODULE. "BARTABLE_INIT OUTPUTAdd a create icon, and this icon will add an initial line to internal table, at next PBO the line will appear.
Regards,
Raymond
2013 Jun 28 7:54 AM
Hi,
Use the following code snippet in PBO,
data: lv_lines type i.
clear: lv_lines .
Describe table G_BARTABLE_ITAB lines lv_lines
if lv_lines LE 0.
lv_lines = 5.
else.
Add 5 to lv_lines,
BARTABLE-lines = lv_lines.
Regards,
Tushar
2013 Jun 28 8:02 AM
Hi,
If ur module is within CHAIN-ENDCHAIN in PAI then write
MODULE BARTABLE_MODIFY ON CHAIN-REQUEST.
Ur cursor will directly go to the next line, it wont get greyed out.
Regards,
Supriya.
2013 Jun 28 10:50 AM
2013 Jun 28 10:50 AM
thanks for your replies.
I am working through wizard by using Zdictionary table so insert/delete option grayed out in Wizard.
Now I am working on the given solutions and get back
2013 Jun 28 12:57 PM
s/m Waqas,
It is better to use your own code than the wizard if you are new to dynpro help is here.
For understanding.
http://www.saptechies.com/create-sap-table-control-abap/
For implementation :
http://sgstocks.tripod.com/abap007.htm
Cheers
2013 Jun 28 11:55 AM
following code addition in MODULE BARTABLE_INIT allows me to enter into the next record
DESCRIBE TABLE G_BARTABLE_ITAB LINES bartable-lines. " Always
But once you enter the record then you are not able to scroll to the next record until you execute the program again.
I want my screen table to work like SAP Order or Purchase Order screen
2013 Jun 28 11:55 AM
following code addition in MODULE BARTABLE_INIT allows me to enter into the next record
DESCRIBE TABLE G_BARTABLE_ITAB LINES bartable-lines. " Always
But once you enter the record then you are not able to scroll to the next record until you execute the program again.
I want my screen table to work like SAP Order or Purchase Order screen