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

EXIT CNEX0007 toggle functionality edit and display

Former Member
0 Likes
1,029

Hello,

I have used the below code to enable the edit and display functionality in transaction CJ20N,

IF sy-ucomm EQ 'TOGGLE'.

    LOOP AT SCREEN.

     IF screen-input = 1.

       screen-input = 0.

     ENDIF.

     MODIFY SCREEN.

   ENDLOOP.

ENDIF.

I have put this code in the PBO - module output.

The problem is that the toggle functionality is not working as per the main screen mode. When I am shifting the tabs, the fields in the customer enhancement tab are automatically changing to edit mode though the main screen mode is in display mode.

Has anyone come across this situation, I have gone through all the posts related to this topic but could not find the answer.

Thanks in advance.

Chakravarthy

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
740

Well why did you do that, let SAP manages the switch betwen display and change modes, and use correctly the Customer-Exits and BAdI provided,

  • Save the SAP_DISPLAY_ONLY parameter received, save it in global area of customer subscreen program
  • Use this flag value in the PBO modules

Also some rules

  • Never use SY-UCOMM use the OK_CODE
  • And never in PBO (did you debug) but in PAI
  • Also OK_CODE must be checked in main screen and not in subscreen (did you notice those don't have an ok_code)

Regards,

Raymond

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
741

Well why did you do that, let SAP manages the switch betwen display and change modes, and use correctly the Customer-Exits and BAdI provided,

  • Save the SAP_DISPLAY_ONLY parameter received, save it in global area of customer subscreen program
  • Use this flag value in the PBO modules

Also some rules

  • Never use SY-UCOMM use the OK_CODE
  • And never in PBO (did you debug) but in PAI
  • Also OK_CODE must be checked in main screen and not in subscreen (did you notice those don't have an ok_code)

Regards,

Raymond

Read only

0 Likes
740

Hi Raymond,

thanks for the reply.

I have made the changes as you have suggested and its working. 🙂

I have made the required declerations in global area and used the flag as below in the PBO.

IF zmode EQ 'X'.

     LOOP AT SCREEN.

       IF screen-input = 1.

         screen-input = 0.

       ENDIF.

       MODIFY SCREEN.

     ENDLOOP.

   ENDIF.

When I am doing this in the PAI, the subscreen is not having any impact of edit/display button.

Will there be any repurcussions when we use PBO?

Can you please elaborate on the rules part.

Thanks again.