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

Need help on screen painter table design

Former Member
0 Likes
1,376

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

12 REPLIES 12
Read only

SreekanthKrishn
Contributor
0 Likes
1,329

Hi,

Have you used wizard to create the table control?

Thanks,

Sreekanth

Read only

0 Likes
1,329

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

Read only

Former Member
0 Likes
1,329

hi ,

remove

REFRESH CONTROL 'BARTABLE' FROM SCREEN '0100'.

in Your coding .

Regards,

Ams K.

Read only

0 Likes
1,329

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,329

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 OUTPUT

Add a create icon, and this icon will add an initial line to internal table, at next PBO the line will appear.

Regards,

Raymond

Read only

Former Member
0 Likes
1,329

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

Read only

Former Member
0 Likes
1,329

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.

Read only

0 Likes
1,329

This message was moderated.

Read only

0 Likes
1,329

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

Read only

0 Likes
1,329

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

Read only

Former Member
0 Likes
1,329

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

Read only

Former Member
0 Likes
1,329

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