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

Function code for sy-uomm = space

Former Member
0 Likes
742

Hi Experts,

I have a field MATNR at Header level(say) and a table control below say with > 1 rows for line items

and few columns in which MATNR is one of them.

I had written code for pressing ENTER at header level which has sy-ucomm as space.

Now for item level (in tab control) also sy-ucomm = space.

I want to assign different func codes to the MATNR field at Header level and in item level (in table control).

This is because when i press enter key the same code triggers at header level or even at table control level

in PAI. The same logic triggers in both cases and gives me wrong result.

How do i handle this if not?

Pls suggest.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
680

Hi

For table control you can use chan endchain so inthis case when you make any changes in the table control then for the fields which have been used inside chain endchain MODULE modify_Control will get triggered.


PAI

*module for Header*
FIELD WA_MATNR Module Change_Header ON INPUT

*Table Control*
Loop at i_tab.
CHAIN.
 
FIELD wa_itab-matnr.
MODULE modify_Control ON CHAIN-REQUEST. 
ENDCHAIN.
 
Endlopp.

Hope that will solve the problem.

Neha

4 REPLIES 4
Read only

Former Member
0 Likes
681

Hi

For table control you can use chan endchain so inthis case when you make any changes in the table control then for the fields which have been used inside chain endchain MODULE modify_Control will get triggered.


PAI

*module for Header*
FIELD WA_MATNR Module Change_Header ON INPUT

*Table Control*
Loop at i_tab.
CHAIN.
 
FIELD wa_itab-matnr.
MODULE modify_Control ON CHAIN-REQUEST. 
ENDCHAIN.
 
Endlopp.

Hope that will solve the problem.

Neha

Read only

0 Likes
680

Hi Neha Shukla,

What exactly should i write in MODULE modify_Control?

FIELD WA_MATNR Module Change_Header ON INPUT --> isn't it ON CHANGE here?

Thanks

Dan

Read only

0 Likes
680

Hi

This Module will be called as soon as you change the value or enter the value in header field Matnr.

As you have mentioned in your case that when you change the value or enter the value then you execute some piece of code using sy-ucomm = space so instead of using sy-ucomm = space

when u enter some value in your header field than this module will be called you save this screen field in some z table or you save it in a temp table or you can validate it ,I mean it`s up to you how do you handle this.

I have suggested to use this instead of sy-ucomm = space.

Neha

Read only

Former Member
0 Likes
680

Not possible with text box.

need to provide drop down and assign a func code