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: 

Execute the field in background

Hello experts,

I have one selection screen with some fields and drop down with 4 options.

I have one field called dp document type, it should not visible in selection screen but based on the drop down option which I selected the program should execute the dp document types in background .how can I achieve this ...can anyone help into this ...

For each drop down option I have specific dp document types which should be executed in background...

Regards,

Shivani.

4 REPLIES 4

dev_parbutteea
Active Contributor
0 Kudos

Hi,

what do you mean that you have to execute the dp document type in background ?

0 Kudos

Yes I have to execute the dp document type in background ...that dp document types I have to pass is it in program without selection screen.

Regards,

shivani

Vaibhav_Shetkar
Explorer
0 Kudos

Hi Shivani,

You can achieve this by marking that parameter or select option on your screen as 'NO-DISPLAY'.

This will hide the DP document type from the selection screen. Now based on the drop down option that you have selected you can populate the value for DP document type in AT-SELECTION SCREEN event or can use it afterwards in the program.

PFB the reference code.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-t01.
PARAMETERS p_carrid TYPE spfli-carrid
AS LISTBOX VISIBLE LENGTH 20
USER-COMMAND onli
DEFAULT 'LH'.
PARAMETERS p_val TYPE char45 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN.
IF p_carrid = 'LH'.
p_val = 'Germany'.
ELSEIF p_carrid = 'AA'.
p_val = 'America'.
ELSE.
p_val = 'Rest of the World'.
ENDIF.

START-OF-SELECTION.
WRITE p_val.

Hope this helps.

Regards,

Vaibhav

former_member1716
Active Contributor
0 Kudos

Hello,

When you don't want to display the field in the selection screen its better you don't display them at all. But still you can hid a selection screen element through key word "NO_DISPLAY".

Instead You can create a variable in your program and assign the value to it Dynamically based on the selection option in the even AT SELECTION SCREEN.

below Code is just for reference, I would suggest you to use case statement which is mpre effective than IF ELSE conditions.

Consider s_sel is your selection screen variable

Data: gv_variable.

AT SELECTION SCREEN.

CASE S_SEL.

WHEN 'DROPDOWN1'

gv_variable = VALUE1.

WHEN 'DROPDOWN2'

gv_variable = VALUE2.

WHEN 'DROPDOWN3'

gv_variable = VALUE3.

WHEN 'DROPDOWN4'

gv_variable = VALUE4.

ENDCASE.

Regards