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

problem with NEXT and PREVIOUS buttons!

Former Member
0 Likes
2,407

Hiii Everyone,

i'm brand-new beginner to programming in ABAP, and i'm facing a problem with my program and i wish for u to help me.

If there is more than 1 record under the same customer number, the user will be able to navigate through records using the previous and next buttons or to do that from the title bar buttons. The thing is, I don't know the code of how to make it go backward and forward through the records.

please need ur help in this and thank u in advance.

)

Hiii Everyone,

i'm brand-new beginner to programming in ABAP, and i'm facing a problem with my program and i wish for u to help me.

If there is more than 1 record under the same customer number, the user will be able to navigate through records using the previous and next buttons or to do that from the title bar buttons. The thing is, I don't know the code of how to make it go backward and forward through the records.

please need ur help in this and thank u in advance.

)

19 REPLIES 19
Read only

Former Member
0 Likes
2,372

.

Edited by: topppi on Mar 15, 2010 8:49 AM

Read only

Kanagaraja_L
Active Contributor
0 Likes
2,372

Check the Following Sample code

For Next

Program - LKKBLF01

Form - form scroll_end tables rt_columns type kkblo_t_columns.

For Previous (same Program)

form scroll_left tables rt_columns type kkblo_t_columns.

Read only

0 Likes
2,372

Hi Sir,

bcoz of it's under MODULE USER_COMMAND_7100 INPUT, so an error message appears to me said, " INCORRECT NESTING: BEFORE THE STATMENT "FORM" THE STRUCTURE INTRODUCED BY "CASE" MUST BE CONCLUDED BY "ENDCASE" which is already there!!!

Edited by: white angel on Mar 15, 2010 7:17 AM

Read only

0 Likes
2,372

check for the syntax error.........beacuse of which end case is not working......

Edited by: Sachin86 on Mar 15, 2010 7:22 AM

Read only

0 Likes
2,372

Send the Piece of code which part you are getting error

Read only

0 Likes
2,372

thats the code..... how can i attach a file so u can see a screen shot??

&----


*& Module USER_COMMAND_7100 INPUT

&----


  • text

----


MODULE USER_COMMAND_7100 INPUT.

CASE ok_code.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'OK'.

SELECT * FROM ycustomer_t INTO G_TAB_CON_WA

WHERE customer_no = F2.

ENDSELECT.

IF sy-subrc EQ 0 .

MOVE-CORRESPONDING G_TAB_CON_WA to ycustomer_t.

ELSE.

MESSAGE 'customer number you entered is not found' type 'I'.

CLEAR G_TAB_CON_WA-clint.

CLEAR G_TAB_CON_WA-customer_no.

CLEAR G_TAB_CON_WA-begin_date.

CLEAR G_TAB_CON_WA-credit_used.

CLEAR G_TAB_CON_WA-credit_allowed.

ENDIF.

WHEN 'SAVE'.

MODIFY ycustomer_t FROM G_TAB_CON_WA.

MESSAGE ' Data has been updated' TYPE 'I'.

WHEN 'NEXT'.

form scroll_end tables rt_columns type kkblo_t_columns.

WHEN 'PREVIOUS'.

form scroll_left tables rt_columns type kkblo_t_columns.

ENDCASE.

ENDMODULE. " USER_COMMAND_7100 INPUT

Read only

0 Likes
2,372

form scroll_end tables rt_columns type kkblo_t_columns.

form scroll_left tables rt_columns type kkblo_t_columns.

Remove the above Form statements.Errors will be solved.

given Example for your reference you cant use directly so check the logic inside the form and make it for your requirement

Read only

0 Likes
2,372

this FORM should be defined somewhere right???

like when use FORM and PERFORM.

bcoz the error still there

Read only

0 Likes
2,372
WHEN 'NEXT'.
form scroll_end tables rt_columns type kkblo_t_columns.


Endform.

WHEN 'PREVIOUS'.
form scroll_left tables rt_columns type kkblo_t_columns.

endform.

I want to Know where you are calling those forms like perform scroll_end . and Perform scroll_left ?

Kanagaraja L

Edited by: Kanagaraja Lokanathan on Mar 15, 2010 8:03 AM

Read only

0 Likes
2,372

WHEN 'NEXT'.

PERFORM scroll_end.

WHEN 'PREVIOUS'.

PERFORM scroll_left.

ENDCASE.

ENDMODULE. " USER_COMMAND_7100 INPUT

&----


*& Form scroll_end

&----


  • text

----


  • -->RT_COLUMNS text

----


form scroll_end tables rt_columns type kkblo_t_columns.

ENDFORM.

  • &---------------------------------------------------------------------

*& Form scroll_left

&----


  • text

----


  • -->RT_COLUMNS text

----


form scroll_left tables rt_columns type kkblo_t_columns.

ENDFORM.

i've tried this....the previous error gone..but now i have another error said " the type kkblo_t_columns. is unknown ".

really exhausting 😛

)

Read only

0 Likes
2,372

You have to Declare TYPE_POOLS KKBLO.

and see the logic inside the Form (Standard form in include LKKBLF01)

Read only

0 Likes
2,372

what kind of declaration???

......... TYPE_POOLS KKBLO???

Read only

0 Likes
2,372

TYPE_POOLS are basically a grouping of types .i.e. when you have a type you want to use you can use a type without having to define it all over again!

Read only

0 Likes
2,372

Yes thats my question... what is the kkblo_t_columns... is it table or what... how to declare it???

Read only

0 Likes
2,372

Yes Internal table You have to declare like below

TYPE-POOLS kkblo.

Inside your Program after that double click on KKBLO then you will navigate to Type-group and you can see the table definitions.

Kanagaraja L

Read only

0 Likes
2,372

this is really getting me frustrated....really sorry gentelmen but now i got new weird error...

different number of parameter in FORM and PERFORM ( routine: SCROLL_END, number of formal parameters: 1, number of actual parameters: 0 ).

Read only

0 Likes
2,372

Hi,

You seem to be getting a helluva compilation errors and you possibly cant list them out here for a chance that it might frustrate people who reply and also you

My suggestion:(considering the fact that you are new to ABAP) You can do a F1 on keywords which opens up a documentation for the keyword. You can also search the SDN for solution.

The error that you are getting is pretty straight forward. The number of formal parameters dont match with the actual parameters.

It essentially means that there is a difference in the number of parameters that you have used while calling the subroutine (PERFORM) and the definition of the subroutine (FORM...ENDFORM)

Use this


WHEN 'NEXT'.
  PERFORM scroll_end tables itab.

Read only

0 Likes
2,372

I think the whole idea of having these errors is that the PERFORM thing is placed in "Module USER_COMMAND_7000 INPUT"... i don't know u r the expret coz everytime i got new error and still not working.

Read only

0 Likes
2,372

Hello Gentelmen,

can i use the system function " sy_step1" sscrfields-functext_02 from table "sscrfields" and use the icons as function code???

the previous FORM and PERFORM thing didn't work so i'm changing the hole idea of it

please need ur help.