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: 

Program has to be trigger only for particular field.

former_member196331
Active Contributor
0 Kudos

Hi,

(Note: I am not asking about search help filtration )

I have one questions. I had written one code. for T-code  FS00.  When ever i press the f4_help for Gl_account i had written some logic.

It is working fine.Like below.

IF SY-TCODE EQ 'FS00'.

IF SY-UNAME EQ 'USER01'.

" I had written the logic.


ENDIF.

ENDIF.


But the above code is triggering , Other fields are also having f4_help not same different fields, fetching data from different tables,

My question is program has to be trigger only for particular screen field. I think i need to written one more if condition. That is also i tried like below.

Then i added the below code like.


LOOP AT SCREEN.

if screen-field = 'SANKR'.

ENDLOOP.


If i activate the program the below error i am getting.

The data object "SCREEN" does not have a component called "FIELD".


Then i open the screen painter for this program in se51  then i got the screen name of the field, then i changed to


if screen-field = SAPLGL_ACCOUNT_MASTER_MAINTAIN.


Still i am getting the same error. Can any body tell me how could i do the validation for particular field.


1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor
0 Kudos

Hi

Use - GET CURSOR FIELD

based on that do your action.

Regards,

Venkat

13 REPLIES 13

former_member196651
Contributor
0 Kudos

Hai,

If you are looping inside the SCREEN structure, then the name of the field is got using

SCREEN-NAME and not SCREEN-FIELD. Please check.

Regards,

Abijith

0 Kudos

HI, Thanks For your reply.  How could i get the screen name.

I open the se51  and here for this field screen name is available i took that one, and i used in the code. But it is not allowing.It means code is not going the inside of the if condition.

If i check the screen-name it is showing that TEXT_COA_BILKT.

Can i use this one as Screen-name. If your answer is yes.

I click on the other field at FS00 . company code i clicked, for that field also screen-name it is showing that  TEXT_COA_BILKT.

0 Kudos

Hai,

When the transaction is running, please place cursor on the required field and press F1. From the popup click on the fourth button and from the next popup you can find the screen field.

Regards,

Abijith

0 Kudos

Hi,

Thanks for your reply. I tried both. Below is my Code. I put the break point at second loop. I hope i put the correct place.

Not firing. Only cursor is coming on if  screen-name condition only. then it will not come to second loop.

two i tried  screen-field is 'sankr' and  GLACCOUNT_SCREEN_KEY-SAKNR

LOOP AT SCREEN.

  if screen-name = 'GLACCOUNT_SCREEN_KEY-SAKNR'.

                 

*  if screen-field = 'SANKR'.

LOOP AT RECORD_TAB[] INTO WA_TEMP.

  CLEAR: ITAB,TEMP_DATA,T1.

endloop

endif.

endloop


But not working, Any reason.

0 Kudos

Hai,

I should have asked this question earlier itself. Actually what is your exact requirement? You want to trigger what code on pressing F4 on SAKNR. This is a standard transaction. Then how you had placed your code and where? Have you done this through any sort of enhancements?

Please explain.

Regards,

Abijith

0 Kudos

Hi...

Please dont ask that question....The topic will be deviates to other things. Then my userid will be deleted . because somebody are observing . Right now just tell me how to get the screen name.

Sorry to say Not able to reveal this time.

venkateswaran_k
Active Contributor
0 Kudos

Hi

Use - GET CURSOR FIELD

based on that do your action.

Regards,

Venkat

0 Kudos

Hi,

Thanks for your reply. Please have a look on below attached image.

The values are empty. already cursor is moving on this fields but still empty.

0 Kudos

Hi,

Just insert this piece of code in your implicit enhancement

data : CALLED_FOR_FIELD(10) type C.

import CALLED_FOR_FIELD = CALLED_FOR_FIELD

        from MEMORY ID 'CALLFIELD'.

0 Kudos

Hi,

Thanks for your reply. i will check it.

0 Kudos

Hi, Tee Gee

Thanks for your reply. It' working Where ever i pressed the f4_help, now it is giving the correct result.

May i know why default it  is not showing the screen-name. Any reason.Can u please Explain.

I used the above in se38  z-program it is working. But in enhancement never used. Now i need to use.

0 Kudos

screen-name remains empty as the program navigates from one to another.

and your code is in a different program.

0 Kudos

Thanks For your reply. Point noted. and i am closing the post.

Keep posting.