Application Development 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: 

Search option for Step loop Items

Former Member
0 Kudos

Dear All,

I need to add a search(FIND) button for step loop items(more than 200 items).

please help.

Thanks & Regards

Ravi

4 REPLIES 4

Former Member
0 Kudos

hi

apart from the back, exit, and cancel buttons taht we see in the standard screens, for all the other buttons in the app. tool bars, we have to write our own funcationalities...this code works fine for search functionality in my table control..should work for u as well..

MODULE USER_COMMAND_0123 INPUT.

FCODE = OKCODE.

CLEAR OKCODE.

CASE FCODE.

WHEN 'SEARCH'.

CALL FUNCTION 'POPUP_TO_GET_ONE_VALUE'

EXPORTING

TEXTLINE1 = V_MATNR

  • TEXTLINE2 = ' '

  • TEXTLINE3 = ' '

TITEL = 'Enter a material to search'

VALUELENGTH = '18'

IMPORTING

ANSWER = V_ANSWER

VALUE1 = V_MATNR

  • EXCEPTIONS

  • TITEL_TOO_LONG = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF V_ANSWER = 'J'.

READ TABLE ITAB_TBL WITH KEY MATNR = V_MATNR.

TBCTRL-TOP_LINE = SY-TABIX.

CLEAR V_MATNR.

ENDIF.

endcase.

where your itab_tbl is the int. table that is displayed in the table control..

if useful, reward...

Sathish. R

0 Kudos

thanks satish

Now, I am finding the field vlaue by the FM 'POPUP_TO_GET_ONE_VALUE', but

need to set the cursor on the same field value of the <b>step loop</b>.

Please help...

ashok_kumar24
Contributor
0 Kudos

Hi Ravikumar,

Good Check the following documentation,

STEP LOOPS

Step Loops are type of screen table . Step loops are repeated blocks of field in a screen. Each block contains one or more fields and these blocks are repeated. Step loops aren’t like actual table. You can scroll vertically but not horizontally. Three steps are associated with creation of step loops:

• Creation of step loops on screen, which includes declaring fields on the screen and then defining the step, loops for these fields.

• Passing data to the step loop is exactly similar to the passing of data to table controls.

• In step loop, you don’t need to define the step loop as such in the module pool program but the cursor needs to be defined in the program.

Types of Step Loops

• Static – Static Step Loop (SSL) have fixed size that cannot be changed during the runtime. If user resizes the window, the size of the static step loop is not changed.

• Dynamic – Dynamic Step Loop (DSL) is variable in size. When the user resizes the window, the system increases or decreases the number of the step loop blocks.

You can have only one dynamic step loop and can have as many static loops in your transaction.

Programming with the Static and dynamic step loop is exactly same. For the system or for the user it doesn’t make any difference whether it is static or dynamic step loop. Only attribute, which you fix during designing of the step loop, is type attribute for step loop F for fixed i.e static and V for variable i.e. dynamic.

Writing code for Step Loop in the flow logic.

PBO.

Loop at itab cursor cl.

Module set.

Endloop.

PAI.

Loop at itab.

Endloop.

  • Empty loop is must for both table control and step loop

LOOP AT statement for step loops and Table controls is similar. Loop At statement transfers the data to screen table. You need to have the Module to assign the values for the screen table.

In module pool program you need to define the cursor.

Date: CL TYPE i.

  • Cursor parameter tells which line of step loop display should start.

“Module Set” in module pool program assigns the values to step loop fields, which is similar to table controls.

in pbo

LOOP AT it_table CURSOR l_step_loop_pos.

ENDLOOP.

in pai

LOOP AT it_table.

MODULE process_list.

ENDLOOP.

The module process_list should be uswed to modify the table which you are looping through:

MODIFY it_table INDEX l_step_loop_pos.

http://help.sap.com/saphelp_nw04/helpdata/en/d1/801c13454211d189710000e8322d00/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/d1/80236c454211d189710000e8322d00/content.htm

Good Luck and thanks

AK

Former Member
0 Kudos

null

Message was edited by:

SHIBA DUTTA