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

Variant

Former Member
0 Likes
1,503

Hi All,

         In selection screen I have 3 fields Plant, material number , po number. When I enter plant as 1000, I should not get a chance of creating a variant.

If plant is not 1000 I should get a chance for creating a variant.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,469

Hi,

Some code:  AA is blocked.

*----------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK block02 WITH FRAME .

PARAMETERS: p_carrid TYPE sflight-carrid  OBLIGATORY .

SELECTION-SCREEN END OF BLOCK block02 .

*----------------------------------------------------------------------*

AT SELECTION-SCREEN .

  PERFORM at_selection_screen_input .

*----------------------------------------------------------------------*

FORM at_selection_screen_input .

  IF sy-ucomm EQ 'SPOS' and p_carrid eq 'AA' .

    MESSAGE e222(dbman).

*   It is not possible to save variants

  ENDIF .

ENDFORM .                    "at_selection_screen

*----------------------------------------------------------------------*

Regards.

12 REPLIES 12
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,470

Hi,

Some code:  AA is blocked.

*----------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK block02 WITH FRAME .

PARAMETERS: p_carrid TYPE sflight-carrid  OBLIGATORY .

SELECTION-SCREEN END OF BLOCK block02 .

*----------------------------------------------------------------------*

AT SELECTION-SCREEN .

  PERFORM at_selection_screen_input .

*----------------------------------------------------------------------*

FORM at_selection_screen_input .

  IF sy-ucomm EQ 'SPOS' and p_carrid eq 'AA' .

    MESSAGE e222(dbman).

*   It is not possible to save variants

  ENDIF .

ENDFORM .                    "at_selection_screen

*----------------------------------------------------------------------*

Regards.

Read only

0 Likes
1,469

Hi Eitan,

Thanks for ur rply.I will check it on Monday and get I back to u.

Read only

0 Likes
1,469

Hi Eitan,

Thanks for ur rply and it is working fine. But I want to know that why we compared sy-ucomm with spos.

Give detail explanation regarding this.

Regards,

Chakradhar.

Read only

0 Likes
1,469

Hi,

"SPOS" is the value the system supply in sy-ucomm when we are using "save as variant" .

Add a break point at: IF sy-ucomm EQ 'SPOS' and p_carrid eq 'AA' .

Then run the report and check sy-ucomm content what do you have now ?

Regards .

Read only

0 Likes
1,469

Hi,

That is the user command when you click on variant.

you have to mark answers as correct answer.

Regards,

Noufal.

Read only

Former Member
0 Likes
1,469

Hi Eitan,

I understood that but I want to know how you know all these things.

Regards,

Chakradhar.

Read only

0 Likes
1,469

Hi,

Tough question...

Look at my picture and look a the white hair......

This represents 40+ years of programing experience (I am a newbie in SAP).

Just think how many bugs I managed to generate...

You just have to go on learning until the day you die ignorant....

Today you learned about sy-ucomm .

Regards .

Read only

0 Likes
1,469

Hi Eitan,

I know about the sy-ucomm earlier itself but I learnt about the saving as variant is related to the system field SPOS. As I am just beginner of ABAP , you must help me in any sort of issues which I post.

Moderator message: no-one must help you at all. This site is entirely voluntary.

Regards,

Chakradhar.

Message was edited by: Matthew Billingham

Read only

0 Likes
1,469

Hi,

SPOS is a value of a field not a field .

Regards.

Read only

0 Likes
1,469

Hi,

k.k. Thanq.

Regards.

Read only

0 Likes
1,469

Dear Yannam,

This site is not to service you alone.

It is not mandatory to answer your questions. No one will sit and answer your queries.

You have to explore your self that what is the meaning of the information given by experts. No one has time to explain you in detail.

Please go through the rules of engagement of SCN:

I hope you understood.

Regards,

Chandra

Read only

0 Likes
1,469

How true....

Regards.