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

tabbed block - problem with selection

former_member213871
Participant
0 Likes
1,088

Hello people,

I have a little problem with data selection using subscreens. I have defined two subscreens:

SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.

SELECT-OPTIONS: ...

SELECTION-SCREEN END OF SCREEN 101.

SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.

SELECT-OPTIONS: ...

SELECTION-SCREEN END OF SCREEN 102.

SELECTION-SCREEN BEGIN OF TABBED BLOCK scr_main FOR 30 LINES.

SELECTION-SCREEN TAB (10) scr1 USER-COMMAND ucomm1

DEFAULT SCREEN 101.

SELECTION-SCREEN TAB (20) scr2 USER-COMMAND ucomm2

DEFAULT SCREEN 102.

SELECTION-SCREEN END OF BLOCK scr_main.

INITIALIZATION.

scr1 = text-ss1.

scr2 = text-ss2.

scr3 = text-ss3.

START-OF-SELECTION.....

When I run report, fill all two screens with data and execute it, I will get what I want. But if I would like to change selection and go back to selection screen, modify data on first tab only (I don't click on second tab) and execute again, only data from first tab are taken to selection. When I go back, switch to second tab (and change nothing), selection is correct.

Is there any way how to manage using data from all tabs without selecting these tabs one by one (data are already filled and I don't want to modify)?

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,019

Hi,

what do you mean when you say that there´s no select information for the fields in the second tab ?? I´ve written a program following your example and it works with me.

Perhaps you mean the information that is in the header line of your select-option fields. Yes, this information is not available at runtime, since you didn´t click on the second tab, but it is available in the internal table that the system created for your selection fields of type select-options.

7 REPLIES 7
Read only

Former Member
0 Likes
1,020

Hi,

what do you mean when you say that there´s no select information for the fields in the second tab ?? I´ve written a program following your example and it works with me.

Perhaps you mean the information that is in the header line of your select-option fields. Yes, this information is not available at runtime, since you didn´t click on the second tab, but it is available in the internal table that the system created for your selection fields of type select-options.

Read only

0 Likes
1,019

Hi,

I am not very experienced with ABAP so maybe I will have now stupid question. I gave a breakpoint on "SELECT" which use selection field from second tab. When I run report again (I didn't click on second tab), select-options fields are really empty (e.g. s_vbeln-low is empty, but there are data on second tab). How can I reach internal table for these selection fields?

Thank you

Read only

0 Likes
1,019

Hi David

To consult data in select-option structure you can deal like a internal table: SELECT-OPTIONS structure contains a header line so you can perform a LOOP and check all values

LOOP AT s_vbeln.

WRITE s_vbeln-low.

WRITE s_vbeln-high.

WRITE s_vbeln-sign.

ENDLOOP.

Kind regards

Carlos Machado

Read only

0 Likes
1,019

Hi,

you have to understand that a selection field declared with Select-Options is at runtime an internal table of type

sign-option-low-high

and that internal table has a header line, which has the same structure. When you set a breakpoint and it stops the application, you can make a double click on your selection field and system displays the content of the header line. Depending on the version of your SAP system you can double click on a small icon which shows up on the left of it (in older versions) or you can select folder Tables and enter your selection field (in newer versions).

Read only

0 Likes
1,019

Hi,

this I understand :). Let me show very short example which shows the problem directly:

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p1(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

select-options: s_dynnr for sy-dynnr.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 200.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,

TAB (25) button1 USER-COMMAND push1

DEFAULT SCREEN 100,

TAB (25) button2 USER-COMMAND push2

DEFAULT SCREEN 200,

END OF BLOCK mytab.

INITIALIZATION.

button1 = 'Tab1'.

button2 = 'Tab2'.

START-OF-SELECTION.

WRITE: / 'P1:', p1.

write: / 'S_DYNNR:',s_dynnr.

If you run this and fill both of tabs, the output will be similar to:

P1: 10

S_DYNNR: IEQ20.

But if you go back (green arrow) and only change on tab1 parameter P1 (no switching to tab2) and run report again, you will see:

P1: 20

S_DYNNR: "empty"

If you go back again and switch to tab2 and do no change and execute again, you will see:

P1: 20

S_DYNNR: IEQ20.

My question is: Is it necessary to switch to all tabs on selection screen to activate select-option fields on them?

I hope this explain my problem better.

Thank you for your effort.

David

Read only

0 Likes
1,019

Hi,

I understand your comment and your code. The problem is that you did not read or could not understand my answer. Your field S_DYNNR is nothing else but an internal table, and as such you must treat it like an internal table and not like a structured field. You can do the following:

START-OF-SELECTION.
  WRITE: / 'P1:', p1.
  LOOP AT s_dynnr.
    WRITE: / 'S_DYNNR:', s_dynnr-low.
  ENDLOOP.

This will display the values in your field, no matter how may you enter.

Read only

0 Likes
1,019

Hi,

as I said before I have ask stupid question. You are completely right. Right now I can see it :-). Thank you for your patience.

David