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: 

How to make selection screen fields invisible based on internal table data?

satish_kumar127
Participant
0 Kudos

Hi experts,

Could you please suggest me how to make " bottling line" parameters based on the internal table data. lets say there are different bottling lines for a plant. some plants are having 2 bottling lines and some 3. want to make invisible other bottling lines based on plant data. i have attached the image. below is my code.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_werks TYPE ztpp_overhead-werks OBLIGATORY,
p_empcat TYPE ztpp_overhead-zpp_head_id OBLIGATORY,
p_date TYPE ztpp_overhead-zpp_cons_date OBLIGATORY,
p_shift TYPE ztpp_overhead-shift OBLIGATORY.

SELECTION-SCREEN : END OF BLOCK b1.

SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: p_line1 TYPE zscenario AS LISTBOX VISIBLE LENGTH 10,
p_line2 TYPE zscenario AS LISTBOX VISIBLE LENGTH 10,
p_line3 TYPE zscenario AS LISTBOX VISIBLE LENGTH 10,
p_line4 TYPE zscenario AS LISTBOX VISIBLE LENGTH 10.

SELECTION-SCREEN : END OF BLOCK b2.

SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

PARAMETERS: p_file TYPE rlgrap-filename .

SELECTION-SCREEN : END OF BLOCK b3.

AT SELECTION-SCREEN.

AT SELECTION-SCREEN OUTPUT.


SELECT werks zline_no zline_type FROM zthr_line_master
INTO TABLE it_zthr_line_master
WHERE werks = p_werks.

LOOP AT it_zthr_line_master INTO wa_zthr_line_master.

LOOP AT SCREEN.

MODIFY SCREEN.

ENDLOOP.

ENDLOOP.

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

Put your code between LOOP AT SCREEN and ENDLOOP in the PBO of the selection screen. Where are you stuck (camparing trailing number in fieldname with number of lines?)

0 Kudos

Hi Raymond,

Thnaks for the reply. My internal table " it_zthr_line_master" is having bottling lines data based on plant. i want to make my line parameters visible based on internal table data. if internal table is having 2 bottling lines then p_line1 and p_line2 should be visible and other 2 should be invisible.

0 Kudos

What part of code aren't you able to write: setting SCREEN-INVISIBLE in the LOOP AT SCREEN/MODIFY SCREEN/ENDLOOP loop extracting the Nr from the fieldname and comparing with the nr of field to display (max number of lines in the plant selection I suppose) or what?

iftah_peretz
Active Contributor
0 Kudos

Hey,

I think you can get something from here, here and here and the list goes on and on.