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: 

User command in 4.7 and 4.5

Former Member
0 Kudos

Hello Friends,

I have a code which works fine in 4.7 but I have to replicate it in 4.5 as well.

I have 2 check boxes in my selection screen.

When the user checks one check box the other has to gray out. I could use radio button but there could be a possibility where both the check boxes are unchecked.

I am using the below code in 4.7, works well but when copied to 4.5 it doesn’t.

It gives a syntax error in 4.5,

( Error - Unable to interpret "USER-COMMAND". Possible causes of error: Incorrect

spelling or comma error.)

When I delete the user-command from the parameters option no errors but doesn’t fulfill my need.

Any Suggestions.

MAdhu

PARAMETERS: p_c1 AS CHECKBOX USER-COMMAND usr1.

PARAMETERS: p_c2 AS CHECKBOX USER-COMMAND usr2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_c1 = 'X' AND screen-name = 'P_C2'.

screen-input = '0'.

ENDIF.

IF p_c2 = 'X' AND screen-name = 'P_C1'.

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

May be the feature is not supported in 4.5

Thanks,

Santosh

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Right , the USER COMMAND was not available with PARAMETERS statements with CHECKBOXES, back in that version, it is simply not supported.

Regards

Rich Heilman

0 Kudos

Thanks Rich,

What could be the best alternative for this to handle in 4.5

MAdhu.

0 Kudos

Use Radiobuttons. I would hope USER COMMAND is valid for radiobuttons.

Regards,

Rich Heilman

0 Kudos

Thanks RICH for the suggestion.

As I said I cant use Radio button because sometimes the user might want to uncheck both the check boxes.

The requirement is when the user checks one check box the other should gray out or both can be unchecked.

Madhu.

Former Member
0 Kudos

May be the feature is not supported in 4.5

Thanks,

Santosh

ferry_lianto
Active Contributor
0 Kudos

Hi Madhu,

Please try this perhaps it may work in SAP 4.5.


REPORT ZTEST.
                                                                        
PARAMETERS: CB1 AS CHECKBOX MODIF ID SC1,
            CB2 AS CHECKBOX MODIF ID SC2.
                                                                        
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF CB1 = 'X' AND SCREEN-NAME = 'CB2'.
      SCREEN-INPUT = '0'.
    ENDIF.
                                                                        
    IF CB2 = 'X' AND SCREEN-NAME = 'CB1'.
      SCREEN-INPUT = '0'.
    ENDIF.
                                                                        
    MODIFY SCREEN.
  ENDLOOP.

Regards,

Ferry Lianto

0 Kudos

Thanks Ferry, It works good but the problem is the user has to hit enter everytime after he checks the check box.

Madhu,

ferry_lianto
Active Contributor
0 Kudos

Hi Madhu,

Sorry ... I wish I could help you further but I don't have SAP 4.5 system.

Are there any DEMO programs that you can search (like transaction ABAPDOCU)?

Regards,

Ferry Lianto