100% found this document useful (1 vote)
116 views4 pages

CNS0

Many times user required a find option to choose material to create delivery from project. Standard program is not providing any F4 help for selecting material, So need to do some change in standard program.

Uploaded by

sachin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
100% found this document useful (1 vote)
116 views4 pages

CNS0

Many times user required a find option to choose material to create delivery from project. Standard program is not providing any F4 help for selecting material, So need to do some change in standard program.

Uploaded by

sachin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 4

Find option in CNS0 (Delivery form Project)

Created By : Sachin Kumar ,Interarch Building Products Pvt. Ltd.

Many times user required a find option to choose material to create delivery from project.

Standard program is not providing any F4 help for selecting material, So need to do some

change in standard program.

Here is 2 ways to do this.

1. Create copy of CNS0 program and do changes as per requirement.


2. Change existing CNS0 program as per requirement.

I have achieved this to select first option.

Here I am giving brief description for this.

Here this is a standard screen (figure 1.1) has no find option.

Figure 1.1.

You can see in (figure 1.2) , have find option.


Figure 1.2

To get this functionality please do these steps.

Step 1. Change screen 2010 in SAP standard program “SAPLCNSH” or copied program from SAP and add
screen control fields

a. label with text “Find”


b. “Input Box” with name “valfind” and adjust subscreen like figure 1.3.

Figure 1.3

Step 2.

First add this line In top module

data : CNSH_MAT_tmp type CNSH_MAT.


Now change existing function module “set_scroll_cursor” figure 1.4

Figure 1.4

In screen 2010.

Add this code

FIELD-SYMBOLS: <tctrl> LIKE tctrl_2010.

DATA: tctrl_name(10) TYPE c VALUE 'TCTRL_XXXX'.

tctrl_name+6(4) = sy-dynnr.
ASSIGN (tctrl_name) TO <tctrl>.

lt_fields-fieldname = 'VALFIND'.

append lt_fields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = lt_fields
exceptions
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
read table lt_fields index 1.

if lt_fields-fieldvalue is NOT INITIAL.


loop at RESBQ_B into CNSH_MAT_tmp." where matnr like ''.
if CNSH_MAT_tmp-matnr CS lt_fields-fieldvalue.
scr_idx = sy-tabix.
ENDIF.
ENDLOOP.

endif.

Step 3.

Now activate program and run.

Just give substring of material in find input box

And press enter you will see that material on top of

List.

You might also like