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.
Showing results for 
Search instead for 
Did you mean: 

Strange Behavior with variants .

Former Member
0 Kudos

I have a Z program. I save a variant with a simple field completed. Plant. THere are also so per-filled select options on the screen.

When I go to get the variant , the displa yis an ALV grid with my variant name listed but its not selectable. Then when I hit the back button. My Z program executes ?

All other Z Programs are behaving normally. i.e: get Variant display a popup to select the variant , brings it back to the selection screen and then you can execute the program

Any ideas ?


Any ideas.


Active Contributor
0 Kudos

Can you check the attributes of the variant you created, might be some settings are responsible.



Developer Advocate
Developer Advocate
0 Kudos

Can you post your code.


Rich Heilman

0 Kudos

I have checked the attributes. The variant looks fine. I simply save the screen as is and when I go to get the variant I cannot select it. It shows me a totally different display than usual, the variant is not selectable.

I have narrowed it down to an error in the initialization of the screen because when I comment the initialization section out , the variant display behaves properly.

Here is the screen and the initialization.

selection-screen begin of block b1 with frame.


s_date for likp-wadat_ist. "4482

selection-screen skip 1.


s_kunag for likp-kunag,

s_vbeln for likp-vbeln,

s_matnr for lips-matnr,

s_lfart for likp-lfart,

s_werks for lips-werks.

selection-screen skip 2.

selection-screen uline .


s_kunag1 for likp-kunag no intervals,

s_lgort for lips-lgort no intervals.

selection-screen end of block b1.

.... the initialization

FORM initialize_data.

*Previous date for deliveries

s_date-sign = 'I'.

s_date-option = 'BT'.

s_date-low = sy-datum - 1. "4482

s_date-high = sy-datum - 1. "4482

append s_date. "4482

sy-batch = 'X'.

*Customer candidates

s_kunag1-sign = 'I'.

s_kunag1-option = 'EQ'.

s_kunag1-low = '0000100000'.

append s_kunag1.

s_kunag1-low = '0000100001'.

append s_kunag1.

s_kunag1-low = '0000100013'.

append s_kunag1.

s_kunag1-low = '0000100025'.

append s_kunag1.

*New stock stor. locations

s_lgort-sign = 'I'.

s_lgort-option = 'EQ'.

s_lgort-low = 'D113'.

append s_lgort.

s_lgort-low = 'D213'.

append s_lgort.

s_lgort-low = 'D313'.

append s_lgort.

ENDFORM. " initialize_data

thx, BAR

0 Kudos

Solved this one. The initialization of sy-batch = 'X' needs to be moved outside of teh initialization section and to the first line in start-of-selection.

thx for your help